rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvTreeGadget Class Reference

Gadget class. More...

#include <ilviews/gadgets/tree.h>

Inheritance diagram for IlvTreeGadget:
IlvScrolledGadget IlvTreeGadgetItemHolder IlvGadget IlvGadgetItemHolder IlvSimpleGraphic IlvGraphic IlvFileChooserTree

List of all members.

Public Member Functions

 IlvTreeGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor.
void addItem (IlvTreeGadgetItem *parent, IlvTreeGadgetItem *item, IlInt index=-1)
 Adds the specified item to the tree hierarchy.
IlvTreeGadgetItemaddItem (IlvTreeGadgetItem *parent, const char *label, IlInt index=-1, IlvBitmap *bitmap=0, IlvBitmap *expandedBitmap=0, IlBoolean redraw=IlTrue)
 Adds a new item to the tree gadget.
void allowDragDrop (IlBoolean allow)
 Specifies whether drag-and-drop operations should be allowed for the tree gadget.
virtual IlBoolean allowDragDrop () const
 Indicates whether drag-and-drop operations are allowed for the tree gadget.
IlBoolean areButtonsVisible () const
 Indicates whether the buttons located to the left of parent items are displayed.
IlBoolean areLinesVisible () const
 Indicates whether the lines connecting tree items to their parent are visible.
IlBoolean areRootsLinked () const
 Indicates whether the children of the root item are linked by a connecting line.
virtual void beginPopulate ()
 Stops all scroll bar computing while populating the tree gadget.
IlBoolean buttonBBox (IlvTreeGadgetItem *item, IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of the button associated with the specified item.
virtual void constantItemHeightAssumed (IlBoolean assumed)
 Indicates that all items are assumed to be the same height.
virtual IlvGadgetItemcreateItem (const char *label, IlvGraphic *g=0, IlvBitmap *bitmap=0, IlvBitmap *sbitmap=0, IlBoolean copy=IlTrue) const
 Returns a new gadget item.
void deSelectAll (IlBoolean redraw=IlTrue)
 Deselects all the selected items.
virtual void drawBackground (IlvPort *, const IlvTransformer *, const IlvRegion *) const
 Draws the gadget background.
virtual void drawButton (IlvPort *dst, const IlvTreeGadgetItem *item, const IlvRect &bbox, const IlvRegion *clip=0) const
 Is called to draw the button of the specified item.
virtual void drawFrame (IlvPort *, const IlvTransformer *, const IlvRegion *) const
 Draws the gadget frame.
virtual void drawGadgetItem (const IlvGadgetItem *, IlvPort *port, const IlvRect &rect, const IlvTransformer *t, const IlvRegion *clip) const
 Draws a specific gadget item.
virtual void endPopulate (IlBoolean redraw=IlTrue)
 Launches all scroll bar computing after the populating of tree. gadget.
void ensureVisible (IlvTreeGadgetItem *item, IlBoolean horizontal=IlTrue, IlBoolean redraw=IlTrue)
 Ensures that the specified tree gadget item is visible.
void expandItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue, IlBoolean all=IlFalse)
 Expands the specified item so that its children become visible.
virtual void getButtonSize (const IlvTreeGadgetItem *item, IlvDim &width, IlvDim &height) const
 Returns the size of the button of the specified tree gadget item.
IlvTreeGadgetItemgetCallbackItem () const
 Returns the item that triggered the callback.
IlvTreeGadgetItemgetFirstVisibleItem () const
 Returns the first visible item of the tree gadget.
IlvDim getIndent () const
 Returns the number of pixels that children are indented relative to the parent.
virtual void getLabelOrientation (IlvOrientation &orientation, IlBoolean &flip) const
 Returns the default orientation of the tree item labels.
virtual IlvPosition getLabelPosition () const
 Returns the default position of the tree item labels, relative to the picture.
IlvTreeGadgetItemgetLastFullVisibleItem (const IlvTransformer *t=0) const
 Returns the last visible item that can be seen without scrolling the tree gadget.
IlvTreeGadgetItemgetLastVisibleItem (const IlvTransformer *t=0) const
 Returns the last visible item of the tree gadget.
IlBoolean getLinesAtRoot () const
 Indicates whether lines connecting the root item to its children are drawn.
virtual IlvPalettegetNormalTextPalette () const
 Returns the default palette used to draw an item.
IlvDim getOffset () const
 Returns the horizontal offset defined for the tree gadget.
virtual IlvPalettegetOpaquePalette () const
 Returns the opaque palette used to draw opaque items.
IlvTreeGadgetItemgetRoot () const
 Returns the root item of the tree hierarchy.
IlvTreeSelectionMode getSelectionMode () const
 Returns the selection mode of the tree gadget.
virtual IlBoolean handleGadgetEvent (IlvEvent &event)
 Handles the gadget events.
virtual IlBoolean handleTreeEvent (IlvEvent &event)
 Handles the events occurring to the tree.
virtual IlBoolean hasToolTips () const
 Indicates whether the tree gadget displays tooltips.
virtual IlBoolean isConstantItemHeightAssumed () const
 Returns IlTrue when all items are assumed to be the same height.
virtual IlBoolean isEditable () const
 Indicates whether the tree items can be edited.
virtual IlBoolean isShowingLabel () const
 Indicates whether the tree item labels are displayed.
virtual IlBoolean isShowingPicture () const
 Indicates whether the tree item pictures are displayed.
IlBoolean itemBBox (IlvTreeGadgetItem *item, IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of the specified item.
void linkRoots (IlBoolean value, IlBoolean redraw=IlTrue)
 Specifies whether the children of the root item should be linked by a connecting line.
IlvTreeGadgetItempointToItem (const IlvPoint &point, IlBoolean &button, const IlvTransformer *t) const
 Returns the item located at the specified position.
IlvTreeGadgetItempointToItemLine (const IlvPoint &point, const IlvTransformer *t) const
 Returns the item located at the specified point.
virtual void recomputeAllItems ()
 Recomputes the size of all the items managed by the holder.
void removeAllItems (IlBoolean redraw=IlTrue)
 Removes all the items from the tree gadget.
void removeItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue)
 Removes and destroys the specified item.
void scrollToItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue)
 Sets the specified item as the first visible item in the tree gadget.
void selectItem (IlvTreeGadgetItem *item, IlBoolean value, IlBoolean deselectAll=IlTrue, IlBoolean redraw=IlTrue)
 Selects or deselects the specified tree gadget item.
void setEditable (IlBoolean value=IlTrue)
 Specifies whether the tree gadget should be editable.
void setIndent (IlvDim indent, IlBoolean redraw=IlTrue)
 Sets the number of pixels that children are indented relative to the parent.
void setLabelOrientation (IlvOrientation orientation, IlBoolean flip=IlFalse, IlBoolean redraw=IlTrue)
 Sets the default orientation of the tree item labels.
void setLabelPosition (IlvPosition position, IlBoolean redraw=IlTrue)
 Sets the default position of the tree item labels, relative to the picture.
void setLinesAtRoot (IlBoolean value, IlBoolean redraw=IlTrue)
 Specifies whether lines connecting the root item to its children should be drawn.
void setOffset (IlvDim offset, IlBoolean redraw=IlTrue)
 Sets the horizontal offset of the tree gadget.
void setSelectionMode (IlvTreeSelectionMode mode)
 Specifies the selection mode of the tree gadget.
void showButtons (IlBoolean value, IlBoolean redraw=IlTrue)
 Shows or hides the buttons appearing to the left of each parent item.
void showLabel (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue)
 Indicates whether the tree item labels should be shown or hidden.
void showLines (IlBoolean value, IlBoolean redraw=IlTrue)
 Shows or hides the lines connecting the tree items to their parent.
void showPicture (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue)
 Specifies whether the tree item pictures should be shown or hidden.
void shrinkItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue)
 Shrinks the specified item so that its children are no longer visible.
virtual void sort (IlvTreeGadgetItem *=0, IlUInt levels=(IlUInt)-1, IlvTreeGadgetItemCompareFunction=0)
 Sorts the children of the specified item.
void useToolTips (IlBoolean value=IlTrue)
 Specifies whether the tree gadget should display tooltips.

Static Public Member Functions

static IlSymbolExpandCallbackType ()
 Returns the callback type for the Expand callback.
static IlSymbolSelectCallbackType ()
 Returns the callback type for the Select callback.
static IlSymbolShrinkCallbackType ()
 Returns the callback type for the Shrink callback.

Protected Member Functions

virtual void activate (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is activated.
virtual void adjustFromScrollBar (const IlvScrollBar *sb, IlvDirection dir)
 Is called to adjust the gadget to the scroll bars values.
virtual void adjustScrollBarValue (IlvScrollBar *sb, IlvDirection dir)
 Is called to adjust the scroll bar values.
virtual void deSelect (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is deselected.
virtual void drawGadgetContents (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the gadget contents.
virtual void expand (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is expanded.
virtual void itemActivated (IlvGadgetItem *item)
 Is called when an item is activated.
virtual void itemDeSelected (IlvGadgetItem *item)
 Is called when an item is deselected.
virtual void itemSelected (IlvGadgetItem *item)
 Is called when an item is selected.
virtual void select (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is selected.
virtual void shrink (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is shrunk.

Friends

class IlvDefaultTreeGadgetLFHandler
class IlvTreeGadgetItem

Detailed Description

Gadget class.

Library: ilvadvgdt

An IlvTreeGadget is a gadget that displays a hierarchical list of items. Each item is an instance of the IlvTreeGadgetItem class. Each tree gadget item displays a label and an optional bitmap and has a list of subitems. The user can expand or shrink the item to show or hide its subitems. The main callback of the tree gadget is invoked when the user double-clicks an item that has no children.

IlvTreeGadgeta.gif

- Tree Gadget -

See also:
IlvTreeGadgetItem, IlvHierarchicalSheet.

Constructor & Destructor Documentation

IlvTreeGadget::IlvTreeGadget ( IlvDisplay display,
const IlvRect rect,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the class IlvTreeGadget.

Parameters:
display The connection to the display.
rect The size and position of the tree gadget.
thickness The thickness of the tree gadget.
palette The palette used by the tree gadget.

Member Function Documentation

virtual void IlvTreeGadget::activate ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called by the interactor when an item is activated.

An item is activated when the user double-clicks on it. The default implementation calls the Activate callback.

Parameters:
item The activated item.
See also:
IlvGadgetItemHolder::ActivateCallbackType, IlvGadgetItem::activate
void IlvTreeGadget::addItem ( IlvTreeGadgetItem parent,
IlvTreeGadgetItem item,
IlInt  index = -1 
)

Adds the specified item to the tree hierarchy.

Parameters:
parent The parent item to which the new item will be attached. If parent is 0, item is added to the root item of the tree hierarchy.
item The item to be added.
index The position where item will be added. If index is -1, item is added at the end of the parent child list.
See also:
IlvTreeGadgetItem::insertChild, removeItem, detachItem.

Reimplemented from IlvTreeGadgetItemHolder.

IlvTreeGadgetItem* IlvTreeGadget::addItem ( IlvTreeGadgetItem parent,
const char *  label,
IlInt  index = -1,
IlvBitmap bitmap = 0,
IlvBitmap expandedBitmap = 0,
IlBoolean  redraw = IlTrue 
)

Adds a new item to the tree gadget.

Parameters:
parent The parent item to which the new item will be attached. If parent is 0, the item is added to the root item of the tree gadget.
label The label of the new item.
index The position where the new item will be added. If index is -1, the item is added at the end of the parent child list.
bitmap The sensitive bitmap of the new item.
expandedBitmap The expanded bitmap of the new item.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
IlvTreeGadgetItem::insertChild, removeItem, detachItem
virtual void IlvTreeGadget::adjustFromScrollBar ( const IlvScrollBar scrollbar,
IlvDirection  direction 
) [protected, virtual]

Is called to adjust the gadget to the scroll bars values.

Is called each time the scroll bar scrollbar of direction direction moves. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.

Parameters:
scrollbar The scroll bar object.
direction The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical.
See also:
adjustScrollBarValue

Reimplemented from IlvScrolledGadget.

virtual void IlvTreeGadget::adjustScrollBarValue ( IlvScrollBar scrollbar,
IlvDirection  direction 
) [protected, virtual]

Is called to adjust the scroll bar values.

Is called by the member function IlvScrolledGadget::adjustScrollBars to adjust the values of the scroll bar scrollbar of direction direction. This member function must modify the scrollbar values to match the gadget scrolling mode. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.

Parameters:
scrollbar The scroll bar object.
direction The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical.
See also:
adjustFromScrollBar

Reimplemented from IlvScrolledGadget.

void IlvTreeGadget::allowDragDrop ( IlBoolean  allow  ) 

Specifies whether drag-and-drop operations should be allowed for the tree gadget.

Parameters:
value A Boolean value specifying whether drag-and-drop operations should be allowed (IlTrue).
See also:
IlvGadgetItemHolder::startDragItem, allowDragDrop
virtual IlBoolean IlvTreeGadget::allowDragDrop (  )  const [virtual]

Indicates whether drag-and-drop operations are allowed for the tree gadget.

Returns:
IlTrue if drag-and-drop operations are allowed and IlFalse otherwise.
See also:
IlvGadgetItemHolder::startDragItem, allowDragDrop(IlBoolean)

Reimplemented from IlvGadgetItemHolder.

IlBoolean IlvTreeGadget::areButtonsVisible (  )  const

Indicates whether the buttons located to the left of parent items are displayed.

Returns:
IlTrue if the buttons to the left of parent items are displayed.
See also:
showButtons
IlBoolean IlvTreeGadget::areLinesVisible (  )  const

Indicates whether the lines connecting tree items to their parent are visible.

Returns:
IlTrue if the lines connecting tree items to their parent are visible.
See also:
showLines
IlBoolean IlvTreeGadget::areRootsLinked (  )  const

Indicates whether the children of the root item are linked by a connecting line.

Returns:
IlTrue if the children of the root item are linked by a connecting line.
See also:
linkRoots
virtual void IlvTreeGadget::beginPopulate (  )  [virtual]

Stops all scroll bar computing while populating the tree gadget.

Call this function to indicate to the tree gadget that all computing operations about scroll bar are stopped while populating the tree gadget.

IlBoolean IlvTreeGadget::buttonBBox ( IlvTreeGadgetItem item,
IlvRect bbox,
const IlvTransformer t = 0 
) const

Returns the bounding box of the button associated with the specified item.

Parameters:
item The tree item.
bbox The returned bounding box of the button associated with item when the tree is drawn with the transformer t.
t The transformer applied to the tree gadget.
Returns:
A Boolean value indicating whether the item button is visible. If IlFalse is returned, the value in bbox is not relevant.
virtual void IlvTreeGadget::constantItemHeightAssumed ( IlBoolean  assumed  )  [virtual]

Indicates that all items are assumed to be the same height.

You can override item height checking to enable faster tree gadget refreshes when you have a lot of items that are all the same height. Use this method to notify the tree gadget instance not to perform height checking. This override is not saved to the ilv file and so is not persistent.

Parameters:
assumed If IlTrue, item height is not checked by the tree gadget instance. The default value is IlFalse.
virtual IlvGadgetItem* IlvTreeGadget::createItem ( const char *  label,
IlvGraphic graphic = 0,
IlvBitmap bitmap = 0,
IlvBitmap selbitmap = 0,
IlBoolean  copy = IlTrue 
) const [virtual]

Returns a new gadget item.

You can override this member function in a subclass to create your own items.

Parameters:
label The item label.
graphic The IlvGraphic object representing the picture associated with the item.
bitmap The IlvBitmap object representing the picture associated with the item.
selbitmap The IlvBitmap object representing the picture of the item when it is selected.
copy A Boolean value specifying whether a label should be copied. If the value is IlFalse, then you must allocate some memory for the label because in any case the label characters are deleted from the memory by the IlvGadgetItem.
Warning:
[note] If both the second and third parameters are not null, only the second parameter is used.
Returns:
The created gadget item.

Reimplemented from IlvTreeGadgetItemHolder.

Reimplemented in IlvFileChooserTree.

virtual void IlvTreeGadget::deSelect ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called by the interactor when an item is deselected.

The default implementation calls the Select callback.

Parameters:
item The deselected item.
See also:
SelectCallbackType
void IlvTreeGadget::deSelectAll ( IlBoolean  redraw = IlTrue  ) 

Deselects all the selected items.

Parameters:
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
IlvGadgetItem::isSelected, IlvGadgetItem::select
virtual void IlvTreeGadget::drawBackground ( IlvPort dst,
const IlvTransformer t,
const IlvRegion clip 
) const [virtual]

Draws the gadget background.

Is called from the draw method. This method is not called if the gadget is transparent.

Parameters:
dst The destination drawing port.
t The transformer applied to the gadget.
clip The clipping area.
See also:
drawFrame, drawScrollBar, drawGadgetContents, IlvGadget::isTransparent

Reimplemented from IlvScrolledGadget.

virtual void IlvTreeGadget::drawButton ( IlvPort dst,
const IlvTreeGadgetItem item,
const IlvRect bbox,
const IlvRegion clip = 0 
) const [virtual]

Is called to draw the button of the specified item.

Parameters:
dst The drawing destination port.
item The tree gadget item.
bbox The rectangle where the button of item should be drawn.
clip The clipping area.
See also:
buttonBBox
virtual void IlvTreeGadget::drawFrame ( IlvPort dst,
const IlvTransformer t,
const IlvRegion clip 
) const [virtual]

Draws the gadget frame.

Is called from the draw method. This method is not called if the method IlvScrolledGadget::isShowingFrame returns IlFalse.

Parameters:
dst The destination drawing port.
t The transformer applied to the gadget.
clip The clipping area.
See also:
drawBackground, drawScrollBar, drawGadgetContents

Reimplemented from IlvScrolledGadget.

virtual void IlvTreeGadget::drawGadgetContents ( IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const [protected, virtual]

Draws the gadget contents.

Is called from the draw method. The default implementation does nothing.

Parameters:
dst The destination drawing port.
t The transformer applied to the gadget.
clip The clipping area.
See also:
drawBackground, drawScrollBar, drawFrame

Reimplemented from IlvScrolledGadget.

virtual void IlvTreeGadget::drawGadgetItem ( const IlvGadgetItem item,
IlvPort port,
const IlvRect rect,
const IlvTransformer t,
const IlvRegion clip 
) const [virtual]

Draws a specific gadget item.

Redraws item in port at the location specified by rect using the clipping area clip. This method simply calls IlvGadgetItem::draw using the item instance.

Parameters:
item The item to be redrawn.
port The destination drawing port.
rect The bounding box of the item.
t The transformer used to draw the item. Not used.
clip The clipping area.
See also:
IlvGadgetItem::draw.

Reimplemented from IlvGadgetItemHolder.

virtual void IlvTreeGadget::endPopulate ( IlBoolean  redraw = IlTrue  )  [virtual]

Launches all scroll bar computing after the populating of tree. gadget.

Call this function to indicate to the tree gadget that all scroll bar computing can be done after the populating if necessary.

Parameters:
redraw A Boolean value specifying whether the tree gadget should be redrawn.
void IlvTreeGadget::ensureVisible ( IlvTreeGadgetItem item,
IlBoolean  horizontal = IlTrue,
IlBoolean  redraw = IlTrue 
)

Ensures that the specified tree gadget item is visible.

Parameters:
item The tree gadget item to be made visible.
horizontal A Boolean value specifying whether the item visibility will be checked horizontally. If horizontal is set to IlTrue, the horizontal offset of the tree gadget item can be modified by this method.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
scrollToItem
virtual void IlvTreeGadget::expand ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called by the interactor when an item is expanded.

The default implementation calls the Expand callback.

Parameters:
item The expanded item.
See also:
ExpandCallbackType, expandItem
static IlSymbol* IlvTreeGadget::ExpandCallbackType (  )  [static]

Returns the callback type for the Expand callback.

The Expand callback is called when an item is expanded.

See also:
IlvGraphic::setCallback, IlvTreeGadgetItem::expand, expandItem
void IlvTreeGadget::expandItem ( IlvTreeGadgetItem item,
IlBoolean  redraw = IlTrue,
IlBoolean  all = IlFalse 
)

Expands the specified item so that its children become visible.

Parameters:
item The item to be expanded.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
all A Boolean value specifying whether the method should expand the children of item (IlTrue) recursively or not (IlTrue).
See also:
IlvTreeGadgetItem::expand
virtual void IlvTreeGadget::getButtonSize ( const IlvTreeGadgetItem item,
IlvDim width,
IlvDim height 
) const [virtual]

Returns the size of the button of the specified tree gadget item.

Warning:
[note] The returned height must be smaller than the height of item.
Parameters:
item The tree gadget item.
width The width of the buttons of the tree gadget.
height The width of the buttons of the tree gadget.
See also:
drawButton, buttonBBox
IlvTreeGadgetItem* IlvTreeGadget::getCallbackItem (  )  const

Returns the item that triggered the callback.

Returns:
The item that triggered the callback. This method should be used only in the callback.

Reimplemented from IlvGadgetItemHolder.

IlvTreeGadgetItem* IlvTreeGadget::getFirstVisibleItem (  )  const

Returns the first visible item of the tree gadget.

Returns:
The first visible item of the tree.
See also:
scrollToItem, getLastFullVisibleItem, getLastVisibleItem
IlvDim IlvTreeGadget::getIndent (  )  const [virtual]

Returns the number of pixels that children are indented relative to the parent.

Returns:
The number of pixels that children are indented relative to the parent.
See also:
setIndent

Implements IlvTreeGadgetItemHolder.

virtual void IlvTreeGadget::getLabelOrientation ( IlvOrientation orientation,
IlBoolean flip 
) const [virtual]

Returns the default orientation of the tree item labels.

Parameters:
orientation The default orientation of the labels.
flip A Boolean value indicating whether the labels should be flipped or not.
See also:
setLabelOrientation

Reimplemented from IlvGadgetItemHolder.

virtual IlvPosition IlvTreeGadget::getLabelPosition (  )  const [virtual]

Returns the default position of the tree item labels, relative to the picture.

Returns:
The default position of the tree item labels, relative to the picture.
See also:
setLabelPosition

Reimplemented from IlvGadgetItemHolder.

IlvTreeGadgetItem* IlvTreeGadget::getLastFullVisibleItem ( const IlvTransformer t = 0  )  const

Returns the last visible item that can be seen without scrolling the tree gadget.

Parameters:
t The transformer applied to the tree gadget.
Returns:
The last visible item that can be seen without scrolling the tree gadget. If the first visible item is larger than the tree gadget height, the first visible item is returned.
See also:
getFirstVisibleItem, getLastVisibleItem
IlvTreeGadgetItem* IlvTreeGadget::getLastVisibleItem ( const IlvTransformer t = 0  )  const

Returns the last visible item of the tree gadget.

Parameters:
t The transformer applied to the tree gadget.
Returns:
The last visible item when this tree gadget is displayed with the transformer t. Only part of the item can be visible.
See also:
getLastFullVisibleItem, getFirstVisibleItem
IlBoolean IlvTreeGadget::getLinesAtRoot (  )  const

Indicates whether lines connecting the root item to its children are drawn.

Returns:
IlTrue if lines connecting the root item to its children are drawn.
See also:
setLinesAtRoot
virtual IlvPalette* IlvTreeGadget::getNormalTextPalette (  )  const [virtual]

Returns the default palette used to draw an item.

Returns:
The default palette used to draw an item.

Implements IlvGadgetItemHolder.

IlvDim IlvTreeGadget::getOffset (  )  const

Returns the horizontal offset defined for the tree gadget.

When the user moves the horizontal scroll bar, the tree gadget items are shifted to the left according to the defined offset value. The bigger the value, the further to the left the items will be displayed.

See also:
setOffset
virtual IlvPalette* IlvTreeGadget::getOpaquePalette (  )  const [virtual]

Returns the opaque palette used to draw opaque items.

Returns:
The opaque palette used to draw opaque items.

Reimplemented from IlvGadgetItemHolder.

IlvTreeGadgetItem* IlvTreeGadget::getRoot (  )  const [virtual]

Returns the root item of the tree hierarchy.

Returns:
The root item of the tree hierarchy.
See also:
addItem, removeItem, detachItem.

Implements IlvTreeGadgetItemHolder.

IlvTreeSelectionMode IlvTreeGadget::getSelectionMode (  )  const

Returns the selection mode of the tree gadget.

Returns:
The selection mode of the tree. The result may be either IlvTreeExtendedSelection or IlvTreeSingleSelection.
See also:
setSelectionMode
virtual IlBoolean IlvTreeGadget::handleGadgetEvent ( IlvEvent event  )  [virtual]

Handles the gadget events.

Is called by IlvScrolledGadget::handleEvent when the member function handleScrollBarsEvent returns IlFalse. Its default implementation does nothing. You can override this member function to implement your own gadget behavior.

Parameters:
event The event.
See also:
handleScrollBarsEvent

Reimplemented from IlvScrolledGadget.

virtual IlBoolean IlvTreeGadget::handleTreeEvent ( IlvEvent event  )  [virtual]

Handles the events occurring to the tree.

You can override this member function to implement a new behavior for the tree gadget.

Parameters:
event The event to be handled.
Returns:
A Boolean value specifying whether the tree gadget handles the events.
virtual IlBoolean IlvTreeGadget::hasToolTips (  )  const [virtual]

Indicates whether the tree gadget displays tooltips.

Returns:
IlTrue if the tree gadget displays tooltips. Otherwise, returns IlFalse.
See also:
useToolTips

Reimplemented from IlvGadgetItemHolder.

virtual IlBoolean IlvTreeGadget::isConstantItemHeightAssumed (  )  const [virtual]

Returns IlTrue when all items are assumed to be the same height.

When you assume that all items are the same height, tree gadget refreshes are faster because the item height is not checked.

Returns:
Returns IlTrue when all items are assumed to be the same height. The default value is IlFalse.
virtual IlBoolean IlvTreeGadget::isEditable (  )  const [virtual]

Indicates whether the tree items can be edited.

Returns:
IlTrue if the tree gadget can be edited. Otherwise, returns IlFalse.
See also:
setEditable, IlvGadgetItem::isEditable

Reimplemented from IlvGadgetItemHolder.

virtual IlBoolean IlvTreeGadget::isShowingLabel (  )  const [virtual]

Indicates whether the tree item labels are displayed.

Returns:
IlTrue if the tree item labels are displayed. Otherwise, returns IlFalse.
See also:
showLabel, isShowingPicture

Reimplemented from IlvGadgetItemHolder.

virtual IlBoolean IlvTreeGadget::isShowingPicture (  )  const [virtual]

Indicates whether the tree item pictures are displayed.

Returns:
IlTrue if the tree item pictures are displayed. Otherwise, returns IlFalse.
See also:
showPicture, isShowingLabel

Reimplemented from IlvGadgetItemHolder.

virtual void IlvTreeGadget::itemActivated ( IlvGadgetItem item  )  [protected, virtual]

Is called when an item is activated.

The default implementation calls the Activate callback.

Parameters:
item The activated gadget item.
See also:
IlvGadgetItem::activate

Reimplemented from IlvGadgetItemHolder.

IlBoolean IlvTreeGadget::itemBBox ( IlvTreeGadgetItem item,
IlvRect bbox,
const IlvTransformer t = 0 
) const

Returns the bounding box of the specified item.

Parameters:
item The tree item.
bbox The returned bounding box of item when the tree is drawn with the transformer t.
t The transformer applied to the tree gadget.
Returns:
A Boolean value indicating whether the item is visible. If IlFalse is returned, the value in bbox is not relevant.
virtual void IlvTreeGadget::itemDeSelected ( IlvGadgetItem item  )  [protected, virtual]

Is called when an item is deselected.

The default implementation does nothing.

Parameters:
item The deselected gadget item.
See also:
IlvGadgetItem::deSelect

Reimplemented from IlvGadgetItemHolder.

virtual void IlvTreeGadget::itemSelected ( IlvGadgetItem item  )  [protected, virtual]

Is called when an item is selected.

The default implementation does nothing.

Parameters:
item The selected gadget item.
See also:
IlvGadgetItem::select

Reimplemented from IlvGadgetItemHolder.

void IlvTreeGadget::linkRoots ( IlBoolean  value,
IlBoolean  redraw = IlTrue 
)

Specifies whether the children of the root item should be linked by a connecting line.

Parameters:
value A Boolean value specifying whether the children of the root item should be linked by a connecting line (IlTrue) or not (IlFalse).
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
areRootsLinked
IlvTreeGadgetItem* IlvTreeGadget::pointToItem ( const IlvPoint point,
IlBoolean button,
const IlvTransformer t 
) const

Returns the item located at the specified position.

Parameters:
point The position of the item to be retrieved.
button A Boolean value indicating whether point is located inside the item button.
t The transformer applied to the tree gadget.
Returns:
The item located at the position specified by point when the tree gadget is drawn with the transformer t, or 0 if there is no item.
See also:
pointToItemLine
IlvTreeGadgetItem* IlvTreeGadget::pointToItemLine ( const IlvPoint point,
const IlvTransformer t 
) const

Returns the item located at the specified point.

The point parameter represents the y coordinate of a point that is located between the top and bottom border of the item bounding box.

Parameters:
point The position of the item to be retrieved.
t The transformer applied to the tree gadget.
Returns:
The item located at the position specified by point when the tree gadget is drawn using the transformer t.
See also:
pointToItem
virtual void IlvTreeGadget::recomputeAllItems (  )  [virtual]

Recomputes the size of all the items managed by the holder.

Calls the IlvGadgetItem::recomputeSize member function for all the items managed by this holder.

See also:
IlvGadgetItem::recomputeSize, applyToItems.

Reimplemented from IlvGadgetItemHolder.

void IlvTreeGadget::removeAllItems ( IlBoolean  redraw = IlTrue  ) 

Removes all the items from the tree gadget.

The root item is never deleted.

Parameters:
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
removeItem, detachItem, addItem
void IlvTreeGadget::removeItem ( IlvTreeGadgetItem item,
IlBoolean  redraw = IlTrue 
)

Removes and destroys the specified item.

item and all its children are removed and deleted.

Parameters:
redraw A Boolean value specifying whether the tree gadget should be redrawn.
void IlvTreeGadget::scrollToItem ( IlvTreeGadgetItem item,
IlBoolean  redraw = IlTrue 
)

Sets the specified item as the first visible item in the tree gadget.

Scrolls the tree gadget vertically so that item becomes the first visible item.

Parameters:
item The new first visible item.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
getFirstVisibleItem
virtual void IlvTreeGadget::select ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called by the interactor when an item is selected.

The default implementation calls the Select callback.

Parameters:
item The selected item.
See also:
SelectCallbackType
static IlSymbol* IlvTreeGadget::SelectCallbackType (  )  [static]

Returns the callback type for the Select callback.

The Select callback is called when an item is selected or deselected. The item that has been selected or deselected is returned by IlvTreeGadget::getCallbackItem. If the item has just been selected, then IlvGadgetItem::isSelected returns IlTrue for that item. If the item has just been deselected, then IlvGadgetItem::isSelected returns IlFalse.

See also:
IlvGraphic::setCallback, IlvGadgetItem::select, IlvGadgetItem::deSelect
void IlvTreeGadget::selectItem ( IlvTreeGadgetItem item,
IlBoolean  value,
IlBoolean  deselectAll = IlTrue,
IlBoolean  redraw = IlTrue 
)

Selects or deselects the specified tree gadget item.

Parameters:
item The tree gadget item to be selected or deselected.
value A Boolean value specifying whether item should be selected or deselected.
deselectAll A Boolean value specifying whether all the tree gadget items should be deselected before the selection of item is modified.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
IlvGadgetItem::select, IlvGadgetItem::deSelect
void IlvTreeGadget::setEditable ( IlBoolean  value = IlTrue  ) 

Specifies whether the tree gadget should be editable.

When this member function is set to IlTrue, you can edit a tree gadget item by clicking on it or by pressing the F2 key once it is selected.

Parameters:
value A Boolean value specifying whether the tree gadget can be edited (IlTrue) or not (IlFalse).
See also:
isEditable, IlvGadgetItem::setEditable
void IlvTreeGadget::setIndent ( IlvDim  indent,
IlBoolean  redraw = IlTrue 
)

Sets the number of pixels that children are indented relative to the parent.

Parameters:
indent The new indentation value.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
getIndent
void IlvTreeGadget::setLabelOrientation ( IlvOrientation  orientation,
IlBoolean  flip = IlFalse,
IlBoolean  redraw = IlTrue 
)

Sets the default orientation of the tree item labels.

When orientation is set to IlvHorizontal, labels are drawn from left to right. When orientation is set to IlvVertical, labels are drawn from top to the bottom if flip is IlFalse and from bottom to top if flip is IlTrue.

Parameters:
orientation The new orientation of the labels.
flip A Boolean value specifying whether the labels are flipped or not.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
getLabelOrientation
void IlvTreeGadget::setLabelPosition ( IlvPosition  position,
IlBoolean  redraw = IlTrue 
)

Sets the default position of the tree item labels, relative to the picture.

This setting is used to compute the geometry of each tree item. For more information, see the member function IlvGadgetItem::setLabelPosition.

Parameters:
position The new position of the tree item labels, relative to the picture.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
void IlvTreeGadget::setLinesAtRoot ( IlBoolean  value,
IlBoolean  redraw = IlTrue 
)

Specifies whether lines connecting the root item to its children should be drawn.

Parameters:
value A Boolean value specifying whether connecting lines should be drawn between the root item and its children.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
void IlvTreeGadget::setOffset ( IlvDim  offset,
IlBoolean  redraw = IlTrue 
)

Sets the horizontal offset of the tree gadget.

When the user moves the horizontal scroll bar, the tree gadget items are shifted to the left according to the defined offset value. The bigger the value, the further to the left the items will be displayed.

Parameters:
offset The new horizontal offset.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
getOffset
void IlvTreeGadget::setSelectionMode ( IlvTreeSelectionMode  mode  ) 

Specifies the selection mode of the tree gadget.

Parameters:
mode The new selection mode. Valid values are: IlvTreeExtendedSelection for the multiple selection mode, or IlvTreeSingleSelection for the single selection mode.
See also:
getSelectionMode
void IlvTreeGadget::showButtons ( IlBoolean  value,
IlBoolean  redraw = IlTrue 
)

Shows or hides the buttons appearing to the left of each parent item.

Parameters:
value A Boolean value specifying whether the buttons located to the left of each parent item should be shown (IlTrue) or hidden (IlFalse).
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
areButtonsVisible
void IlvTreeGadget::showLabel ( IlBoolean  value = IlTrue,
IlBoolean  redraw = IlTrue 
)

Indicates whether the tree item labels should be shown or hidden.

Parameters:
value A Boolean value specifying whether the tree item labels should be shown (IlTrue) or hidden (IlFalse).
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
isShowingLabel, showPicture
void IlvTreeGadget::showLines ( IlBoolean  value,
IlBoolean  redraw = IlTrue 
)

Shows or hides the lines connecting the tree items to their parent.

Parameters:
value A Boolean value specifying whether the lines connecting the tree items to their parent should be shown (IlTrue).
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
areLinesVisible
void IlvTreeGadget::showPicture ( IlBoolean  value = IlTrue,
IlBoolean  redraw = IlTrue 
)

Specifies whether the tree item pictures should be shown or hidden.

Parameters:
value A Boolean value specifying whether the tree item pictures should be shown (IlTrue) or hidden (IlFalse).
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
isShowingPicture, showLabel
virtual void IlvTreeGadget::shrink ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called by the interactor when an item is shrunk.

The default implementation calls the Shrink callback.

Parameters:
item The shrunk item.
See also:
ShrinkCallbackType, shrinkItem
static IlSymbol* IlvTreeGadget::ShrinkCallbackType (  )  [static]

Returns the callback type for the Shrink callback.

The Shrink callback is called when an item is shrunk.

See also:
IlvGraphic::setCallback, IlvTreeGadgetItem::shrink, shrinkItem
void IlvTreeGadget::shrinkItem ( IlvTreeGadgetItem item,
IlBoolean  redraw = IlTrue 
)

Shrinks the specified item so that its children are no longer visible.

Parameters:
item The item to be shrunk.
redraw A Boolean value specifying whether the tree gadget should be redrawn.
See also:
IlvTreeGadgetItem::shrink
virtual void IlvTreeGadget::sort ( IlvTreeGadgetItem item = 0,
IlUInt  levels = (IlUInt)-1,
IlvTreeGadgetItemCompareFunction  func = 0 
) [virtual]

Sorts the children of the specified item.

Runs the sorting algorithm on all the children of item. If you provide a sorting function in the form of an IlvTreeGadgetItemCompareFunction, this function is called to compare each item pair. If you do not provide a sorting function, a default comparison function is used that sort items in the ascendant order using their labels.

Parameters:
item The item whose children are going to be sorted.
levels An integer value specifying the depth of the sorting algorithm.
func A sorting function.
See also:
IlvTreeGadgetItem::sortChildren, IlvTreeGadgetItemCompareFunction, compareItems.

Reimplemented from IlvTreeGadgetItemHolder.

void IlvTreeGadget::useToolTips ( IlBoolean  value = IlTrue  ) 

Specifies whether the tree gadget should display tooltips.

A tooltip is displayed when the cursor remains over a partially visible item for a short while.

Parameters:
value A Boolean value specifying whether the tree gadget should display tooltips (IlTrue) or not (IlFalse).
See also:
hasToolTips
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.