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();

Attributes:

int get_count() const;
CL_Component* get_item(int index) const;
int get_current_item() const;
bool is_selected(int index) const;

Operations:

CL_TreeView_Node* insert_item(const std::string, int index = -1);
CL_TreeView_Node* insert_item(CL_Component* component, int index = -1);
void remove_item(int index);
void set_current_item(int index);
void set_selected(int index, bool select);
void clear_selection();
void select_all(bool select = true);
void invert_selection();
void set_multi_selection(bool enable = true);
void clear();
void draw_nodes(CL_Point& point);
 

private function member index:

Implementation:

void draw_node(CL_Point& point);
void on_child_click(const CL_Key& key);
 

Description:


Function Member Descriptions:

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


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


CL_TreeView_Node::get_count - Returns the number of children.
int get_count() const;


CL_TreeView_Node::get_current_item - Returns the index of the current item, or -1 if no item has been selected.
int get_current_item() const;


CL_TreeView_Node::get_item - Returns the item at position index.
CL_Component* get_item(int index) const;


CL_TreeView_Node::insert_item - Inserts an item at index.
CL_TreeView_Node* insert_item(const std::string, 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 (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::invert_selection - Inverts the selection.
Works only in Multi selection mode.
void invert_selection();


CL_TreeView_Node::is_selected - Returns true if item index is selected. Returns false if it is not selected or if there is an error.
bool is_selected(int index) const;


CL_TreeView_Node::remove_item - Removes and deletes the item at position index.
If index is equal to get_current_item(), a new item gets highlighted and the sig_highlighted() signal is emitted.
void remove_item(int index);


CL_TreeView_Node::select_all - If select is true, all items get selected, else all get unselected.
This works only in Multi selection mode.
void select_all(bool select = true);


CL_TreeView_Node::set_current_item - Sets the highlighted item to the item index.
The highlighting is moved and the treeview scrolled as necessary.
void set_current_item(int index);


CL_TreeView_Node::set_multi_selection - Sets the listbox to multiselection if enable is true,
single selection otherwise.
void set_multi_selection(bool enable = true);


CL_TreeView_Node::set_selected - Selects item at index if select is true, or unselects it if select is false.
If the treeview is a single-selection listbox and and select is true, set_current_item() is called.
If the treeview is a single-selection listbox and and select is false, clear_selection()
is called if index is the currently selected item.
void set_selected(int index, bool select);



Variable Member Descriptions: