C# Class Smrf.GraphicsLib.ToolTipTrackerBase

Helper class for displaying tooltips.
This is meant for use by a Control object that displays various objects within its window and wants to show a tooltip for each object. The ToolTip class in the FCL makes it easy to show a single tooltip for an entire control, but it does not support different tooltips for different parts of the control's window.

To use ToolTipTracker, call OnMouseMoveOverObject from the control's MouseMove event handler. If the mouse is currently over an object that has a tooltip associated with it, pass the object as the method's oObjectToTrack parameter. Otherwise, pass null. Also, call OnMouseMoveOverObject with a null parameter from the control's MouseLeave event handler.

If the mouse remains over an object for a period of milliseconds, ToolTipTracker fires a event. The event arguments include the object being tracked.

A HideToolTip event is fired when the tooltip should be hidden. This occurs HideDelayMs after the event fires if the mouse remains over the object, or immediately if OnMouseMoveOverObject(null) is called.

Note that ToolTipTracker does not actually show or hide the tooltip; that's up to the application. The easiest way to do this is to create a child ToolTipPanel control and call its Show and Hide methods in response to the ShowToolTip and HideToolTip events.

If the mouse is moved to another object within ReshowDelayMs milliseconds, another ShowToolTip event is fired. Otherwise, the waiting period reverts to ShowDelayMs.

Call Reset to reset ToolTipTracker to its initial state. This forces a HideToolTip event if a tooltip is showing.

IMPORTANT

The control must call Dispose() from its own Dispose method. This prevents timer-based events from firing after the control no longer has a handle.

Inheritance: Object, IDisposable
Afficher le fichier Open project: 2014-sed-team3/term-project

Protected Properties

Свойство Type Description
m_bDisposed System.Boolean
m_iHideDelayMs System.Int32
m_iReshowDelayMs System.Int32
m_iShowDelayMs System.Int32
m_iState State
m_oTimer IToolTipTimer
m_oTrackedObject Object

Méthodes publiques

Méthode Description
Dispose ( ) : void
OnMouseMoveOverObject ( Object objectToTrack ) : void
Reset ( ) : void
ToolTipTrackerBase ( IToolTipTimer toolTipTimer ) : System

Initializes a new instance of the ToolTipTrackerBase class.

Méthodes protégées

Méthode Description
ChangeState ( State iState, Object oObjectToTrack ) : void
Dispose ( System.Boolean bDisposing ) : void
FireHideToolTipEvent ( Object oObject ) : void
FireShowToolTipEvent ( Object oObject ) : void
TimerTick ( Object oSource, EventArgs oEventArgs ) : void
ValidateDelayProperty ( Int32 iValue, String sPropertyName ) : void

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

ChangeState() protected méthode

protected ChangeState ( State iState, Object oObjectToTrack ) : void
iState State
oObjectToTrack Object
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( System.Boolean bDisposing ) : void
bDisposing System.Boolean
Résultat void

FireHideToolTipEvent() protected méthode

protected FireHideToolTipEvent ( Object oObject ) : void
oObject Object
Résultat void

FireShowToolTipEvent() protected méthode

protected FireShowToolTipEvent ( Object oObject ) : void
oObject Object
Résultat void

OnMouseMoveOverObject() public méthode

public OnMouseMoveOverObject ( Object objectToTrack ) : void
objectToTrack Object
Résultat void

Reset() public méthode

public Reset ( ) : void
Résultat void

TimerTick() protected méthode

protected TimerTick ( Object oSource, EventArgs oEventArgs ) : void
oSource Object
oEventArgs System.EventArgs
Résultat void

ToolTipTrackerBase() public méthode

Initializes a new instance of the ToolTipTrackerBase class.
public ToolTipTrackerBase ( IToolTipTimer toolTipTimer ) : System
toolTipTimer IToolTipTimer /// The timer to use internally. See the /// interface for details. ///
Résultat System

ValidateDelayProperty() protected méthode

protected ValidateDelayProperty ( Int32 iValue, String sPropertyName ) : void
iValue System.Int32
sPropertyName String
Résultat void

Property Details

m_bDisposed protected_oe property

protected Boolean,System m_bDisposed
Résultat System.Boolean

m_iHideDelayMs protected_oe property

protected Int32,System m_iHideDelayMs
Résultat System.Int32

m_iReshowDelayMs protected_oe property

protected Int32,System m_iReshowDelayMs
Résultat System.Int32

m_iShowDelayMs protected_oe property

protected Int32,System m_iShowDelayMs
Résultat System.Int32

m_iState protected_oe property

protected State m_iState
Résultat State

m_oTimer protected_oe property

protected IToolTipTimer m_oTimer
Résultat IToolTipTimer

m_oTrackedObject protected_oe property

protected Object m_oTrackedObject
Résultat Object