C# Класс 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.

Наследование: Object, IDisposable
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
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

Открытые методы

Метод Описание
Dispose ( ) : void
OnMouseMoveOverObject ( Object objectToTrack ) : void
Reset ( ) : void
ToolTipTrackerBase ( IToolTipTimer toolTipTimer ) : System

Initializes a new instance of the ToolTipTrackerBase class.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
AssertValid ( ) : void

Описание методов

ChangeState() защищенный Метод

protected ChangeState ( State iState, Object oObjectToTrack ) : void
iState State
oObjectToTrack Object
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( System.Boolean bDisposing ) : void
bDisposing System.Boolean
Результат void

FireHideToolTipEvent() защищенный Метод

protected FireHideToolTipEvent ( Object oObject ) : void
oObject Object
Результат void

FireShowToolTipEvent() защищенный Метод

protected FireShowToolTipEvent ( Object oObject ) : void
oObject Object
Результат void

OnMouseMoveOverObject() публичный Метод

public OnMouseMoveOverObject ( Object objectToTrack ) : void
objectToTrack Object
Результат void

Reset() публичный Метод

public Reset ( ) : void
Результат void

TimerTick() защищенный Метод

protected TimerTick ( Object oSource, EventArgs oEventArgs ) : void
oSource Object
oEventArgs System.EventArgs
Результат void

ToolTipTrackerBase() публичный Метод

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. ///
Результат System

ValidateDelayProperty() защищенный Метод

protected ValidateDelayProperty ( Int32 iValue, String sPropertyName ) : void
iValue System.Int32
sPropertyName String
Результат void

Описание свойств

m_bDisposed защищенное свойство

protected Boolean,System m_bDisposed
Результат System.Boolean

m_iHideDelayMs защищенное свойство

protected Int32,System m_iHideDelayMs
Результат System.Int32

m_iReshowDelayMs защищенное свойство

protected Int32,System m_iReshowDelayMs
Результат System.Int32

m_iShowDelayMs защищенное свойство

protected Int32,System m_iShowDelayMs
Результат System.Int32

m_iState защищенное свойство

protected State m_iState
Результат State

m_oTimer защищенное свойство

protected IToolTipTimer m_oTimer
Результат IToolTipTimer

m_oTrackedObject защищенное свойство

protected Object m_oTrackedObject
Результат Object