Pyrogenesis
13997
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
gui
CRadioButton.cpp
Go to the documentation of this file.
1
/* Copyright (C) 2009 Wildfire Games.
2
* This file is part of 0 A.D.
3
*
4
* 0 A.D. is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* 0 A.D. is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
/*
19
CCheckBox
20
*/
21
22
#include "precompiled.h"
23
#include "
GUI.h
"
24
#include "
CRadioButton.h
"
25
26
27
void
CRadioButton::HandleMessage
(
SGUIMessage
&Message)
28
{
29
// Important
30
IGUIButtonBehavior::HandleMessage
(Message);
31
IGUITextOwner::HandleMessage
(Message);
32
33
switch
(Message.
type
)
34
{
35
case
GUIM_PRESSED
:
36
{
37
for
(vector_pObjects::iterator it =
GetParent
()->
ChildrenItBegin
(); it !=
GetParent
()->
ChildrenItEnd
(); ++it)
38
{
39
// Notice, if you use other objects within the parent object that has got
40
// the setting "checked", it too will change. Hence NO OTHER OBJECTS THAN
41
// RADIO BUTTONS SHOULD BE WITHIN IT!
42
GUI<bool>::SetSetting
((*it),
"checked"
,
false
);
43
}
44
45
GUI<bool>::SetSetting
(
this
,
"checked"
,
true
);
46
break
;
47
}
48
49
default
:
50
break
;
51
}
52
}
GUI.h
IGUIObject::GetParent
IGUIObject * GetParent() const
NOTE! This will not just return m_pParent, when that is need use it! There is one exception to it...
Definition:
IGUIObject.cpp:323
IGUIObject::ChildrenItEnd
vector_pObjects::iterator ChildrenItEnd()
Definition:
IGUIObject.h:226
IGUITextOwner::HandleMessage
virtual void HandleMessage(SGUIMessage &Message)
Definition:
IGUITextOwner.cpp:48
GUI::SetSetting
static PSRETURN SetSetting(IGUIObject *pObject, const CStr &Setting, const T &Value, const bool &SkipMessage=false)
Sets a value by name using a real datatype as input.
Definition:
GUIutil.cpp:366
GUIM_PRESSED
Definition:
GUIbase.h:91
IGUIObject::ChildrenItBegin
vector_pObjects::iterator ChildrenItBegin()
Definition:
IGUIObject.h:225
SGUIMessage
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
Definition:
GUIbase.h:106
SGUIMessage::type
EGUIMessageType type
Describes what the message regards.
Definition:
GUIbase.h:122
CRadioButton::HandleMessage
virtual void HandleMessage(SGUIMessage &Message)
Definition:
CRadioButton.cpp:27
IGUIButtonBehavior::HandleMessage
virtual void HandleMessage(SGUIMessage &Message)
Definition:
IGUIButtonBehavior.cpp:39
CRadioButton.h
Generated on Mon Oct 14 2013 00:58:06 for Pyrogenesis by
1.8.5