Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/scgadget.h>
Public Member Functions | |
IlvScrolledGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
virtual void | adjustScrollBars (IlBoolean redraw=IlFalse) |
Recomputes the scroll bars. | |
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. | |
void | computeBBox (IlvRect &ibox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. | |
virtual IlvScrollBar * | createScrollBar (const IlvRect &rect, IlvDirection direction, IlUShort thickness, IlvPalette *palette) |
Returns a new instance of the IlvScrollBar class. | |
virtual void | drawBackground (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget background. | |
virtual void | drawFrame (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget frame. | |
virtual void | drawGadgetContents (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget contents. | |
virtual void | drawScrollBar (IlvPort *dst, IlvDirection direction, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the specified internal scroll bar. | |
void | fitToRect (const IlvRect &rect) |
Resizes the object so that the scrollable area fits the specified rectangle. | |
IlUShort | getBottomMargin () const |
Returns the bottom margin. | |
IlvScrollBar * | getHorizontalScrollBar () const |
Returns a pointer to the internal horizontal scroll bar. | |
IlUShort | getLeftMargin () const |
Returns the left margin. | |
IlUShort | getRightMargin () const |
Returns the right margin. | |
IlvScrollBar * | getScrollBar (IlvDirection direction) const |
Returns a pointer to the specified internal scroll bar. | |
void | getScrollBarShowAsNeeded (IlBoolean &vert, IlBoolean &hor) const |
Returns the scroll bar mode of the internal scroll bars. | |
IlUShort | getTopMargin () const |
Returns the top margin. | |
IlvScrollBar * | getVerticalScrollBar () const |
Returns a pointer to the internal vertical scroll bar. | |
virtual IlBoolean | handleGadgetEvent (IlvEvent &event) |
Handles the gadget events. | |
virtual IlBoolean | handleScrollBarsEvent (IlvEvent &event) |
Handles the internal scroll bars event. | |
void | hideScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Hides the specified internal scroll bar. | |
virtual void | internalBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the internal bounding box of the gadget. | |
void | moveScrollBar (IlvDirection direction, IlvPosition where, IlBoolean redraw=IlTrue) |
Moves the specified internal scroll bar to a new position. | |
virtual void | scrollableSize (IlvDim &width, IlvDim &height) const |
Returns the size of the scrollable area of the gadget. | |
virtual void | scrollBarBBox (IlvDirection direction, IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the bounding box of the specified internal scroll bar. | |
virtual void | scrollBarHasMoved (IlvDirection direction) |
Is called when an internal scroll bar has moved. | |
void | scrollBarShowAsNeeded (IlBoolean vertical, IlBoolean horizontal, IlBoolean redraw=IlTrue) |
Sets the scroll bar mode of the internal scroll bars. | |
virtual void | scrollBarVisibilityChanged (IlvDirection direction) |
Is called when an internal scroll bar is shown or hidden. | |
void | setBottomMargin (IlUShort margin) |
Sets the bottom margin. | |
void | setLeftMargin (IlUShort margin) |
Sets the left margin. | |
void | setMargin (IlUShort val) |
Sets the left, right, top, and bottom margins. | |
void | setRightMargin (IlUShort margin) |
Sets the right margin. | |
void | setTopMargin (IlUShort margin) |
Sets the top margin. | |
void | showScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Shows the specified internal scroll bar. | |
virtual void | visibleBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the visible bounding box of the gadget. | |
IlvPosition | whereIsScrollBar (IlvDirection direction) const |
Returns the location of the specified internal scroll bar. | |
Static Public Member Functions | |
static IlSymbol * | ScrollBarMovedSymbol () |
Returns the callback type for the Scroll Bar Moved callback. | |
static IlSymbol * | ScrollBarVisibilitySymbol () |
Returns the callback type for the Scroll Bar Visibility Changed callback. | |
Protected Member Functions | |
virtual void | adjustFromScrollBar (const IlvScrollBar *scrollbar, IlvDirection direction) |
Is called to adjust the gadget to the scroll bars values. | |
virtual void | adjustScrollBarValue (IlvScrollBar *scrollbar, IlvDirection direction) |
Is called to adjust the scroll bar values. | |
IlvDim | getLimitHeightValue () const |
Returns the limit value for the vertical scrolling. | |
IlvDim | getLimitWidthValue () const |
Returns the limit value for the horizontal scrolling. | |
IlvDim | getScrollableHeight () const |
Returns the height of the scrollable area. | |
IlvDim | getScrollableWidth () const |
Returns the width of the scrollable area. | |
void | setLimitHeightValue (IlvDim value) |
Sets the limit value for the vertical scrolling. | |
void | setLimitWidthValue (IlvDim value) |
Sets the limit value for the horizontal scrolling. | |
void | setScrollableHeight (IlvDim height) |
Sets the height of the scrollable area. | |
void | setScrollableWidth (IlvDim width) |
Sets the width of the scrollable area. | |
Friends | |
class | IlvDefaultScrolledGadgetLFHandler |
Gadget class.
Library: ilvadvgdt
The IlvScrolledGadget
class is an abstract gadget class that handles scroll bars. It is the base class for the gadgets that have scroll bars.
Examples of subclasses of the IlvScrolledGadget class
IlvScrolledGadget::IlvScrolledGadget | ( | IlvDisplay * | display, | |
const IlvRect & | rect, | |||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Initializes a new instance of the IlvScrolledGadget
class.
display | The connection to the display. | |
rect | The size and position of the gadget. | |
thickness | The thickness of the gadget. | |
palette | The palette used by the gadget. |
virtual void IlvScrolledGadget::adjustFromScrollBar | ( | const IlvScrollBar * | scrollbar, | |
IlvDirection | direction | |||
) | [protected, virtual] |
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 in IlvAbstractMatrix, IlvStringList, IlvText, and IlvTreeGadget.
virtual void IlvScrolledGadget::adjustScrollBars | ( | IlBoolean | redraw = IlFalse |
) | [virtual] |
Recomputes the scroll bars.
Sets the right values to the scroll bars.
redraw | A Boolean value specifying whether the gadget should be redrawn. |
Reimplemented in IlvText.
virtual void IlvScrolledGadget::adjustScrollBarValue | ( | IlvScrollBar * | scrollbar, | |
IlvDirection | direction | |||
) | [protected, virtual] |
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 in IlvAbstractMatrix, IlvStringList, IlvText, and IlvTreeGadget.
void IlvScrolledGadget::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.
ibox | The returned internal bounding box of the gadget. | |
vbox | The returned visible bounding box of the gadget. | |
vs | The returned internal vertical scroll bar bounding box of the gadget. | |
hs | The returned internal horizontal scroll bar bounding box of the gadget. | |
t | The transformer applied to the gadget. |
void IlvScrolledGadget::computeBBox | ( | IlvRect & | ibox, | |
IlvRect & | vs, | |||
IlvRect & | hs, | |||
const IlvTransformer * | t = 0 | |||
) | const |
Computes the bounding boxes of the elements that compose the gadget.
ibox | The returned internal bounding box of the gadget. | |
vs | The returned internal vertical scroll bar bounding box of the gadget. | |
hs | The returned internal horizontal scroll bar bounding box of the gadget. | |
t | The transformer applied to the gadget. |
Reimplemented in IlvSheet.
virtual IlvScrollBar* IlvScrolledGadget::createScrollBar | ( | const IlvRect & | rect, | |
IlvDirection | direction, | |||
IlUShort | thickness, | |||
IlvPalette * | palette | |||
) | [virtual] |
Returns a new instance of the IlvScrollBar
class.
Is called by the member function IlvScrolledGadget::showScrollBar
to create a new scroll bar. If you want to create your own scroll bars, you can override this member function in a subclass.
rect | The bounding box of the scroll bar to be created. | |
direction | The direction of the scroll bar to be created. Valid values are: IlvHorizontal and IlvVertical . | |
thickness | The thickness of the scroll bar to create. | |
palette | The palette of the scroll bar to create. |
Reimplemented in IlvAbstractMatrix.
virtual void IlvScrolledGadget::drawBackground | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [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 IlvGadget.
Reimplemented in IlvMatrix, IlvStringList, IlvText, and IlvTreeGadget.
virtual void IlvScrolledGadget::drawFrame | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [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 IlvGadget.
Reimplemented in IlvMatrix, IlvSheet, IlvStringList, IlvText, and IlvTreeGadget.
virtual void IlvScrolledGadget::drawGadgetContents | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [virtual] |
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 in IlvAbstractMatrix, IlvMatrix, IlvSheet, IlvStringList, IlvText, and IlvTreeGadget.
virtual void IlvScrolledGadget::drawScrollBar | ( | IlvPort * | dst, | |
IlvDirection | direction, | |||
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [virtual] |
Draws the specified internal scroll bar.
dst | The destination drawing port. | |
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . | |
t | The transformer applied to the gadget. | |
clip | The clipping area. |
void IlvScrolledGadget::fitToRect | ( | const IlvRect & | rect | ) |
Resizes the object so that the scrollable area fits the specified rectangle.
rect | The new size of the scrollable area. |
IlUShort IlvScrolledGadget::getBottomMargin | ( | ) | const |
IlvScrollBar* IlvScrolledGadget::getHorizontalScrollBar | ( | ) | const |
Returns a pointer to the internal horizontal scroll bar.
0
if there is no horizontal scroll bar. IlUShort IlvScrolledGadget::getLeftMargin | ( | ) | const |
IlvDim IlvScrolledGadget::getLimitHeightValue | ( | ) | const [protected] |
Returns the limit value for the vertical scrolling.
IlvDim IlvScrolledGadget::getLimitWidthValue | ( | ) | const [protected] |
Returns the limit value for the horizontal scrolling.
IlUShort IlvScrolledGadget::getRightMargin | ( | ) | const |
IlvDim IlvScrolledGadget::getScrollableHeight | ( | ) | const [protected] |
Returns the height of the scrollable area.
IlvDim IlvScrolledGadget::getScrollableWidth | ( | ) | const [protected] |
Returns the width of the scrollable area.
IlvScrollBar* IlvScrolledGadget::getScrollBar | ( | IlvDirection | direction | ) | const |
Returns a pointer to the specified internal scroll bar.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
0
if such a scroll bar does not exist. Returns the scroll bar mode of the internal scroll bars.
vertical | A Boolean value specifying whether the visibility of the internal vertical scroll bar should be managed by the gadget automatically. | |
horizontal | A Boolean value specifying whether the visibility of the internal horizontal scroll bar should be managed by the gadget automatically. |
IlUShort IlvScrolledGadget::getTopMargin | ( | ) | const |
IlvScrollBar* IlvScrolledGadget::getVerticalScrollBar | ( | ) | const |
Returns a pointer to the internal vertical scroll bar.
0
if there is no vertical scroll bar. 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 in IlvAbstractMatrix, IlvStringList, IlvText, and IlvTreeGadget.
Handles the internal scroll bars event.
Is called from the handleEvent
method. You can override this member function to implement your own scroll bar behavior.
event | The event. |
IlFalse
if the event has not been handled by the scroll bars. In this case, handleGadgetEvent
will be called. void IlvScrolledGadget::hideScrollBar | ( | IlvDirection | direction, | |
IlBoolean | redraw = IlTrue | |||
) |
Hides the specified internal scroll bar.
The scroll bar is deleted. Does nothing if the scroll bar mode is "as needed".
direction | The direction for which the scroll bar should be hidden. Valid values are: IlvHorizontal and IlvVertical . | |
redraw | A Boolean value specifying whether the gadget should be redrawn. |
virtual void IlvScrolledGadget::internalBBox | ( | IlvRect & | bbox, | |
const IlvTransformer * | t = 0 | |||
) | const [virtual] |
Returns the internal bounding box of the gadget.
Puts in bbox the internal bounding box of the scrolled gadget computed with the transformer t. The internal bounding box is used to draw the frame and to compute the scrollable area. If you want to change the internal bounding box, you can override this member function in a subclass.
bbox | The returned internal bounding box. | |
t | The transformer applied to the gadget. |
Reimplemented in IlvMatrix.
void IlvScrolledGadget::moveScrollBar | ( | IlvDirection | direction, | |
IlvPosition | where, | |||
IlBoolean | redraw = IlTrue | |||
) |
Moves the specified internal scroll bar to a new position.
direction | The direction for which the scroll bar should be hidden. Valid values are: IlvHorizontal and IlvVertical . | |
where | The new position of the internal scroll bar. Valid values are: IlvLeft and IlvRight for horizontal scroll bars, and IlvTop and IlvBottom for vertical scroll bars. | |
redraw | A Boolean value specifying whether the gadget should be redrawn. |
Returns the size of the scrollable area of the gadget.
Puts the width and height of the scrollable area in width and height, respectively. These values are used to compute the values of the scroll bars. You can override this member function to change the scrollable area.
virtual void IlvScrolledGadget::scrollBarBBox | ( | IlvDirection | direction, | |
IlvRect & | bbox, | |||
const IlvTransformer * | t = 0 | |||
) | const [virtual] |
Returns the bounding box of the specified internal scroll bar.
Puts in bbox the bounding box of the internal scroll bar specified by direction using the transformer t. If you want to change the internal scroll bars bounding box, you can override this member function in a subclass.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . | |
bbox | The returned internal scroll bar bounding box. | |
t | The transformer applied to the gadget. |
Reimplemented in IlvAbstractMatrix.
virtual void IlvScrolledGadget::scrollBarHasMoved | ( | IlvDirection | direction | ) | [virtual] |
Is called when an internal scroll bar has moved.
Is called by handleEvent
each time the value of the internal scroll bar specified by direction changes. The default implementation invokes the Scroll Bar Moved callback.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
Reimplemented in IlvAbstractMatrix, IlvStringList, and IlvText.
static IlSymbol* IlvScrolledGadget::ScrollBarMovedSymbol | ( | ) | [static] |
Returns the callback type for the Scroll Bar Moved callback.
The Scroll Bar Moved callback is invoked each time a scroll bar is moved.
void IlvScrolledGadget::scrollBarShowAsNeeded | ( | IlBoolean | vertical, | |
IlBoolean | horizontal, | |||
IlBoolean | redraw = IlTrue | |||
) |
Sets the scroll bar mode of the internal scroll bars.
The "as needed" scroll bar mode lets the gadget manage the scroll bar visibility by showing or hiding the internal scroll bars when needed.
vertical | A Boolean value specifying whether the visibility of the internal vertical scroll bar should be managed by the gadget automatically. | |
horizontal | A Boolean value specifying whether the visibility of the internal horizontal scroll bar should be managed by the gadget automatically. | |
redraw | A Boolean value specifying whether the gadget should be redrawn. |
virtual void IlvScrolledGadget::scrollBarVisibilityChanged | ( | IlvDirection | direction | ) | [virtual] |
Is called when an internal scroll bar is shown or hidden.
Is called by handleEvent
each time the internal scroll bar specified by direction is shown or hidden. The default implementation invokes the Scroll Bar Visibility Changed callback.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
static IlSymbol* IlvScrolledGadget::ScrollBarVisibilitySymbol | ( | ) | [static] |
Returns the callback type for the Scroll Bar Visibility Changed callback.
The Scroll Bar Visibility Changed callback is invoked each time an internal scroll bar is shown or hidden.
void IlvScrolledGadget::setBottomMargin | ( | IlUShort | margin | ) |
void IlvScrolledGadget::setLeftMargin | ( | IlUShort | margin | ) |
void IlvScrolledGadget::setLimitHeightValue | ( | IlvDim | value | ) | [protected] |
Sets the limit value for the vertical scrolling.
This value is used to compute the maximum value that can have a vertical scroll bar connected to this scrolled gadget.
value | The new limit value for the vertical scrolling. |
void IlvScrolledGadget::setLimitWidthValue | ( | IlvDim | value | ) | [protected] |
Sets the limit value for the horizontal scrolling.
This value is used to compute the maximum value that can have a horizontal scroll bar connected to this scrolled gadget.
value | The new limit value for the horizontal scrolling. |
void IlvScrolledGadget::setMargin | ( | IlUShort | val | ) |
Sets the left, right, top, and bottom margins.
margin | The new margins. |
void IlvScrolledGadget::setRightMargin | ( | IlUShort | margin | ) |
void IlvScrolledGadget::setScrollableHeight | ( | IlvDim | height | ) | [protected] |
Sets the height of the scrollable area.
Call this method each time the height of the scrolled object encapsulated by this scrolled gadget changes.
with | The new scrollable height. |
void IlvScrolledGadget::setScrollableWidth | ( | IlvDim | width | ) | [protected] |
Sets the width of the scrollable area.
Call this method each time the width of the scrolled object encapsulated by this scrolled gadget changes.
with | The new scrollable width. |
void IlvScrolledGadget::setTopMargin | ( | IlUShort | margin | ) |
void IlvScrolledGadget::showScrollBar | ( | IlvDirection | direction, | |
IlBoolean | redraw = IlTrue | |||
) |
Shows the specified internal scroll bar.
Does nothing if the scroll bar mode is "as needed".
direction | The direction for which the scroll bar should be visible. Valid values are: IlvHorizontal and IlvVertical . | |
redraw | A Boolean value specifying whether the gadget should be redrawn. |
virtual void IlvScrolledGadget::visibleBBox | ( | IlvRect & | bbox, | |
const IlvTransformer * | t = 0 | |||
) | const [virtual] |
Returns the visible bounding box of the gadget.
Puts in bbox the visible bounding box of the scrolled gadget computed with the transformer t. The visible bounding box is used to draw the gadget contents. The default implementation computes the internal bounding box and subtracts the margins from it. If you want to change the visible bounding box, you can override this member function in a subclass.
bbox | The returned visible bounding box. | |
t | The transformer applied to the gadget. |
IlvPosition IlvScrolledGadget::whereIsScrollBar | ( | IlvDirection | direction | ) | const |
Returns the location of the specified internal scroll bar.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
© 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.