Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

CmTreeNode Class Reference

MTreeNode Class. More...

Inheritance diagram for CmTreeNode:

CmMGUI

Public Methods

 CmTreeNode (CmTree *tree, CmTreeNode *parent, CARD16 type, CARD16 flags, const char *text)
 Adds a CmTreeNode to a CmTree.

void destroyContainee (int notify)
 Destroys all contained nodes, but not the node itself.

void open (int notify)
 Opens a node making its children available.

void close (int notify)
 Closes a node making its children unavailable.

void select (int notify)
 Selects a node (passing it the input focus).

CmTreeNode * getNext (void)
 Returns a reference to the following node.

CmTreeNode * getFirstChild (void)
 Returns a reference to the first child node.

CmTreeNode * getParent (void)
 Returns a reference to the parent node.

char * getPath (char separator, char *buff)
 Creates a path composed by concatenating the name of all nodes starting from the root up to the calling node object.

void setImages (CmImage *norm, CmImage *open, CmImage *sel)
 Sets the images to be associated to a specific node.

void setText (const char *text)
 Changes the text associated to a node.

char * getText (char *text)
 Retrieves the text associated to a node.

CARD16 getType (void)
 Retrieves the type of the specified node.

void setOpenCallback (CmCallback *owner, MTREENODE_CB cb)
 Sets the node open callback at local level (callback applies to this node only).

void setCloseCallback (CmCallback *owner, MTREENODE_CB cb)
 Sets the node close callback at local level (callback applies to this node only).

void setSelectCallback (CmCallback *owner, MTREENODE_CB cb)
 Sets the node select callback at local level (callback applies to this node only).


Detailed Description

MTreeNode Class.


Constructor & Destructor Documentation

CmTreeNode::CmTreeNode CmTree   tree,
CmTreeNode *    parent,
CARD16    type,
CARD16    flags,
const char *    text
 

Adds a CmTreeNode to a CmTree.

Parameters:
tree CmTree object which to add the node to.
parent The node containing the one being created (NULL for 1st level node).
type An integer value identifying the node type. Must be less than the n_types used when the MTree object was created.
flags Currently supported flags include the value NF_CONTAINER.
text Text associated to the node.


Member Function Documentation

void CmTreeNode::close int    notify
 

Closes a node making its children unavailable.

Parameters:
notify Boolean value stating whether or not to call the node close callback.

void CmTreeNode::destroyContainee int    notify
 

Destroys all contained nodes, but not the node itself.

Parameters:
notify Boolean value stating whether or not to call the destroy callback for all contained nodes.

CmTreeNode* CmTreeNode::getFirstChild void   
 

Returns a reference to the first child node.

CmTreeNode* CmTreeNode::getNext void   
 

Returns a reference to the following node.

CmTreeNode* CmTreeNode::getParent void   
 

Returns a reference to the parent node.

char* CmTreeNode::getPath char    separator,
char *    buff
 

Creates a path composed by concatenating the name of all nodes starting from the root up to the calling node object.

Parameters:
separator Character to be used to concatenate two consecutive node names.
buff Return buffer, used to store the path string and returned as value. If NULL is passed, then a suitable buffer is allocated and returned instead. In this case, the application is responsible of freeing the allocated memory.

char* CmTreeNode::getText char *    text
 

Retrieves the text associated to a node.

Parameters:
text The buffer where to store the node text (returned as value if not NULL).
If NULL is passed, then a suitable buffer is allocated and returned. In this case the application is responsible of freeing the internally allocated buffer. In this case, the application is responsible of freeing the allocated memory.

CARD16 CmTreeNode::getType void   
 

Retrieves the type of the specified node.

void CmTreeNode::open int    notify
 

Opens a node making its children available.

Parameters:
notify Boolean value stating whether or not to call the node open callback.

void CmTreeNode::select int    notify
 

Selects a node (passing it the input focus).

Parameters:
notify Boolean value stating whether or not to call the node select callback.

void CmTreeNode::setCloseCallback CmCallback   owner,
MTREENODE_CB    cb
 

Sets the node close callback at local level (callback applies to this node only).

Parameters:
owner Reference to the object providing the callback method.
cb The node close callback.

void CmTreeNode::setImages CmImage   norm,
CmImage   open,
CmImage   sel
 

Sets the images to be associated to a specific node.

The images are used only by the calling node object.

Parameters:
norm The image to be used when the node is not opened nor selected.
open The image to be used when the node is opened. If NULL is passed then the norm image will be used instead.
sel The image to be used when the node is selected. If NULL is passed then the norm image will be used instead.
See also:
CmTree::setImages

void CmTreeNode::setOpenCallback CmCallback   owner,
MTREENODE_CB    cb
 

Sets the node open callback at local level (callback applies to this node only).

Parameters:
owner Reference to the object providing the callback method.
cb The node open callback.

void CmTreeNode::setSelectCallback CmCallback   owner,
MTREENODE_CB    cb
 

Sets the node select callback at local level (callback applies to this node only).

Parameters:
owner Reference to the object providing the callback method.
cb The node select callback.

void CmTreeNode::setText const char *    text
 

Changes the text associated to a node.

Parameters:
text The new text.


Generated on Sun Jun 29 13:03:08 2003 for MGui API by doxygen1.3-rc2