xoreos  0.0.5
mousesettings.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos 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; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include "src/common/configman.h"
26 
28 
31 
32 namespace Engines {
33 
34 namespace KotOR {
35 
37  load("optmouse");
38 
40 
41  getCheckBox("CB_REVBUTTONS", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
42 
43  readConfig();
44 }
45 
47 }
48 
50  readConfig();
51  displayConfig();
52 
53  GUI::show();
54 }
55 
57  if (widget.getTag() == "BTN_DEFAULT") {
58  setDefault();
59  displayConfig();
60  }
61 
62  if (widget.getTag() == "BTN_BACK") {
63  adoptChanges();
64  _returnCode = 1;
65  return;
66  }
67 
68  if (widget.getTag() == "CB_REVBUTTONS") {
69  _reverseMouseButtons = getCheckBoxState("CB_REVBUTTONS");
70  return;
71  }
72 }
73 
75  _reverseMouseButtons = ConfigMan.getDefaultBool("reversemousebuttons");
76 }
77 
79  setDefault();
80 
81  _reverseMouseButtons = ConfigMan.getBool("reversemousebuttons");
82 }
83 
85  setCheckBoxState("CB_REVBUTTONS", _reverseMouseButtons);
86 }
87 
89  ConfigMan.setBool("reversemousebuttons", _reverseMouseButtons, true);
90 }
91 
92 } // End of namespace KotOR
93 
94 } // End of namespace Engines
void load(const Common::UString &resref)
Definition: gui.cpp:103
static const Common::UString & kBackgroundTypeMenu
Definition: guibackground.h:42
uint32 _returnCode
The GUI&#39;s return code.
Definition: gui.h:75
The global config manager.
A checkbox widget for Star Wars: Knights of the Old Repulic and Jade Empire.
bool getCheckBoxState(const Common::UString &tag)
Definition: gui.cpp:312
#define ConfigMan
Shortcut for accessing the config manager.
Definition: configman.h:176
OptionsMouseSettingsMenu(::Engines::Console *console=0)
const Common::UString & getTag() const
Get the widget&#39;s tag.
Definition: widget.cpp:45
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
virtual void show()
Show the GUI.
void addBackground(const Common::UString &background, bool front=false)
Definition: gui.cpp:300
virtual void show()
Show the GUI.
Definition: gui.cpp:69
The mouse settings menu.
A widget in a GUI.
A widget in a GUI.
Definition: widget.h:40
void setColor(float r, float g, float b, float a)
WidgetCheckBox * getCheckBox(const Common::UString &tag, bool vital=false)
Definition: gui.cpp:240
A KotOR GUI.
Definition: gui.h:57
void setCheckBoxState(const Common::UString &tag, bool state)
Definition: gui.cpp:307