Skip to content

Commit 160ef9f

Browse files
authored
Merge pull request #115 from Shallowmallow/File/Dir-Dialog-improvements
File/dir dialog improvements
2 parents d40c1a5 + 9330033 commit 160ef9f

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

src/hx/widgets/DirDialog.hx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ class DirDialog extends Dialog {
3737
dirDialogRef.ptr.setPath(s);
3838
return value;
3939
}
40+
41+
#if (wxWidgetsVersion >= version("3.1.4"))
42+
public var paths(get, never):Array<String>;
43+
private function get_paths():Array<String> {
44+
var wxArray = new ArrayString();
45+
dirDialogRef.ptr.getPaths(@:privateAccess wxArray.arraystringRef.ref);
46+
var array = new ArrayString();
47+
var r = wxArray.toArray();
48+
wxArray.destroy();
49+
return r;
50+
}
51+
#end
4052

4153
//////////////////////////////////////////////////////////////////////////////////////////////////////////
4254
// Helpers

src/wx/widgets/DirDialog.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package wx.widgets;
22

33
import cpp.Pointer;
44
import cpp.RawPointer;
5+
import cpp.Reference;
56

67
@:include("wx/wx.h")
78
@:unreflective
@@ -19,4 +20,7 @@ extern class DirDialog extends Dialog {
1920

2021
@:native("GetPath") public function getPath():WxString;
2122
@:native("SetPath") public function setPath(path:WxString):Void;
23+
#if (wxWidgetsVersion >= version("3.1.4"))
24+
@:native("GetPaths") public function getPaths(paths:Reference<ArrayString>):WxString;
25+
#end
2226
}

src/wx/widgets/styles/DirDialogStyle.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ class DirDialogStyle {
1414
public static var DIR_MUST_EXIST:Int = untyped __cpp__("wxDD_DIR_MUST_EXIST");
1515
/** Change the current working directory to the directory chosen by the user. */
1616
public static var CHANGE_DIR:Int = untyped __cpp__("wxDD_CHANGE_DIR");
17-
17+
#if (wxWidgetsVersion >= version("3.1.4"))
18+
public static var SHOW_HIDDEN:Int = untyped __cpp__("wxDD_SHOW_HIDDEN");
19+
public static var MULTIPLE:Int = untyped __cpp__("wxDD_MULTIPLE");
20+
#end
1821
}

src/wx/widgets/styles/FileDialogStyle.hx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,15 @@ class FileDialogStyle {
2727
public static var CHANGE_DIR:Int = untyped __cpp__("wxFD_CHANGE_DIR");
2828
/** Show the preview of the selected files (currently only supported by wxGTK). */
2929
public static var PREVIEW:Int = untyped __cpp__("wxFD_PREVIEW");
30+
#if (wxWidgetsVersion >= version("3.1.0"))
31+
/** Directs the dialog to return the path and file name of the selected shortcut file, not its target as it does by default.
32+
* Currently this flag is only implemented in wxMSW and wxOSX (where it prevents aliases from being resolved).
33+
* The non-dereferenced link path is always returned, even without this flag, under Unix and so using it there doesn't do anything */
34+
public static var NO_FOLLOW:Int = untyped __cpp__("wxFD_NO_FOLLOW");
35+
#end
36+
#if (wxWidgetsVersion >= version("3.1.3"))
37+
/** Show hidden files */
38+
public static var SHOW_HIDDEN:Int = untyped __cpp__("wxFD_SHOW_HIDDEN");
39+
#end
3040

3141
}

0 commit comments

Comments
 (0)