diff --git a/dlangui-monod-linux.sln b/dlangui-monod-linux.sln index 4ec3cba7..1bc9c31e 100644 --- a/dlangui-monod-linux.sln +++ b/dlangui-monod-linux.sln @@ -11,6 +11,8 @@ Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "tetris-monod-linux", "examp EndProject Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "dmledit-monod-linux", "examples\dmledit\dmledit-monod-linux.dproj", "{075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}" EndProject +Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "spreadsheet-monod-linux", "examples\spreadsheet\spreadsheet-monod-linux.dproj", "{5BD82AA8-4026-44C2-8957-B4E2932542F0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -28,8 +30,8 @@ Global {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugX11|Any CPU.Build.0 = DebugX11|x64 - {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Release|Any CPU.Build.0 = Release|Any CPU + {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Release|Any CPU.ActiveCfg = Release|x64 + {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Release|Any CPU.Build.0 = Release|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.ReleaseMinimal|Any CPU.Build.0 = ReleaseMinimal|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Unittest|Any CPU.ActiveCfg = Unittest|x64 @@ -42,8 +44,8 @@ Global {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugX11|Any CPU.Build.0 = DebugX11|x64 - {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Release|Any CPU.Build.0 = Release|Any CPU + {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Release|Any CPU.ActiveCfg = Release|x64 + {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Release|Any CPU.Build.0 = Release|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.ReleaseMinimal|Any CPU.Build.0 = ReleaseMinimal|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Unittest|Any CPU.ActiveCfg = Unittest|x64 @@ -56,22 +58,36 @@ Global {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugX11|Any CPU.Build.0 = DebugX11|x64 - {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.Build.0 = Release|Any CPU + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.ActiveCfg = Release|x64 + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.Build.0 = Release|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.ReleaseMinimal|Any CPU.Build.0 = ReleaseMinimal|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Unittest|Any CPU.ActiveCfg = Unittest|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Unittest|Any CPU.Build.0 = Unittest|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.UnittestMinimal|Any CPU.ActiveCfg = UnittestMinimal|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.UnittestMinimal|Any CPU.Build.0 = UnittestMinimal|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.Debug|Any CPU.ActiveCfg = DebugX11|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.Debug|Any CPU.Build.0 = DebugX11|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.DebugX11|Any CPU.Build.0 = DebugX11|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.Release|Any CPU.ActiveCfg = Release|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.Release|Any CPU.Build.0 = Release|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.ReleaseMinimal|Any CPU.Build.0 = ReleaseMinimal|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.Unittest|Any CPU.ActiveCfg = Unittest|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.Unittest|Any CPU.Build.0 = Unittest|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.UnittestMinimal|Any CPU.ActiveCfg = UnittestMinimal|x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0}.UnittestMinimal|Any CPU.Build.0 = UnittestMinimal|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Debug|Any CPU.ActiveCfg = Debug|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Debug|Any CPU.Build.0 = Debug|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugX11|Any CPU.Build.0 = DebugX11|x64 - {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Release|Any CPU.Build.0 = Release|Any CPU + {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Release|Any CPU.ActiveCfg = Release|x64 + {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Release|Any CPU.Build.0 = Release|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.ReleaseMinimal|Any CPU.Build.0 = ReleaseMinimal|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Unittest|Any CPU.ActiveCfg = Unittest|x64 @@ -84,8 +100,8 @@ Global {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugX11|Any CPU.Build.0 = DebugX11|x64 - {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.Build.0 = Release|Any CPU + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.ActiveCfg = Release|x64 + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.Build.0 = Release|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.ReleaseMinimal|Any CPU.Build.0 = ReleaseMinimal|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Unittest|Any CPU.ActiveCfg = Unittest|x64 diff --git a/examples/spreadsheet/spreadsheet-monod-linux.dproj b/examples/spreadsheet/spreadsheet-monod-linux.dproj new file mode 100644 index 00000000..db8dbf87 --- /dev/null +++ b/examples/spreadsheet/spreadsheet-monod-linux.dproj @@ -0,0 +1,201 @@ + + + + Debug + x64 + {5BD82AA8-4026-44C2-8957-B4E2932542F0} + DMD2 + true + true + true + + + ../../src + ../../deps/dlib + ../../deps/gl3n + ../../deps/DerelictSDL2/source + ../../deps/DerelictFT/source + ../../deps/DerelictGL3/source + ../../deps/DerelictUtil/source + + + + + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1} + + + + + true + bin\Debug + obj/Debug + true + false + spreadsheet-monod-linux + Executable + true + 0 + + + USE_SDL + USE_OPENGL + USE_FREETYPE + EmbedStandardResources + + + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + + + bin\Release + + + USE_SDL + USE_OPENGL + USE_FREETYPE + EmbedStandardResources + + + obj/Release + true + false + spreadsheet-monod-linux + Executable + true + 0 + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + + + true + bin\Unittest + + + USE_SDL + USE_OPENGL + USE_FREETYPE + EmbedStandardResources + + + obj/Unittest + true + true + spreadsheet-monod-linux + Executable + true + 0 + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + + + true + bin\Debug + + + USE_SDL + USE_FREETYPE + EmbedStandardResources + + + obj/Debug + true + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + false + spreadsheet-monod-linux + Executable + true + 0 + + + bin\Release + + + USE_SDL + USE_FREETYPE + EmbedStandardResources + + + obj/Release + true + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + false + spreadsheet-monod-linux + Executable + true + 0 + + + true + bin\Unittest + + + USE_SDL + USE_FREETYPE + EmbedStandardResources + + + obj/Unittest + true + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + true + spreadsheet-monod-linux + Executable + true + 0 + + + true + bin\Debug + + + USE_X11 + USE_FREETYPE + EmbedStandardResources + + + obj/Debug + true + -Jviews +-Jviews/res +-Jviews/res/hdpi +-Jviews/res/mdpi +-Jviews/res/i18n + + false + spreadsheet-monod-linux + Executable + true + 0 + + + + + + \ No newline at end of file diff --git a/examples/spreadsheet/src/dlangui/widgets/spreadsheet.d b/examples/spreadsheet/src/dlangui/widgets/spreadsheet.d index 24a38048..30d260dd 100644 --- a/examples/spreadsheet/src/dlangui/widgets/spreadsheet.d +++ b/examples/spreadsheet/src/dlangui/widgets/spreadsheet.d @@ -46,6 +46,8 @@ class SpreadSheetView : StringGridWidget { super(ID); layoutWidth = FILL_PARENT; layoutHeight = FILL_PARENT; + defRowHeight = 14; + defColumnWidth = 80; styleId = null; backgroundColor = 0xFFFFFF; resize(50, 50); diff --git a/src/dlangui/platforms/x11/x11app.d b/src/dlangui/platforms/x11/x11app.d index 1ce84aea..07c50baa 100644 --- a/src/dlangui/platforms/x11/x11app.d +++ b/src/dlangui/platforms/x11/x11app.d @@ -701,15 +701,10 @@ class X11Platform : Platform { bool handleTimers() { bool handled = false; - bool needRestart = true; - while (needRestart) { - needRestart = false; - foreach(w; _windowMap) { - if (w.handleTimer()) { - needRestart = true; - handled = true; - break; - } + foreach(w; _windowMap) { + if (w.handleTimer()) { + handled = true; + break; } } return handled; @@ -734,7 +729,8 @@ class X11Platform : Platform { /* get the next event and stuff it into our event variable. Note: only events we set the mask for are detected! */ - if (!XPending(x11display) && !handleTimers()) { + handleTimers(); + if (!XPending(x11display)) { Thread.sleep(dur!("msecs")(10)); continue; } @@ -805,17 +801,6 @@ class X11Platform : Platform { } else { Log.e("Window not found"); } -// if (XLookupString(&event.xkey, text.ptr, 255, &key, cast(XComposeStatus*)null) == 1) { -// /* use the XLookupString routine to convert the invent -// KeyPress data into regular text. Weird but necessary... -// */ -// if (text[0]=='q') { -// finished = true; -// break; -// //close_x(); -// } -// Log.d("You pressed the key", text[0]); -// } break; case KeyRelease: Log.d("X11: KeyRelease event");