Public Member Functions | Protected Attributes

GuiButton Class Reference

Display, manage, and manipulate buttons in the GUI. Buttons can have images, icons, text, and sound set (all of which are optional). More...

#include <gui.h>

Inheritance diagram for GuiButton:
GuiElement

List of all members.

Public Member Functions

 GuiButton ()
 GuiButton (int w, int h)
 ~GuiButton ()
 Destructor.
void SetImage (GuiImage *i)
void SetImageOver (GuiImage *i)
void SetImageHold (GuiImage *i)
void SetImageClick (GuiImage *i)
void SetIcon (GuiImage *i)
void SetIconOver (GuiImage *i)
void SetIconHold (GuiImage *i)
void SetIconClick (GuiImage *i)
void SetLabel (GuiText *t, int n=0)
void SetLabelOver (GuiText *t, int n=0)
void SetLabelHold (GuiText *t, int n=0)
void SetLabelClick (GuiText *t, int n=0)
void SetSoundOver (GuiSound *s)
void SetSoundHold (GuiSound *s)
void SetSoundClick (GuiSound *s)
void Draw ()
 Constantly called to draw the GuiButton.
void Update (GuiTrigger *t)

Protected Attributes

GuiImageimage
 Button image (default).
GuiImageimageOver
 Button image for STATE_SELECTED.
GuiImageimageHold
 Button image for STATE_HELD.
GuiImageimageClick
 Button image for STATE_CLICKED.
GuiImageicon
 Button icon (drawn after button image).
GuiImageiconOver
 Button icon for STATE_SELECTED.
GuiImageiconHold
 Button icon for STATE_HELD.
GuiImageiconClick
 Button icon for STATE_CLICKED.
GuiTextlabel [3]
 Label(s) to display (default).
GuiTextlabelOver [3]
 Label(s) to display for STATE_SELECTED.
GuiTextlabelHold [3]
 Label(s) to display for STATE_HELD.
GuiTextlabelClick [3]
 Label(s) to display for STATE_CLICKED.
GuiSoundsoundOver
 Sound to play for STATE_SELECTED.
GuiSoundsoundHold
 Sound to play for STATE_HELD.
GuiSoundsoundClick
 Sound to play for STATE_CLICKED.

Detailed Description

Display, manage, and manipulate buttons in the GUI. Buttons can have images, icons, text, and sound set (all of which are optional).

Definition at line 666 of file gui.h.


Constructor & Destructor Documentation

GuiButton::GuiButton (  ) 

Constructor for the GuiButton class.

Definition at line 16 of file gui_button.cpp.

GuiButton::GuiButton ( int  w,
int  h 
)

Constructor

Parameters:
w Width
h Height

Definition at line 43 of file gui_button.cpp.

GuiButton::~GuiButton (  ) 

Destructor.

Destructor for the GuiButton class.

Definition at line 75 of file gui_button.cpp.


Member Function Documentation

void GuiButton::Draw (  )  [virtual]

Constantly called to draw the GuiButton.

Draw the button on screen

Reimplemented from GuiElement.

Definition at line 155 of file gui_button.cpp.

void GuiButton::SetIcon ( GuiImage i  ) 

Sets the button's icon

Parameters:
i Pointer to GuiImage object

Definition at line 99 of file gui_button.cpp.

void GuiButton::SetIconClick ( GuiImage i  ) 

Sets the button's icon on click

Parameters:
i Pointer to GuiImage object

Definition at line 114 of file gui_button.cpp.

void GuiButton::SetIconHold ( GuiImage i  ) 

Sets the button's icon on hold

Parameters:
i Pointer to GuiImage object

Definition at line 109 of file gui_button.cpp.

void GuiButton::SetIconOver ( GuiImage i  ) 

Sets the button's icon on over

Parameters:
i Pointer to GuiImage object

Definition at line 104 of file gui_button.cpp.

void GuiButton::SetImage ( GuiImage i  ) 

Sets the button's image

Parameters:
i Pointer to GuiImage object

Definition at line 79 of file gui_button.cpp.

void GuiButton::SetImageClick ( GuiImage i  ) 

Sets the button's image on click

Parameters:
i Pointer to GuiImage object

Definition at line 94 of file gui_button.cpp.

void GuiButton::SetImageHold ( GuiImage i  ) 

Sets the button's image on hold

Parameters:
i Pointer to GuiImage object

Definition at line 89 of file gui_button.cpp.

void GuiButton::SetImageOver ( GuiImage i  ) 

Sets the button's image on over

Parameters:
i Pointer to GuiImage object

Definition at line 84 of file gui_button.cpp.

void GuiButton::SetLabel ( GuiText t,
int  n = 0 
)

Sets the button's label

Parameters:
t Pointer to GuiText object
n Index of label to set (optional, default is 0)

Definition at line 119 of file gui_button.cpp.

void GuiButton::SetLabelClick ( GuiText t,
int  n = 0 
)

Sets the button's label on click

Parameters:
t Pointer to GuiText object
n Index of label to set (optional, default is 0)

Definition at line 134 of file gui_button.cpp.

void GuiButton::SetLabelHold ( GuiText t,
int  n = 0 
)

Sets the button's label on hold

Parameters:
t Pointer to GuiText object
n Index of label to set (optional, default is 0)

Definition at line 129 of file gui_button.cpp.

void GuiButton::SetLabelOver ( GuiText t,
int  n = 0 
)

Sets the button's label on over (eg: different colored text)

Parameters:
t Pointer to GuiText object
n Index of label to set (optional, default is 0)

Definition at line 124 of file gui_button.cpp.

void GuiButton::SetSoundClick ( GuiSound s  ) 

Sets the sound to play on click

Parameters:
s Pointer to GuiSound object

Definition at line 147 of file gui_button.cpp.

void GuiButton::SetSoundHold ( GuiSound s  ) 

Sets the sound to play on hold

Parameters:
s Pointer to GuiSound object

Definition at line 143 of file gui_button.cpp.

void GuiButton::SetSoundOver ( GuiSound s  ) 

Sets the sound to play on over

Parameters:
s Pointer to GuiSound object

Definition at line 139 of file gui_button.cpp.

void GuiButton::Update ( GuiTrigger t  )  [virtual]

Constantly called to allow the GuiButton to respond to updated input data

Parameters:
t Pointer to a GuiTrigger, containing the current input data from PAD/WPAD

Reimplemented from GuiElement.

Definition at line 182 of file gui_button.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Defines