Drawing and menu updates
This commit is contained in:
parent
e26fb77a7a
commit
b8a82e73ce
4 changed files with 98 additions and 88 deletions
|
|
@ -69,7 +69,6 @@ public class GDXAppMain extends Game {
|
|||
private GDXAppScreen desktop2;
|
||||
private GDXAppScreen desktop3;
|
||||
private GDXAppScreen desktop4;
|
||||
private ImBoolean openWindowFlag = new ImBoolean(true);
|
||||
private ImBoolean showImGuiDemo = new ImBoolean(false);
|
||||
|
||||
public GDXAppMain(List<String> args, int viewWidth, int viewHeight, NativeFileChooser fileChooser) {
|
||||
|
|
@ -228,19 +227,15 @@ public class GDXAppMain extends Game {
|
|||
}
|
||||
if (appScreen != null && appScreen.getDeskAppScreen().getCurrentDeskApp() != null) {
|
||||
int sizeFlags = ImGuiCond.Always;
|
||||
ImGui.setNextWindowPos(5, 30, sizeFlags);
|
||||
ImGui.setNextWindowSize(Gdx.graphics.getWidth() - 10, Gdx.graphics.getHeight() - 35, sizeFlags);
|
||||
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize;
|
||||
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), openWindowFlag, windowFlags)) {
|
||||
ImGui.setNextWindowPos(0, 28, sizeFlags);
|
||||
ImGui.setNextWindowSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - 28, sizeFlags);
|
||||
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar;
|
||||
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), windowFlags)) {
|
||||
DeskAppRenderer renderer = appScreen.getDeskAppScreen().getCurrentDeskApp().getContours().getContour(DeskAppContourSection.MAIN);
|
||||
if (renderer != null) {
|
||||
renderer.render();
|
||||
}
|
||||
}
|
||||
if (openWindowFlag.get() == false) {
|
||||
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
|
||||
openWindowFlag.set(true);
|
||||
}
|
||||
ImGui.end();
|
||||
}
|
||||
if (screen != null) {
|
||||
|
|
@ -256,62 +251,8 @@ public class GDXAppMain extends Game {
|
|||
private void renderMenu(GDXAppScreen appScreen) {
|
||||
DeskApp deskApp = appScreen.getDeskAppScreen().getCurrentDeskApp();
|
||||
ImGui.beginMainMenuBar();
|
||||
if (ImGui.beginMenu("File")) {
|
||||
if (deskApp != null) {
|
||||
DeskAppRenderer fileNew = deskApp.getContours().getContour(DeskAppContourSection.FILE_NEW);
|
||||
DeskAppRenderer fileClose = deskApp.getContours().getContour(DeskAppContourSection.FILE_CLOSE);
|
||||
DeskAppRenderer fileSave = deskApp.getContours().getContour(DeskAppContourSection.FILE_SAVE);
|
||||
DeskAppRenderer fileOption = deskApp.getContours().getContour(DeskAppContourSection.FILE_OPTION);
|
||||
DeskAppRenderer filePrint = deskApp.getContours().getContour(DeskAppContourSection.FILE_PRINT);
|
||||
if (fileNew != null) {
|
||||
fileNew.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (fileClose != null) {
|
||||
fileClose.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (fileSave != null) {
|
||||
fileSave.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (fileOption != null) {
|
||||
fileOption.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (filePrint != null) {
|
||||
filePrint.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
}
|
||||
if (ImGui.menuItem("Minimize", "", fileMinimizeSelected, deskApp != null )) {
|
||||
if (deskApp != null) {
|
||||
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
|
||||
}
|
||||
}
|
||||
if (ImGui.menuItem("Exit", "", fileCloseSelected, deskApp != null)) {
|
||||
if (deskApp != null) {
|
||||
appScreen.getDeskAppScreen().removeDeskApp(deskApp);
|
||||
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
|
||||
}
|
||||
}
|
||||
ImGui.endMenu();
|
||||
}
|
||||
|
||||
if (deskApp != null) {
|
||||
renderEditMenu(deskApp);
|
||||
}
|
||||
if (ImGui.beginMenu("vrGEM⁴")) {
|
||||
if (ImGui.beginMenu("Start")) {
|
||||
for (GDXAppLauncher launcher: apps) {
|
||||
if (ImGui.menuItem(launcher.getName())) {
|
||||
appScreen.getDeskAppScreen().addDeskApp(launcher.getLauncher().get());
|
||||
}
|
||||
}
|
||||
ImGui.endMenu();
|
||||
}
|
||||
ImGui.separator();
|
||||
|
||||
String infix1 = "";
|
||||
String infix2 = "";
|
||||
String infix3 = "";
|
||||
|
|
@ -381,6 +322,17 @@ public class GDXAppMain extends Game {
|
|||
ImGui.endMenu();
|
||||
}
|
||||
ImGui.separator();
|
||||
if (ImGui.beginMenu("Start App")) {
|
||||
for (GDXAppLauncher launcher: apps) {
|
||||
if (ImGui.menuItem(launcher.getName())) {
|
||||
appScreen.getDeskAppScreen().addDeskApp(launcher.getLauncher().get());
|
||||
}
|
||||
}
|
||||
ImGui.endMenu();
|
||||
}
|
||||
if (ImGui.menuItem("Run App")) {
|
||||
}
|
||||
ImGui.separator();
|
||||
if (Gdx.graphics.isFullscreen()) {
|
||||
if (ImGui.menuItem("Window Mode")) {
|
||||
Gdx.graphics.setWindowedMode(viewWidth, viewHeight);
|
||||
|
|
@ -407,9 +359,69 @@ public class GDXAppMain extends Game {
|
|||
}
|
||||
ImGui.endMenu();
|
||||
}
|
||||
|
||||
|
||||
if (deskApp != null) {
|
||||
renderEditMenu(deskApp);
|
||||
renderFileMenu(deskApp);
|
||||
}
|
||||
|
||||
if (deskApp != null) {
|
||||
if (ImGui.beginMenu(deskApp.getTitle())) {
|
||||
if (ImGui.menuItem("Minimize", "", fileMinimizeSelected, deskApp != null )) {
|
||||
fileMinimizeSelected.set(false);
|
||||
if (deskApp != null) {
|
||||
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
|
||||
}
|
||||
}
|
||||
if (ImGui.menuItem("Exit", "", fileCloseSelected, deskApp != null)) {
|
||||
fileCloseSelected.set(false);
|
||||
if (deskApp != null) {
|
||||
appScreen.getDeskAppScreen().removeDeskApp(deskApp);
|
||||
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
|
||||
}
|
||||
}
|
||||
ImGui.endMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ImGui.endMainMenuBar();
|
||||
}
|
||||
|
||||
private void renderFileMenu(DeskApp deskApp) {
|
||||
DeskAppRenderer fileNew = deskApp.getContours().getContour(DeskAppContourSection.FILE_NEW);
|
||||
DeskAppRenderer fileClose = deskApp.getContours().getContour(DeskAppContourSection.FILE_CLOSE);
|
||||
DeskAppRenderer fileSave = deskApp.getContours().getContour(DeskAppContourSection.FILE_SAVE);
|
||||
DeskAppRenderer fileOption = deskApp.getContours().getContour(DeskAppContourSection.FILE_OPTION);
|
||||
DeskAppRenderer filePrint = deskApp.getContours().getContour(DeskAppContourSection.FILE_PRINT);
|
||||
if (fileNew == null && fileClose == null && fileSave == null && fileOption == null && filePrint == null) {
|
||||
return;
|
||||
}
|
||||
if (ImGui.beginMenu("File")) {
|
||||
if (fileNew != null) {
|
||||
fileNew.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (fileClose != null) {
|
||||
fileClose.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (fileSave != null) {
|
||||
fileSave.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (fileOption != null) {
|
||||
fileOption.render();
|
||||
ImGui.separator();
|
||||
}
|
||||
if (filePrint != null) {
|
||||
filePrint.render();
|
||||
}
|
||||
ImGui.endMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private void renderEditMenu(DeskApp deskApp) {
|
||||
DeskAppRenderer editUndo = deskApp.getContours().getContour(DeskAppContourSection.EDIT_UNDO);
|
||||
DeskAppRenderer editCopy = deskApp.getContours().getContour(DeskAppContourSection.EDIT_COPY);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ public class ImGuiSetup {
|
|||
private static void initStyle() {
|
||||
ImGui.styleColorsDark();
|
||||
ImGuiStyle style = ImGui.getStyle();
|
||||
style.setWindowRounding(6f);
|
||||
style.setWindowRounding(0f);
|
||||
style.setWindowBorderSize(0f);
|
||||
style.setWindowPadding(6f, 6f);
|
||||
style.setScrollbarSize(22f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,7 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
|
|||
private String print10Numbers(BaseGlyphSet set) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (int i=0;i<10;i++) {
|
||||
buf.append(set.BȍőnNumber10().BȍőnCharFor(i));
|
||||
buf.append(set.BȍőnNumber10().BȍőnCharSeperator());
|
||||
buf.append(set.BȍőnPrintNumber10(i, 9));
|
||||
buf.append(" ");
|
||||
}
|
||||
return buf.toString();
|
||||
|
|
@ -69,10 +68,12 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
|
|||
|
||||
private String print16Numbers(BaseGlyphSet set) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
if (set.BȍőnNumber16() == null) {
|
||||
return buf.toString();
|
||||
}
|
||||
int x=240;
|
||||
for (int i=0;i<16;i++) {
|
||||
buf.append(set.BȍőnPrintNumber16(i + x, 99));
|
||||
buf.append(set.BȍőnNumber16().BȍőnCharSeperator());
|
||||
buf.append(set.BȍőnPrintNumber16(i + x, 16)); // hex; +one
|
||||
buf.append(" ");
|
||||
x = x - 16;
|
||||
}
|
||||
|
|
@ -85,8 +86,7 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
|
|||
return buf.toString();
|
||||
}
|
||||
for (int i=0;i<27;i++) {
|
||||
buf.append(set.BȍőnPrintNumber27(i, 99));
|
||||
buf.append(set.BȍőnNumber27().BȍőnCharSeperator());
|
||||
buf.append(set.BȍőnPrintNumber27(i, 26));
|
||||
buf.append(" ");
|
||||
}
|
||||
return buf.toString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue