Planeshift
pawsconfigmouse.h
Go to the documentation of this file.
1 /*
2  * pawsconfigmouse.h - Author: Andrew Robberts
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PAWS_CONFIG_MOUSE_HEADER
21 #define PAWS_CONFIG_MOUSE_HEADER
22 
23 // CS INCLUDES
24 #include <csutil/array.h>
25 
26 // PAWS INCLUDES
27 #include "paws/pawswidget.h"
28 #include "paws/pawsbutton.h"
29 #include "paws/pawstextbox.h"
30 #include "pawsconfigwindow.h"
31 #include "paws/psmousebinds.h"
32 
33 class psMouseBinds;
34 
36 // pawsConfigMouse
38 
43 {
44 public:
45  virtual ~pawsConfigMouse();
46 
47  // from pawsConfigSectionWindow:
48  virtual bool Initialize();
49  virtual bool LoadConfig();
50  virtual bool SaveConfig();
51  virtual void SetDefault();
52 
53  // from pawsWidget:
54  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
55 
56  virtual bool OnChange(pawsWidget* widget);
57 
58 protected:
59 
60  bool LoadMouse(const char * fileName);
61 
65  bool CreateTree();
66 
67  void CreateTreeWidgets(pawsTreeNode * subtreeRoot);
68  // Adds widgets to all nodes in subtree with root 'subtreeRoot'
69  // -- command label, key combination label and button that opens FingeringWindow
70  void SetActionLabels(pawsTreeNode * subtreeRoot);
71  // Sets all labels that hold mouse events (in subtree with root 'subtreeRoot')
72 
73  pawsTree * tree; // the tree that makes whole window GUI
74 
76 
79  void HandleEditedAction( csString& editedAction );
80 };
81 
82 
83 
84 
86 {
87 public:
89  {
90  Register( "pawsConfigMouse" );
91  }
93  {
94  return new pawsConfigMouse();
95  }
96 };
97 
98 
99 
100 #endif
101 
102 
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
bool LoadMouse(const char *fileName)
virtual void SetDefault()
sets content of dialog according to default configuration
psMouseBinds binds
configuration screen for mouse settings like invert axis, sensibility, ...
void CreateTreeWidgets(pawsTreeNode *subtreeRoot)
void HandleEditedAction(csString &editedAction)
Update the ingame state depending on the action that was edited.
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
void SetActionLabels(pawsTreeNode *subtreeRoot)
psMouseBinds holds set of psMouseAction
Definition: psmousebinds.h:64
virtual bool OnChange(pawsWidget *widget)
Called whenever a widget is selected.
virtual bool Initialize()
virtual ~pawsConfigMouse()
bool CreateTree()
Creates the tree that makes the whole GUI.
virtual bool LoadConfig()
sets content of dialog according to current configuration
virtual bool SaveConfig()
remembers settings in-game and saves them permanently to a file also