Wxwidgets graphics plugin
[lsnes.git] / platform / wxwidgets / src / filenamebox.hpp
blob59ae96626020d969fabba06bb6d583dcf5cc2b03
1 #ifndef _wxwidgets_filenamebox__hpp__included__
2 #define _wxwidgets_filenamebox__hpp__included__
4 //Permanent label.
5 #define FNBF_PL 1
6 //Start disabled.
7 #define FNBF_SD 2
8 //No notification on filename change.
9 #define FNBF_NN 4
10 //Insert as one item.
11 #define FNBF_OI 8
12 //Peek inside .zip files.
13 #define FNBF_PZ 16
15 #include <wx/wx.h>
16 #include <wx/event.h>
18 class filenamebox : public wxEvtHandler
20 public:
21 filenamebox(wxSizer* sizer, wxWindow* parent, const std::string& initial_label, int flags,
22 wxEvtHandler* dispatch_to, wxObjectEventFunction on_fn_change);
23 ~filenamebox();
24 void disable();
25 void enable();
26 void change_label(const std::string& new_label);
27 void enable(const std::string& new_label);
28 bool is_enabled();
29 std::string get_file();
30 void on_file_select(wxCommandEvent& e);
31 bool is_nonblank();
32 bool is_nonblank_or_disabled();
33 void clear();
34 private:
35 int given_flags;
36 std::string last_label;
37 bool enabled;
38 wxStaticText* label;
39 wxTextCtrl* filename;
40 wxButton* file_select;
41 wxWindow* pwindow;
44 #endif