Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/tree.h>
Public Member Functions | |
IlvTreeGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvTreeGadgetItem * | 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. 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 IlvGadgetItem * | createItem (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... | |
IlvTreeGadgetItem * | getCallbackItem () const |
Returns the item that triggered the callback. More... | |
IlvTreeGadgetItem * | getFirstVisibleItem () 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... | |
IlvTreeGadgetItem * | getLastFullVisibleItem (const IlvTransformer *t=0) const |
Returns the last visible item that can be seen without scrolling the tree gadget. More... | |
IlvTreeGadgetItem * | getLastVisibleItem (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 IlvPalette * | getNormalTextPalette () 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 IlvPalette * | getOpaquePalette () const |
Returns the opaque palette used to draw opaque items. More... | |
IlvTreeGadgetItem * | getRoot () 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... | |
IlvTreeGadgetItem * | pointToItem (const IlvPoint &point, IlBoolean &button, const IlvTransformer *t) const |
Returns the item located at the specified position. More... | |
IlvTreeGadgetItem * | pointToItemLine (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 IlvScrollBar * | createScrollBar (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... | |
IlvScrollBar * | getHorizontalScrollBar () 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... | |
IlvScrollBar * | getScrollBar (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... | |
IlvScrollBar * | getVerticalScrollBar () 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 IlvGadgetItem * | applyToItems (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... | |
IlvTreeGadgetItem * | getFirstSelectedItem () 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 | |
IlvGadgetItem * | getCallbackItem () const |
Returns the item that triggered a callback. More... | |
IlvGadgetItem * | getDragDropTarget () const |
Returns the target item of a drag-and-drop operation. More... | |
IlvGraphic * | getDraggedImage () const |
Returns the graphic object used to draw the ghost image during a drag-and-drop operation. More... | |
IlvGadgetItem * | getDraggedItem () const |
Returns the item that is being dragged during a drag-and-drop operation. More... | |
IlvGadgetItem * | getEditedItem () const |
Returns the item that is being edited. More... | |
virtual IlvPalette * | getHighlightTextPalette () const |
Returns the highlight palette used to draw the label of highlighted items. More... | |
virtual IlvGadgetItem * | getItemByName (const char *name) const |
Returns the item whose name is specified. More... | |
IlvGadgetItem * | getToolTipItem () 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 IlSymbol * | ExpandCallbackType () |
Returns the callback type for the Expand callback. More... | |
static IlSymbol * | SelectCallbackType () |
Returns the callback type for the Select callback. More... | |
static IlSymbol * | ShrinkCallbackType () |
Returns the callback type for the Shrink callback. More... | |
Static Public Member Functions inherited from IlvScrolledGadget | |
static IlSymbol * | ScrollBarMovedSymbol () |
Returns the callback type for the Scroll Bar Moved callback. More... | |
static IlSymbol * | ScrollBarVisibilitySymbol () |
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 |
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 -
IlvTreeGadgetItem
, IlvHierarchicalSheet
. IlvTreeGadget::IlvTreeGadget | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the class IlvTreeGadget
.
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. |
|
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.
item | The activated item. |
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.
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. |
|
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.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
Reimplemented from IlvScrolledGadget.
|
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.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
Reimplemented from IlvScrolledGadget.
|
virtual |
Indicates whether drag-and-drop operations are allowed for the tree gadget.
IlTrue
if drag-and-drop operations are allowed and IlFalse
otherwise. Reimplemented from IlvGadgetItemHolder.
void IlvTreeGadget::allowDragDrop | ( | IlBoolean | allow | ) |
Specifies whether drag-and-drop operations should be allowed for the tree gadget.
value | A Boolean value specifying whether drag-and-drop operations should be allowed (IlTrue ). |
IlBoolean IlvTreeGadget::areButtonsVisible | ( | ) | const |
Indicates whether the buttons located to the left of parent items are displayed.
IlTrue
if the buttons to the left of parent items are displayed. showButtons
IlBoolean IlvTreeGadget::areLinesVisible | ( | ) | const |
Indicates whether the lines connecting tree items to their parent are visible.
IlTrue
if the lines connecting tree items to their parent are visible. showLines
IlBoolean IlvTreeGadget::areRootsLinked | ( | ) | const |
Indicates whether the children of the root item are linked by a connecting line.
IlTrue
if the children of the root item are linked by a connecting line. linkRoots
|
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.
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. |
IlFalse
is returned, the value in bbox is not relevant.
|
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.
assumed | If IlTrue , item height is not checked by the tree gadget instance. The default value is IlFalse . |
|
virtual |
Returns a new gadget item.
You can override this member function in a subclass to create your own items.
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 |
[note] If both the second and third parameters are not null, only the second parameter is used.
The created gadget item.
Reimplemented from IlvTreeGadgetItemHolder.
Reimplemented in IlvFileChooserTree.
|
protectedvirtual |
Is called by the interactor when an item is deselected.
The default implementation calls the Select callback.
item | The deselected item. |
SelectCallbackType
Deselects all the selected items.
redraw | A Boolean value specifying whether the tree gadget should be redrawn. |
|
virtual |
Draws the gadget background.
Is called from the draw
method. This method is not called if the gadget is transparent.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
Reimplemented from IlvScrolledGadget.
|
virtual |
Is called to draw the button of the specified item.
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. |
buttonBBox
|
virtual |
Draws the gadget frame.
Is called from the draw
method. This method is not called if the method IlvScrolledGadget::isShowingFrame
returns IlFalse
.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
Reimplemented from IlvScrolledGadget.
|
protectedvirtual |
Draws the gadget contents.
Is called from the draw
method. The default implementation does nothing.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
Reimplemented from IlvScrolledGadget.
|
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.
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. |
IlvGadgetItem::draw
. Reimplemented from IlvGadgetItemHolder.
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.
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.
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. |
scrollToItem
|
protectedvirtual |
Is called by the interactor when an item is expanded.
The default implementation calls the Expand callback.
item | The expanded item. |
ExpandCallbackType
, expandItem
|
static |
Returns the callback type for the Expand callback.
The Expand callback is called when an item is expanded.
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.
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 ). |
IlvTreeGadgetItem::expand
|
virtual |
Returns the size of the button of the specified tree gadget item.
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. |
drawButton
, buttonBBox
IlvTreeGadgetItem* IlvTreeGadget::getCallbackItem | ( | ) | const |
Returns the item that triggered the callback.
IlvTreeGadgetItem* IlvTreeGadget::getFirstVisibleItem | ( | ) | const |
Returns the first visible item of the tree gadget.
|
virtual |
Returns the number of pixels that children are indented relative to the parent.
setIndent
Implements IlvTreeGadgetItemHolder.
|
virtual |
Returns the default orientation of the tree item labels.
orientation | The default orientation of the labels. |
flip | A Boolean value indicating whether the labels should be flipped or not. |
setLabelOrientation
Reimplemented from IlvGadgetItemHolder.
|
virtual |
Returns the default position of the tree item labels, relative to the picture.
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.
t | The transformer applied to the tree gadget. |
getFirstVisibleItem
, getLastVisibleItem
IlvTreeGadgetItem* IlvTreeGadget::getLastVisibleItem | ( | const IlvTransformer * | t = 0 | ) | const |
Returns the last visible item of the tree gadget.
t | The transformer applied to the tree gadget. |
IlBoolean IlvTreeGadget::getLinesAtRoot | ( | ) | const |
Indicates whether lines connecting the root item to its children are drawn.
IlTrue
if lines connecting the root item to its children are drawn. setLinesAtRoot
|
virtual |
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.
setOffset
|
virtual |
Returns the opaque palette used to draw opaque items.
Reimplemented from IlvGadgetItemHolder.
|
virtual |
Returns the root item of the tree hierarchy.
addItem
, removeItem
, detachItem
. Implements IlvTreeGadgetItemHolder.
IlvTreeSelectionMode IlvTreeGadget::getSelectionMode | ( | ) | const |
Returns the selection mode of the tree gadget.
IlvTreeExtendedSelection
or IlvTreeSingleSelection
. setSelectionMode
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.
event | The event. |
Reimplemented from IlvScrolledGadget.
Handles the events occurring to the tree.
You can override this member function to implement a new behavior for the tree gadget.
event | The event to be handled. |
|
virtual |
Indicates whether the tree gadget displays tooltips.
IlTrue
if the tree gadget displays tooltips. Otherwise, returns IlFalse
. useToolTips
Reimplemented from IlvGadgetItemHolder.
|
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.
IlTrue
when all items are assumed to be the same height. The default value is IlFalse
.
|
virtual |
Indicates whether the tree items can be edited.
IlTrue
if the tree gadget can be edited. Otherwise, returns IlFalse
. setEditable
, IlvGadgetItem::isEditable
Reimplemented from IlvGadgetItemHolder.
|
virtual |
Indicates whether the tree item labels are displayed.
IlTrue
if the tree item labels are displayed. Otherwise, returns IlFalse
. showLabel
, isShowingPicture
Reimplemented from IlvGadgetItemHolder.
|
virtual |
Indicates whether the tree item pictures are displayed.
IlTrue
if the tree item pictures are displayed. Otherwise, returns IlFalse
. showPicture
, isShowingLabel
Reimplemented from IlvGadgetItemHolder.
|
protectedvirtual |
Is called when an item is activated.
The default implementation calls the Activate callback.
item | The activated gadget item. |
Reimplemented from IlvGadgetItemHolder.
IlBoolean IlvTreeGadget::itemBBox | ( | IlvTreeGadgetItem * | item, |
IlvRect & | bbox, | ||
const IlvTransformer * | t = 0 |
||
) | const |
Returns the bounding box of the specified item.
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. |
IlFalse
is returned, the value in bbox is not relevant.
|
protectedvirtual |
Is called when an item is deselected.
The default implementation does nothing.
item | The deselected gadget item. |
Reimplemented from IlvGadgetItemHolder.
|
protectedvirtual |
Is called when an item is selected.
The default implementation does nothing.
item | The selected gadget item. |
Reimplemented from IlvGadgetItemHolder.
Specifies whether the children of the root item should be linked by a connecting line.
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. |
areRootsLinked
IlvTreeGadgetItem* IlvTreeGadget::pointToItem | ( | const IlvPoint & | point, |
IlBoolean & | button, | ||
const IlvTransformer * | t | ||
) | const |
Returns the item located at the specified position.
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. |
0
if there is no item. 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.
point | The position of the item to be retrieved. |
t | The transformer applied to the tree gadget. |
pointToItem
|
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.
IlvGadgetItem::recomputeSize
, applyToItems
. Reimplemented from IlvGadgetItemHolder.
Removes all the items from the tree gadget.
The root item is never deleted.
redraw | A Boolean value specifying whether the tree gadget should be redrawn. |
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.
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.
item | The new first visible item. |
redraw | A Boolean value specifying whether the tree gadget should be redrawn. |
getFirstVisibleItem
|
protectedvirtual |
Is called by the interactor when an item is selected.
The default implementation calls the Select callback.
item | The selected item. |
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
.
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.
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. |
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.
value | A Boolean value specifying whether the tree gadget can be edited (IlTrue ) or not (IlFalse ). |
isEditable
, IlvGadgetItem::setEditable
Sets the number of pixels that children are indented relative to the parent.
indent | The new indentation value. |
redraw | A Boolean value specifying whether the tree gadget should be redrawn. |
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
.
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. |
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
.
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. |
Specifies whether lines connecting the root item to its children should be drawn.
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. |
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.
offset | The new horizontal offset. |
redraw | A Boolean value specifying whether the tree gadget should be redrawn. |
getOffset
void IlvTreeGadget::setSelectionMode | ( | IlvTreeSelectionMode | mode | ) |
Specifies the selection mode of the tree gadget.
mode | The new selection mode. Valid values are: IlvTreeExtendedSelection for the multiple selection mode, or IlvTreeSingleSelection for the single selection mode. |
getSelectionMode
Shows or hides the buttons appearing to the left of each parent item.
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. |
areButtonsVisible
Indicates whether the tree item labels should be shown or hidden.
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. |
isShowingLabel
, showPicture
Shows or hides the lines connecting the tree items to their parent.
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. |
areLinesVisible
Specifies whether the tree item pictures should be shown or hidden.
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. |
isShowingPicture
, showLabel
|
protectedvirtual |
Is called by the interactor when an item is shrunk.
The default implementation calls the Shrink callback.
item | The shrunk item. |
ShrinkCallbackType
, shrinkItem
|
static |
Returns the callback type for the Shrink callback.
The Shrink callback is called when an item is shrunk.
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.
item | The item to be shrunk. |
redraw | A Boolean value specifying whether the tree gadget should be redrawn. |
IlvTreeGadgetItem::shrink
|
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.
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. |
Reimplemented from IlvTreeGadgetItemHolder.
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.
value | A Boolean value specifying whether the tree gadget should display tooltips (IlTrue ) or not (IlFalse ). |
hasToolTips
© 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.