rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvAbstractBar Class Reference

Gadget class. More...

#include <ilviews/gadgets/absbar.h>

Inheritance diagram for IlvAbstractBar:
IlvAbstractMenu IlvGadget IlvListGadgetItemHolder IlvSimpleGraphic IlvGadgetItemHolder IlvGraphic IlvMenuBar IlvToolBar IlvToolBarPath

List of all members.

Public Member Functions

 IlvAbstractBar (IlvDisplay *display, const IlvRect &rect, IlvMenuItem *items, IlUShort count, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor.
 IlvAbstractBar (IlvDisplay *display, const IlvPoint &point, IlvMenuItem *items, IlUShort count, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor.
 IlvAbstractBar (IlvDisplay *display, const IlvRect &rect, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor.
 IlvAbstractBar (IlvDisplay *display, const IlvPoint &point, const char *const *labels=0, IlUShort count=0, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor.
virtual void drawGadgetItem (const IlvGadgetItem *, IlvPort *port, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws a specific gadget item.
virtual void geometryChanged (const IlvRect &rect)
 Is called when the bar geometry has changed.
void getDefaultItemSize (IlvDim &width, IlvDim &height) const
 Returns the default item size.
virtual IlvDirection getOrientation () const
 Returns the orientation of the bar.
IlvDim getSpacing () const
 Returns the spacing between two items.
virtual void internalBBox (IlvRect &rect, const IlvTransformer *t=0) const
 Returns the internal bounding box of the bar.
IlBoolean isFlushingRight () const
 Indicates whether the bar is flush-right.
virtual void itemBBox (IlUShort item, IlvRect &rect, const IlvTransformer *t=0) const
 Returns the bounding box of a menu item in the menu.
virtual void orientationChanged ()
 Is called when the bar orientation has changed.
virtual void select (IlUShort pos)
 Is called when an item has been selected.
void setConstraintMode (IlBoolean value)
 Sets the constraint mode of the bar.
void setDefaultItemSize (IlvDim width, IlvDim height, IlBoolean redraw=IlTrue)
 Sets the default item size.
void setFlushingRight (IlBoolean value)
 Specifies whether the bar should be flush-right.
void setHeight (IlvDim height)
 Sets the height of the bar.
void setOrientation (IlvDirection orientation)
 Sets the orientation of the bar.
void setSpacing (IlvDim spacing)
 Sets the spacing between two items.
void setWidth (IlvDim width)
 Sets the bar width.
virtual void unSelect (IlUShort pos)
 Is called when an item has been deselected.
IlBoolean useConstraintMode () const
 Indicates whether the bar is in constraint mode.

Static Public Member Functions

static IlSymbolGeometryChangedCallbackType ()
 Returns the callback type for the Geometry Changed callback.
static IlSymbolOrientationChangedCallbackType ()
 Returns the callback type for the Orientation Changed callback.

Detailed Description

Gadget class.

Library: ilvgadgt

IlvAbstractBar is an abstract class used to manage a list of menu items. It lets you choose the bar orientation and force the bar to display all the items it contains. This class is the base class for IlvToolBar and IlvMenuBar.

See also:
IlvMenuBar, IlvToolBar, IlvMenuItem, IlvAbstractBarPane

Constructor & Destructor Documentation

IlvAbstractBar::IlvAbstractBar ( IlvDisplay display,
const IlvPoint point,
const char *const *  labels = 0,
IlUShort  count = 0,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvAbstractBar class.

Parameters:
display The connection to the display.
point The position of the bar.
labels An array containing the item labels.
count The number of elements of the labels array.
thickness The thickness of the bar.
palette The palette used by the bar.
IlvAbstractBar::IlvAbstractBar ( IlvDisplay display,
const IlvRect rect,
const char *const *  labels = 0,
IlUShort  count = 0,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvAbstractBar class.

Parameters:
display The connection to the display.
rect The size and position of the bar.
labels An array containing the item labels.
count The number of elements of the labels array.
thickness The thickness of the bar.
palette The palette used by the bar.
IlvAbstractBar::IlvAbstractBar ( IlvDisplay display,
const IlvPoint point,
IlvMenuItem items,
IlUShort  count,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvAbstractBar class. The items are copied by this constructor.

Parameters:
display The connection to the display.
point The position of the bar.
items An array of menu items.
count The number of elements of the items array.
thickness The thickness of the bar.
palette The palette used by the bar.
IlvAbstractBar::IlvAbstractBar ( IlvDisplay display,
const IlvRect rect,
IlvMenuItem items,
IlUShort  count,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvAbstractBar class. The items are copied by this constructor.

Parameters:
display The connection to the display.
rect The size and position of the bar.
items An array of menu items.
count The number of elements of the items array.
thickness The thickness of the bar.
palette The palette used by the bar.

Member Function Documentation

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

Draws a specific gadget item.

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

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

Reimplemented from IlvGadgetItemHolder.

Reimplemented in IlvMenuBar, and IlvToolBar.

virtual void IlvAbstractBar::geometryChanged ( const IlvRect rect  )  [virtual]

Is called when the bar geometry has changed.

This method is called only if the bar is using the constrained mode The default behavior calls the Geometry Changed Callback.

See also:
IlvGraphic::setCallback, IlvAbstractBar::useConstraintMode IlvAbstractBar::GeometryChangedCallbackType
static IlSymbol* IlvAbstractBar::GeometryChangedCallbackType (  )  [static]

Returns the callback type for the Geometry Changed callback.

The Geometry Changed callback is called when the bar is using the constrained mode, and when resizing it in a given direction also resize it into the orthogonal direction.

See also:
IlvGraphic::setCallback, IlvAbstractBar::geometryChanged, IlvAbstractBar::useConstraintMode
void IlvAbstractBar::getDefaultItemSize ( IlvDim width,
IlvDim height 
) const

Returns the default item size.

Sets width and height to the default item width and item height, if all the items have the same size.

Parameters:
width The default width of the items. If width is 0, the items are using their own width.
height The default height of the items. If height is 0, the items are using their own height.
See also:
setDefaultItemSize
virtual IlvDirection IlvAbstractBar::getOrientation (  )  const [virtual]

Returns the orientation of the bar.

If the orientation of the bar is set to IlvVertical, the items are drawn from top to bottom. If it is set to IlvHorizontal, items are drawn from left to right.

Returns:
The orientation of the bar.
See also:
setOrientation

Implements IlvAbstractMenu.

IlvDim IlvAbstractBar::getSpacing (  )  const

Returns the spacing between two items.

Returns:
The spacing between two items.
See also:
setSpacing
virtual void IlvAbstractBar::internalBBox ( IlvRect rect,
const IlvTransformer t = 0 
) const [virtual]

Returns the internal bounding box of the bar.

Uses rect to return the internal bounding box of the bar when the object is computed with the transformer t. The internal bounding box delimits the area within which the bar items are drawn. You can override this member function in a subclass to change the internal bounding box.

Parameters:
rect The internal bounding box of the bar.
t The transformer used to compute the internal bounding box.

Implements IlvAbstractMenu.

Reimplemented in IlvMenuBar, and IlvToolBar.

IlBoolean IlvAbstractBar::isFlushingRight (  )  const

Indicates whether the bar is flush-right.

Returns:
IlTrue if the last item is flush-right. Otherwise, it returns IlFalse.
See also:
setFlushingRight
virtual void IlvAbstractBar::itemBBox ( IlUShort  index,
IlvRect bbox,
const IlvTransformer t = 0 
) const [virtual]

Returns the bounding box of a menu item in the menu.

Uses bbox to return the bounding box of the item specified by index when the object is displayed with the transformer t.

Parameters:
index The index of the item.
bbox The returned menu item's bounding box.
t The transformer used to compute the item's bounding box.

Implements IlvAbstractMenu.

virtual void IlvAbstractBar::orientationChanged (  )  [virtual]

Is called when the bar orientation has changed.

The default behavior calls the Orientation Changed Callback.

See also:
IlvGraphic::setCallback, IlvAbstractBar::OrientationChangedCallbackType
static IlSymbol* IlvAbstractBar::OrientationChangedCallbackType (  )  [static]

Returns the callback type for the Orientation Changed callback.

The Orientation Changed callback is called when the orientation of the bar has changed.

See also:
IlvGraphic::setCallback, IlvAbstractBar::setOrientation, IlvAbstractBar::orientationChanged
virtual void IlvAbstractBar::select ( IlUShort  pos  )  [virtual]

Is called when an item has been selected.

Parameters:
pos The index of the selected item.
See also:
unSelect

Reimplemented from IlvAbstractMenu.

void IlvAbstractBar::setConstraintMode ( IlBoolean  value  ) 

Sets the constraint mode of the bar.

Sets the bar to use the constraint mode (IlTrue). When the bar uses the constraint mode, it is resized to make visible all the items it contains.

Parameters:
value A Boolean value specifying whether the bar should operate in constraint mode (IlTrue) or not (IlFalse).
See also:
setConstraintMode, setWidth, setHeight
void IlvAbstractBar::setDefaultItemSize ( IlvDim  width,
IlvDim  height,
IlBoolean  redraw = IlTrue 
)

Sets the default item size.

Changes the size of all the items according to the following rules: Sets the item width to width, if width is different from 0. If width equals 0, the items keep their own width. Sets the items height to height, if height is different from 0. If height equals 0, the items keep their own height.

Parameters:
width The new default item width.
height The new default item height.
redraw A Boolean value specifying whether the bar should be redrawn.
See also:
getDefaultItemSize
void IlvAbstractBar::setFlushingRight ( IlBoolean  value  ) 

Specifies whether the bar should be flush-right.

Specifies whether the last item of the menu bar is flush-right. This is meaningful only if the bar is oriented horizontally.

Parameters:
value A Boolean value specifying whether the last item of the bar should be flush-right.
See also:
isFlushingRight
void IlvAbstractBar::setHeight ( IlvDim  height  ) 

Sets the height of the bar.

Changes the bar height to height and computes the new bar width so that all the items are visible. This method is automatically called by the member function IlvGraphic::applyTransform when the bar uses the constraint mode. This applies only to vertical bars.

Parameters:
height The new bar height.
See also:
setWidth, setConstraintMode
void IlvAbstractBar::setOrientation ( IlvDirection  orientation  ) 

Sets the orientation of the bar.

If orientation is different from the previous bar orientation, the orientationChanged method is called.

Parameters:
orientation The new bar orientation. Valid values are: IlvVertical and IlvHorizontal.
See also:
getOrientation
void IlvAbstractBar::setSpacing ( IlvDim  spacing  ) 

Sets the spacing between two items.

Changes the spacing between two items.

Parameters:
spacing The new spacing value.
See also:
getSpacing
void IlvAbstractBar::setWidth ( IlvDim  width  ) 

Sets the bar width.

Changes the bar width to width and computes the new bar height so that all the items are visible. This method is automatically called by the member function IlvGraphic::applyTransform when the bar uses the constraint mode. This applies only to horizontal bars.

Parameters:
width The new bar width.
See also:
setHeight, setConstraintMode
virtual void IlvAbstractBar::unSelect ( IlUShort  pos  )  [virtual]

Is called when an item has been deselected.

Parameters:
pos The index of the unselected item.
See also:
select

Reimplemented from IlvAbstractMenu.

IlBoolean IlvAbstractBar::useConstraintMode (  )  const

Indicates whether the bar is in constraint mode.

Returns:
IlTrue if the bar is in constraint mode and IlFalse otherwise.
See also:
setConstraintMode, setWidth, setHeight
 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.