Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PG_RadioButton Class Reference

A single radio button. More...

#include <pgradiobutton.h>

Inheritance diagram for PG_RadioButton:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PG_RadioButton (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const std::string &text=PG_NULLSTR, PG_RadioButton *firstOfGroup=NULL, int id=-1, const std::string &style="RadioButton")
 ~PG_RadioButton ()
void LoadThemeStyle (const std::string &widgettype)
 Load a specific themestyle.
bool GetPressed ()
void SetPressed ()
void SetAlignment (PG_Label::TextAlign a)
 Sets text alignment.
void SetText (const std::string &text)
 Sets text.
const PG_String & GetText ()
 Returns text.
void SetFontColor (const PG_Color &Color)
void SetSizeByText (int Width=0, int Height=0, const std::string &Text=PG_NULLSTR)
 Set widget size by size of text (should be used before Show() or AddWidget()).
void AddToGroup (PG_RadioButton *w)
PG_RadioButtonGetFirstOfGroup ()
 Returns first radio button of the group.
PG_RadioButtonGetNextOfGroup ()
 Returns next radio button in the group.

Public Attributes

SignalButtonClick< bool > sigClick

Protected Member Functions

void ReleaseButton ()
void eventMouseEnter ()
 eventhandler for mouse movements.
void eventMouseLeave ()
 eventhandler for mouse movements.
bool eventMouseButtonUp (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.
virtual bool handleButtonClick (PG_Button *button)

Protected Attributes

PG_RadioButtonmy_groupFirst
PG_RadioButtonmy_groupNext
PG_Buttonmy_widgetButton
PG_Labelmy_widgetLabel
bool my_isPressed

Classes

class  SignalButtonClick
 Signal type declaration. More...

Detailed Description

A single radio button.

Author:
Alexander Pipelka
A single radio button, which has an attribute to signify what group it belongs to.

Definition at line 56 of file pgradiobutton.h.


Constructor & Destructor Documentation

PG_RadioButton::PG_RadioButton PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const std::string &  text = PG_NULLSTR,
PG_RadioButton firstOfGroup = NULL,
int  id = -1,
const std::string &  style = "RadioButton"
 

Definition at line 36 of file pgradiobutton.cpp.

References AddToGroup(), PG_Signal2< P1, P2, datatype >::connect(), PG_Widget::EnableReceiver(), handleButtonClick(), LoadThemeStyle(), my_groupFirst, my_groupNext, PG_Rect::my_height, my_isPressed, my_widgetButton, my_widgetLabel, PG_Rect::my_width, PG_PropStr::RadioButton, PG_Widget::SetID(), SetPressed(), PG_Rect::SetRect(), PG_Button::SetToggle(), PG_ThemeWidget::SetTransparency(), and PG_Button::sigClick.

PG_RadioButton::~PG_RadioButton  ) 
 

Definition at line 92 of file pgradiobutton.cpp.

References my_widgetButton, and my_widgetLabel.


Member Function Documentation

void PG_RadioButton::AddToGroup PG_RadioButton w  ) 
 

Definition at line 184 of file pgradiobutton.cpp.

References my_groupFirst, and my_groupNext.

Referenced by ASCGUI_Window::parsePanelASCTXT(), and PG_RadioButton().

bool PG_RadioButton::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Reimplemented in PG_CheckButton.

Definition at line 109 of file pgradiobutton.cpp.

References my_groupFirst, my_groupNext, PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, PG_Rect::my_ypos, and SetPressed().

void PG_RadioButton::eventMouseEnter  )  [protected, virtual]
 

eventhandler for mouse movements.

This overrideable handler is called everytime the mouse cursor is entering the widget area.

Reimplemented from PG_Widget.

Definition at line 97 of file pgradiobutton.cpp.

References PG_Widget::eventMouseEnter(), PG_ThemeWidget::SetTransparency(), and PG_Widget::Update().

void PG_RadioButton::eventMouseLeave  )  [protected, virtual]
 

eventhandler for mouse movements.

This overrideable handler is called everytime the mouse cursor is leaving the widget area.

Reimplemented from PG_Widget.

Definition at line 103 of file pgradiobutton.cpp.

References PG_Widget::eventMouseLeave(), PG_ThemeWidget::SetTransparency(), and PG_Widget::Update().

PG_RadioButton* PG_RadioButton::GetFirstOfGroup  )  [inline]
 

Returns first radio button of the group.

Definition at line 97 of file pgradiobutton.h.

PG_RadioButton* PG_RadioButton::GetNextOfGroup  )  [inline]
 

Returns next radio button in the group.

Definition at line 103 of file pgradiobutton.h.

bool PG_RadioButton::GetPressed  ) 
 

Definition at line 175 of file pgradiobutton.cpp.

References my_isPressed.

Referenced by PG_PropertyField_Checkbox< B >::Apply(), StartMultiplayerGame::Apply(), ResourcePlacementDialog::buttonEvent(), ReplayRecorderDialog::getAppend(), and CopyMap::paste().

const PG_String & PG_RadioButton::GetText  )  [virtual]
 

Returns text.

Returns:
Pointer to the text of the widget (read-only)

Reimplemented from PG_Widget.

Definition at line 200 of file pgradiobutton.cpp.

References PG_Widget::GetText(), and my_widgetLabel.

bool PG_RadioButton::handleButtonClick PG_Button button  )  [protected, virtual]
 

Definition at line 146 of file pgradiobutton.cpp.

References SetPressed().

Referenced by PG_RadioButton().

void PG_RadioButton::LoadThemeStyle const std::string &  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ThemeWidget.

Definition at line 81 of file pgradiobutton.cpp.

References PG_Theme::GetProperty(), PG_Application::GetTheme(), PG_Label::LoadThemeStyle(), PG_Button::LoadThemeStyle(), PG_ThemeWidget::LoadThemeStyle(), my_widgetButton, my_widgetLabel, PG_PropStr::RadioButton, and PG_PropStr::transparency.

Referenced by PG_CheckButton::PG_CheckButton(), and PG_RadioButton().

void PG_RadioButton::ReleaseButton  )  [protected]
 

Definition at line 179 of file pgradiobutton.cpp.

References my_isPressed, my_widgetButton, and PG_Button::SetPressed().

Referenced by SetPressed().

void PG_RadioButton::SetAlignment PG_Label::TextAlign  a  ) 
 

Sets text alignment.

Definition at line 204 of file pgradiobutton.cpp.

References my_widgetLabel, and PG_Label::SetAlignment().

void PG_RadioButton::SetFontColor const PG_Color Color  ) 
 

Definition at line 208 of file pgradiobutton.cpp.

References my_widgetLabel, and PG_Widget::SetFontColor().

void PG_RadioButton::SetPressed  ) 
 

Definition at line 151 of file pgradiobutton.cpp.

References my_groupFirst, my_groupNext, my_isPressed, my_widgetButton, ReleaseButton(), PG_Button::SetPressed(), sigClick, and PG_Widget::Update().

Referenced by AmmoTransferWindow::AmmoTransferWindow(), CopyMap::CopyMap(), EventEditor::EventEditor(), eventMouseButtonUp(), PG_CheckButton::eventMouseButtonUp(), handleButtonClick(), PG_PropertyField_Checkbox< B >::PG_PropertyField_Checkbox(), PG_RadioButton(), PG_PropertyField_Checkbox< B >::Reload(), ReplayRecorderDialog::ReplayRecorderDialog(), SetRadioButtonAtts(), SoundSettings::SoundSettings(), StartMultiplayerGame::StartMultiplayerGame(), VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow(), and WeatherDialog::WeatherDialog().

void PG_RadioButton::SetSizeByText int  Width = 0,
int  Height = 0,
const std::string &  Text = PG_NULLSTR
 

Set widget size by size of text (should be used before Show() or AddWidget()).

Parameters:
Width Value witch is added to text width (default = 0)
Height Value witch is added to text height (default = 0)
Text Text to get size from, if NULL my_text is used

Reimplemented from PG_Widget.

Definition at line 212 of file pgradiobutton.cpp.

References PG_Widget::MoveWidget(), PG_Rect::my_height, my_widgetButton, my_widgetLabel, PG_Rect::my_width, PG_MAX, PG_Label::SetSizeByText(), PG_Button::SetSizeByText(), and PG_Widget::SizeWidget().

Referenced by AddWeatherAreaDialog::AddWeatherAreaDialog(), ResourcePlacementDialog::ResourcePlacementDialog(), SaveGameBaseDialog::SaveGameBaseDialog(), and WeatherDialog::WeatherDialog().

void PG_RadioButton::SetText const std::string &  text  )  [virtual]
 

Sets text.

Parameters:
text Set the widget text and update widget C++ version, handles std::string

Reimplemented from PG_Widget.

Definition at line 196 of file pgradiobutton.cpp.

References my_widgetLabel, and PG_Widget::SetText().

Referenced by ASCGUI_Window::parsePanelASCTXT().


Member Data Documentation

PG_RadioButton* PG_RadioButton::my_groupFirst [protected]
 

Definition at line 126 of file pgradiobutton.h.

Referenced by AddToGroup(), eventMouseButtonUp(), PG_RadioButton(), and SetPressed().

PG_RadioButton* PG_RadioButton::my_groupNext [protected]
 

Definition at line 128 of file pgradiobutton.h.

Referenced by AddToGroup(), eventMouseButtonUp(), PG_RadioButton(), and SetPressed().

bool PG_RadioButton::my_isPressed [protected]
 

Definition at line 134 of file pgradiobutton.h.

Referenced by PG_CheckButton::eventMouseButtonUp(), GetPressed(), PG_RadioButton(), ReleaseButton(), SetPressed(), and PG_CheckButton::SetUnpressed().

PG_Button* PG_RadioButton::my_widgetButton [protected]
 

Definition at line 130 of file pgradiobutton.h.

Referenced by LoadThemeStyle(), PG_CheckButton::PG_CheckButton(), PG_RadioButton(), ReleaseButton(), SetPressed(), SetSizeByText(), PG_CheckButton::SetUnpressed(), and ~PG_RadioButton().

PG_Label* PG_RadioButton::my_widgetLabel [protected]
 

Definition at line 132 of file pgradiobutton.h.

Referenced by GetText(), LoadThemeStyle(), PG_RadioButton(), SetAlignment(), SetFontColor(), SetSizeByText(), SetText(), and ~PG_RadioButton().

SignalButtonClick<bool> PG_RadioButton::sigClick
 

Definition at line 107 of file pgradiobutton.h.

Referenced by AmmoTransferWindow::AmmoTransferWindow(), EventEditor::EventEditor(), MapInfoPanel::MapInfoPanel(), PG_PropertyField_Checkbox< B >::PG_PropertyField_Checkbox(), SetPressed(), PG_CheckButton::SetUnpressed(), SoundSettings::SoundSettings(), StartMultiplayerGame::StartMultiplayerGame(), and VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:19:20 2008 for Advanced Strategic Command by  doxygen 1.4.2