1 /* 2 Copyright (C) 2010-2014 Kristian Duske 3 4 This file is part of TrenchBroom. 5 6 TrenchBroom is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 TrenchBroom is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef TrenchBroom_PreferenceDialog 21 #define TrenchBroom_PreferenceDialog 22 23 #include <wx/dialog.h> 24 25 class wxPanel; 26 class wxSimplebook; 27 class wxToolBar; 28 class wxToolBarToolBase; 29 30 namespace TrenchBroom { 31 namespace View { 32 class PreferencePane; 33 34 class PreferenceDialog : public wxDialog { 35 private: 36 typedef enum { 37 PrefPane_First = 0, 38 PrefPane_Games = 0, 39 PrefPane_View = 1, 40 PrefPane_Mouse = 2, 41 PrefPane_Keyboard = 3, 42 PrefPane_Last = 3 43 } PrefPane; 44 45 wxToolBar* m_toolBar; 46 wxSimplebook* m_book; 47 public: 48 PreferenceDialog(); 49 bool Create(); 50 51 void OnToolClicked(wxCommandEvent& event); 52 void OnOKClicked(wxCommandEvent& event); 53 void OnApplyClicked(wxCommandEvent& event); 54 void OnCancelClicked(wxCommandEvent& event); 55 void OnClose(wxCloseEvent& event); 56 void OnFileClose(wxCommandEvent& event); 57 58 void OnResetClicked(wxCommandEvent& event); 59 void OnUpdateReset(wxUpdateUIEvent& event); 60 61 DECLARE_DYNAMIC_CLASS(PreferenceDialog) 62 private: 63 void createGui(); 64 void bindEvents(); 65 66 void switchToPane(const PrefPane pane); 67 void toggleTools(const PrefPane pane); 68 69 PreferencePane* currentPane() const; 70 PrefPane currentPaneId() const; 71 72 void updateAcceleratorTable(const PrefPane pane); 73 }; 74 } 75 } 76 77 #endif /* defined(TrenchBroom_PreferenceDialog) */ 78