class MASKING_DLL_DECLSPEC Tooltip
A helper widget for displaying popup help bubbles.
Inheritance:
Public Methods
-
virtual void SetBackColor(const Color &col)
- Sets the background color of the help bubble.
-
virtual void SetBorderColor(const Color &col)
- Sets the border color of the help bubble.
-
virtual void SetText(const char* text)
- Sets the text used to display the help message.
Protected Fields
-
int counter
- Counters for counting time the mouse hasn't moved
-
int hideCounter
- Counters for counting time before the tooltip should hide itself
-
Color backCol
- The background colour for the help bubble
-
Color borderCol
- The border colour for the help bubble
-
Point lastMousePos
- The last known absolute screen coordinates of the mouse cursor.
-
char* text
- The text the tooltip prints in the help bubble.
-
Widget* lastWidget
- A pointer to the last widget in the parent dialog the mouse was on top of.
Protected Methods
-
void Draw(Bitmap &canvas)
- Draws the help bubble and fills it with text.
-
void MsgInitSkin()
- Sets the default font, colours and other info as defined by the skin
-
void MsgTick()
- The main help bubble logic function.
-
bool MsgWantmouse()
- Returns false to make sure the tooltips don't confuse the dialog when dealing with moving the input focus
-
virtual void ShowTooltip()
- Helper function for turning the tooltip on
-
virtual void HideTooltip()
- Helper function for turning the tooltip off
-
virtual void CalculateGeometry()
- Calculates the geometry (size and position) of the tooltip help bubble.
-
virtual void CalculatePosition()
- Lower level function for calculating the tooltip help bubble position.
-
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.
int counter
-
Counters for counting time the mouse hasn't moved
int hideCounter
-
Counters for counting time before the tooltip should hide itself
Color backCol
-
The background colour for the help bubble
Color borderCol
-
The border colour for the help bubble
Point lastMousePos
-
The last known absolute screen coordinates of the mouse cursor. Used for
checking whether the mouse has moved or not.
char* text
-
The text the tooltip prints in the help bubble. If NULL, the tooltip
isn't drawn at all.
Widget* 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.
void 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.
void MsgInitSkin()
-
Sets the default font, colours and other info as defined by the skin
void 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.
bool MsgWantmouse()
-
Returns false to make sure the tooltips don't confuse the dialog when
dealing with moving the input focus
virtual void ShowTooltip()
-
Helper function for turning the tooltip on
virtual void HideTooltip()
-
Helper function for turning the tooltip off
virtual 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.
virtual 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.
virtual 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.
virtual 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.
virtual 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.
virtual 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++