|
#include <CTreeControl.h>

Public Member Functions | |
| CTreeControl (const char *label, int layoutSize=50, CLayoutAlign align=SP_ALIGN_TOP) | |
| CTreeItem * | addItem (const char *label, const Fl_Image *openedImage=0L, const Fl_Image *closedImage=0L, void *data=0L) |
| CTreeItem * | addPath (const std::vector< std::string > &path, const Fl_Image *openedImage, const Fl_Image *closedImage, const Fl_Image *itemImage=0L, void *data=0L) |
| CTreeItem * | addPath (const std::vector< std::string > &path, const Fl_Image *itemImage=0L, void *data=0L) |
| CTreeItem * | findItem (const char *item) const |
| Finds an item by the item label in the whole tree. | |
| CTreeItem * | findData (const void *data) const |
| Finds an item by the item user data in the whole tree. | |
| virtual void | clear () |
| Removes all the items in the tree. | |
| void | moveItem (CTreeItem *item, CTreeItem *beforeItem=0L) |
| Moves the item in the tree. | |
| void | removeItem (CTreeItem *item) |
| Removes all the item and underlying structure from the tree. | |
| CTreeItem * | root () const |
| Reports the root item. | |
| CTreeItem * | selected () const |
| Reports the currently selected item. | |
| void | selectOnly (CTreeItem *item, bool giveFocus=false) |
| Selects only one item. | |
| void | makeVisible (CTreeItem *item) |
| Makes the item visible if it's outside the visible area. | |
| int | handle (int event) |
| Special handle() function. | |
| void | itemCreator (CTreeItemCreator ic) |
| The tree item creator creates a tree item' body,. | |
| virtual void | load (const CXmlNode &node, bool autoCreate=false) throw (CException) |
| Loads group controls data from XML node. | |
| virtual void | load (const CXmlNode *node, bool autoCreate=false) throw (CException) |
| Loads group controls data from XML node. | |
| virtual void | save (CXmlNode &node) const |
| Saves group controls data into XML node. | |
| virtual void | save (CXmlNode *node) const |
| Saves group controls data into XML node. | |
| virtual std::string | className () const |
| Returns widget class name (internal SPTK RTTI). | |
Static Protected Member Functions | |
| static CLayoutClient * | defaultItemCreator (CTreeItem *item) |
| The default tree item creator. | |
Protected Attributes | |
| bool | m_tabPressed |
| Internal flag to temporarely block tree items focus acceptance. | |
| CTreeItemCreator | m_itemCreator |
| The tree item creator creates a tree item' body,. | |
Friends | |
| class | CTreeItem |
Designed to be used inside CTreeView widget, but also can be used by itself. It's missing for data connection support of CTreeView, though.
| sptk::CTreeControl::CTreeControl | ( | const char * | label, | |
| int | layoutSize = 50, |
|||
| CLayoutAlign | align = SP_ALIGN_TOP | |||
| ) |
The constructor.
| label | const char *, the widget's label | |
| layoutSize | int, size of widget in layout. See CLayoutClient for details | |
| align | CLayoutAlign, widget align in the layout |
| CTreeItem* sptk::CTreeControl::addItem | ( | const char * | label, | |
| const Fl_Image * | openedImage = 0L, |
|||
| const Fl_Image * | closedImage = 0L, |
|||
| void * | data = 0L | |||
| ) |
Adds a child item to the root item. If the closedImage parameter is omitted the openedImage is used instead.
| label | const char *, the item label | |
| openedImage | Fl_Image, the image for the opened state | |
| closedImage | Fl_Image, the image for the closed state | |
| data | void *, the user data or ID attached to the item |
| CTreeItem* sptk::CTreeControl::addPath | ( | const std::vector< std::string > & | path, | |
| const Fl_Image * | itemImage = 0L, |
|||
| void * | data = 0L | |||
| ) |
Adds a child item to the root item using the path. The required path items are created automatically. Path elements are separated with '/'. The default images are used for the folders in the path.
| path | const std::vector<std::string>&, the path to the new child item | |
| itemImage | Fl_Image, the image for the child item | |
| data | void *, the user data or ID attached to the item |
| CTreeItem* sptk::CTreeControl::addPath | ( | const std::vector< std::string > & | path, | |
| const Fl_Image * | openedImage, | |||
| const Fl_Image * | closedImage, | |||
| const Fl_Image * | itemImage = 0L, |
|||
| void * | data = 0L | |||
| ) |
Adds a child item to the root item using the path. The required path items are created automatically. Path elements are separated with '/'. The default images are used for the folders in the path.
| path | const std::vector<std::string>&, the path to the new child item | |
| openedImage | Fl_Image, the image for the folders in opened state | |
| closedImage | Fl_Image, the image for the folders in closed state | |
| itemImage | Fl_Image, the image for the child item | |
| data | void *, the user data or ID attached to the item |
| static CLayoutClient* sptk::CTreeControl::defaultItemCreator | ( | CTreeItem * | item | ) | [static, protected] |
| CTreeItem* sptk::CTreeControl::findData | ( | const void * | data | ) | const |
Finds an item by the item user data in the whole tree.
| data | void *, user data to find |
| CTreeItem* sptk::CTreeControl::findItem | ( | const char * | item | ) | const |
Finds an item by the item label in the whole tree.
| item | const char *, item label to find |
| int sptk::CTreeControl::handle | ( | int | event | ) |
Special handle() function.
| event | int, an FLTK event |
Reimplemented from sptk::CScroll.
| void sptk::CTreeControl::itemCreator | ( | CTreeItemCreator | ic | ) | [inline] |
The tree item creator creates a tree item' body,.
References m_itemCreator.
| virtual void sptk::CTreeControl::load | ( | const CXmlNode * | node, | |
| bool | autoCreate = false | |||
| ) | throw (CException) [inline, virtual] |
Loads group controls data from XML node.
| node | const CXmlNode*, node to load data from | |
| autoCreate | bool, create widgets if they are not found |
References load().
| virtual void sptk::CTreeControl::load | ( | const CXmlNode & | node, | |
| bool | autoCreate = false | |||
| ) | throw (CException) [virtual] |
| void sptk::CTreeControl::makeVisible | ( | CTreeItem * | item | ) |
Makes the item visible if it's outside the visible area.
| item | CTreeItem, item to make visible |
| void sptk::CTreeControl::removeItem | ( | CTreeItem * | item | ) |
Removes all the item and underlying structure from the tree.
| item | CTreeItem *, item to remove |
| virtual void sptk::CTreeControl::save | ( | CXmlNode * | node | ) | const [inline, virtual] |
Saves group controls data into XML node.
| node | const CXmlNode*, node to save data into |
References save().
| virtual void sptk::CTreeControl::save | ( | CXmlNode & | node | ) | const [virtual] |
| void sptk::CTreeControl::selectOnly | ( | CTreeItem * | item, | |
| bool | giveFocus = false | |||
| ) |
Selects only one item.
| item | CTreeItem, item to select | |
| giveFocus | bool, should the item be focused? |
CTreeItemCreator sptk::CTreeControl::m_itemCreator [protected] |
The tree item creator creates a tree item' body,.
Referenced by itemCreator().