|
#include <CButton.h>

Public Member Functions | |
| void | defaultButton (bool defaultBtn) |
| Makes this button a default button. | |
| bool | defaultButton () const |
| Returns true if the button is a default button. | |
| virtual std::string | className () const |
| Returns widget class name (internal SPTK RTTI). | |
| virtual void | buttonImage (CButtonKind bkind, CIconSize iconSize)=0 |
| Sets the stock image to the button. Purely virtual. | |
| virtual void | buttonImage (Fl_Image *image)=0 |
| Sets the image to the button. Purely virtual. | |
| virtual Fl_Image * | buttonImage ()=0 |
| Returns the button's image. Purely virtual. | |
| const char * | label () const |
| Returns button label. | |
| void | label (const char *lbl) |
| Sets button label. | |
Protected Member Functions | |
| void | image (CButtonKind buttonKind, CIconSize iconSize, const char *label="") |
| Sets the button image to the selected kind buttonKind. | |
| void | draw () |
| Draws the button. | |
| void | drawFocus (bool usingTheme) |
| Draws the focus for the button. | |
| int | handle (int event) |
| Special handle() method. | |
| virtual bool | preferredSize (int &w, int &h) |
| Preferred size for the button computes the optimal size for the button. | |
| CBaseButton (CButtonKind kind, CLayoutAlign layoutAlign=SP_ALIGN_RIGHT, bool is_small=false, const char *label=0, CThemeButtonType tbt=THM_BUTTON_NORMAL) | |
| Constructor in SPTK style. | |
| CBaseButton (const char *label=0, CLayoutAlign layoutAlign=SP_ALIGN_RIGHT, CThemeButtonType tbt=THM_BUTTON_NORMAL) | |
| Constructor in SPTK style. The image should be assigned separately. | |
Protected Attributes | |
| CButtonKind | m_kind |
| Button kind (for a stock image) or SP_UNDEFINED_BUTTON for user_defined image. | |
| Fl_Image * | m_image |
| Internal image pointer. | |
| CIconSize | m_iconSize |
| Icon size. | |
Friends | |
| class | CThemes |
Base class for CButton and CSmallButton, uses Fl_Image * or a stock image of CButtonKind.
| sptk::CBaseButton::CBaseButton | ( | CButtonKind | kind, | |
| CLayoutAlign | layoutAlign = SP_ALIGN_RIGHT, |
|||
| bool | is_small = false, |
|||
| const char * | label = 0, |
|||
| CThemeButtonType | tbt = THM_BUTTON_NORMAL | |||
| ) | [protected] |
Constructor in SPTK style.
| kind | CButtonKind, stock image id | |
| layoutAlign | CLayoutAlign, widget align in layout | |
| is_small | bool, true for the small button (small pixmap, no label) | |
| label | const char * label | |
| tbt | CThemeButtonType, the type of button |
| sptk::CBaseButton::CBaseButton | ( | const char * | label = 0, |
|
| CLayoutAlign | layoutAlign = SP_ALIGN_RIGHT, |
|||
| CThemeButtonType | tbt = THM_BUTTON_NORMAL | |||
| ) | [protected] |
Constructor in SPTK style. The image should be assigned separately.
| label | const char *, label | |
| layoutAlign | CLayoutAlign, widget align in layout | |
| tbt | CThemeButtonType, the type of button |
| virtual Fl_Image* sptk::CBaseButton::buttonImage | ( | ) | [pure virtual] |
Returns the button's image. Purely virtual.
Implemented in sptk::CButton, and sptk::CSmallButton.
| virtual void sptk::CBaseButton::buttonImage | ( | Fl_Image * | image | ) | [pure virtual] |
Sets the image to the button. Purely virtual.
| image | Fl_Image * image pointer |
Implemented in sptk::CButton, and sptk::CSmallButton.
| virtual void sptk::CBaseButton::buttonImage | ( | CButtonKind | bkind, | |
| CIconSize | iconSize | |||
| ) | [pure virtual] |
Sets the stock image to the button. Purely virtual.
| bkind | CButtonKind stock image id. | |
| iconSize | CIconSize, the size of the icon |
Implemented in sptk::CButton, and sptk::CSmallButton.
| bool sptk::CBaseButton::defaultButton | ( | ) | const [inline] |
Returns true if the button is a default button.
| void sptk::CBaseButton::defaultButton | ( | bool | defaultBtn | ) |
Makes this button a default button.
Is used to define a button as default for the current window of CDialog class. The default button is activated when an Enter button is pressed inside CDialog on the widget and the widget doesn't process Enter button.
| defaultBtn | bool makes button default or not |
| void sptk::CBaseButton::drawFocus | ( | bool | usingTheme | ) | [protected] |
Draws the focus for the button.
| usingTheme | bool, to use theme's value for the focus corner radius. Otherwise, radius is 0. |
| void sptk::CBaseButton::image | ( | CButtonKind | buttonKind, | |
| CIconSize | iconSize, | |||
| const char * | label = "" | |||
| ) | [protected] |
Sets the button image to the selected kind buttonKind.
| buttonKind | CButtonKind, the button kind | |
| iconSize | CIconSize, the size of the icon | |
| label | const char*, optional label |
| void sptk::CBaseButton::label | ( | const char * | lbl | ) |
Sets button label.
| lbl | const char *, new button label |
Reimplemented from sptk::CLayoutClient.
| const char* sptk::CBaseButton::label | ( | ) | const [inline] |
| virtual bool sptk::CBaseButton::preferredSize | ( | int & | w, | |
| int & | h | |||
| ) | [protected, virtual] |
Preferred size for the button computes the optimal size for the button.
| w | int&, button width | |
| h | int&, button height |
Reimplemented from sptk::CLayoutClient.