rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvHierarchicalSheet Class Reference

Gadget Class. More...

#include <ilviews/gadgets/hsheet.h>

Inheritance diagram for IlvHierarchicalSheet:
IlvSheet IlvMatrix IlvAbstractMatrix IlvGadgetItemHolder IlvScrolledGadget IlvGadget IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IlvHierarchicalSheet (IlvDisplay *d, const IlvRect &rect, IlUShort nbcol, IlUShort nbrow, IlvDim xgrid=IlvDefaultMatrixWidth, IlvDim ygrid=IlvDefaultMatrixHeight, IlvDim thickness=IlvDefaultGadgetThickness, IlBoolean showVSB=IlTrue, IlBoolean showHSB=IlTrue, IlvPalette *palette=0)
 Constructor.
IlvTreeGadgetItemaddItem (IlvTreeGadgetItem *parent, const char *label, IlInt index=-1, IlvBitmap *bitmap=0, IlvBitmap *selectionBitmap=0)
 Adds an item to the tree hierarchy with the specified label.
void addItem (IlvTreeGadgetItem *parent, IlvTreeGadgetItem *item, IlInt index=-1)
 Adds the specified item to the tree hierarchy.
IlBoolean areLinesVisible () const
 Indicates whether the lines connecting items to their parents are visible.
void expandItem (IlvTreeGadgetItem *item, IlBoolean expandAll=IlFalse)
 Expands the specified tree item to show its child items.
virtual void fitHeightToSize (IlUShort=0)
 Computes a new size for the rows so that they fit the height of the matrix.
IlvDim getIndent () const
 Returns the indentation value applied to the tree hierarchy.
IlUShort getItemRow (IlvTreeGadgetItem *item) const
 Returns the row where the given tree item is located.
IlUInt getItemsCount () const
 Return the total number of IlvTreeGadgetItem objects that the sheet contains.
virtual IlvPalettegetLinkPalette () const
 Returns the palette used to draw the lines connecting items to their parents.
IlvTreeGadgetItemgetRoot () const
 Returns the root item of the tree hierarchy.
virtual IlUShort getTreeColumn () const
 Returns the column in which the tree hierarchy is displayed.
IlvTreeGadgetItemgetTreeItem (IlUShort row) const
 Returns the tree item object located in the specified row.
IlUInt getVisibleItemsCount () const
 Returns the number of visible IlvTreeGadgetItem objects in the sheet.
virtual IlBoolean handleMatrixEvent (IlvEvent &)
 Handles the events sent to the matrix.
virtual IlBoolean handleResizeColumn (IlvEvent &)
 Handles resizing events applying to fixed columns.
virtual void reinitialize (IlUShort c, IlUShort r)
 Resets the matrix dimensions.
void removeAllItems ()
 Removes all the items from the tree hierarchy.
void removeItem (IlvTreeGadgetItem *item, IlBoolean destroy=IlTrue)
 Removes the specified item from the tree.
void removeRow (IlUShort r, IlBoolean destroy=IlTrue)
 Removes a row from the matrix.
void setIndent (IlvDim indent, IlBoolean redraw=IlTrue)
 Sets the indentation value to be applied to the tree hierarchy.
void setLinkPalette (IlvPalette *palette)
 Sets the palette used to draw the lines connecting items to their parents.
void showLines (IlBoolean value, IlBoolean redraw=IlTrue)
 Shows or hides the lines connecting items to their parents.
void shrinkItem (IlvTreeGadgetItem *item)
 Shrinks the specified tree item to hide its child items.

Static Public Member Functions

static IlSymbolExpandCallbackType ()
 Returns the type of the Expand callback.
static IlSymbolShrinkCallbackType ()
 Returns the type of the Shrink callback.

Protected Member Functions

virtual void expand (IlvTreeGadgetItem *item)
 Is called when an item is expanded.
virtual void shrink (IlvTreeGadgetItem *item)
 Is called when an item is shrunk.

Detailed Description

Gadget Class.

Library: ilvadvgdt

The IlvHierarchicalSheet class implements a special sheet that handles a tree hierarchy. The tree is composed of objects of the class IlvTreeGadgetItem, and can be accessed through the same API as the IlvTreeGadget class. By default, the tree hierarchy is drawn in the first column of the sheet, but you can change this setting by overriding the member function getTreeColumn.

IlvHierarchicalSheeta.gif

- IlvHierarchicalSheet -

See also:
IlvSheet, IlvTreeGadget, IlvTreeGadgetItem

Constructor & Destructor Documentation

IlvHierarchicalSheet::IlvHierarchicalSheet ( IlvDisplay d,
const IlvRect rect,
IlUShort  nbcol,
IlUShort  nbrow,
IlvDim  xgrid = IlvDefaultMatrixWidth,
IlvDim  ygrid = IlvDefaultMatrixHeight,
IlvDim  thickness = IlvDefaultGadgetThickness,
IlBoolean  showVSB = IlTrue,
IlBoolean  showHSB = IlTrue,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvHierarchicalSheet class.

Parameters:
display The connection to the display.
rect The size and position of the sheet.
nbcol The number of columns in the sheet.
nbrow The number of rows in the sheet.
xgrid The default cell width.
ygrid The default cell height.
thickness The thickness of the matrix.
showVSB A Boolean value specifying whether the vertical scroll bar should be shown or hidden.
showHSB A Boolean value specifying whether the horizontal scroll bar should be shown or hidden.
palette The palette used by the sheet.

Member Function Documentation

IlvTreeGadgetItem* IlvHierarchicalSheet::addItem ( IlvTreeGadgetItem parent,
const char *  label,
IlInt  index = -1,
IlvBitmap bitmap = 0,
IlvBitmap selectionBitmap = 0 
)

Adds an item to the tree hierarchy with the specified label.

When a tree item is added to the sheet, the associated row is created automatically and the sheet is redrawn.

Parameters:
parent The parent of the added item. If parent is 0 , the new item is added to the root item.
label The label of the item to be added.
index The position where the new item should be added in the list of child items. If index is -1, the item is added at the end of the list.
bitmap The sensitive bitmap associated with the added item. The bitmap is locked.
selectionBitmap The selection bitmap associated with the added item. The bitmap is locked.
Returns:
The created item.
See also:
removeItem, addItem(IlvTreeGadgetItem*, IlvTreeGadgetItem*, IlInt)
void IlvHierarchicalSheet::addItem ( IlvTreeGadgetItem parent,
IlvTreeGadgetItem item,
IlInt  index = -1 
)

Adds the specified item to the tree hierarchy.

When a tree item is added to the sheet, the associated row is automatically created and the sheet is redrawn.

Parameters:
parent The parent of the added item. If parent is 0 , the new item is added to the root item.
item The item to be added.
index The position where the new item should be added in the list of child items. If index is -1, the item is added at the end of the list.
See also:
removeItem, addItem(IlvTreeGadgetItem*, const char*, IlInt, IlvBitmap*, IlvBitmap*)
IlBoolean IlvHierarchicalSheet::areLinesVisible (  )  const

Indicates whether the lines connecting items to their parents are visible.

Returns:
IlTrue if the lines connecting items to their parents are visible and IlFalse otherwise.
See also:
showLines
virtual void IlvHierarchicalSheet::expand ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called when an item is expanded.

The default implementation calls the Expand callback of the item.

Parameters:
item The item that has been expanded.
See also:
ExpandCallbackType, shrink
static IlSymbol* IlvHierarchicalSheet::ExpandCallbackType (  )  [static]

Returns the type of the Expand callback.

The Expand callback is invoked when an item is expanded.

Returns:
The type of the Expand callback.
See also:
ShrinkCallbackType, expand
void IlvHierarchicalSheet::expandItem ( IlvTreeGadgetItem item,
IlBoolean  expandAll = IlFalse 
)

Expands the specified tree item to show its child items.

After item has been expanded, the expand method is called. The sheet is redrawn.

Parameters:
item The item to be expanded.
expandAll A Boolean value specifying whether item should be expanded recursively. In this case, the expand method is called for all the expanded items.
See also:
shrinkItem, expand
virtual void IlvHierarchicalSheet::fitHeightToSize ( IlUShort  row = 0  )  [virtual]

Computes a new size for the rows so that they fit the height of the matrix.

Rows located before the row specified by row are not modified.

Parameters:
row The starting row.
See also:
fitToSize, fitWidthToSize

Reimplemented from IlvMatrix.

IlvDim IlvHierarchicalSheet::getIndent (  )  const

Returns the indentation value applied to the tree hierarchy.

Returns:
The indentation value applied to the tree hierarchy.
See also:
setIndent
IlUShort IlvHierarchicalSheet::getItemRow ( IlvTreeGadgetItem item  )  const

Returns the row where the given tree item is located.

Parameters:
item The tree item.
Returns:
The row where item is located.
IlUInt IlvHierarchicalSheet::getItemsCount (  )  const

Return the total number of IlvTreeGadgetItem objects that the sheet contains.

Returns:
The total number of IlvTreeGadgetItem objects that the sheet contains, not including the root item.
See also:
addItem
virtual IlvPalette* IlvHierarchicalSheet::getLinkPalette (  )  const [virtual]

Returns the palette used to draw the lines connecting items to their parents.

Returns:
The palette used to draw the links connecting items to their parents.
See also:
setLinkPalette
IlvTreeGadgetItem* IlvHierarchicalSheet::getRoot (  )  const

Returns the root item of the tree hierarchy.

This item must never be removed nor deleted.

Returns:
The root item of the tree hierarchy.
virtual IlUShort IlvHierarchicalSheet::getTreeColumn (  )  const [virtual]

Returns the column in which the tree hierarchy is displayed.

The default implementation returns 0. You can override this method if you want to display the tree into another column.

Returns:
The column in which the tree hierarchy is displayed.
IlvTreeGadgetItem* IlvHierarchicalSheet::getTreeItem ( IlUShort  row  )  const

Returns the tree item object located in the specified row.

Parameters:
row The row index.
Returns:
The IlvTreeGadgetItem object associated with row. The method returns 0 if this item is not found.
See also:
getItemRow
IlUInt IlvHierarchicalSheet::getVisibleItemsCount (  )  const

Returns the number of visible IlvTreeGadgetItem objects in the sheet.

Returns:
The number of visible IlvTreeGadgetItem objects in the sheet. An item is visible when all its parents are expanded.
See also:
expandItem, shrinkItem
virtual IlBoolean IlvHierarchicalSheet::handleMatrixEvent ( IlvEvent event  )  [virtual]

Handles the events sent to the matrix.

Is called by the member function handleEvent to handle an event applying to the matrix. Scroll bar events are handled by the method IlvScrolledGadget::handleScrollBarsEvent. The default implementation does nothing and must be redefined if necessary.

Parameters:
event The event.
Returns:
IlTrue if the matrix used the events, or IlFalse otherwise.
See also:
IlvGadget::handleEvent, IlvScrolledGadget::handleScrollBarsEvent

Reimplemented from IlvSheet.

virtual IlBoolean IlvHierarchicalSheet::handleResizeColumn ( IlvEvent event  )  [virtual]

Handles resizing events applying to fixed columns.

Handles the specified event and calls the IlvMatrix::resizeRow member function.

Parameters:
event The event to handle.
See also:
IlvMatrix::resizeRow, handleResizeRow.

Reimplemented from IlvSheet.

virtual void IlvHierarchicalSheet::reinitialize ( IlUShort  cols,
IlUShort  rows 
) [virtual]

Resets the matrix dimensions.

The items that are in the removed columns and rows are destroyed.

Parameters:
cols The new number of columns.
rows The new number of rows.
See also:
removeColumn, removeRow

Reimplemented from IlvMatrix.

void IlvHierarchicalSheet::removeAllItems (  ) 

Removes all the items from the tree hierarchy.

All associated rows are removed from the sheet. The sheet is redrawn.

See also:
removeItem, addItem
void IlvHierarchicalSheet::removeItem ( IlvTreeGadgetItem item,
IlBoolean  destroy = IlTrue 
)

Removes the specified item from the tree.

The corresponding row is also removed from the sheet, which is redrawn.

Parameters:
item The item to be removed.
destroy A Boolean value specifying whether the removed item should be destroyed. The corresponding rows are removed from the sheet. If destroy is omitted or is IlTrue, the removed item is destroyed.
See also:
addItem, removeAllItems
void IlvHierarchicalSheet::removeRow ( IlUShort  row,
IlBoolean  destroy = IlTrue 
) [virtual]

Removes a row from the matrix.

Parameters:
row The index of the row to be removed.
destroy A Boolean value specifying whether the items that this row contains are deleted.
See also:
insertRow, removeColumn

Reimplemented from IlvMatrix.

void IlvHierarchicalSheet::setIndent ( IlvDim  indent,
IlBoolean  redraw = IlTrue 
)

Sets the indentation value to be applied to the tree hierarchy.

Parameters:
indent The indentation value to use.
redraw A Boolean value specifying whether the sheet should be redrawn.
See also:
getIndent
void IlvHierarchicalSheet::setLinkPalette ( IlvPalette palette  ) 

Sets the palette used to draw the lines connecting items to their parents.

Parameters:
palette The palette used to draw the connecting lines. The previous palette is unlocked, and the new one is locked.
See also:
getLinkPalette
void IlvHierarchicalSheet::showLines ( IlBoolean  value,
IlBoolean  redraw = IlTrue 
)

Shows or hides the lines connecting items to their parents.

Parameters:
value A Boolean value specifying whether the lines connecting items to their parent should be shown (IlTrue) or hidden (IlFalse).
redraw A Boolean value specifying whether the sheet should be redrawn.
See also:
areLinesVisible
virtual void IlvHierarchicalSheet::shrink ( IlvTreeGadgetItem item  )  [protected, virtual]

Is called when an item is shrunk.

The default implementation calls the Shrink callback of the item.

Parameters:
item The item that has been shrunk.
See also:
ShrinkCallbackType, expand
static IlSymbol* IlvHierarchicalSheet::ShrinkCallbackType (  )  [static]

Returns the type of the Shrink callback.

The Shrink callback is invoked when an item is shrunk.

Returns:
The type of the Shrink callback.
See also:
ExpandCallbackType, shrink
void IlvHierarchicalSheet::shrinkItem ( IlvTreeGadgetItem item  ) 

Shrinks the specified tree item to hide its child items.

After item has been shrunk, the shrink method is called. The sheet is redrawn.

Parameters:
item The item to be shrunk.
See also:
expandItem, shrink
 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.