#include <CButton.h>
Public Member Functions | |
void | defaultButton (bool defaultBtn) |
bool | defaultButton () const |
String | className () const override |
virtual void | buttonImage (CButtonKind bkind, CIconSize iconSize=CIconSize::IS_LARGE_ICON) |
virtual void | buttonImage (Fl_Image *image) |
virtual const Fl_Image * | buttonImage () const |
const String & | label () const override |
void | label (const String &lbl) override |
Public Member Functions inherited from sptk::CLayoutClient | |
CLayoutClient (Fl_Widget *widget, int layoutSize, CLayoutAlign ca) | |
virtual | ~CLayoutClient () |
CLayoutAlign | layoutAlign () const |
void | layoutAlign (CLayoutAlign al) |
int | layoutSize () const |
void | layoutSize (int ls) |
virtual void | label (const String &l) |
virtual const String & | label () const |
void | name (const char *aname) |
void | name (const String &aname) |
const String & | name () const |
virtual bool | preferredSize (int &w, int &h) |
virtual bool | computeSize (int &w, int &h) |
virtual String | className () const |
Fl_Widget * | widget () const |
virtual void | load (const xdoc::SNode &node, CLayoutXMLmode xmlMode) |
virtual void | load (const std::shared_ptr< xdoc::Node > &node) |
virtual void | save (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) const |
Protected Member Functions | |
void | image (CButtonKind buttonKind, CIconSize iconSize, String label="") |
void | draw () override |
void | drawFocus (bool usingTheme) |
int | handle (int event) override |
bool | preferredSize (int &w, int &h) override |
CBaseButton (CButtonKind kind, CLayoutAlign layoutAlign=CLayoutAlign::RIGHT, bool is_small=false, const char *label=nullptr, CThemeButtonType tbt=THM_BUTTON_NORMAL) | |
CBaseButton (const char *label=nullptr, CLayoutAlign layoutAlign=CLayoutAlign::RIGHT, CThemeButtonType tbt=THM_BUTTON_NORMAL) | |
Protected Member Functions inherited from sptk::CLayoutClient | |
int | lastPreferredH () const |
int | lastPreferredW () const |
void | lastPreferredH (int height) |
void | lastPreferredW (int width) |
Friends | |
class | CThemes |
Additional Inherited Members | |
Protected Attributes inherited from sptk::CLayoutClient | |
Fl_Widget * | m_widget |
String | m_name |
String | m_label |
CLayoutAlign | m_layoutAlign |
Base button widget
Base class for CButton and CSmallButton, uses Fl_Image * or a stock image of CButtonKind.
|
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 |
|
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 |
|
inlinevirtual |
Returns the button's image. Purely virtual.
|
inlinevirtual |
Sets the stock image to the button. Purely virtual.
bkind | CButtonKind stock image id. |
iconSize | CIconSize, the size of the icon |
|
inlinevirtual |
Sets the image to the button. Purely virtual.
image | Fl_Image * image pointer |
|
inlineoverridevirtual |
Returns widget class name (internal SPTK RTTI).
Reimplemented from sptk::CLayoutClient.
|
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 |
|
overrideprotected |
Draws the button
|
protected |
Draws the focus for the button.
usingTheme | bool, to use theme's value for the focus corner radius. Otherwise, radius is 0. |
|
overrideprotected |
Special handle() method
|
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 |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Sets button label
lbl | const char *, new button label |
Reimplemented from sptk::CLayoutClient.
|
overrideprotectedvirtual |
Preferred size for the button computes the optimal size for the button
w | int&, button width |
h | int&, button height |
Reimplemented from sptk::CLayoutClient.