Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget Class. More...
#include <ilviews/gadgets/hsheet.h>
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. | |
IlvTreeGadgetItem * | 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. | |
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 IlvPalette * | getLinkPalette () const |
Returns the palette used to draw the lines connecting items to their parents. | |
IlvTreeGadgetItem * | getRoot () const |
Returns the root item of the tree hierarchy. | |
virtual IlUShort | getTreeColumn () const |
Returns the column in which the tree hierarchy is displayed. | |
IlvTreeGadgetItem * | getTreeItem (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 IlSymbol * | ExpandCallbackType () |
Returns the type of the Expand callback. | |
static IlSymbol * | ShrinkCallbackType () |
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. |
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
.
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.
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. |
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.
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. |
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.
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. |
IlBoolean IlvHierarchicalSheet::areLinesVisible | ( | ) | const |
Indicates whether the lines connecting items to their parents are visible.
IlTrue
if the lines connecting items to their parents are visible and IlFalse
otherwise. 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.
item | The item that has been expanded. |
static IlSymbol* IlvHierarchicalSheet::ExpandCallbackType | ( | ) | [static] |
Returns the type of the Expand callback.
The Expand callback is invoked when an item is expanded.
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.
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. |
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.
row | The starting row. |
fitToSize
, fitWidthToSize
Reimplemented from IlvMatrix.
IlvDim IlvHierarchicalSheet::getIndent | ( | ) | const |
Returns the indentation value applied to the tree hierarchy.
IlUShort IlvHierarchicalSheet::getItemRow | ( | IlvTreeGadgetItem * | item | ) | const |
Returns the row where the given tree item is located.
item | The tree item. |
IlUInt IlvHierarchicalSheet::getItemsCount | ( | ) | const |
Return the total number of IlvTreeGadgetItem
objects that the sheet contains.
IlvTreeGadgetItem
objects that the sheet contains, not including the root item. virtual IlvPalette* IlvHierarchicalSheet::getLinkPalette | ( | ) | const [virtual] |
Returns the palette used to draw the lines connecting items to their parents.
IlvTreeGadgetItem* IlvHierarchicalSheet::getRoot | ( | ) | const |
Returns the root item of the tree hierarchy.
This item must never be removed nor deleted.
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.
IlvTreeGadgetItem* IlvHierarchicalSheet::getTreeItem | ( | IlUShort | row | ) | const |
Returns the tree item object located in the specified row.
row | The row index. |
IlvTreeGadgetItem
object associated with row. The method returns 0
if this item is not found. IlUInt IlvHierarchicalSheet::getVisibleItemsCount | ( | ) | const |
Returns the number of visible IlvTreeGadgetItem
objects in the sheet.
IlvTreeGadgetItem
objects in the sheet. An item is visible when all its parents are expanded. 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.
event | The event. |
IlTrue
if the matrix used the events, or IlFalse
otherwise. Reimplemented from IlvSheet.
Handles resizing events applying to fixed columns.
Handles the specified event and calls the IlvMatrix::resizeRow
member function.
event | The event to handle. |
IlvMatrix::resizeRow
, handleResizeRow
. Reimplemented from IlvSheet.
Resets the matrix dimensions.
The items that are in the removed columns and rows are destroyed.
cols | The new number of columns. | |
rows | The new number of rows. |
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.
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.
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. |
Removes a row from the matrix.
row | The index of the row to be removed. | |
destroy | A Boolean value specifying whether the items that this row contains are deleted. |
insertRow
, removeColumn
Reimplemented from IlvMatrix.
Sets the indentation value to be applied to the tree hierarchy.
indent | The indentation value to use. | |
redraw | A Boolean value specifying whether the sheet should be redrawn. |
void IlvHierarchicalSheet::setLinkPalette | ( | IlvPalette * | palette | ) |
Sets the palette used to draw the lines connecting items to their parents.
palette | The palette used to draw the connecting lines. The previous palette is unlocked, and the new one is locked. |
Shows or hides the lines connecting items to their parents.
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. |
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.
item | The item that has been shrunk. |
static IlSymbol* IlvHierarchicalSheet::ShrinkCallbackType | ( | ) | [static] |
Returns the type of the Shrink callback.
The Shrink callback is invoked when an item is shrunk.
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.
item | The item to be shrunk. |
© 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.