Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvToolTip Class Reference

Named Property class. More...

#include <ilviews/graphics/tooltip.h>

Inheritance diagram for IlvToolTip:
IlvNamedProperty IlvValueInterface

Public Member Functions

 IlvToolTip (const char *label, IlvPalette *palette=0, IlUShort xMargin=4, IlUShort yMargin=4, IlvAlignment alignment=IlvLeft)
 Constructor. More...
 
virtual void abort (const IlvView *view, const IlvGraphic *graphic)
 Is called when the pointing device leaves the object associated with the tooltip. More...
 
virtual void boundingBox (IlvRect &bbox, IlvDisplay *display=0) const
 Returns the bounding box of the tooltip. More...
 
virtual void draw (IlvPort *dst, const IlvRect &bbox, const IlvRegion *clip) const
 Is called to draw the tooltip. More...
 
IlvAlignment getAlignment () const
 Returns the label alignment of this tooltip if it extends over multiple lines. More...
 
const char * getLabel () const
 Returns the label displayed by this tooltip. More...
 
IlvPalettegetPalette () const
 Returns the palette used by this tooltip. More...
 
IlUShort getXMargin () const
 Retrieves the horizontal margin of the text. More...
 
IlUShort getYMargin () const
 Retrieves the vertical margin of the text. More...
 
virtual void init (const IlvView *view, const IlvGraphic *graphic, const IlvPoint &point)
 Is called when the user places the mouse over the graphic object associated with the tooltip. More...
 
virtual void reInit (const IlvView *view, const IlvGraphic *graphic, const IlvPoint &point)
 Is called when the user moves the mouse over the graphic object associated with the tooltip. More...
 
void setAlignment (IlvAlignment alignment)
 Sets the label alignment of this tooltip if it extends over multiple lines. More...
 
void setBackground (IlvColor *color)
 Sets the background color to be applied to this tooltip. More...
 
void setForeground (IlvColor *color)
 Sets the foreground color to be applied to this tooltip. More...
 
void setLabel (const char *label)
 Sets the labels displayed by this tooltip. More...
 
void setPalette (IlvPalette *palette)
 Sets the palette to be used by this tooltip. More...
 
void setXMargin (IlUShort xMargin)
 Sets the horizontal margin of the text. More...
 
void setYMargin (IlUShort yMargin)
 Sets the vertical margin of the text. More...
 
virtual void show (IlvView *view, IlvRect &bbox)
 Is called when this tooltip is about to be displayed. More...
 
- Public Member Functions inherited from IlvNamedProperty
 IlvNamedProperty (IlSymbol *)
 Constructor. More...
 
 IlvNamedProperty (const IlvNamedProperty &source)
 Constructor. More...
 
IlvNamedPropertycopy () const =0
 Copies the property. More...
 
const char * getName () const
 Gets the name of the property. More...
 
IlSymbolgetSymbol () const
 Gets the name of the property. More...
 
virtual IlBoolean isPersistent () const
 Specifies whether the property must save itself. More...
 
void write (IlvOutputFile &stream) const =0
 Saves the description of the property. More...
 
- Public Member Functions inherited from IlvValueInterface
virtual IlBoolean applyValue (const IlvValue &value)
 Apply an accessor. More...
 
virtual IlBoolean changeValue (const IlvValue &val)
 Changes the value of an accessor. More...
 
virtual IlBoolean changeValues (const IlvValue *values, IlUShort count=0)
 Changes several accessor values simultaneously. More...
 
virtual void getAccessors (const IlSymbol *const **names, const IlvValueTypeClass *const **types, IlUInt &count) const
 Retrieves the list of available accessors of an object. More...
 
virtual IlvValuequeryValue (IlvValue &val) const
 Retrieves an accessor value. More...
 
virtual void queryValues (IlvValue *values, IlUShort count) const
 Retrieves multiple accessor values simultaneously. More...
 

Static Public Member Functions

static void Enable (IlBoolean value)
 Enables or disables the tooltip feature. More...
 
static IlvPos GetHorizontalOffset ()
 Returns the horizontal offset set for the tooltip window. More...
 
static IlvPaletteGetPalette (const IlvToolTip *, IlvDisplay *)
 Returns the palette associated with the tooltip. More...
 
static IlUInt GetTimerPeriod ()
 Returns the period of time in milliseconds that elapses before a tooltip is displayed. More...
 
static IlUInt GetTimerVisibilityPeriod ()
 Returns the period of time in milliseconds that a tooltip is displayed. More...
 
static IlvToolTipGetToolTip (const IlvGraphic *obj)
 Returns the tooltip instance associated with the specified object. More...
 
static IlvPos GetVerticalOffset ()
 Returns the vertical offset set for the tooltip window. More...
 
static IlBoolean IsEnabled ()
 Indicates whether tooltips are enabled. More...
 
static void SetHorizontalOffset (IlvPos offset)
 Sets the horizontal offset of the tooltip window. More...
 
static void SetTimerPeriod (IlUInt period)
 Sets the period of time in milliseconds that elapses before a tooltip is displayed. More...
 
static void SetTimerVisibilityPeriod (IlUInt period)
 Sets the period of time in milliseconds that a tooltip is displayed. More...
 
static void SetVerticalOffset (IlvPos offset)
 Sets the vertical offset of the tooltip window. More...
 

Additional Inherited Members

- Public Attributes inherited from IlvNamedProperty
IlvNamedProperty *IlvInputFilestream
 Reads an instance of the property class. More...
 

Detailed Description

Named Property class.

Library: views

The class IlvToolTip defines tooltips. A tooltip is a short explanatory text that is displayed in a small window when the user leaves the mouse for a short while over a GUI component. Only objects stored in a gadget container or in gadget manager display tooltips. If you want to have tooltips in an another kind of object, see the IlvToolTipHandler class.

See also
IlvGadgetContainer, IlvGadgetManager, IlvToolTipHandler.

Accessors

Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue(), IlvValueInterface::queryValues(), IlvValueInterface::changeValue(), IlvValueInterface::changeValues(). This class inherits the accessors of its superclass IlvNamedProperty and adds the following ones:

Name Type Equivalent methods
label String getLabel(), setLabel()
alignment Direction getAlignment(), setAlignment()

Constructor & Destructor Documentation

§ IlvToolTip()

IlvToolTip::IlvToolTip ( const char *  label,
IlvPalette palette = 0,
IlUShort  xMargin = 4,
IlUShort  yMargin = 4,
IlvAlignment  alignment = IlvLeft 
)

Constructor.

Initializes a new instance of the class IlvToopTip that displays a text with the provided graphic attributes and the specified margins.

Parameters
labelThe text that the tooltip displays. This text can extend over several lines separated by the '
' character. This label is copied.
paletteThe palette used to display by the tooltip. If this parameter is omitted or set to 0, the default tooltip palette is used.
xMarginThe horizontal margin of the text.
yMarginThe vertical margin of the text.
alignmentThe label alignment.
See also
setAlignment(), getAlignment().

Member Function Documentation

§ abort()

virtual void IlvToolTip::abort ( const IlvView view,
const IlvGraphic graphic 
)
virtual

Is called when the pointing device leaves the object associated with the tooltip.

Is called to indicate that the tooltip should be hidden.

Parameters
viewThe view in which the object is displayed.
graphicA pointer to the object that owns the tooltip.
See also
init(), reInit().

§ boundingBox()

virtual void IlvToolTip::boundingBox ( IlvRect bbox,
IlvDisplay display = 0 
) const
virtual

Returns the bounding box of the tooltip.

You can override this member function to give a specific size to the tooltip.

Parameters
bboxThe returned bounding box.
displayThe connection to the display. You can use this tooltip to provide a palette to the tooltip if it has no associated palette.
See also
draw().

§ draw()

virtual void IlvToolTip::draw ( IlvPort dst,
const IlvRect bbox,
const IlvRegion clip 
) const
virtual

Is called to draw the tooltip.

You can override this member function to display images more elaborate than simple text lines.

Parameters
dstThe destination drawing port.
bboxThe bounding box of the tooltip.
clipThe clipping region.
See also
boundingBox().

§ Enable()

static void IlvToolTip::Enable ( IlBoolean  value)
static

Enables or disables the tooltip feature.

Parameters
valueA Boolean value specifying whether tooltips should be enables (IlTrue) or not (IlFalse). When value is set to IlFalse, tooltips are not displayed.
See also
IsEnabled().

§ getAlignment()

IlvAlignment IlvToolTip::getAlignment ( ) const

Returns the label alignment of this tooltip if it extends over multiple lines.

Returns
The label alignment used by this tooltip.
See also
setAlignment().

§ GetHorizontalOffset()

static IlvPos IlvToolTip::GetHorizontalOffset ( )
static

Returns the horizontal offset set for the tooltip window.

The default value is 0. This value aligns the x coordinate of the pointing device with the center of the tooltip window.

Returns
The horizontal offset set for the tooltip window.
See also
SetHorizontalOffset().

§ getLabel()

const char* IlvToolTip::getLabel ( ) const

Returns the label displayed by this tooltip.

Returns
The label displayed by this tooltip. The returned string should not be deleted or modified by the user.
See also
setLabel().

§ getPalette()

IlvPalette* IlvToolTip::getPalette ( ) const

Returns the palette used by this tooltip.

Returns
The palette used by this tooltip or 0 if no palette has been set with the method IlvToolTip::setPalette().
See also
setPalette().

§ GetPalette()

static IlvPalette* IlvToolTip::GetPalette ( const IlvToolTip ,
IlvDisplay  
)
static

Returns the palette associated with the tooltip.

If the palette has no associated palette, it returns the default tooltip palette.

Returns
Returns the palette associated with the tooltip.
See also
Enable().

§ GetTimerPeriod()

static IlUInt IlvToolTip::GetTimerPeriod ( )
static

Returns the period of time in milliseconds that elapses before a tooltip is displayed.

Returns
The period of time in milliseconds that elapses between the moment when the mouse enters an object and its associated tooltip is displayed. The default value is 500 ms.
See also
SetTimerPeriod().

§ GetTimerVisibilityPeriod()

static IlUInt IlvToolTip::GetTimerVisibilityPeriod ( )
static

Returns the period of time in milliseconds that a tooltip is displayed.

Returns
The period of time in milliseconds that a tooltip tooltip is displayed. The default value is 6000 ms.
See also
SetTimerVisibilityPeriod().

§ GetToolTip()

static IlvToolTip* IlvToolTip::GetToolTip ( const IlvGraphic obj)
static

Returns the tooltip instance associated with the specified object.

Returns
The tooltip instance associated with the specified object, or 0 if there is none.

§ GetVerticalOffset()

static IlvPos IlvToolTip::GetVerticalOffset ( )
static

Returns the vertical offset set for the tooltip window.

The default value is 20. This value sets the top coordinate of the tooltip window 20 pixels below the pointing device location.

Returns
The vertical offset set for the tooltip window.
See also
SetVerticalOffset().

§ getXMargin()

IlUShort IlvToolTip::getXMargin ( ) const

Retrieves the horizontal margin of the text.

Returns
The horizontal margin of the text.
See also
setXMargin().

§ getYMargin()

IlUShort IlvToolTip::getYMargin ( ) const

Retrieves the vertical margin of the text.

Returns
The vertical margin of the text.
See also
setYMargin().

§ init()

virtual void IlvToolTip::init ( const IlvView view,
const IlvGraphic graphic,
const IlvPoint point 
)
virtual

Is called when the user places the mouse over the graphic object associated with the tooltip.

Parameters
viewThe view in which the graphic object is displayed.
graphicA pointer to the object that owns the tooltip.
pointThe coordinates of the last mouse event that occurred to the graphic object.
See also
reInit().

§ IsEnabled()

static IlBoolean IlvToolTip::IsEnabled ( )
static

Indicates whether tooltips are enabled.

Returns
IlTrue if tooltips are enabled and IlFalse otherwise.
See also
Enable().

§ reInit()

virtual void IlvToolTip::reInit ( const IlvView view,
const IlvGraphic graphic,
const IlvPoint point 
)
virtual

Is called when the user moves the mouse over the graphic object associated with the tooltip.

Is called to indicate that the tooltip is not to be displayed.

Parameters
viewThe view in which the graphic object is displayed.
graphicA pointer to the object that owns the tooltip.
pointThe coordinates of the last mouse event that occurred to the graphic object.
See also
init(), abort().

§ setAlignment()

void IlvToolTip::setAlignment ( IlvAlignment  alignment)

Sets the label alignment of this tooltip if it extends over multiple lines.

Parameters
alignmentThe label alignment. Valid values are IlvLeft, IlvCenter, and IlvRight.
See also
getAlignment().

§ setBackground()

void IlvToolTip::setBackground ( IlvColor color)

Sets the background color to be applied to this tooltip.

Parameters
colorThe background color to be applied to this tooltip. This color is locked.
See also
getPalette(), setForeground().

§ setForeground()

void IlvToolTip::setForeground ( IlvColor color)

Sets the foreground color to be applied to this tooltip.

Parameters
colorThe foreground color to be applied to this tooltip. This color is locked.
See also
getPalette(), setBackground().

§ SetHorizontalOffset()

static void IlvToolTip::SetHorizontalOffset ( IlvPos  offset)
static

Sets the horizontal offset of the tooltip window.

Parameters
offsetThe new horizontal offset.
See also
GetHorizontalOffset().

§ setLabel()

void IlvToolTip::setLabel ( const char *  label)

Sets the labels displayed by this tooltip.

The string is copied.

Parameters
labelThe label to be displayed by the tooltip.
See also
getLabel().

§ setPalette()

void IlvToolTip::setPalette ( IlvPalette palette)

Sets the palette to be used by this tooltip.

Parameters
paletteThe palette to be used by the tooltip. The old palette, if any, is unlocked, and the new one is locked.
See also
getPalette().

§ SetTimerPeriod()

static void IlvToolTip::SetTimerPeriod ( IlUInt  period)
static

Sets the period of time in milliseconds that elapses before a tooltip is displayed.

Parameters
periodThe new timer period.
See also
GetTimerPeriod().

§ SetTimerVisibilityPeriod()

static void IlvToolTip::SetTimerVisibilityPeriod ( IlUInt  period)
static

Sets the period of time in milliseconds that a tooltip is displayed.

Parameters
periodThe new timer period.
See also
GetTimerVisibiltyPeriod().

§ SetVerticalOffset()

static void IlvToolTip::SetVerticalOffset ( IlvPos  offset)
static

Sets the vertical offset of the tooltip window.

Parameters
offsetThe new vertical offset.
See also
GetVerticalOffset().

§ setXMargin()

void IlvToolTip::setXMargin ( IlUShort  xMargin)

Sets the horizontal margin of the text.

Parameters
xMarginThe new horizontal margin of the text.
See also
getXMargin().

§ setYMargin()

void IlvToolTip::setYMargin ( IlUShort  yMargin)

Sets the vertical margin of the text.

Parameters
yMarginThe new vertical margin of the text.
See also
getYMargin().

§ show()

virtual void IlvToolTip::show ( IlvView view,
IlvRect bbox 
)
virtual

Is called when this tooltip is about to be displayed.

Parameters
viewThe view in which the tooltip is displayed.
bboxThe size of the tooltip window.

© Copyright 2018, 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.