|
#include <CTreeView.h>

Public Member Functions | |
| CTreeView (const char *label=0, int layoutSize=10, CLayoutAlign layoutAlign=SP_ALIGN_TOP) | |
| Constructor in SPTK style. | |
| ~CTreeView () | |
| Destructor. | |
| virtual CControlKind | kind () const |
| Returns controls' kind (internal SPTK RTTI). | |
| virtual std::string | className () const |
| Returns controls' class name (internal SPTK RTTI). | |
| CTreeItem * | addItem (std::string label, const Fl_Image *openedImage, const Fl_Image *closedImage=0L, void *data=0L) |
| Adds a child item to the item. If the closedImage parameter is omitted the openedImage is used instead. | |
| CTreeItem * | 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 item using the path. The required path items are created automatically. | |
| CTreeItem * | addPath (const std::vector< std::string > &path, const Fl_Image *itemImage=0L, void *data=0L) |
| Adds a child item to the item using the default folder images. | |
| void | removeItem (CTreeItem *item) |
| Removes an item from the parent tree item. | |
| CTreeItem * | selected () const |
| Returns currently selected item. | |
| std::string | selectedPath () const |
| Returns currently selected item path in the tree. | |
| virtual void | clear () |
| Removes all the tree items. | |
| void | relayout () |
| Relayouts the tree. May be necessary after you've changed items data a lot. | |
| virtual void | resize (int x, int y, int w, int h) |
| Resizes the control and inside widgets. | |
| virtual CVariant | data () const |
| Returns the currently selected item ID (or user_data). | |
| virtual void | data (const CVariant v) |
| Selects the item with matching ID (or user_data). | |
| virtual void | load (CQuery *) |
| Data connection isn't implemented yet. | |
| virtual void | save (CQuery *) |
| Data connection isn't implemented yet. | |
| virtual void | load (const CXmlNode *node) |
| Loads the the widget from XML node. | |
| virtual void | save (CXmlNode *node) const |
| Saves the the widget to XML node. | |
| virtual bool | valid () const |
| Returns tru if data is valid. | |
Static Public Member Functions | |
| static CLayoutClient * | creator (CXmlNode *node) |
| Creates a widget based on the XML node information. | |
Static Protected Member Functions | |
| static void | internal_callback (Fl_Widget *, void *) |
| Internal tree control callback. | |
Shows tree items with icons. Can use different icons for opened/closed folders.
| sptk::CTreeView::CTreeView | ( | const char * | label = 0, |
|
| int | layoutSize = 10, |
|||
| CLayoutAlign | layoutAlign = SP_ALIGN_TOP | |||
| ) |
Constructor in SPTK style.
| label | const char *, label | |
| layoutSize | int, widget align in layout | |
| layoutAlign | CLayoutAlign, widget align in layout |
| CTreeItem* sptk::CTreeView::addItem | ( | std::string | label, | |
| const Fl_Image * | openedImage, | |||
| const Fl_Image * | closedImage = 0L, |
|||
| void * | data = 0L | |||
| ) | [inline] |
Adds a child item to the item. If the closedImage parameter is omitted the openedImage is used instead.
| label | std::string, the item label | |
| openedImage | const Fl_Image *, the image for the opened state | |
| closedImage | const Fl_Image *, the image for the closed state | |
| data | void *, the user data or ID attached to the item |
References sptk::CTreeItem::addItem().
| CTreeItem* sptk::CTreeView::addPath | ( | const std::vector< std::string > & | path, | |
| const Fl_Image * | itemImage = 0L, |
|||
| void * | data = 0L | |||
| ) | [inline] |
Adds a child item to the item using the default folder images.
| path | const CStrings&, the item full path in the tree starting with '/' | |
| itemImage | const Fl_Image *, the image for the child item | |
| data | void *, the user data or ID attached to the item |
| CTreeItem* sptk::CTreeView::addPath | ( | const std::vector< std::string > & | path, | |
| const Fl_Image * | openedImage, | |||
| const Fl_Image * | closedImage, | |||
| const Fl_Image * | itemImage = 0L, |
|||
| void * | data = 0L | |||
| ) | [inline] |
Adds a child item to the item using the path. The required path items are created automatically.
| path | const CStrings&, the path to the new child item relatively to the item | |
| openedImage | const Fl_Image *, the image for the opened folder | |
| closedImage | const Fl_Image *, the image for the closed folder | |
| itemImage | const Fl_Image *, the image for the child item | |
| data | void *, the user data or ID attached to the item |
References sptk::CTreeItem::addPath().
| static CLayoutClient* sptk::CTreeView::creator | ( | CXmlNode * | node | ) | [static] |
Creates a widget based on the XML node information.
| node | CXmlNode*, an XML node with widget information |
| virtual void sptk::CTreeView::load | ( | const CXmlNode * | node | ) | [virtual] |
Loads the the widget from XML node.
The widget information may include widget attributes and widget data
| node | CXmlNode*, XML node |
| virtual void sptk::CTreeView::resize | ( | int | x, | |
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) | [virtual] |
Resizes the control and inside widgets.
| x | int, x-position | |
| y | int, y-position | |
| w | int, width | |
| h | int, height |
Reimplemented from sptk::CControl.
| virtual void sptk::CTreeView::save | ( | CXmlNode * | node | ) | const [virtual] |
Saves the the widget to XML node.
The widget information may include widget attributes and widget data
| node | CXmlNode*, XML node |