diff --git a/examples/example1/dub.json b/examples/example1/dub.json index d69f0dfe..9d70d235 100644 --- a/examples/example1/dub.json +++ b/examples/example1/dub.json @@ -17,5 +17,16 @@ "dependencies": { "dlangui": {"path": "../../"} - } + }, + "configurations" : [ + { + "name" : "default", + }, + { + "name" : "sdl", + "subConfigurations" : { + "dlangui" : "sdl" + } + } + ] } diff --git a/examples/example1/src/example1.d b/examples/example1/src/example1.d index c4d9dc46..cb08fdb0 100644 --- a/examples/example1/src/example1.d +++ b/examples/example1/src/example1.d @@ -352,9 +352,10 @@ extern (C) int UIAppMain(string[] args) { UIString caption; caption = "Open Text File"d; FileDialog dlg = new FileDialog(caption, window, null); - dlg.addFilter(FileFilterEntry(UIString("FILTER_ALL_FILES", "All files (*.*)"d), "*.*")); + dlg.addFilter(FileFilterEntry(UIString("FILTER_ALL_FILES", "All files (*)"d), "*")); dlg.addFilter(FileFilterEntry(UIString("FILTER_TEXT_FILES", "Text files (*.txt)"d), "*.txt")); dlg.addFilter(FileFilterEntry(UIString("FILTER_SOURCE_FILES", "Source files"d), "*.d;*.dd;*.c;*.cc;*.cpp;*.h;*.hpp")); + dlg.addFilter(FileFilterEntry(UIString("FILTER_EXECUTABLE_FILES", "Executable files"d), "*", true)); //dlg.filterIndex = 2; dlg.dialogResult = delegate(Dialog dlg, const Action result) { if (result.id == ACTION_OPEN.id) { diff --git a/src/dlangui/core/files.d b/src/dlangui/core/files.d index ac9b2f44..3924d9d2 100644 --- a/src/dlangui/core/files.d +++ b/src/dlangui/core/files.d @@ -119,7 +119,7 @@ struct RootEntry { @property RootEntry[] getRootPaths() { RootEntry[] res; res ~= RootEntry(RootEntryType.HOME, homePath); - version (posix) { + version (Posix) { res ~= RootEntry(RootEntryType.ROOT, "/", "File System"d); } version (Windows) { @@ -192,10 +192,12 @@ bool filterFilename(in string filename, in string[] filters) pure nothrow { Returns true if directory exists and listed successfully, false otherwise. */ bool listDirectory(in string dir, in bool includeDirs, in bool includeFiles, in bool showHiddenFiles, in string[] filters, ref DirEntry[] entries, in bool showExecutables = false) { - entries.length = 0; - - if (!isDir(dir)) { + + import std.exception : collectException; + bool dirExists; + collectException(dir.isDir, dirExists); + if (!dirExists) { return false; } @@ -216,6 +218,8 @@ bool listDirectory(in string dir, in bool includeDirs, in bool includeFiles, in files ~= e; } } + dirs.sort!((a,b) => filenameCmp!(std.path.CaseSensitive.no)(a,b) < 0); + files.sort!((a,b) => filenameCmp!(std.path.CaseSensitive.no)(a,b) < 0); if (includeDirs) foreach(DirEntry e; dirs) entries ~= e; @@ -228,7 +232,7 @@ bool listDirectory(in string dir, in bool includeDirs, in bool includeFiles, in passed = e.name.endsWith(".exe") || e.name.endsWith(".EXE") || e.name.endsWith(".cmd") || e.name.endsWith(".CMD") || e.name.endsWith(".bat") || e.name.endsWith(".BAT"); - } else version (posix) { + } else version (Posix) { // execute permission for others passed = (e.attributes & attr_mask) != 0; } else version(OSX) { diff --git a/src/dlangui/platforms/sdl/sdlapp.d b/src/dlangui/platforms/sdl/sdlapp.d index 7749e565..52147f4c 100644 --- a/src/dlangui/platforms/sdl/sdlapp.d +++ b/src/dlangui/platforms/sdl/sdlapp.d @@ -1056,6 +1056,9 @@ class SDLPlatform : Platform { break; case SDL_WINDOWEVENT_EXPOSED: debug(DebugSDL) Log.d("SDL_WINDOWEVENT_EXPOSED"); + version(linux) { + w.redraw(); + } break; case SDL_WINDOWEVENT_MOVED: debug(DebugSDL) Log.d("SDL_WINDOWEVENT_MOVED"); @@ -1068,6 +1071,9 @@ class SDLPlatform : Platform { break; case SDL_WINDOWEVENT_RESTORED: debug(DebugSDL) Log.d("SDL_WINDOWEVENT_RESTORED"); + version(linux) { //not sure if needed on Windows or OSX. Also need to check on FreeBSD + w.redraw(); + } break; case SDL_WINDOWEVENT_ENTER: debug(DebugSDL) Log.d("SDL_WINDOWEVENT_ENTER");