sptk2 logo
SPTK Home Page
Public Member Functions | Static Public Member Functions | List of all members
sptk::CButton Class Reference

#include <CButton.h>

Inheritance diagram for sptk::CButton:
sptk::CBaseButton sptk::CLayoutClient

Public Member Functions

 CButton (CButtonKind kind, CLayoutAlign layoutAlign=CLayoutAlign::RIGHT, const char *label="", CThemeButtonType tbt=THM_BUTTON_NORMAL)
 
 CButton (const char *label="", CLayoutAlign layoutAlign=CLayoutAlign::RIGHT, CThemeButtonType tbt=THM_BUTTON_NORMAL)
 
void load (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) override
 
void load (const xdoc::SNode &node) override
 
void save (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode lm=CLayoutXMLmode::LAYOUT) const override
 
- Public Member Functions inherited from sptk::CBaseButton
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 Stringlabel () 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 Stringlabel () const
 
void name (const char *aname)
 
void name (const String &aname)
 
const Stringname () 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
 

Static Public Member Functions

static CLayoutClientcreator (const xdoc::SNode &node)
 

Additional Inherited Members

- Protected Member Functions inherited from sptk::CBaseButton
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)
 
- Protected Attributes inherited from sptk::CLayoutClient
Fl_Widget * m_widget
 
String m_name
 
String m_label
 
CLayoutAlign m_layoutAlign
 

Detailed Description

Button widget

Button that displays an a regular Fl_Image *, or as a stock image of CButtonKind.

Constructor & Destructor Documentation

◆ CButton() [1/2]

sptk::CButton::CButton ( CButtonKind  kind,
CLayoutAlign  layoutAlign = CLayoutAlign::RIGHT,
const char *  label = "",
CThemeButtonType  tbt = THM_BUTTON_NORMAL 
)
inline

Constructor in SPTK style

Parameters
kindCButtonKind stock image id
layoutAlignCLayoutAlign widget align in layout
labelconst char * label
tbtCThemeButtonType, the size type of the button

◆ CButton() [2/2]

sptk::CButton::CButton ( const char *  label = "",
CLayoutAlign  layoutAlign = CLayoutAlign::RIGHT,
CThemeButtonType  tbt = THM_BUTTON_NORMAL 
)
inline

Default constructor in SPTK style

Parameters
labelconst char * label
layoutAlignCLayoutAlign widget align in layout
tbtCThemeButtonType, the button type (size)

Member Function Documentation

◆ creator()

static CLayoutClient * sptk::CButton::creator ( const xdoc::SNode &  node)
static

Creates a button based on the XML node information

◆ load() [1/2]

void sptk::CButton::load ( const std::shared_ptr< xdoc::Node > &  node,
CLayoutXMLmode  xmlMode 
)
inlineoverride

Loads layout client information from XML node

Layout information may also include widget size and position, as well as visible() and active() states

Parameters
nodethe XML node
xmlMode(ignored)

◆ load() [2/2]

void sptk::CButton::load ( const xdoc::SNode &  node)
override

Loads the the widget from XML node

The widget information may include widget attributes and widget data

Parameters
nodexml::Node*, XML node

◆ save()

void sptk::CButton::save ( const std::shared_ptr< xdoc::Node > &  node,
CLayoutXMLmode  lm = CLayoutXMLmode::LAYOUT 
) const
overridevirtual

Saves the the widget to XML node

The widget information may include widget attributes and widget data

Parameters
nodeXML node
lm(ignored)

Reimplemented from sptk::CLayoutClient.


The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:33: SPTK 5.4.1