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_MousePreferencePane
21 #define TrenchBroom_MousePreferencePane
22 
23 #include "View/PreferencePane.h"
24 
25 class wxButton;
26 class wxCheckBox;
27 class wxChoice;
28 class wxSlider;
29 class wxStaticText;
30 
31 namespace TrenchBroom {
32     namespace View {
33         class KeyboardShortcutEditor;
34         class KeyboardShortcutEvent;
35 
36         class MousePreferencePane : public PreferencePane {
37         private:
38             wxSlider* m_lookSpeedSlider;
39             wxCheckBox* m_invertLookHAxisCheckBox;
40             wxCheckBox* m_invertLookVAxisCheckBox;
41             wxSlider* m_panSpeedSlider;
42             wxCheckBox* m_invertPanHAxisCheckBox;
43             wxCheckBox* m_invertPanVAxisCheckBox;
44             wxSlider* m_moveSpeedSlider;
45             wxCheckBox* m_invertMouseWheelCheckBox;
46             wxCheckBox* m_enableAltMoveCheckBox;
47             wxCheckBox* m_invertAltMoveAxisCheckBox;
48             wxCheckBox* m_moveInCursorDirCheckBox;
49             wxSlider* m_flySpeedSlider;
50             wxCheckBox* m_invertFlyVAxisCheckBox;
51 
52             KeyboardShortcutEditor* m_forwardKeyEditor;
53             KeyboardShortcutEditor* m_backwardKeyEditor;
54             KeyboardShortcutEditor* m_leftKeyEditor;
55             KeyboardShortcutEditor* m_rightKeyEditor;
56         public:
57             MousePreferencePane(wxWindow* parent);
58 
59             void OnLookSpeedChanged(wxScrollEvent& event);
60             void OnInvertLookHAxisChanged(wxCommandEvent& event);
61             void OnInvertLookVAxisChanged(wxCommandEvent& event);
62 
63             void OnPanSpeedChanged(wxScrollEvent& event);
64             void OnInvertPanHAxisChanged(wxCommandEvent& event);
65             void OnInvertPanVAxisChanged(wxCommandEvent& event);
66 
67             void OnMoveSpeedChanged(wxScrollEvent& event);
68 
69             void OnInvertMouseWheelChanged(wxCommandEvent& event);
70             void OnEnableAltMoveChanged(wxCommandEvent& event);
71             void OnInvertAltMoveAxisChanged(wxCommandEvent& event);
72             void OnMoveCameraInCursorDirChanged(wxCommandEvent& event);
73 
74             void OnFlySpeedChanged(wxScrollEvent& event);
75             void OnInvertFlyVAxisChanged(wxCommandEvent& event);
76 
77             void OnForwardKeyChanged(KeyboardShortcutEvent& event);
78             void OnBackwardKeyChanged(KeyboardShortcutEvent& event);
79             void OnLeftKeyChanged(KeyboardShortcutEvent& event);
80             void OnRightKeyChanged(KeyboardShortcutEvent& event);
81         private:
82             void createGui();
83             wxWindow* createCameraPreferences();
84 
85             void bindEvents();
86 
87             bool doCanResetToDefaults();
88             void doResetToDefaults();
89             void doUpdateControls();
90             bool doValidate();
91         };
92     }
93 }
94 
95 #endif /* defined(TrenchBroom_MousePreferencePane) */
96