CEGUI::Tooltip Class Reference

Base class for Tooltip widgets. More...

Inheritance diagram for CEGUI::Tooltip:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::Tooltip:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Tooltip (const String &type, const String &name)
 Constructor for the Tooltip base class constructor.
 ~Tooltip (void)
 Destructor for the Tooltip base class.
void setTargetWindow (Window *wnd)
 Sets the target window for the tooltip. This used internally to manage tooltips, you should not have to call this yourself.
const WindowgetTargetWindow ()
 return the current target window for this Tooltip.
void resetTimer (void)
 Resets the timer on the tooltip when in the Active / Inactive states. This is used internally to control the tooltip, it is not normally necessary to call this method yourself.
float getHoverTime (void) const
 Return the number of seconds the mouse should hover stationary over the target window before the tooltip gets activated.
void setDisplayTime (float seconds)
 Set the number of seconds the tooltip should be displayed for before it automatically de-activates itself. 0 indicates that the tooltip should never timesout and auto-deactivate.
float getFadeTime (void) const
 Return the number of seconds that should be taken to fade the tooltip into and out of visibility.
void setHoverTime (float seconds)
 Set the number of seconds the mouse should hover stationary over the target window before the tooltip gets activated.
float getDisplayTime (void) const
 Return the number of seconds the tooltip should be displayed for before it automatically de-activates itself. 0 indicates that the tooltip never timesout and auto-deactivates.
void setFadeTime (float seconds)
 Set the number of seconds that should be taken to fade the tooltip into and out of visibility.
void positionSelf (void)
 Causes the tooltip to position itself appropriately.
void sizeSelf (void)
 Causes the tooltip to resize itself appropriately.
Size getTextSize () const
 Return the size of the area that will be occupied by the tooltip text, given any current formatting options.
virtual Size getTextSize_impl () const
 Return the size of the area that will be occupied by the tooltip text, given any current formatting options.

Static Public Attributes

static const String WidgetTypeName
 Window factory name.
static const String EventNamespace
 Namespace for global events.
static const String EventHoverTimeChanged
 Event fired when the hover timeout gets changed.
static const String EventDisplayTimeChanged
 Event fired when the display timeout gets changed.
static const String EventFadeTimeChanged
 Event fired when the fade timeout gets changed.
static const String EventTooltipActive
 Event fired when the tooltip is about to get activated.
static const String EventTooltipInactive
 Event fired when the tooltip has been deactivated.

Protected Types

enum  TipState { Inactive, Active, FadeIn, FadeOut }
 states for tooltip More...

Protected Member Functions

void doActiveState (float elapsed)
void doInactiveState (float elapsed)
void doFadeInState (float elapsed)
void doFadeOutState (float elapsed)
void switchToInactiveState (void)
void switchToActiveState (void)
void switchToFadeInState (void)
void switchToFadeOutState (void)
virtual bool testClassName_impl (const String &class_name) const
 Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
virtual bool validateWindowRenderer (const String &name) const
 Function used in checking if a WindowRenderer is valid for this window.
virtual void onHoverTimeChanged (WindowEventArgs &e)
 Event trigger method called when the hover timeout gets changed.
virtual void onDisplayTimeChanged (WindowEventArgs &e)
 Event trigger method called when the display timeout gets changed.
virtual void onFadeTimeChanged (WindowEventArgs &e)
 Event trigger method called when the fade timeout gets changed.
virtual void onTooltipActive (WindowEventArgs &e)
 Event trigger method called just before the tooltip becomes active.
virtual void onTooltipInactive (WindowEventArgs &e)
 Event trigger method called just after the tooltip is deactivated.
void updateSelf (float elapsed)
 Perform actual update processing for this Window.
void onMouseEnters (MouseEventArgs &e)
 Handler called when the mouse cursor has entered this window's area.
void onTextChanged (WindowEventArgs &e)
 Handler called when the window's text is changed.

Protected Attributes

TipState d_state
 Current tooltip state.
float d_elapsed
 Used to track state change timings.
const Windowd_target
 Current target Window for this Tooltip.
float d_hoverTime
 tool-tip hover time (seconds mouse must stay stationary before tip shows).
float d_displayTime
 tool-tip display time (seconds that tip is showsn for).
float d_fadeTime
 tool-tip fade time (seconds it takes for tip to fade in and/or out).


Detailed Description

Base class for Tooltip widgets.

The Tooltip class shows a simple pop-up window around the mouse position with some text information. The tool-tip fades in when the user hovers with the mouse over a window which has tool-tip text set, and then fades out after some pre-set time.

Note:
For Tooltip to work properly, you must specify a default tool-tip widget type via System::setTooltip, or by setting a custom tool-tip object for your Window(s). Additionally, you need to ensure that time pulses are properly passed to the system via System::injectTimePulse.

Member Enumeration Documentation

enum CEGUI::Tooltip::TipState [protected]

states for tooltip

Enumerator:
Inactive  Tooltip is currently inactive.
Active  Tooltip is currently displayed and active.
FadeIn  Tooltip is currently transitioning from Inactive to Active state.
FadeOut  Tooltip is currently transitioning from Active to Inactive state.


Member Function Documentation

float CEGUI::Tooltip::getDisplayTime ( void   )  const

Return the number of seconds the tooltip should be displayed for before it automatically de-activates itself. 0 indicates that the tooltip never timesout and auto-deactivates.

Returns:
float value representing a number of seconds.

References d_displayTime.

float CEGUI::Tooltip::getFadeTime ( void   )  const

Return the number of seconds that should be taken to fade the tooltip into and out of visibility.

Returns:
float value representing a number of seconds.

References d_fadeTime.

float CEGUI::Tooltip::getHoverTime ( void   )  const

Return the number of seconds the mouse should hover stationary over the target window before the tooltip gets activated.

Returns:
float value representing a number of seconds.

References d_hoverTime.

const Window * CEGUI::Tooltip::getTargetWindow ( void   ) 

return the current target window for this Tooltip.

Returns:
Pointer to the target window for this Tooltip or 0 for none.

References d_target.

Referenced by CEGUI::Window::destroy(), CEGUI::Tree::onMouseMove(), CEGUI::Listbox::onMouseMove(), and CEGUI::Window::setTooltipText().

Size CEGUI::Tooltip::getTextSize (  )  const

Return the size of the area that will be occupied by the tooltip text, given any current formatting options.

Returns:
Size object describing the size of the rendered tooltip text in pixels.

References CEGUI::Window::d_windowRenderer, CEGUI::TooltipWindowRenderer::getTextSize(), and getTextSize_impl().

Referenced by sizeSelf().

Size CEGUI::Tooltip::getTextSize_impl (  )  const [virtual]

Return the size of the area that will be occupied by the tooltip text, given any current formatting options.

Returns:
Size object describing the size of the rendered tooltip text in pixels.

References CEGUI::Window::d_text, CEGUI::Window::getFont(), CEGUI::Font::getFormattedLineCount(), CEGUI::Font::getFormattedTextExtent(), CEGUI::Font::getLineSpacing(), CEGUI::System::getSingleton(), and CEGUI::LeftAligned.

Referenced by CEGUI::FalagardTooltip::getTextSize(), and getTextSize().

void CEGUI::Tooltip::onDisplayTimeChanged ( WindowEventArgs e  )  [protected, virtual]

Event trigger method called when the display timeout gets changed.

Parameters:
e WindowEventArgs object.
Returns:
Nothing.

References EventDisplayTimeChanged, EventNamespace, and CEGUI::EventSet::fireEvent().

Referenced by setDisplayTime().

void CEGUI::Tooltip::onFadeTimeChanged ( WindowEventArgs e  )  [protected, virtual]

Event trigger method called when the fade timeout gets changed.

Parameters:
e WindowEventArgs object.
Returns:
Nothing.

References EventFadeTimeChanged, EventNamespace, and CEGUI::EventSet::fireEvent().

Referenced by setFadeTime().

void CEGUI::Tooltip::onHoverTimeChanged ( WindowEventArgs e  )  [protected, virtual]

Event trigger method called when the hover timeout gets changed.

Parameters:
e WindowEventArgs object.
Returns:
Nothing.

References EventHoverTimeChanged, EventNamespace, and CEGUI::EventSet::fireEvent().

Referenced by setHoverTime().

void CEGUI::Tooltip::onMouseEnters ( MouseEventArgs e  )  [protected, virtual]

Handler called when the mouse cursor has entered this window's area.

Parameters:
e MouseEventArgs object. All fields are valid.

Reimplemented from CEGUI::Window.

References positionSelf().

void CEGUI::Tooltip::onTextChanged ( WindowEventArgs e  )  [protected, virtual]

Handler called when the window's text is changed.

Parameters:
e WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.

Reimplemented from CEGUI::Window.

References positionSelf(), and sizeSelf().

void CEGUI::Tooltip::onTooltipActive ( WindowEventArgs e  )  [protected, virtual]

Event trigger method called just before the tooltip becomes active.

Parameters:
e WindowEventArgs object.
Returns:
Nothing.

References EventNamespace, EventTooltipActive, and CEGUI::EventSet::fireEvent().

void CEGUI::Tooltip::onTooltipInactive ( WindowEventArgs e  )  [protected, virtual]

Event trigger method called just after the tooltip is deactivated.

Parameters:
e WindowEventArgs object.
Returns:
Nothing.

References EventNamespace, EventTooltipInactive, and CEGUI::EventSet::fireEvent().

void CEGUI::Tooltip::positionSelf ( void   ) 

void CEGUI::Tooltip::resetTimer ( void   ) 

Resets the timer on the tooltip when in the Active / Inactive states. This is used internally to control the tooltip, it is not normally necessary to call this method yourself.

Returns:
Nothing.

References Active, d_elapsed, d_state, and Inactive.

Referenced by CEGUI::Window::onMouseMove(), and setTargetWindow().

void CEGUI::Tooltip::setDisplayTime ( float  seconds  ) 

Set the number of seconds the tooltip should be displayed for before it automatically de-activates itself. 0 indicates that the tooltip should never timesout and auto-deactivate.

Parameters:
seconds float value representing a number of seconds.
Returns:
Nothing.

References d_displayTime, and onDisplayTimeChanged().

void CEGUI::Tooltip::setFadeTime ( float  seconds  ) 

Set the number of seconds that should be taken to fade the tooltip into and out of visibility.

Parameters:
seconds float value representing a number of seconds.
Returns:
Nothing.

References d_fadeTime, and onFadeTimeChanged().

void CEGUI::Tooltip::setHoverTime ( float  seconds  ) 

Set the number of seconds the mouse should hover stationary over the target window before the tooltip gets activated.

Parameters:
seconds float value representing a number of seconds.
Returns:
Nothing.

References d_hoverTime, and onHoverTimeChanged().

void CEGUI::Tooltip::setTargetWindow ( Window wnd  ) 

Sets the target window for the tooltip. This used internally to manage tooltips, you should not have to call this yourself.

Parameters:
wnd Window object that the tooltip should be associated with (for now).
Returns:
Nothing.

References CEGUI::Window::addChildWindow(), d_target, CEGUI::System::getGUISheet(), CEGUI::System::getSingleton(), CEGUI::Window::getTooltipText(), positionSelf(), resetTimer(), CEGUI::Window::setText(), and sizeSelf().

Referenced by CEGUI::Window::destroy(), CEGUI::Window::onMouseButtonDown(), CEGUI::Window::onMouseEnters(), CEGUI::Window::onMouseLeaves(), CEGUI::Tree::onMouseMove(), and CEGUI::Listbox::onMouseMove().

void CEGUI::Tooltip::sizeSelf ( void   ) 

Causes the tooltip to resize itself appropriately.

Returns:
Nothing.

References CEGUI::Size::d_height, CEGUI::Size::d_width, getTextSize(), and CEGUI::Window::setSize().

Referenced by onTextChanged(), and setTargetWindow().

virtual bool CEGUI::Tooltip::testClassName_impl ( const String class_name  )  const [inline, protected, virtual]

Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.

Parameters:
class_name The class name that is to be checked.
Returns:
true if this window was inherited from class_name. false if not.

Reimplemented from CEGUI::Window.

References CEGUI::Window::testClassName_impl().

void CEGUI::Tooltip::updateSelf ( float  elapsed  )  [protected, virtual]

Perform actual update processing for this Window.

Parameters:
elapsed float value indicating the number of seconds elapsed since the last update call.
Returns:
Nothing.

Reimplemented from CEGUI::Window.

References Active, d_state, CEGUI::Errors, FadeIn, FadeOut, CEGUI::Window::getName(), CEGUI::Window::getType(), and Inactive.

virtual bool CEGUI::Tooltip::validateWindowRenderer ( const String name  )  const [inline, protected, virtual]

Function used in checking if a WindowRenderer is valid for this window.

Returns:
Returns true if the given WindowRenderer class name is valid for this window. False if not.

Reimplemented from CEGUI::Window.


Generated on Thu Nov 27 20:34:39 2008 for Crazy Eddies GUI System by  doxygen 1.5.7.1