csButton Class Reference
[Button]
The Button class implements different types of push buttons.
More...
#include <csws/csbutton.h>
Inheritance diagram for csButton:

Public Member Functions | |
csButton (csComponent *iParent, int iCommandCode, int iButtonStyle=CSBS_DEFAULTVALUE, csButtonFrameStyle iFrameStyle=csbfsOblique) | |
Create button object. | |
virtual | ~csButton () |
Destroy button object. | |
virtual void | SetText (const char *iText) |
Set button text. | |
void | SetDrawTextOnHighlightOnly (bool iTOHO) |
Set text draw to highlight only. | |
bool | GetDrawTextOnHighlightOnly () |
Return value of DrawTextOnHighlightOnly. | |
void | SetBitmap (csPixmap *iNormal, csPixmap *iPressed, bool iDelete=true) |
Set button bitmaps in normal and pressed states. | |
void | SetFrameBitmaps (csPixmap *iNormal, csPixmap *iPressed, csPixmap *iHighlighted, bool iDelete=true) |
Sets the button's frame bitmaps in normal, pressed, and highlighted (mouseover) states. | |
void | SetButtonTexture (csPixmap *iNormal, csPixmap *iPressed, bool iDelete=true) |
Sets the button's texture in normal and pressed states. | |
void | GetBitmap (csPixmap **iNormal, csPixmap **iPressed) |
Query button bitmaps. | |
void | GetFrameBitmaps (csPixmap **iNormal, csPixmap **iPressed, csPixmap **iHighlighted) |
Query button bitmaps. | |
void | FreeBitmaps () |
Delete image bitmaps if iDelete was true on SetBitmap. | |
void | FreeFrameBitmaps () |
Delete frame image bitmaps if iDelete was true on SetBitmap. | |
virtual bool | HandleEvent (iEvent &Event) |
Handle external events. | |
virtual bool | PostHandleEvent (iEvent &Event) |
Pre-handle keyboard events. | |
virtual void | SetState (int mask, bool enable) |
Override SetState method to redraw button if it is default. | |
virtual void | SuggestSize (int &w, int &h) |
Return the recommended minimal size of button. | |
void | SetCommandCode (int iCommandCode) |
Query this button's command code. | |
int | GetCommandCode () |
Query this button's command code. | |
virtual void | SetPressed (bool state) |
Set button pressed state. | |
int | GetButtonStyle () |
Get button style flags. | |
csButtonFrameStyle | GetFrameStyle () |
Get button frame style. | |
size_t | GetUnderlinePos () |
Get the character number to be underlined (hotkey). | |
uint8 | GetAlpha () |
Get the alpha-ness of the button. | |
void | SetAlpha (uint8 iAlpha) |
Set the alpha-ness of the button (only useful with csbfsTextured and csbfsBitmap). | |
void | SetTextureOrigin (int iOrgX, int iOrgy) |
Set the origin of the texture. | |
void | GetTextureOrigin (int *iOrgx, int *iOrgy) |
Get the texture origins. | |
virtual char * | GetSkinName () |
Get the name of the skip slice for this component. | |
Public Attributes | |
bool | Pressed |
Current button state. | |
bool | Highlighted |
Highlight state. | |
Protected Member Functions | |
virtual void | Press () |
Emulate a button press (generate command). | |
bool | HandleKeyPress (iEvent &Event) |
Handle a key down event (called for HandleEvent and PreHandleEvent). | |
void | DeselectNeighbours () |
Deselect all button's neightbours in his group. | |
Protected Attributes | |
csPixmap * | ImageNormal |
Button images in normal and pressed state. | |
csPixmap * | ImagePressed |
Button images in normal and pressed state. | |
csPixmap * | FrameNormal |
Images for button's frame in normal, pressed, and mouseover state also used for textures if mode is csbfsTextured. | |
csPixmap * | FramePressed |
Images for button's frame in normal, pressed, and mouseover state also used for textures if mode is csbfsTextured. | |
csPixmap * | FrameHighlighted |
Images for button's frame in normal, pressed, and mouseover state also used for textures if mode is csbfsTextured. | |
bool | delImages |
Should images be automatically deleted? | |
bool | delFrameImages |
Should frame images be automatically deleted? | |
int | CommandCode |
Command code emmited when button is pressed. | |
size_t | underline_pos |
Character number that should be underlined (-1 == none). | |
int | ButtonStyle |
Button style. | |
csButtonFrameStyle | FrameStyle |
Button frame style. | |
int | TexOrgX |
Origin of the texture. | |
int | TexOrgY |
Origin of the texture. | |
uint8 | ButtonAlpha |
Alpha-ness of the texture or frame bitmaps. | |
bool | DrawTextOnHighlightOnly |
True if button text is only displayed when it has the focus. |
Detailed Description
The Button class implements different types of push buttons.Buttons can contain a text string and/or a bitmap.
Definition at line 139 of file csbutton.h.
Constructor & Destructor Documentation
|
Create button object.
|
|
Destroy button object.
|
Member Function Documentation
|
Deselect all button's neightbours in his group.
|
|
Delete image bitmaps if iDelete was true on SetBitmap.
|
|
Delete frame image bitmaps if iDelete was true on SetBitmap.
|
|
Get the alpha-ness of the button.
Definition at line 263 of file csbutton.h. |
|
Query button bitmaps.
|
|
Get button style flags.
Definition at line 251 of file csbutton.h. |
|
Query this button's command code.
Definition at line 244 of file csbutton.h. |
|
Return value of DrawTextOnHighlightOnly.
Definition at line 190 of file csbutton.h. |
|
Query button bitmaps.
|
|
Get button frame style.
Definition at line 255 of file csbutton.h. References csButtonFrameStyle. |
|
Get the name of the skip slice for this component.
Reimplemented from csComponent. Definition at line 276 of file csbutton.h. |
|
Get the texture origins.
|
|
Get the character number to be underlined (hotkey).
Definition at line 259 of file csbutton.h. |
|
Handle external events.
Reimplemented from csComponent. Reimplemented in csCheckBox, and csRadioButton. |
|
Handle a key down event (called for HandleEvent and PreHandleEvent).
|
|
Pre-handle keyboard events.
Reimplemented from csComponent. |
|
Emulate a button press (generate command).
Reimplemented in csCheckBox, and csRadioButton. |
|
Set the alpha-ness of the button (only useful with csbfsTextured and csbfsBitmap).
|
|
Set button bitmaps in normal and pressed states. If iDelete is true, bitmaps will be automatically deleted when they are no longer needed (i.e. button disposal or another SetBitmap) |
|
Sets the button's texture in normal and pressed states. If iDelete is true, bitmaps will be automatically deleted when they are no longer needed (i.e. button disposal or another SetButtonBitmaps) |
|
Query this button's command code.
Definition at line 240 of file csbutton.h. |
|
Set text draw to highlight only.
Definition at line 186 of file csbutton.h. |
|
Sets the button's frame bitmaps in normal, pressed, and highlighted (mouseover) states. If iDelete is true, bitmaps will be automatically deleted when they are no longer needed (i.e. button disposal or another SetButtonBitmaps) |
|
Set button pressed state.
|
|
Override SetState method to redraw button if it is default.
Reimplemented from csComponent. |
|
Set button text.
Reimplemented from csComponent. Definition at line 182 of file csbutton.h. References csComponent::Invalidate(), and csComponent::PrepareLabel(). |
|
Set the origin of the texture.
|
|
Return the recommended minimal size of button.
Reimplemented from csComponent. |
Member Data Documentation
|
Alpha-ness of the texture or frame bitmaps.
Definition at line 166 of file csbutton.h. |
|
Button style.
Definition at line 160 of file csbutton.h. |
|
Command code emmited when button is pressed.
Definition at line 156 of file csbutton.h. |
|
Should frame images be automatically deleted?
Definition at line 154 of file csbutton.h. |
|
Should images be automatically deleted?
Definition at line 152 of file csbutton.h. |
|
True if button text is only displayed when it has the focus.
Definition at line 168 of file csbutton.h. |
|
Images for button's frame in normal, pressed, and mouseover state also used for textures if mode is csbfsTextured.
Definition at line 149 of file csbutton.h. |
|
Images for button's frame in normal, pressed, and mouseover state also used for textures if mode is csbfsTextured.
Definition at line 149 of file csbutton.h. |
|
Images for button's frame in normal, pressed, and mouseover state also used for textures if mode is csbfsTextured.
Definition at line 149 of file csbutton.h. |
|
Button frame style.
Definition at line 162 of file csbutton.h. |
|
Highlight state.
Definition at line 174 of file csbutton.h. |
|
Button images in normal and pressed state.
Definition at line 143 of file csbutton.h. |
|
Button images in normal and pressed state.
Definition at line 143 of file csbutton.h. |
|
Current button state.
Definition at line 172 of file csbutton.h. |
|
Origin of the texture.
Definition at line 164 of file csbutton.h. |
|
Origin of the texture.
Definition at line 164 of file csbutton.h. |
|
Character number that should be underlined (-1 == none).
Definition at line 158 of file csbutton.h. |
The documentation for this class was generated from the following file:
- csws/csbutton.h
Generated for Crystal Space by doxygen 1.3.9.1