Planeshift
|
A simple button widget. More...
#include <pawsbutton.h>
Public Member Functions | |
virtual void | Draw () |
Draws the widget and all of it's children. | |
virtual void | Flash (bool state, FLASH_STATE type=FLASH_REGULAR) |
virtual bool | GetState () |
const char * | GetText () |
virtual bool | IsDown () |
virtual bool | IsEnabled () const |
virtual bool | OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers) |
Process keydown messages. | |
virtual bool | OnMouseDown (int button, int modifiers, int x, int y) |
Manage mouse down event to test for and apply window changes. | |
virtual bool | OnMouseEnter () |
Called whenever the mouse enters this widget. | |
virtual bool | OnMouseExit () |
Called whenever the mouse leaves this widget. | |
virtual bool | OnMouseUp (int button, int modifiers, int x, int y) |
Manage mouse up event. | |
pawsButton (const pawsButton &pb) | |
pawsButton () | |
bool | SelfPopulate (iDocumentNode *node) |
This function allows a widget to fill in its own contents from an xml node supplied and calls the same function for all children. | |
void | SetDownImage (const csString &image) |
virtual void | SetEnabled (bool enabled) |
void | SetGreyDownImage (const csString &greyDownImage) |
void | SetGreyUpImage (const csString &greyUpImage) |
virtual void | SetNotify (pawsWidget *widget) |
void | SetOnSpecialImage (const csString &image) |
void | SetSound (const char *sound) |
virtual void | SetState (bool isDown, bool publish=true) |
void | SetText (const char *text) |
virtual void | SetToggle (bool t) |
Set the toggle attribute. To change toggle state use SetState. | |
virtual bool | Setup (iDocumentNode *node) |
Setup this widget. | |
void | SetUpImage (const csString &image) |
virtual | ~pawsButton () |
Protected Member Functions | |
virtual bool | CheckKeyHandled (int keyCode) |
Allow pawsButton to simulate button pushes based on keypresses. | |
Protected Attributes | |
csString | buttonLabel |
Text shown in button. | |
bool | changeOnMouseOver |
Whether or not to change image on mouse enter/exit. | |
bool | down |
Track to see if the button is down. | |
int | downTextOffsetX |
int | downTextOffsetY |
bool | enabled |
int | flash |
The state if the button is flashing, 0 is no flashing. | |
FLASH_STATE | flashtype |
Type of flash (regular/special) | |
csRef< iPawsImage > | greyDownImage |
csRef< iPawsImage > | greyUpImage |
char | keybinding |
Keyboard equivalent of clicking on this button. | |
pawsWidget * | notify |
Widget to which event notifications are sent. If NULL, notifications go to parent. | |
int | originalFontColour |
Used when restoring from highlight state. | |
csRef< iPawsImage > | pressedImage |
Image to draw when button is pressed or when the mouse enters. | |
csRef< iPawsImage > | releasedImage |
Image to draw when button is released or when the mouse exits. | |
csString | sound_click |
Button can trigger sound effects with this. | |
csRef< iPawsImage > | specialFlashImage |
Image to draw when button is released. | |
int | style |
Style -- right now only ShadowText supported. | |
bool | toggle |
Check to see if this is a toggle button. | |
int | upTextOffsetX |
int | upTextOffsetY |
A simple button widget.
Definition at line 43 of file pawsbutton.h.
pawsButton::pawsButton | ( | ) |
pawsButton::pawsButton | ( | const pawsButton & | pb | ) |
virtual pawsButton::~pawsButton | ( | ) | [virtual] |
virtual bool pawsButton::CheckKeyHandled | ( | int | ) | [protected, virtual] |
Allow pawsButton to simulate button pushes based on keypresses.
Return true if key is handled.
Reimplemented from pawsWidget.
Reimplemented in pawsDnDButton.
virtual void pawsButton::Draw | ( | ) | [virtual] |
Draws the widget and all of it's children.
Reimplemented from pawsWidget.
Reimplemented in pawsDnDButton.
virtual void pawsButton::Flash | ( | bool | state, |
FLASH_STATE | type = FLASH_REGULAR |
||
) | [inline, virtual] |
Definition at line 96 of file pawsbutton.h.
virtual bool pawsButton::GetState | ( | ) | [inline, virtual] |
Reimplemented in pawsRadioButton.
Definition at line 76 of file pawsbutton.h.
const char* pawsButton::GetText | ( | ) | [inline] |
Definition at line 90 of file pawsbutton.h.
virtual bool pawsButton::IsDown | ( | ) | [inline, virtual] |
Definition at line 71 of file pawsbutton.h.
virtual bool pawsButton::IsEnabled | ( | ) | const [virtual] |
virtual bool pawsButton::OnKeyDown | ( | utf32_char | keyCode, |
utf32_char | keyChar, | ||
int | modifiers | ||
) | [virtual] |
Process keydown messages.
keyCode | The code for the pressed key. |
keyChar | The key pressed. |
modifiers | Used to modify tab behavior. |
Reimplemented from pawsWidget.
Manage mouse down event to test for and apply window changes.
button | Type of button: 1 resizable or movable, 2 context menu or config window. |
modifiers | Used with PAWS_CONSTRUCTION. |
x | Used to test for resize. |
y | Used to test for resize. |
Reimplemented from pawsWidget.
Reimplemented in pawsDnDButton.
virtual bool pawsButton::OnMouseEnter | ( | ) | [virtual] |
Called whenever the mouse enters this widget.
Reimplemented from pawsWidget.
virtual bool pawsButton::OnMouseExit | ( | ) | [virtual] |
Called whenever the mouse leaves this widget.
Reimplemented from pawsWidget.
Manage mouse up event.
Reimplemented from pawsWidget.
Reimplemented in pawsDnDButton.
bool pawsButton::SelfPopulate | ( | iDocumentNode * | node | ) | [virtual] |
This function allows a widget to fill in its own contents from an xml node supplied and calls the same function for all children.
node | The xml data for the widget. |
Reimplemented from pawsWidget.
Reimplemented in pawsDnDButton.
void pawsButton::SetDownImage | ( | const csString & | image | ) |
virtual void pawsButton::SetEnabled | ( | bool | enabled | ) | [virtual] |
void pawsButton::SetGreyDownImage | ( | const csString & | greyDownImage | ) |
void pawsButton::SetGreyUpImage | ( | const csString & | greyUpImage | ) |
virtual void pawsButton::SetNotify | ( | pawsWidget * | widget | ) | [virtual] |
void pawsButton::SetOnSpecialImage | ( | const csString & | image | ) |
void pawsButton::SetSound | ( | const char * | sound | ) |
virtual void pawsButton::SetState | ( | bool | isDown, |
bool | publish = true |
||
) | [virtual] |
void pawsButton::SetText | ( | const char * | text | ) |
virtual void pawsButton::SetToggle | ( | bool | t | ) | [inline, virtual] |
Set the toggle attribute. To change toggle state use SetState.
Definition at line 81 of file pawsbutton.h.
virtual bool pawsButton::Setup | ( | iDocumentNode * | ) | [virtual] |
Setup this widget.
Reimplemented from pawsWidget.
Reimplemented in pawsDnDButton, and pawsRadioButton.
void pawsButton::SetUpImage | ( | const csString & | image | ) |
csString pawsButton::buttonLabel [protected] |
Text shown in button.
Definition at line 135 of file pawsbutton.h.
bool pawsButton::changeOnMouseOver [protected] |
Whether or not to change image on mouse enter/exit.
Definition at line 165 of file pawsbutton.h.
bool pawsButton::down [protected] |
Track to see if the button is down.
Definition at line 117 of file pawsbutton.h.
int pawsButton::downTextOffsetX [protected] |
Definition at line 158 of file pawsbutton.h.
int pawsButton::downTextOffsetY [protected] |
Definition at line 159 of file pawsbutton.h.
bool pawsButton::enabled [protected] |
Definition at line 146 of file pawsbutton.h.
int pawsButton::flash [protected] |
The state if the button is flashing, 0 is no flashing.
Definition at line 149 of file pawsbutton.h.
FLASH_STATE pawsButton::flashtype [protected] |
Type of flash (regular/special)
Definition at line 152 of file pawsbutton.h.
csRef<iPawsImage> pawsButton::greyDownImage [protected] |
Definition at line 126 of file pawsbutton.h.
csRef<iPawsImage> pawsButton::greyUpImage [protected] |
Definition at line 125 of file pawsbutton.h.
char pawsButton::keybinding [protected] |
Keyboard equivalent of clicking on this button.
Definition at line 138 of file pawsbutton.h.
pawsWidget* pawsButton::notify [protected] |
Widget to which event notifications are sent. If NULL, notifications go to parent.
Definition at line 141 of file pawsbutton.h.
int pawsButton::originalFontColour [protected] |
Used when restoring from highlight state.
Definition at line 162 of file pawsbutton.h.
csRef<iPawsImage> pawsButton::pressedImage [protected] |
Image to draw when button is pressed or when the mouse enters.
Definition at line 120 of file pawsbutton.h.
csRef<iPawsImage> pawsButton::releasedImage [protected] |
Image to draw when button is released or when the mouse exits.
Definition at line 123 of file pawsbutton.h.
csString pawsButton::sound_click [protected] |
Button can trigger sound effects with this.
Definition at line 155 of file pawsbutton.h.
csRef<iPawsImage> pawsButton::specialFlashImage [protected] |
Image to draw when button is released.
Definition at line 129 of file pawsbutton.h.
int pawsButton::style [protected] |
Style -- right now only ShadowText supported.
Definition at line 144 of file pawsbutton.h.
bool pawsButton::toggle [protected] |
Check to see if this is a toggle button.
Definition at line 132 of file pawsbutton.h.
int pawsButton::upTextOffsetX [protected] |
Definition at line 156 of file pawsbutton.h.
int pawsButton::upTextOffsetY [protected] |
Definition at line 157 of file pawsbutton.h.