class MASKING_DLL_DECLSPEC Tooltip

A helper widget for displaying popup help bubbles.

Inheritance:

Tooltip - Widget - Rect


Public Methods

[more]virtual void SetBackColor(const Color &col)
Sets the background color of the help bubble.
[more]virtual void SetBorderColor(const Color &col)
Sets the border color of the help bubble.
[more]virtual void SetText(const char* text)
Sets the text used to display the help message.

Protected Fields

[more]int counter
Counters for counting time the mouse hasn't moved
[more]int hideCounter
Counters for counting time before the tooltip should hide itself
[more]Color backCol
The background colour for the help bubble
[more]Color borderCol
The border colour for the help bubble
[more]Point lastMousePos
The last known absolute screen coordinates of the mouse cursor.
[more]char* text
The text the tooltip prints in the help bubble.
[more]Widget* lastWidget
A pointer to the last widget in the parent dialog the mouse was on top of.

Protected Methods

[more]void Draw(Bitmap &canvas)
Draws the help bubble and fills it with text.
[more]void MsgInitSkin()
Sets the default font, colours and other info as defined by the skin
[more]void MsgTick()
The main help bubble logic function.
[more]bool MsgWantmouse()
Returns false to make sure the tooltips don't confuse the dialog when dealing with moving the input focus
[more]virtual void ShowTooltip()
Helper function for turning the tooltip on
[more]virtual void HideTooltip()
Helper function for turning the tooltip off
[more]virtual void CalculateGeometry()
Calculates the geometry (size and position) of the tooltip help bubble.
[more]virtual void CalculatePosition()
Lower level function for calculating the tooltip help bubble position.
[more]virtual void CalculateSize()
Lower level function for calculating the tooltip help bubble size.


Documentation

A helper widget for displaying popup help bubbles. A tooltip is displayed when the mouse hovers over a widget for a while. It can display any length of text, even in several lines and it can be easily extended to display bitmaps and other data. Every dialog contains a default tooltip object which is added to it implicitely but you can create your own easily.
oint counter
Counters for counting time the mouse hasn't moved

oint hideCounter
Counters for counting time before the tooltip should hide itself

oColor backCol
The background colour for the help bubble

oColor borderCol
The border colour for the help bubble

oPoint lastMousePos
The last known absolute screen coordinates of the mouse cursor. Used for checking whether the mouse has moved or not.

ochar* text
The text the tooltip prints in the help bubble. If NULL, the tooltip isn't drawn at all.

oWidget* lastWidget
A pointer to the last widget in the parent dialog the mouse was on top of. Used for checking when the mouse focus moved.

ovoid Draw(Bitmap &canvas)
Draws the help bubble and fills it with text. It tries to be as clever as possible to choose the best possible size and position for the bubble in order to make it look as nice as possible.

ovoid MsgInitSkin()
Sets the default font, colours and other info as defined by the skin

ovoid MsgTick()
The main help bubble logic function. In MsgTick() the tooltip constantly checks if the parent's mouse object changed, if the mouse has not moved for a certain period of time and so on and acts accordingly.

obool MsgWantmouse()
Returns false to make sure the tooltips don't confuse the dialog when dealing with moving the input focus

ovirtual void ShowTooltip()
Helper function for turning the tooltip on

ovirtual void HideTooltip()
Helper function for turning the tooltip off

ovirtual void CalculateGeometry()
Calculates the geometry (size and position) of the tooltip help bubble. It does so by calling CalculateSize() and CalculatePosition(). Overload this function in a derived tooltip class so you can draw tooltips with different size, position and content.

ovirtual void CalculatePosition()
Lower level function for calculating the tooltip help bubble position. The position is based on the position of the mouse and the size of the bubble so that it fits on screen and isn't obscured by the mouse cursor.

ovirtual void CalculateSize()
Lower level function for calculating the tooltip help bubble size. The size is calculated from the length of the tooltip text. If there's too much text to fit in one line, it is distributed in several lines.

ovirtual void SetBackColor(const Color &col)
Sets the background color of the help bubble. The default is pale yellow. The actual color is read from the skin file.

ovirtual void SetBorderColor(const Color &col)
Sets the border color of the help bubble. The default is black. The actual color is read from the skin file.

ovirtual void SetText(const char* text)
Sets the text used to display the help message. Usually you shouldn't have to worry about calling this function because the default implementation will obtain the text from the appropriate widget by itself.


This class has no child classes.

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++