Drawing and menu updates

This commit is contained in:
Willem Cazander 2022-02-15 19:04:27 +01:00
parent e26fb77a7a
commit b8a82e73ce
4 changed files with 98 additions and 88 deletions

View file

@ -25,7 +25,7 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BãßBȍ
LATIN_DTMF( LATIN_DTMF(
new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaValue()))).withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE), new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaValue()))).withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE),
new BaseGlyphSetNumber("1","2","3","A","4","5","6","B","7","8","9","C","*","0","#","D"), new BaseGlyphSetNumber("1","2","3","A","4","5","6","B","7","8","9","C","*","0","#","D"),
LATIN_BASIC.BȍőnNumber27()), null),
LATIN_TOP( LATIN_TOP(
new BaseGlyphSetNumber("","¹","²","³","","","","","",""), new BaseGlyphSetNumber("","¹","²","³","","","","","",""),
new BaseGlyphSetNumber("","¹","²","³","","","","","","","","","","","",""), new BaseGlyphSetNumber("","¹","²","³","","","","","","","","","","","",""),
@ -37,7 +37,11 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BãßBȍ
LATIN_TOPHEX( LATIN_TOPHEX(
LATIN_BASIC.BȍőnNumber10(), LATIN_BASIC.BȍőnNumber10(),
LATIN_BASIC.BȍőnNumber16().withAltGlyphSet(LATIN_TOP), LATIN_BASIC.BȍőnNumber16().withAltGlyphSet(LATIN_TOP),
LATIN_BASIC.BȍőnNumber27()), null),
LATIN_SUBHEX(
LATIN_BASIC.BȍőnNumber10(),
LATIN_BASIC.BȍőnNumber16().withAltGlyphSet(LATIN_SUB),
null),
TONE_SCRIPT( TONE_SCRIPT(
new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))), new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
@ -99,52 +103,44 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BãßBȍ
new BaseGlyphSetNumber("","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")), new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
RUNIC_TOPHEX(
RUNIC.BȍőnNumber10(),
RUNIC.BȍőnNumber16().withAltGlyphSet(LATIN_TOP),
RUNIC.BȍőnNumber27()),
KOREAN( KOREAN(
new BaseGlyphSetNumber("","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")), new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
KOREAN_TOPHEX(
KOREAN.BȍőnNumber10(),
KOREAN.BȍőnNumber16().withAltGlyphSet(LATIN_TOP),
KOREAN.BȍőnNumber27()),
CHINA( CHINA(
new BaseGlyphSetNumber("","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnNumber16(), null,
null), null),
CHINA_FORMAL( CHINA_FORMAL(
new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaKey()))), new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaKey()))),
LATIN_BASIC.BȍőnNumber16(), null,
null), null),
CHINA_FORMAL_OLD( CHINA_FORMAL_OLD(
new BaseGlyphSetNumber("","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnNumber16(), null,
null), null),
JAPAN( JAPAN(
CHINA.BȍőnNumber10(), CHINA.BȍőnNumber10(),
LATIN_BASIC.BȍőnNumber16(), null,
null), null),
JAPAN_FORMAL( JAPAN_FORMAL(
new BaseGlyphSetNumber("","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","",""),
LATIN_BASIC.BȍőnNumber16(), null,
null), null),
CYRILLIC( CYRILLIC(
new BaseGlyphSetNumber("Ф","А","В","Г","Д","Є","Ѕ","З","И","Ѳ"), new BaseGlyphSetNumber("Ф","А","В","Г","Д","Є","Ѕ","З","И","Ѳ"),
LATIN_BASIC.BȍőnNumber16(), new BaseGlyphSetNumber("Ф","А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ"),
new BaseGlyphSetNumber("А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ","Ѻ","П","Ч","Р","С","Т","Ѵ","Ф","Х","Ѱ","Ѿ","Ц")), new BaseGlyphSetNumber("А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ","Ѻ","П","Ч","Р","С","Т","Ѵ","Ф","Х","Ѱ","Ѿ","Ц")),
ARABIC( ARABIC(
new BaseGlyphSetNumber("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"), new BaseGlyphSetNumber("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"),
LATIN_BASIC.BȍőnNumber16(), null,
new BaseGlyphSetNumber("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ"), new BaseGlyphSetNumber("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ"),
true), true),
HEBREW( HEBREW(
new BaseGlyphSetNumber("אֶפֶס","אֶחָד","שְׁתַּיִם","שְׁלֹשָׁה","אַרְבַּע‎","חֲמִשָּׁה‎","שֵׁשׁ‎","שִׁבְעָה","שְׁמוֹנֶה","תִּשְׁעָה‎").withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE), new BaseGlyphSetNumber("אֶפֶס","אֶחָד","שְׁתַּיִם","שְׁלֹשָׁה","אַרְבַּע‎","חֲמִשָּׁה‎","שֵׁשׁ‎","שִׁבְעָה","שְׁמוֹנֶה","תִּשְׁעָה‎").withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE),
LATIN_BASIC.BȍőnNumber16(), null,
new BaseGlyphSetNumber("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ"), new BaseGlyphSetNumber("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ"),
true), true),
; ;

View file

@ -69,7 +69,6 @@ public class GDXAppMain extends Game {
private GDXAppScreen desktop2; private GDXAppScreen desktop2;
private GDXAppScreen desktop3; private GDXAppScreen desktop3;
private GDXAppScreen desktop4; private GDXAppScreen desktop4;
private ImBoolean openWindowFlag = new ImBoolean(true);
private ImBoolean showImGuiDemo = new ImBoolean(false); private ImBoolean showImGuiDemo = new ImBoolean(false);
public GDXAppMain(List<String> args, int viewWidth, int viewHeight, NativeFileChooser fileChooser) { 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) { if (appScreen != null && appScreen.getDeskAppScreen().getCurrentDeskApp() != null) {
int sizeFlags = ImGuiCond.Always; int sizeFlags = ImGuiCond.Always;
ImGui.setNextWindowPos(5, 30, sizeFlags); ImGui.setNextWindowPos(0, 28, sizeFlags);
ImGui.setNextWindowSize(Gdx.graphics.getWidth() - 10, Gdx.graphics.getHeight() - 35, sizeFlags); ImGui.setNextWindowSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() - 28, sizeFlags);
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize; int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar;
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), openWindowFlag, windowFlags)) { if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), windowFlags)) {
DeskAppRenderer renderer = appScreen.getDeskAppScreen().getCurrentDeskApp().getContours().getContour(DeskAppContourSection.MAIN); DeskAppRenderer renderer = appScreen.getDeskAppScreen().getCurrentDeskApp().getContours().getContour(DeskAppContourSection.MAIN);
if (renderer != null) { if (renderer != null) {
renderer.render(); renderer.render();
} }
} }
if (openWindowFlag.get() == false) {
appScreen.getDeskAppScreen().setCurrentDeskApp(null);
openWindowFlag.set(true);
}
ImGui.end(); ImGui.end();
} }
if (screen != null) { if (screen != null) {
@ -256,62 +251,8 @@ public class GDXAppMain extends Game {
private void renderMenu(GDXAppScreen appScreen) { private void renderMenu(GDXAppScreen appScreen) {
DeskApp deskApp = appScreen.getDeskAppScreen().getCurrentDeskApp(); DeskApp deskApp = appScreen.getDeskAppScreen().getCurrentDeskApp();
ImGui.beginMainMenuBar(); 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("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 infix1 = "";
String infix2 = ""; String infix2 = "";
String infix3 = ""; String infix3 = "";
@ -381,6 +322,17 @@ public class GDXAppMain extends Game {
ImGui.endMenu(); ImGui.endMenu();
} }
ImGui.separator(); 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 (Gdx.graphics.isFullscreen()) {
if (ImGui.menuItem("Window Mode")) { if (ImGui.menuItem("Window Mode")) {
Gdx.graphics.setWindowedMode(viewWidth, viewHeight); Gdx.graphics.setWindowedMode(viewWidth, viewHeight);
@ -407,9 +359,69 @@ public class GDXAppMain extends Game {
} }
ImGui.endMenu(); 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(); 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) { private void renderEditMenu(DeskApp deskApp) {
DeskAppRenderer editUndo = deskApp.getContours().getContour(DeskAppContourSection.EDIT_UNDO); DeskAppRenderer editUndo = deskApp.getContours().getContour(DeskAppContourSection.EDIT_UNDO);
DeskAppRenderer editCopy = deskApp.getContours().getContour(DeskAppContourSection.EDIT_COPY); DeskAppRenderer editCopy = deskApp.getContours().getContour(DeskAppContourSection.EDIT_COPY);

View file

@ -38,7 +38,9 @@ public class ImGuiSetup {
private static void initStyle() { private static void initStyle() {
ImGui.styleColorsDark(); ImGui.styleColorsDark();
ImGuiStyle style = ImGui.getStyle(); ImGuiStyle style = ImGui.getStyle();
style.setWindowRounding(6f); style.setWindowRounding(0f);
style.setWindowBorderSize(0f);
style.setWindowPadding(6f, 6f);
style.setScrollbarSize(22f); style.setScrollbarSize(22f);
} }

View file

@ -60,8 +60,7 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
private String print10Numbers(BaseGlyphSet set) { private String print10Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
for (int i=0;i<10;i++) { for (int i=0;i<10;i++) {
buf.append(set.BȍőnNumber10().BȍőnCharFor(i)); buf.append(set.BȍőnPrintNumber10(i, 9));
buf.append(set.BȍőnNumber10().BȍőnCharSeperator());
buf.append(" "); buf.append(" ");
} }
return buf.toString(); return buf.toString();
@ -69,10 +68,12 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
private String print16Numbers(BaseGlyphSet set) { private String print16Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
if (set.BȍőnNumber16() == null) {
return buf.toString();
}
int x=240; int x=240;
for (int i=0;i<16;i++) { for (int i=0;i<16;i++) {
buf.append(set.BȍőnPrintNumber16(i + x, 99)); buf.append(set.BȍőnPrintNumber16(i + x, 16)); // hex; +one
buf.append(set.BȍőnNumber16().BȍőnCharSeperator());
buf.append(" "); buf.append(" ");
x = x - 16; x = x - 16;
} }
@ -85,8 +86,7 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
return buf.toString(); return buf.toString();
} }
for (int i=0;i<27;i++) { for (int i=0;i<27;i++) {
buf.append(set.BȍőnPrintNumber27(i, 99)); buf.append(set.BȍőnPrintNumber27(i, 26));
buf.append(set.BȍőnNumber27().BȍőnCharSeperator());
buf.append(" "); buf.append(" ");
} }
return buf.toString(); return buf.toString();