Wxwidgets graphics plugin
[lsnes.git] / platform / wxwidgets / src / settingseditor.hpp
blob901728b0d4ed8c94b03e40f2fe6a7ba4bc86f411
1 #ifndef _wxwidgets_settingseditor__hpp__included__
2 #define _wxwidgets_settingseditor__hpp__included__
4 #include <wx/wx.h>
5 #include <wx/event.h>
6 #include <wx/control.h>
7 #include <wx/combobox.h>
8 #include <vector>
9 #include <string>
10 #include "window.hpp"
12 class wx_settings_editor_setting : public wxEvtHandler
14 public:
15 wx_settings_editor_setting(wxSizer* sizer, wxWindow* window, const std::string& name);
16 void on_clear_click(wxCommandEvent& e);
17 void on_edit_click(wxCommandEvent& e);
18 void change_setting(const std::string& setting, const std::string& value);
19 void clear_setting(const std::string& setting);
20 private:
21 std::string a_name;
22 wxWindow* parent;
23 wxStaticText* label;
24 wxButton* clear;
25 wxButton* edit;
28 class wx_settings_editor;
30 class wx_settings_editor_listener : public window_callback
32 public:
33 wx_settings_editor_listener(wx_settings_editor* _editor);
34 ~wx_settings_editor_listener() throw();
35 void on_setting_change(const std::string& setting, const std::string& value);
36 void on_setting_clear(const std::string& setting);
37 private:
38 wx_settings_editor* editor;
41 class wx_settings_editor : public wxDialog
43 public:
44 wx_settings_editor(wxWindow* parent);
45 ~wx_settings_editor();
46 bool ShouldPreventAppExit() const;
47 void on_close(wxCommandEvent& e);
48 void change_setting(const std::string& setting, const std::string& value);
49 void clear_setting(const std::string& setting);
50 private:
51 wx_settings_editor_listener listener;
52 std::vector<wx_settings_editor_setting*> esettings;
53 wxButton* close;
56 #endif