|
#include <CLayoutManager.h>

Public Member Functions | |
| CLayoutManager (Fl_Group *group, int layoutSize, CLayoutAlign ca) | |
| virtual | ~CLayoutManager () |
| Destructor. | |
| virtual void | clear () |
| Removes all the children. | |
| int | layoutSpacing () const |
| Returns current layout spacing between widgets. | |
| void | layoutSpacing (int ls) |
| void | layoutGrowMode (CLayoutGrowMode gm=LGM_AUTO_GROW) |
| CLayoutGrowMode | layoutGrowMode () const |
| void | relayout () |
| void | frame (CFrame *frame, bool drawBackground=true) |
| Defines frame. | |
| const CFrame * | frame () const |
| Returnes the current frame. | |
| uint32_t | frameWidth () const |
| Returns frame width. | |
| virtual void | loadLayout (const CXmlNode *node, CLayoutXMLmode xmlMode) throw (CException) |
| Loads group controls data from XML node. | |
| virtual void | saveLayout (CXmlNode *node, CLayoutXMLmode xmlMode) const |
| Saves group controls data into XML node. | |
| void | nameIndex (CWidgetNamesMap &index, bool recursive, bool clean=true) const |
| Builds an index of internal widget names. | |
| bool | noXml () const |
| Returns flag of blocking XML processing. | |
| void | noXml (bool noXml) |
| Sets flag of blocking XML processing. | |
Static Public Member Functions | |
| static void | registerControl (std::string typeName, createControlCallback creator) |
| Register control type for loading layouts. | |
|
static const std::map < std::string, Fl_Boxtype > & | boxTypeNames () |
| Returns a read-only map of box type names and corresponding constants. | |
Protected Member Functions | |
| bool | autoLayout (int x, int y, int &w, int &h, bool resizeWidgets) const |
| virtual void | paintBackground () |
| Paints background in tiles mode. | |
Protected Attributes | |
| int | m_layoutSpacing |
| An extra space between widgets. | |
| CLayoutGrowMode | m_layoutGrowMode |
| Layout grow mode,. | |
| Fl_Group * | m_group |
| Attached group to manage. | |
| CFrame * | m_frame |
| The group frame, including optional background image. | |
| bool | m_frameDrawBackground |
| Should we draw background. | |
| bool | m_noXml |
| If true - do not read or write any XML. | |
Static Protected Attributes | |
|
static std::map< std::string, Fl_Boxtype > | m_boxTypeNames |
| A map of box type names and corresponding constants. | |
| static createControlCallbackMap | controlCreator |
| A map of control types and callbacks that create them. | |
Friends | |
| class | CLayoutManagerInitializer |
Maintains the position and size of the CLayoutClient-derived objects in the attached group. It uses the CLayoutClient::layoutAlign() property of such objects and the output of CLayoutClient::preferredSize() to determine the widget's size and position.
| sptk::CLayoutManager::CLayoutManager | ( | Fl_Group * | group, | |
| int | layoutSize, | |||
| CLayoutAlign | ca | |||
| ) |
| bool sptk::CLayoutManager::autoLayout | ( | int | x, | |
| int | y, | |||
| int & | w, | |||
| int & | h, | |||
| bool | resizeWidgets | |||
| ) | const [protected] |
Does the auto layout computations and optional actual widget resizing
| x | int, the layout x position, input | |
| y | int, the layout y position, input | |
| w | int&, the layout width, input/output | |
| h | int&, the layout height, input/output | |
| resizeWidgets | bool, resize widgets if true, or just compute the layout size |
| void sptk::CLayoutManager::frame | ( | CFrame * | frame, | |
| bool | drawBackground = true | |||
| ) | [inline] |
Defines frame.
| frame | CFrame *, frame to use | |
| drawBackground | bool, if true then background is paint |
References m_frame, and m_frameDrawBackground.
| CLayoutGrowMode sptk::CLayoutManager::layoutGrowMode | ( | ) | const [inline] |
| void sptk::CLayoutManager::layoutGrowMode | ( | CLayoutGrowMode | gm = LGM_AUTO_GROW |
) | [inline] |
Defines layout grow mode
| gm | CLayoutGrowMode, new layout grow mode |
References m_layoutGrowMode.
| void sptk::CLayoutManager::layoutSpacing | ( | int | ls | ) | [inline] |
Defines layout spacing between widgets
| ls | int, new layout spacing |
References m_layoutSpacing.
| virtual void sptk::CLayoutManager::loadLayout | ( | const CXmlNode * | node, | |
| CLayoutXMLmode | xmlMode | |||
| ) | throw (CException) [virtual] |
Loads group controls data from XML node.
| node | const CXmlNode*, node to load data from | |
| xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be loaded |
| void sptk::CLayoutManager::nameIndex | ( | CWidgetNamesMap & | index, | |
| bool | recursive, | |||
| bool | clean = true | |||
| ) | const |
Builds an index of internal widget names.
The index is filled in with pairs of widget name - widget. Only CLayoutClient-derived widgets with names are included.
| index | CWidgetNamesMap&, the index to fill in | |
| recursive | bool, if true also processes the children | |
| clean | bool, if true, the list is cleaned prior to fill |
| void sptk::CLayoutManager::noXml | ( | bool | noXml | ) | [inline] |
Sets flag of blocking XML processing.
If this flag is set then no XML is loaded or saved. This flag may be used, for instance, if you want to exclude some control (widget) from being stored in XML.
| noXml | bool, if true - no XML is red or written |
References m_noXml.
| bool sptk::CLayoutManager::noXml | ( | ) | const [inline] |
Returns flag of blocking XML processing.
If this flag is set then no XML is loaded or saved
References m_noXml.
| static void sptk::CLayoutManager::registerControl | ( | std::string | typeName, | |
| createControlCallback | creator | |||
| ) | [inline, static] |
Register control type for loading layouts.
The control name can be anything as far as in can be used as XML tag name. The creator callback creates a control (widget) using the XML information passed to the callback by the layout manager.
| typeName | std::string, the type of the (control) widget | |
| creator | createControlCallback, a callback that creates the required widget |
References controlCreator.
| void sptk::CLayoutManager::relayout | ( | ) |
Relayouts the attached group. It may be necessary if the inside widgets have changed content or shown/hidden.
Reimplemented in sptk::CWindow.
| virtual void sptk::CLayoutManager::saveLayout | ( | CXmlNode * | node, | |
| CLayoutXMLmode | xmlMode | |||
| ) | const [virtual] |
Saves group controls data into XML node.
| node | const CXmlNode*, node to save data into | |
| xmlMode | CLayoutXMLmode, the mode defining how the layout and/or data should be stored |