|
#include <CLayoutClient.h>

Public Member Functions | |
| CLayoutClient (Fl_Widget *widget, int layoutSize, CLayoutAlign ca) | |
| Constructor. | |
| virtual | ~CLayoutClient () |
| Destructor. | |
| CLayoutAlign | layoutAlign () const |
| Returns widget's layout align. | |
| void | layoutAlign (CLayoutAlign al) |
| Sets widget's layout align. | |
| int | layoutSize () const |
| Returns widget's layout size. | |
| void | layoutSize (int ls) |
| Sets widget's layout size. | |
| void | label (const char *lbl) |
| Sets the new label, makes an internal copy of the string. | |
| void | label (const std::string &l) |
| Sets label, makes an internal copy of the string. | |
| const std::string & | label () const |
| Returns the current label. | |
| void | name (const char *aname) |
| Sets the new widget name. | |
| void | name (const std::string &aname) |
| Sets the new widget name. | |
| const std::string & | name () const |
| Returns the current name. | |
| virtual bool | preferredSize (int &w, int &h) |
| Computes widget's preferred size. | |
| virtual bool | computeSize (int &w, int &h) |
| Computes widget's preferred size, and stores size values internally as cache. | |
| virtual std::string | className () const |
| Returns widget class name (internal SPTK RTTI). | |
| Fl_Widget * | widget () const |
| Returns widget handled by that object. | |
| void | load (const CXmlNode *node, CLayoutXMLmode xmlMode) |
| Loads layout client information from XML node. | |
| void | save (CXmlNode *node, CLayoutXMLmode xmlMode) const |
| Saves layout client information from XML node. | |
Protected Attributes | |
| int | m_layoutSize |
| The preferred layout size. | |
| int | m_lastPreferredW |
| The width as a result of the last call of preferredSize(). | |
| int | m_lastPreferredH |
| The width as a result of the last call of preferredSize(). | |
| Fl_Widget * | m_widget |
| Widget to manage. | |
| std::string | m_name |
| Widget name (widget id). | |
| std::string | m_label |
| Widget caption storage. | |
| CLayoutAlign | m_layoutAlign |
| The layout align for the widget in CLayoutManager group. | |
Friends | |
| class | CLayoutManager |
Allows CLayoutManager objects to move and resize the CLayoutClient objects in accordancy with they preferredSize() and layout alignment.
| sptk::CLayoutClient::CLayoutClient | ( | Fl_Widget * | widget, | |
| int | layoutSize, | |||
| CLayoutAlign | ca | |||
| ) |
Constructor.
| widget | Fl_Widget*, widget to control | |
| layoutSize | int, the size of the widget in layout. See m_layoutSize for more information. | |
| ca | CLayoutAlign, widget align in layout |
| virtual bool sptk::CLayoutClient::computeSize | ( | int & | w, | |
| int & | h | |||
| ) | [inline, virtual] |
Computes widget's preferred size, and stores size values internally as cache.
Used internally by CLayoutManager.
| w | int&, input/output widget preferred width | |
| h | int&, input/output widget preferred height |
References m_lastPreferredH, m_lastPreferredW, and preferredSize().
| void sptk::CLayoutClient::label | ( | const std::string & | l | ) | [inline] |
Sets label, makes an internal copy of the string.
| l | const string&, new label |
Reimplemented in sptk::CGroup, sptk::CScroll, and sptk::CWindow.
| void sptk::CLayoutClient::label | ( | const char * | lbl | ) | [inline] |
Sets the new label, makes an internal copy of the string.
| lbl | const char*, new label |
Reimplemented in sptk::CBaseButton, sptk::CGroup, sptk::CScroll, sptk::CTreeItem, and sptk::CWindow.
References m_label, and m_widget.
Referenced by sptk::CTreeItem::label().
| void sptk::CLayoutClient::layoutAlign | ( | CLayoutAlign | al | ) | [inline] |
| CLayoutAlign sptk::CLayoutClient::layoutAlign | ( | ) | const [inline] |
| void sptk::CLayoutClient::load | ( | const CXmlNode * | node, | |
| CLayoutXMLmode | xmlMode | |||
| ) |
Loads layout client information from XML node.
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 in sptk::CButtonGroup, sptk::CBaseListBox, sptk::CControl, sptk::CDateTimeBaseInput, sptk::CInput, sptk::CListView, and sptk::CWindow.
Referenced by sptk::CMenuBar::creator().
| void sptk::CLayoutClient::name | ( | const std::string & | aname | ) | [inline] |
| void sptk::CLayoutClient::name | ( | const char * | aname | ) | [inline] |
| virtual bool sptk::CLayoutClient::preferredSize | ( | int & | w, | |
| int & | h | |||
| ) | [inline, virtual] |
Computes widget's preferred size.
Should be overriten in derived widget if it has any ideas about it's size limits. Widget may want to change none, one, or both preferred width and height suggested by the CLayoutManager.
| w | int&, input/output widget preferred width | |
| h | int&, input/output widget preferred height |
Reimplemented in sptk::CBox, sptk::CBaseButton, sptk::CButtonGroup, sptk::CCheckButton, sptk::CBaseListBox, sptk::CDBDropDownList, sptk::CEditor, sptk::CGroup, sptk::CHtmlBox, sptk::CInput_, sptk::CInput, sptk::CListView, sptk::CMemoInput, sptk::CMenuBar, sptk::CProgressBar, sptk::CScroll, sptk::CScrollBar, sptk::CToolBar, sptk::CTreeItem, and sptk::CWindow.
Referenced by computeSize().
| void sptk::CLayoutClient::save | ( | CXmlNode * | node, | |
| CLayoutXMLmode | xmlMode | |||
| ) | const |
Saves layout client information from XML node.
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 in sptk::CButtonGroup, sptk::CBaseListBox, sptk::CControl, sptk::CDateTimeBaseInput, sptk::CInput, sptk::CListView, and sptk::CWindow.
int sptk::CLayoutClient::m_layoutSize [protected] |
The preferred layout size.
It makes different sense depending on the widget layout align. For layout align SP_ALIGN_TOP or SP_ALIGN_BOTTOM it is a recomended height of the widget. For layout align SP_ALIGN_LEFT or SP_ALIGN_RIGHT it is a recomended width of the widget. For layout align SP_ALIGN_NONE or SP_ALIGN_CLIENT it is ignored. If the widget isn't in CLayoutManager group - it is ignored. If it doesn't contradict with preferred widget size it will define the final size of the widget.
Referenced by layoutSize().