Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Tree: A Widget for List or Tree Layout

Defines a widget for laying out other widgets in a tree or list like manner. More...

Data Structures

struct  Ewl_Tree
 The tree is a columnar listing, where items in the list may be nested below other items. More...

struct  Ewl_Tree
 The tree is a columnar listing, where items in the list may be nested below other items. More...


Defines

#define EWL_TREE(t)   ((Ewl_Tree *)t)
 Typecasts a pointer to an Ewl_Tree pointer.

#define EWL_TREE_NODE(t)   ((Ewl_Tree_Node *)t)
 Typecasts a pointer to an Ewl_Tree_Node pointer.


Enumerations

enum  Ewl_Tree_Mode

Functions

Ewl_Widgetewl_tree_node_new (void)
 Allocate and initialize a new node.

int ewl_tree_node_init (Ewl_Tree_Node *tree_node)
 Initialize the node fields of an inheriting object.

void ewl_tree_node_collapse (Ewl_Tree_Node *tree)
 Collapse a node in the tree.

void ewl_tree_node_expand (Ewl_Tree_Node *tree)
 Expand a node in the tree.

Ewl_Widgetewl_tree_new (unsigned short columns)
 Allocate and initialize a new tree widget.

int ewl_tree_init (Ewl_Tree *tree, unsigned short columns)
 Initialize the contents of a tree widget.

void ewl_tree_headers_set (Ewl_Tree *tree, char **headers)
 Change the widgets in a trees column headers.

void ewl_tree_columns_set (Ewl_Tree *tree, unsigned short columns)
 Change the number of columns displayed in a tree.

Ecore_List * ewl_tree_selected_get (Ewl_Tree *tree)
 Retrieves a list of selected rows from a tree.

void ewl_tree_selected_clear (Ewl_Tree *tree)
 Clear the current selection from a tree.

Ewl_Tree_Mode ewl_tree_mode_get (Ewl_Tree *tree)
 Retrieve the current selection mode of a tree.

void ewl_tree_mode_set (Ewl_Tree *tree, Ewl_Tree_Mode mode)
 Change the selection mode for a specified tree.

Ewl_Widgetewl_tree_row_add (Ewl_Tree *tree, Ewl_Row *prow, Ewl_Widget **children)
 Add a group of widgets to a row in the tree.

Ewl_Widgetewl_tree_text_row_add (Ewl_Tree *tree, Ewl_Row *prow, char **text)
 Add a row of text to a tree.

Ewl_Widgetewl_tree_entry_row_add (Ewl_Tree *tree, Ewl_Row *prow, char **text)
 Add a row of text entries to a tree.

void ewl_tree_row_destroy (Ewl_Tree *tree, Ewl_Row *row)
 Destroy a specified row from the tree.

void ewl_tree_row_expand_set (Ewl_Row *row, Ewl_Tree_Node_Flags expanded)
 Set the expand state of a specific row.


Detailed Description

Defines a widget for laying out other widgets in a tree or list like manner.


Enumeration Type Documentation

enum Ewl_Tree_Mode
 

Widget Theme Keys:
/tree/file

/tree/group


Function Documentation

void ewl_tree_columns_set Ewl_Tree tree,
unsigned short  columns
 

Change the number of columns displayed in a tree.

Parameters:
tree: the tree to change the number of columns
columns: the new number of columns to be displayed
Returns:
Returns no value.
The number of columns displayed in tree is changed to columns. When rows are added, pre-existing rows have empty contents in the additional columns which are appended. When rows are removed, previously existing rows destroy column contents that are removed from the end. If you need finer grain control over where columns are added or removed, see ewl_tree_add_column and ewl_tree_del_column.

Ewl_Widget* ewl_tree_entry_row_add Ewl_Tree tree,
Ewl_Row *  prow,
char **  text
 

Add a row of text entries to a tree.

Parameters:
tree: the tree to hold the new entry row
prow: the parent row of the new entry row
text: the array of strings that hold the entry text to be added
Returns:
Returns a pointer to a new row on success, NULL on failure.

void ewl_tree_headers_set Ewl_Tree tree,
char **  headers
 

Change the widgets in a trees column headers.

Parameters:
tree: the tree to change column headers
headers: the array of widget pointers containing the new headers
Returns:
Returns no value.
Stores the widgets in headers to header row of tree.

int ewl_tree_init Ewl_Tree tree,
unsigned short  columns
 

Initialize the contents of a tree widget.

Parameters:
tree: the tree widget to be initialized
columns: the number of columns in the tree
Returns:
Returns TRUE on success, FALSE on failure.
The contents of the tree widget tree are initialized to their defaults, and the number of columns to display is set to columns.

Ewl_Tree_Mode ewl_tree_mode_get Ewl_Tree tree  ) 
 

Retrieve the current selection mode of a tree.

Parameters:
tree: the tree to get the selection mode
Returns:
Returns the current selection mode of the tree.

void ewl_tree_mode_set Ewl_Tree tree,
Ewl_Tree_Mode  mode
 

Change the selection mode for a specified tree.

Parameters:
tree: the tree to set the selection mode
mode: the new selection mode for the tree
Returns:
Returns no value.

Ewl_Widget* ewl_tree_new unsigned short  columns  ) 
 

Allocate and initialize a new tree widget.

Parameters:
columns: the number of columns to display
Returns:
Returns NULL on failure, a new tree widget on success.
The paramater columns can be modified at a later time to display a different number of columns.

void ewl_tree_node_collapse Ewl_Tree_Node *  node  ) 
 

Collapse a node in the tree.

Parameters:
node: the node in the tree to collapse
Returns:
Returns no value. Hides the rows below node.

void ewl_tree_node_expand Ewl_Tree_Node *  node  ) 
 

Expand a node in the tree.

Parameters:
node: the node in the tree to expand
Returns:
Returns no value. Hides the rows below node.

int ewl_tree_node_init Ewl_Tree_Node *  node  ) 
 

Initialize the node fields of an inheriting object.

Parameters:
node: the node object to initialize
Returns:
Returns TRUE on success, FALSE on failure.
The fields of the node object are initialized to their defaults.

Ewl_Widget* ewl_tree_node_new void   ) 
 

Allocate and initialize a new node.

Returns:
Returns a newly allocated node on success, NULL on failure.

Ewl_Widget* ewl_tree_row_add Ewl_Tree tree,
Ewl_Row *  prow,
Ewl_Widget **  children
 

Add a group of widgets to a row in the tree.

Parameters:
tree: the tree to hold the widgets
prow: the parent row of the new row for the added widgets
children: a NULL terminated array of widgets to add to the tree
Returns:
Returns a pointer to a new row on success, NULL on failure.
Adds a row to a specified tree with a parent row of prow and built from the widgets in the array children. The created row is nested below prow, and if prow is NULL the row is appended to the end of the list at the top level. The array children must be equal in size to the number of columns in tree. It is valid for the entries in children to be NULL, this creates an empty cell.

void ewl_tree_row_destroy Ewl_Tree tree,
Ewl_Row *  row
 

Destroy a specified row from the tree.

Parameters:
tree: the tree to destroy a row from
row: the row to be destroyed from the tree
Returns:
Returns no value.
Removes row from tree if it is present in tree. The widgets in the row will be destroyed, so they should not be accessed at a later time.

void ewl_tree_row_expand_set Ewl_Row *  row,
Ewl_Tree_Node_Flags  expanded
 

Set the expand state of a specific row.

Parameters:
row: the row to change the expanded state
expanded: the new expanded state for the row
Returns:
Returns no value.
Changes the expanded state of row to expanded, which should be TRUE or FALSE.

void ewl_tree_selected_clear Ewl_Tree tree  ) 
 

Clear the current selection from a tree.

Parameters:
tree: the tree to clear the current selection
Returns:
Returns no value.

Ecore_List* ewl_tree_selected_get Ewl_Tree tree  ) 
 

Retrieves a list of selected rows from a tree.

Parameters:
tree: the tree to retrieve selected rows
Returns:
Returns a list of selected rows on success, NULL on failure.

Ewl_Widget* ewl_tree_text_row_add Ewl_Tree tree,
Ewl_Row *  prow,
char **  text
 

Add a row of text to a tree.

Parameters:
tree: the tree to hold the new text row
prow: the parent row of the new text row
text: the array of strings that hold the text to be added
Returns:
Returns a pointer to a new row on success, NULL on failure.