|
#include <CButtonGroup.h>

Public Member Functions | |
| void | buttons (const CStrings &buttonList) |
| Sets the list of the buttons. | |
| const CStrings & | buttons () const |
| Returns the list of the buttons. | |
| virtual void | clearButtons () |
| Clears the list of buttons. | |
| virtual CVariant | data () const |
| Returns the currently selected button(s) as pipe ('|') separated string. | |
| virtual void | data (const CVariant v) |
| Sets the currently selected button(s). | |
| virtual void | load (CQuery *) |
| Loads the the currently selected button(s). | |
| virtual void | save (CQuery *) |
| Saves the the currently selected button(s). | |
| virtual void | load (const CXmlNode *node, CLayoutXMLmode xmlMode) |
| Loads control data from XML. | |
| virtual void | save (CXmlNode *node, CLayoutXMLmode xmlMode) const |
| Saves control data to XML. | |
| virtual bool | valid () const |
| Tells if the the current data content is valid. | |
| virtual bool | preferredSize (int &w, int &h) |
| Computes the preferred size of the button group based on its contents. | |
Protected Member Functions | |
| virtual void | controlDataChanged () |
| Internal callback processing. | |
| int | buttonIndex (const char *buttonLabel) |
| void | deselectAllButtons () |
| Deselects all buttons. | |
| void | selectButton (int choice) |
| Selects button by index. | |
| virtual Fl_Button * | createButton (const char *label, int sz=10, CLayoutAlign layoutAlignment=SP_ALIGN_TOP)=0 |
| Creates button. Should be implemented in the derived class. | |
| void | ctor_init () |
| Constructor initializer. | |
| CButtonGroup (const char *label=0, int layoutSize=20, CLayoutAlign layoutAlignment=SP_ALIGN_TOP) | |
Protected Attributes | |
| std::string | m_lastValue |
| Last value of the group (last list of choices). | |
| CStrings | m_buttonLabels |
| Button labels for the buttons inside. | |
| Fl_Button * | m_otherButton |
| The 'Other' Button if requested (add '*' in the button list). | |
| CInput_ * | m_otherInput |
| The 'Other' Input if requested (add '*' in the button list). | |
Implements the most important data communication methods for these button groups.
| sptk::CButtonGroup::CButtonGroup | ( | const char * | label = 0, |
|
| int | layoutSize = 20, |
|||
| CLayoutAlign | layoutAlignment = SP_ALIGN_TOP | |||
| ) | [protected] |
SPTK-style constructor
| label | const char *, the widget label | |
| layoutSize | int, the size of widget in layout | |
| layoutAlignment | CLayoutAlign, widget align in the layout |
| int sptk::CButtonGroup::buttonIndex | ( | const char * | buttonLabel | ) | [protected] |
Finds a button by label
| buttonLabel | const char *, button label |
| void sptk::CButtonGroup::buttons | ( | const CStrings & | buttonList | ) |
| virtual void sptk::CButtonGroup::data | ( | const CVariant | v | ) | [virtual] |
Sets the currently selected button(s).
Buttons are presented as pipe ('|') separated string. If the button group allows only one button to be selected at a time (like radio buttons), only the first item of the string will be used.
Reimplemented from sptk::CControl.
Reimplemented in sptk::CCheckButtons.
| virtual void sptk::CButtonGroup::load | ( | const CXmlNode * | node, | |
| CLayoutXMLmode | xmlMode | |||
| ) | [virtual] |
Loads control data from XML.
Layout information may also include widget size and position, as well as visible() and active() states
| node | CXmlNode*, the XML node | |
| xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |
Reimplemented from sptk::CControl.
| virtual void sptk::CButtonGroup::load | ( | CQuery * | ) | [virtual] |
Loads the the currently selected button(s).
Buttons should be presented as pipe ('|') separated string.
Reimplemented from sptk::CControl.
| virtual bool sptk::CButtonGroup::preferredSize | ( | int & | w, | |
| int & | h | |||
| ) | [virtual] |
Computes the preferred size of the button group based on its contents.
| w | int&, the optimal width | |
| h | int&, the optimal height |
Reimplemented from sptk::CLayoutClient.
| virtual void sptk::CButtonGroup::save | ( | CXmlNode * | node, | |
| CLayoutXMLmode | xmlMode | |||
| ) | const [virtual] |
Saves control data to XML.
Layout information may also include widget size and position, as well as visible() and active() states
| node | CXmlNode*, the XML node | |
| xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |
Reimplemented from sptk::CControl.
| virtual void sptk::CButtonGroup::save | ( | CQuery * | ) | [virtual] |
Saves the the currently selected button(s).
Buttons are presented as pipe ('|') separated string
Reimplemented from sptk::CControl.
| virtual bool sptk::CButtonGroup::valid | ( | ) | const [inline, virtual] |
Tells if the the current data content is valid.
Always true for this widget.
Implements sptk::CControl.