rwlogo

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
IlvTreeGadget Class Reference

Gadget class. More...

#include <ilviews/gadgets/tree.h>

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

Public Member Functions

 IlvTreeGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
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. More...
 
virtual IlBoolean allowDragDrop () const
 Indicates whether drag-and-drop operations are allowed for the tree gadget. More...
 
void allowDragDrop (IlBoolean allow)
 Specifies whether drag-and-drop operations should be allowed for the tree gadget. More...
 
IlBoolean areButtonsVisible () const
 Indicates whether the buttons located to the left of parent items are displayed. More...
 
IlBoolean areLinesVisible () const
 Indicates whether the lines connecting tree items to their parent are visible. More...
 
IlBoolean areRootsLinked () const
 Indicates whether the children of the root item are linked by a connecting line. More...
 
virtual void beginPopulate ()
 Stops all scroll bar computing while populating the tree gadget. More...
 
IlBoolean buttonBBox (IlvTreeGadgetItem *item, IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of the button associated with the specified item. More...
 
virtual void constantItemHeightAssumed (IlBoolean assumed)
 Indicates that all items are assumed to be the same height. More...
 
virtual IlvGadgetItemcreateItem (const char *label, IlvGraphic *g=0, IlvBitmap *bitmap=0, IlvBitmap *sbitmap=0, IlBoolean copy=IlTrue) const
 Returns a new gadget item. More...
 
void deSelectAll (IlBoolean redraw=IlTrue)
 Deselects all the selected items. More...
 
virtual void drawBackground (IlvPort *, const IlvTransformer *, const IlvRegion *) const
 Draws the gadget background. More...
 
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. More...
 
virtual void drawFrame (IlvPort *, const IlvTransformer *, const IlvRegion *) const
 Draws the gadget frame. More...
 
virtual void drawGadgetItem (const IlvGadgetItem *, IlvPort *port, const IlvRect &rect, const IlvTransformer *t, const IlvRegion *clip) const
 Draws a specific gadget item. More...
 
virtual void endPopulate (IlBoolean redraw=IlTrue)
 Launches all scroll bar computing after the populating of tree. gadget. More...
 
void ensureVisible (IlvTreeGadgetItem *item, IlBoolean horizontal=IlTrue, IlBoolean redraw=IlTrue)
 Ensures that the specified tree gadget item is visible. More...
 
void expandItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue, IlBoolean all=IlFalse)
 Expands the specified item so that its children become visible. More...
 
virtual void getButtonSize (const IlvTreeGadgetItem *item, IlvDim &width, IlvDim &height) const
 Returns the size of the button of the specified tree gadget item. More...
 
IlvTreeGadgetItemgetCallbackItem () const
 Returns the item that triggered the callback. More...
 
IlvTreeGadgetItemgetFirstVisibleItem () const
 Returns the first visible item of the tree gadget. More...
 
IlvDim getIndent () const
 Returns the number of pixels that children are indented relative to the parent. More...
 
virtual void getLabelOrientation (IlvOrientation &orientation, IlBoolean &flip) const
 Returns the default orientation of the tree item labels. More...
 
virtual IlvPosition getLabelPosition () const
 Returns the default position of the tree item labels, relative to the picture. More...
 
IlvTreeGadgetItemgetLastFullVisibleItem (const IlvTransformer *t=0) const
 Returns the last visible item that can be seen without scrolling the tree gadget. More...
 
IlvTreeGadgetItemgetLastVisibleItem (const IlvTransformer *t=0) const
 Returns the last visible item of the tree gadget. More...
 
IlBoolean getLinesAtRoot () const
 Indicates whether lines connecting the root item to its children are drawn. More...
 
virtual IlvPalettegetNormalTextPalette () const
 Returns the default palette used to draw an item. More...
 
IlvDim getOffset () const
 Returns the horizontal offset defined for the tree gadget. More...
 
virtual IlvPalettegetOpaquePalette () const
 Returns the opaque palette used to draw opaque items. More...
 
IlvTreeGadgetItemgetRoot () const
 Returns the root item of the tree hierarchy. More...
 
IlvTreeSelectionMode getSelectionMode () const
 Returns the selection mode of the tree gadget. More...
 
virtual IlBoolean handleGadgetEvent (IlvEvent &event)
 Handles the gadget events. More...
 
virtual IlBoolean handleTreeEvent (IlvEvent &event)
 Handles the events occurring to the tree. More...
 
virtual IlBoolean hasToolTips () const
 Indicates whether the tree gadget displays tooltips. More...
 
virtual IlBoolean isConstantItemHeightAssumed () const
 Returns IlTrue when all items are assumed to be the same height. More...
 
virtual IlBoolean isEditable () const
 Indicates whether the tree items can be edited. More...
 
virtual IlBoolean isShowingLabel () const
 Indicates whether the tree item labels are displayed. More...
 
virtual IlBoolean isShowingPicture () const
 Indicates whether the tree item pictures are displayed. More...
 
IlBoolean itemBBox (IlvTreeGadgetItem *item, IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of the specified item. More...
 
void linkRoots (IlBoolean value, IlBoolean redraw=IlTrue)
 Specifies whether the children of the root item should be linked by a connecting line. More...
 
IlvTreeGadgetItempointToItem (const IlvPoint &point, IlBoolean &button, const IlvTransformer *t) const
 Returns the item located at the specified position. More...
 
IlvTreeGadgetItempointToItemLine (const IlvPoint &point, const IlvTransformer *t) const
 Returns the item located at the specified point. More...
 
virtual void recomputeAllItems ()
 Recomputes the size of all the items managed by the holder. More...
 
void removeAllItems (IlBoolean redraw=IlTrue)
 Removes all the items from the tree gadget. More...
 
void removeItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue)
 Removes and destroys the specified item. More...
 
void scrollToItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue)
 Sets the specified item as the first visible item in the tree gadget. More...
 
void selectItem (IlvTreeGadgetItem *item, IlBoolean value, IlBoolean deselectAll=IlTrue, IlBoolean redraw=IlTrue)
 Selects or deselects the specified tree gadget item. More...
 
void setEditable (IlBoolean value=IlTrue)
 Specifies whether the tree gadget should be editable. More...
 
void setIndent (IlvDim indent, IlBoolean redraw=IlTrue)
 Sets the number of pixels that children are indented relative to the parent. More...
 
void setLabelOrientation (IlvOrientation orientation, IlBoolean flip=IlFalse, IlBoolean redraw=IlTrue)
 Sets the default orientation of the tree item labels. More...
 
void setLabelPosition (IlvPosition position, IlBoolean redraw=IlTrue)
 Sets the default position of the tree item labels, relative to the picture. More...
 
void setLinesAtRoot (IlBoolean value, IlBoolean redraw=IlTrue)
 Specifies whether lines connecting the root item to its children should be drawn. More...
 
void setOffset (IlvDim offset, IlBoolean redraw=IlTrue)
 Sets the horizontal offset of the tree gadget. More...
 
void setSelectionMode (IlvTreeSelectionMode mode)
 Specifies the selection mode of the tree gadget. More...
 
void showButtons (IlBoolean value, IlBoolean redraw=IlTrue)
 Shows or hides the buttons appearing to the left of each parent item. More...
 
void showLabel (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue)
 Indicates whether the tree item labels should be shown or hidden. More...
 
void showLines (IlBoolean value, IlBoolean redraw=IlTrue)
 Shows or hides the lines connecting the tree items to their parent. More...
 
void showPicture (IlBoolean value=IlTrue, IlBoolean redraw=IlTrue)
 Specifies whether the tree item pictures should be shown or hidden. More...
 
void shrinkItem (IlvTreeGadgetItem *item, IlBoolean redraw=IlTrue)
 Shrinks the specified item so that its children are no longer visible. More...
 
virtual void sort (IlvTreeGadgetItem *=0, IlUInt levels=(IlUInt)-1, IlvTreeGadgetItemCompareFunction=0)
 Sorts the children of the specified item. More...
 
void useToolTips (IlBoolean value=IlTrue)
 Specifies whether the tree gadget should display tooltips. More...
 
- Public Member Functions inherited from IlvScrolledGadget
 IlvScrolledGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
virtual void adjustScrollBars (IlBoolean redraw=IlFalse)
 Recomputes the scroll bars. More...
 
void computeBBox (IlvRect &ibox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const
 Computes the bounding boxes of the elements that compose the gadget. More...
 
void computeBBox (IlvRect &ibox, IlvRect &vbox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const
 Computes the bounding boxes of the elements that compose the gadget. More...
 
virtual IlvScrollBarcreateScrollBar (const IlvRect &rect, IlvDirection direction, IlUShort thickness, IlvPalette *palette)
 Returns a new instance of the IlvScrollBar class. More...
 
virtual void drawScrollBar (IlvPort *dst, IlvDirection direction, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the specified internal scroll bar. More...
 
void fitToRect (const IlvRect &rect)
 Resizes the object so that the scrollable area fits the specified rectangle. More...
 
IlUShort getBottomMargin () const
 Returns the bottom margin. More...
 
IlvScrollBargetHorizontalScrollBar () const
 Returns a pointer to the internal horizontal scroll bar. More...
 
IlUShort getLeftMargin () const
 Returns the left margin. More...
 
IlUShort getRightMargin () const
 Returns the right margin. More...
 
IlvScrollBargetScrollBar (IlvDirection direction) const
 Returns a pointer to the specified internal scroll bar. More...
 
void getScrollBarShowAsNeeded (IlBoolean &vert, IlBoolean &hor) const
 Returns the scroll bar mode of the internal scroll bars. More...
 
IlUShort getTopMargin () const
 Returns the top margin. More...
 
IlvScrollBargetVerticalScrollBar () const
 Returns a pointer to the internal vertical scroll bar. More...
 
virtual IlBoolean handleScrollBarsEvent (IlvEvent &event)
 Handles the internal scroll bars event. More...
 
void hideScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue)
 Hides the specified internal scroll bar. More...
 
virtual void internalBBox (IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the internal bounding box of the gadget. More...
 
void moveScrollBar (IlvDirection direction, IlvPosition where, IlBoolean redraw=IlTrue)
 Moves the specified internal scroll bar to a new position. More...
 
virtual void scrollableSize (IlvDim &width, IlvDim &height) const
 Returns the size of the scrollable area of the gadget. More...
 
virtual void scrollBarBBox (IlvDirection direction, IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the bounding box of the specified internal scroll bar. More...
 
virtual void scrollBarHasMoved (IlvDirection direction)
 Is called when an internal scroll bar has moved. More...
 
void scrollBarShowAsNeeded (IlBoolean vertical, IlBoolean horizontal, IlBoolean redraw=IlTrue)
 Sets the scroll bar mode of the internal scroll bars. More...
 
virtual void scrollBarVisibilityChanged (IlvDirection direction)
 Is called when an internal scroll bar is shown or hidden. More...
 
void setBottomMargin (IlUShort margin)
 Sets the bottom margin. More...
 
void setLeftMargin (IlUShort margin)
 Sets the left margin. More...
 
void setMargin (IlUShort val)
 Sets the left, right, top, and bottom margins. More...
 
void setRightMargin (IlUShort margin)
 Sets the right margin. More...
 
void setTopMargin (IlUShort margin)
 Sets the top margin. More...
 
void showScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue)
 Shows the specified internal scroll bar. More...
 
virtual void visibleBBox (IlvRect &bbox, const IlvTransformer *t=0) const
 Returns the visible bounding box of the gadget. More...
 
IlvPosition whereIsScrollBar (IlvDirection direction) const
 Returns the location of the specified internal scroll bar. More...
 
- Public Member Functions inherited from IlvTreeGadgetItemHolder
void addItem (IlvTreeGadgetItem *parent, IlvTreeGadgetItem *item, IlInt index=-1)
 Adds the specified item to the tree hierarchy. More...
 
virtual IlvGadgetItemapplyToItems (IlvApplyGadgetItem f, IlAny arg)
 Applies the specified function to all the items of the holder. More...
 
virtual int compareItems (const IlvTreeGadgetItem *item1, const IlvTreeGadgetItem *item2) const
 Compares a pair of items. More...
 
void deSelectAll ()
 Deselects all the selected items. More...
 
void detachItem (IlvTreeGadgetItem *item)
 Removes the specified item from the tree without destroying it. More...
 
IlvTreeGadgetItemgetFirstSelectedItem () const
 Retrieves the first selected item. More...
 
IlUInt getItemsCount () const
 Returns the number of items in the tree. More...
 
IlUInt getVisibleItemsCount () const
 Returns the number of visible tree items. More...
 
void moveItem (IlvTreeGadgetItem *item, IlvTreeGadgetItem *parent, IlInt index=-1)
 Moves the specified item to a new parent. More...
 
void removeItem (IlvTreeGadgetItem *item)
 Removes the specified item from the tree. More...
 
- Public Member Functions inherited from IlvGadgetItemHolder
IlvGadgetItemgetCallbackItem () const
 Returns the item that triggered a callback. More...
 
IlvGadgetItemgetDragDropTarget () const
 Returns the target item of a drag-and-drop operation. More...
 
IlvGraphicgetDraggedImage () const
 Returns the graphic object used to draw the ghost image during a drag-and-drop operation. More...
 
IlvGadgetItemgetDraggedItem () const
 Returns the item that is being dragged during a drag-and-drop operation. More...
 
IlvGadgetItemgetEditedItem () const
 Returns the item that is being edited. More...
 
virtual IlvPalettegetHighlightTextPalette () const
 Returns the highlight palette used to draw the label of highlighted items. More...
 
virtual IlvGadgetItemgetItemByName (const char *name) const
 Returns the item whose name is specified. More...
 
IlvGadgetItemgetToolTipItem () const
 Returns the item that is displaying a tooltip. More...
 
virtual void initReDrawItems ()
 Begins a redraw session. More...
 
virtual void reDrawItems ()
 Ends a redraw session. More...
 
void setDragDropTarget (IlvGadgetItem *item)
 Sets the target item of a drag-and-drop operation. More...
 
void setDraggedImage (IlvGraphic *graphic)
 Sets the graphic object used to draw the ghost image during a drag-and-drop operation. More...
 
void setDraggedItem (IlvGadgetItem *item)
 Sets the dragged item. More...
 

Static Public Member Functions

static IlSymbolExpandCallbackType ()
 Returns the callback type for the Expand callback. More...
 
static IlSymbolSelectCallbackType ()
 Returns the callback type for the Select callback. More...
 
static IlSymbolShrinkCallbackType ()
 Returns the callback type for the Shrink callback. More...
 
- Static Public Member Functions inherited from IlvScrolledGadget
static IlSymbolScrollBarMovedSymbol ()
 Returns the callback type for the Scroll Bar Moved callback. More...
 
static IlSymbolScrollBarVisibilitySymbol ()
 Returns the callback type for the Scroll Bar Visibility Changed callback. More...
 

Protected Member Functions

virtual void activate (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is activated. More...
 
virtual void adjustFromScrollBar (const IlvScrollBar *sb, IlvDirection dir)
 Is called to adjust the gadget to the scroll bars values. More...
 
virtual void adjustScrollBarValue (IlvScrollBar *sb, IlvDirection dir)
 Is called to adjust the scroll bar values. More...
 
virtual void deSelect (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is deselected. More...
 
virtual void drawGadgetContents (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the gadget contents. More...
 
virtual void expand (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is expanded. More...
 
virtual void itemActivated (IlvGadgetItem *item)
 Is called when an item is activated. More...
 
virtual void itemDeSelected (IlvGadgetItem *item)
 Is called when an item is deselected. More...
 
virtual void itemSelected (IlvGadgetItem *item)
 Is called when an item is selected. More...
 
virtual void select (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is selected. More...
 
virtual void shrink (IlvTreeGadgetItem *item)
 Is called by the interactor when an item is shrunk. More...
 
- Protected Member Functions inherited from IlvScrolledGadget
IlvDim getLimitHeightValue () const
 Returns the limit value for the vertical scrolling. More...
 
IlvDim getLimitWidthValue () const
 Returns the limit value for the horizontal scrolling. More...
 
IlvDim getScrollableHeight () const
 Returns the height of the scrollable area. More...
 
IlvDim getScrollableWidth () const
 Returns the width of the scrollable area. More...
 
void setLimitHeightValue (IlvDim value)
 Sets the limit value for the vertical scrolling. More...
 
void setLimitWidthValue (IlvDim value)
 Sets the limit value for the horizontal scrolling. More...
 
void setScrollableHeight (IlvDim height)
 Sets the height of the scrollable area. More...
 
void setScrollableWidth (IlvDim width)
 Sets the width of the scrollable area. More...
 

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.

- 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
displayThe connection to the display.
rectThe size and position of the tree gadget.
thicknessThe thickness of the tree gadget.
paletteThe palette used by the tree gadget.

Member Function Documentation

virtual void IlvTreeGadget::activate ( IlvTreeGadgetItem item)
protectedvirtual

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
itemThe activated item.
See Also
IlvGadgetItemHolder::ActivateCallbackType, IlvGadgetItem::activate
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
parentThe 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.
labelThe label of the new item.
indexThe position where the new item will be added. If index is -1, the item is added at the end of the parent child list.
bitmapThe sensitive bitmap of the new item.
expandedBitmapThe expanded bitmap of the new item.
redrawA 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 
)
protectedvirtual

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
scrollbarThe scroll bar object.
directionThe 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 
)
protectedvirtual

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
scrollbarThe scroll bar object.
directionThe direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical.
See Also
adjustFromScrollBar

Reimplemented from IlvScrolledGadget.

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.

void IlvTreeGadget::allowDragDrop ( IlBoolean  allow)

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

Parameters
valueA Boolean value specifying whether drag-and-drop operations should be allowed (IlTrue).
See Also
IlvGadgetItemHolder::startDragItem, allowDragDrop
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
itemThe tree item.
bboxThe returned bounding box of the button associated with item when the tree is drawn with the transformer t.
tThe 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
assumedIf 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
labelThe item label.
graphicThe IlvGraphic object representing the picture associated with the item.
bitmapThe IlvBitmap object representing the picture associated with the item.
selbitmapThe IlvBitmap object representing the picture of the item when it is selected.
copyA 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)
protectedvirtual

Is called by the interactor when an item is deselected.

The default implementation calls the Select callback.

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

Deselects all the selected items.

Parameters
redrawA 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
dstThe destination drawing port.
tThe transformer applied to the gadget.
clipThe 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
dstThe drawing destination port.
itemThe tree gadget item.
bboxThe rectangle where the button of item should be drawn.
clipThe 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
dstThe destination drawing port.
tThe transformer applied to the gadget.
clipThe 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
protectedvirtual

Draws the gadget contents.

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

Parameters
dstThe destination drawing port.
tThe transformer applied to the gadget.
clipThe 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
itemThe item to be redrawn.
portThe destination drawing port.
rectThe bounding box of the item.
tThe transformer used to draw the item. Not used.
clipThe 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
redrawA 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
itemThe tree gadget item to be made visible.
horizontalA 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.
redrawA Boolean value specifying whether the tree gadget should be redrawn.
See Also
scrollToItem
virtual void IlvTreeGadget::expand ( IlvTreeGadgetItem item)
protectedvirtual

Is called by the interactor when an item is expanded.

The default implementation calls the Expand callback.

Parameters
itemThe 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
itemThe item to be expanded.
redrawA Boolean value specifying whether the tree gadget should be redrawn.
allA 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
itemThe tree gadget item.
widthThe width of the buttons of the tree gadget.
heightThe 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.
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
orientationThe default orientation of the labels.
flipA 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
tThe 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
tThe 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
eventThe 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
eventThe 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)
protectedvirtual

Is called when an item is activated.

The default implementation calls the Activate callback.

Parameters
itemThe 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
itemThe tree item.
bboxThe returned bounding box of item when the tree is drawn with the transformer t.
tThe 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)
protectedvirtual

Is called when an item is deselected.

The default implementation does nothing.

Parameters
itemThe deselected gadget item.
See Also
IlvGadgetItem::deSelect

Reimplemented from IlvGadgetItemHolder.

virtual void IlvTreeGadget::itemSelected ( IlvGadgetItem item)
protectedvirtual

Is called when an item is selected.

The default implementation does nothing.

Parameters
itemThe 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
valueA Boolean value specifying whether the children of the root item should be linked by a connecting line (IlTrue) or not (IlFalse).
redrawA 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
pointThe position of the item to be retrieved.
buttonA Boolean value indicating whether point is located inside the item button.
tThe 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
pointThe position of the item to be retrieved.
tThe 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
redrawA 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
redrawA 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
itemThe new first visible item.
redrawA Boolean value specifying whether the tree gadget should be redrawn.
See Also
getFirstVisibleItem
virtual void IlvTreeGadget::select ( IlvTreeGadgetItem item)
protectedvirtual

Is called by the interactor when an item is selected.

The default implementation calls the Select callback.

Parameters
itemThe 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
itemThe tree gadget item to be selected or deselected.
valueA Boolean value specifying whether item should be selected or deselected.
deselectAllA Boolean value specifying whether all the tree gadget items should be deselected before the selection of item is modified.
redrawA 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
valueA 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
indentThe new indentation value.
redrawA 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
orientationThe new orientation of the labels.
flipA Boolean value specifying whether the labels are flipped or not.
redrawA 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
positionThe new position of the tree item labels, relative to the picture.
redrawA 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
valueA Boolean value specifying whether connecting lines should be drawn between the root item and its children.
redrawA 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
offsetThe new horizontal offset.
redrawA 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
modeThe 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
valueA Boolean value specifying whether the buttons located to the left of each parent item should be shown (IlTrue) or hidden (IlFalse).
redrawA 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
valueA Boolean value specifying whether the tree item labels should be shown (IlTrue) or hidden (IlFalse).
redrawA 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
valueA Boolean value specifying whether the lines connecting the tree items to their parent should be shown (IlTrue).
redrawA 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
valueA Boolean value specifying whether the tree item pictures should be shown (IlTrue) or hidden (IlFalse).
redrawA Boolean value specifying whether the tree gadget should be redrawn.
See Also
isShowingPicture, showLabel
virtual void IlvTreeGadget::shrink ( IlvTreeGadgetItem item)
protectedvirtual

Is called by the interactor when an item is shrunk.

The default implementation calls the Shrink callback.

Parameters
itemThe 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
itemThe item to be shrunk.
redrawA 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
itemThe item whose children are going to be sorted.
levelsAn integer value specifying the depth of the sorting algorithm.
funcA 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
valueA Boolean value specifying whether the tree gadget should display tooltips (IlTrue) or not (IlFalse).
See Also
hasToolTips

© Copyright 2014, 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.