2004-05-29 06:06:50 +02:00
|
|
|
/*
|
|
|
|
CCheckBox
|
|
|
|
by Gustav Larsson
|
|
|
|
gee@pyro.nu
|
|
|
|
*/
|
|
|
|
|
2004-06-03 20:38:14 +02:00
|
|
|
#include "precompiled.h"
|
2004-05-29 06:06:50 +02:00
|
|
|
#include "GUI.h"
|
|
|
|
#include "CRadioButton.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
void CRadioButton::HandleMessage(const SGUIMessage &Message)
|
|
|
|
{
|
|
|
|
// Important
|
|
|
|
IGUIButtonBehavior::HandleMessage(Message);
|
|
|
|
|
|
|
|
switch (Message.type)
|
|
|
|
{
|
|
|
|
case GUIM_PRESSED:
|
2004-06-08 14:10:51 +02:00
|
|
|
{ // janwas added scoping to squelch ICC var decl warning
|
2004-05-29 06:06:50 +02:00
|
|
|
for (vector_pObjects::iterator it = GetParent()->ChildrenItBegin(); it != GetParent()->ChildrenItEnd(); ++it)
|
|
|
|
{
|
|
|
|
// Notice, if you use other objects within the parent object that has got
|
|
|
|
// this the "checked", it too will change. Hence NO OTHER OBJECTS THAN
|
|
|
|
// RADIO BUTTONS SHOULD BE WITHIN IT!
|
|
|
|
GUI<bool>::SetSetting((*it), "checked", false);
|
|
|
|
}
|
|
|
|
|
|
|
|
GUI<bool>::SetSetting(this, "checked", true);
|
|
|
|
|
|
|
|
//GetGUI()->TEMPmessage = "Check box " + string((const TCHAR*)m_Name) + " was " + (m_Settings.m_Checked?"checked":"unchecked");
|
|
|
|
break;
|
2004-06-08 14:10:51 +02:00
|
|
|
}
|
2004-05-29 06:06:50 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2004-06-11 04:14:18 +02:00
|
|
|
}
|