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

PG_RadioButton Class Reference

Inheritance diagram for PG_RadioButton:

Inheritance graph
[legend]
Collaboration diagram for PG_RadioButton:

Collaboration graph
[legend]
List of all members.

Detailed Description

A single radio button.

Author:
Alexander Pipelka

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

Examples:

paratest.cpp.


Public Member Functions

 PG_RadioButton (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const char *text=NULL, PG_RadioButton *firstOfGroup=NULL, int id=-1, const char *style="RadioButton")
 ~PG_RadioButton ()
void LoadThemeStyle (const char *widgettype)
 Load a specific themestyle.

bool GetPressed ()
void SetPressed ()
void SetAlignment (PG_Label::TextAlign a)
 Sets text alignment.

void SetText (const char *text)
 Sets text.

const char * GetText ()
 Returns text.

void SetFontColor (const PG_Color &Color)
 Set font color.

void SetSizeByText (int Width=0, int Height=0, const char *Text=NULL)
 Set widget size by size of text (should be used before Show() or AddWidget()).

void AddToGroup (PG_RadioButton *w)

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.

bool handleButtonClick (PG_Button *button)

Protected Attributes

PG_RadioButtonmy_groupFirst
PG_RadioButtonmy_groupNext
PG_Buttonmy_widgetButton
PG_Labelmy_widgetLabel
bool my_isPressed


Constructor & Destructor Documentation

PG_RadioButton::PG_RadioButton PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const char *  text = NULL,
PG_RadioButton firstOfGroup = NULL,
int  id = -1,
const char *  style = "RadioButton"
 

PG_RadioButton::~PG_RadioButton  ) 
 


Member Function Documentation

void PG_RadioButton::AddToGroup PG_RadioButton w  ) 
 

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.

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.

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.

bool PG_RadioButton::GetPressed  ) 
 

const char* PG_RadioButton::GetText  )  [virtual]
 

Returns text.

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

Reimplemented from PG_Widget.

bool PG_RadioButton::handleButtonClick PG_Button button  )  [protected]
 

void PG_RadioButton::LoadThemeStyle const char *  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ThemeWidget.

void PG_RadioButton::ReleaseButton  )  [protected]
 

void PG_RadioButton::SetAlignment PG_Label::TextAlign  a  ) 
 

Sets text alignment.

Examples:
paratest.cpp.

void PG_RadioButton::SetFontColor const PG_Color Color  ) 
 

Set font color.

Parameters:
Color PG_Color class contains color information (RGB)

Reimplemented from PG_Widget.

void PG_RadioButton::SetPressed  ) 
 

void PG_RadioButton::SetSizeByText int  Width = 0,
int  Height = 0,
const char *  Text = NULL
 

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.

void PG_RadioButton::SetText const char *  text  )  [virtual]
 

Sets text.

Parameters:
text Set the widget text and update widget

Reimplemented from PG_Widget.


Member Data Documentation

PG_RadioButton* PG_RadioButton::my_groupFirst [protected]
 

PG_RadioButton* PG_RadioButton::my_groupNext [protected]
 

bool PG_RadioButton::my_isPressed [protected]
 

PG_Button* PG_RadioButton::my_widgetButton [protected]
 

PG_Label* PG_RadioButton::my_widgetLabel [protected]
 

SignalButtonClick<bool> PG_RadioButton::sigClick
 

Examples:
dblbuffer.cpp.


The ParaGUI Project - Alexander Pipelka