1 #ifndef _platform__wxwidgets__loadsave__hpp__included__
2 #define _platform__wxwidgets__loadsave__hpp__included__
5 #include "platform/wxwidgets/platform.hpp"
7 struct filedialog_type_entry
9 filedialog_type_entry(std::string _name
, std::string _extensions
, std::string _primaryext
)
12 extensions
= _extensions
;
13 primaryext
= _primaryext
;
16 std::string extensions
;
17 std::string primaryext
;
20 struct filedialog_input_params
22 std::vector
<filedialog_type_entry
> types
;
24 std::string default_filename
;
27 struct filedialog_output_params
36 typedef std::string returntype
;
37 single_type(const std::string
& _ext
, const std::string
& _desc
= "");
38 filedialog_input_params
input(bool save
) const;
39 std::string
output(const filedialog_output_params
& p
, bool save
) const;
48 typedef std::string returntype
;
49 filedialog_input_params
input(bool save
) const;
50 std::string
output(const filedialog_output_params
& p
, bool save
) const;
53 extern lua_script_type filetype_lua_script
;
54 extern single_type filetype_macro
;
55 extern single_type filetype_watch
;
56 extern single_type filetype_commentary
;
57 extern single_type filetype_sox
;
58 extern single_type filetype_sub
;
59 extern single_type filetype_png
;
60 extern single_type filetype_hexbookmarks
;
61 extern single_type filetype_memorysearch
;
62 extern single_type filetype_textfile
;
63 extern single_type filetype_trace
;
64 extern single_type filetype_font
;
65 extern single_type filetype_disassembly
;
66 extern single_type filetype_r16m
;
68 filedialog_output_params
show_filedialog(wxWindow
* parent
, const std::string
& title
, const std::string
& basepath
,
69 const filedialog_input_params
& p
, const std::string
& defaultname
, bool saving
);
72 typename
T::returntype
choose_file_load(wxWindow
* parent
, const std::string
& title
, const std::string
& basepath
,
73 const T
& types
, const std::string
& defaultname
= "")
75 filedialog_input_params p
= types
.input(false);
76 filedialog_output_params q
= show_filedialog(parent
, title
, basepath
, p
, defaultname
, false);
77 return types
.output(q
, false);
81 typename
T::returntype
choose_file_save(wxWindow
* parent
, const std::string
& title
, const std::string
& basepath
,
82 const T
& types
, const std::string
& defaultname
= "")
84 filedialog_input_params p
= types
.input(true);
85 filedialog_output_params q
= show_filedialog(parent
, title
, basepath
, p
, defaultname
, true);
86 return types
.output(q
, true);