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

CmTree Class Reference

MTree Class This Object allows the creation of a graphical tree. More...

Inheritance diagram for CmTree:

CmObject CmMGUI

Public Methods

 CmTree (CmContainer *parent, MTFont font, int width, int height, int n_types)
 CmTree widget.

void setImages (int type, const char *norm, const char *open, const char *sel)
 Sets the images to be associated to a given node type.

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

void setHighLightColors (CmColor *bgc, CmColor *fgc)
 Sets the text foreground and background colors to be used to highlight a selected node.

void setHighLightFGColor (CmColor *fgc)
 Sets the text foreground color to be used to highlight a selected node.

void setLineColor (CmColor *color)
 Sets the color to be used to draw node connecting lines.

void setSliderColor (CmColor *color)
 Sets the color of the sliders in the scrollbars of a CmTree object.

void setSliderColorShift (int percentage)
 Sets the color of the sliders in the scrollbars of a CmTree object as a percentage of their normal color.

CmTreeNodegetSelectedNode (void)
 Returns a reference to the currently selected node.

CmTreeNodegetFirstNode (void)
 Returns a reference to the the first node in the tree.

void setOpenCallback (CmCallback *owner, MTREENODE_CB cb)
 Sets the node open callback at Tree level (same callback for all nodes).

void setCloseCallback (CmCallback *owner, MTREENODE_CB cb)
 Sets the node close callback at Tree level (same callback for all nodes).

void setSelectCallback (CmCallback *owner, MTREENODE_CB cb)
 Sets the node select callback at Tree level (same callback for all nodes).


Detailed Description

MTree Class This Object allows the creation of a graphical tree.

It is used by the MFileBrowse utility function. It was made up using the standard MGui API.


Constructor & Destructor Documentation

CmTree::CmTree CmContainer   parent,
MTFont    font,
int    width,
int    height,
int    n_types
 

CmTree widget.

Parameters:
parent Container parent widget.
font Fonts to be used for displaying node names.
width initial desired width (in pixel units).
height initial desired height (in pixel units).
n_types number of node types (used internally to pre-allocate structures).
See also:
CmTreeNode


Member Function Documentation

CmTreeNode* CmTree::getFirstNode void   
 

Returns a reference to the the first node in the tree.

CmTreeNode* CmTree::getSelectedNode void   
 

Returns a reference to the currently selected node.

void CmTree::setCloseCallback CmCallback   owner,
MTREENODE_CB    cb
 

Sets the node close callback at Tree level (same callback for all nodes).

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

void CmTree::setHighLightColors CmColor   bgc,
CmColor   fgc
 

Sets the text foreground and background colors to be used to highlight a selected node.

Parameters:
bgc Background color.
fgc Foreground color.

void CmTree::setHighLightFGColor CmColor   fgc
 

Sets the text foreground color to be used to highlight a selected node.

Parameters:
fgc Foreground color.

void CmTree::setImages int    type,
CmImage   norm,
CmImage   open,
CmImage   sel
 

Sets the images to be associated to a give node type.

The set images are used by default to draw node icons.

Parameters:
type The node type which to bind images to.
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 BMP will be used instead.
sel The image to be used when the node is selected. If NULL is passed then the norm BMP will be used instead.
See also:
CmTreeNode::setImages

void CmTree::setImages int    type,
const char *    norm,
const char *    open,
const char *    sel
 

Sets the images to be associated to a given node type.

The set images are used by default to draw icons for all nodes of the same type.

Parameters:
type The node type which to bind images to.
norm Filename of the BMP image to be used when the node is not opened nor selected.
open Filename of the BMP image to be used when the node is opened. If NULL is passed then the norm BMP will be used instead.
sel Filename of the BMP image to be used when the node is selected. If NULL is passed then the norm BMP will be used instead.
See also:
CmTreeNode::setImages

void CmTree::setLineColor CmColor   color
 

Sets the color to be used to draw node connecting lines.

Parameters:
color Background color.

void CmTree::setOpenCallback CmCallback   owner,
MTREENODE_CB    cb
 

Sets the node open callback at Tree level (same callback for all nodes).

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

void CmTree::setSelectCallback CmCallback   owner,
MTREENODE_CB    cb
 

Sets the node select callback at Tree level (same callback for all nodes).

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

void CmTree::setSliderColor CmColor   color
 

Sets the color of the sliders in the scrollbars of a CmTree object.

Parameters:
color Color to apply.

void CmTree::setSliderColorShift int    percentage
 

Sets the color of the sliders in the scrollbars of a CmTree object as a percentage of their normal color.

Parameters:
percentage Percentage to apply.


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