ClanSoft logo
ClanSoft logo
Entire Class Index Main Class Index Cross Index Global Index

Class CL_TreeView_Node

TreeView node
Contained in: global
Derived from: none
Derived by: CL_TreeView
Group: GUI (Controls)

#include <ClanLib/gui.h>


public function member index:

Construction:

CL_TreeView_Node(CL_TreeView* rootTree);
virtual ~CL_TreeView_Node();

Attributes:

void* get_userdata() const;

Operations:

CL_TreeView_Node* insert_item(const std::string& text, int index = -1);
CL_TreeView_Node* insert_item(CL_Component* component, int index = -1);
void set_selected(bool select = true);
void set_selected(CL_TreeView_Node* node, bool select = true);
void clear_selection();
void invert_selection();
void clear();
void set_userdata(void* data);
 

private function member index:

Callbacks:

void on_child_click(const CL_Key& key);

Implementation:

void draw_nodes(CL_Point& point);
void draw_node(CL_Point& point);
 

Description:


Function Member Descriptions:

CL_TreeView_Node::CL_TreeView_Node - The treeview node constructor.
Not to be constructed by user - use insert_item() instead, which
creates a CL_TreeView_Node.
CL_TreeView_Node(CL_TreeView* rootTree);


CL_TreeView_Node::clear - Deletes all items in the tree.
void clear();


CL_TreeView_Node::clear_selection - Deselects current selected item.
void clear_selection();


CL_TreeView_Node::get_userdata - Returns the attaches userdata, if any.
void* get_userdata() const;


CL_TreeView_Node::insert_item - Inserts an item (uses any type of component) at index.
CL_TreeView_Node* insert_item(CL_Component* component, int index = -1);
If index is negative, text is inserted at the end of the list.
Returns the node of the item.



CL_TreeView_Node::insert_item - Inserts an item at index.
CL_TreeView_Node* insert_item(const std::string& text, int index = -1);
If index is negative, text is inserted at the end of the list.
Returns the node of the item.



CL_TreeView_Node::invert_selection - Inverts the selection.
Works only in Multi selection mode.
void invert_selection();


CL_TreeView_Node::set_selected - Select any of the children nodes.
void set_selected(CL_TreeView_Node* node, bool select = true);


CL_TreeView_Node::set_selected - Select this node.
void set_selected(bool select = true);


CL_TreeView_Node::set_userdata - Attaches userdata to node.
void set_userdata(void* data);



Variable Member Descriptions: