Provides a controllable popup hint window, which can be embedded in VCL components. It allows control of when and where the popup hint window appears and also has the timing information embedded within it (so that it can automatically disappear after a certain time period).
To use the TRSHintWindow component, you need to perform two (or optionally three) steps:
• Create the TRSHintWindow component inside your component
• Call the ActivateHint method when you want to show the popup hint window
• Call the HideHint method when you want to hide the popup hint window
Namespace: RSHintWindow
THintWindow
RSHintWindow.TRSHintWindow
|
Delphi
|
type
TRSHintWindow = class(THintWindow)
end;
|
|
Name
|
Description
|
|
ActivateHint(TPoint,String)
|
Overloaded. Displays the hint window at the specified screen coordinates.
Call ActivateHint to display the hint window at the coordinates provided by the Point parameter. If the Point parameter appears off screen, ActivateHint moves the hint window to the closest approximation to the coordinates supplied by Point that appears entirely on screen. ActivateHint sets the Caption property to the AHint parameter before showing the window, so that the AHint string appears to the user.
After the hint window is displayed, it automatically deactivates it after the time period specified by the RSHintWindow.TRSHintWindow.Interval property has elapsed, or when you call the RSHintWindow.TRSHintWindow.HideHint method. If the interval is 0, the hint window is not hidden until the HideHint method is called explicitly.
|
|
ActivateHint(TRect,String)
|
Overloaded. Displays the hint window in the specified rectangle.
Call ActivateHint to display the hint window at the coordinates provided by the Point parameter. If the Point parameter appears off screen, ActivateHint moves the hint window to the closest approximation to the coordinates supplied by Point that appears entirely on screen. ActivateHint sets the Caption property to the AHint parameter before showing the window, so that the AHint string appears to the user.
After the hint window is displayed, it automatically deactivates it after the time period specified by the RSHintWindow.TRSHintWindow.Interval property has elapsed, or when you call the RSHintWindow.TRSHintWindow.HideHint method. If the interval is 0, the hint window is not hidden until the HideHint method is called explicitly.
|
|
HideHint
|
Hides the current hint. Usually, the TRSHintWindow class hides the popup hint window automatically after the amount of time specified in the RSHintWindow.TRSHintWindow.Interval property has passed. However, if the interval is 0 or you wish to hide the window immediately, call the HideHint method.
|
|
Paint
|
Represents method Paint.
|
|
SetActivating(Boolean)
|
Represents method SetActivating(Boolean).
|
|
TimeOut(TObject)
|
Called when timer finishes and the hint window should disappear.
|
Top
|
Create the TRSHintWindow component inside your component:
Delphi
|
constructor TMyControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FHintWindow := TRSHintWindow.Create(Self);
FHintWindow.SetSubComponent(True);
FHintWindow.Interval := 0; // interval of time in milliseconds that the hint window should stay visible,
// 0 milliseconds means show indefinitely and use HideHint to hide the window
end;
destructor TMyControl.Destroy;
begin
FHintWindow.Free;
inherited Destroy;
end;
|
Call the ActivateHint method when you want to show the popup hint window:
Delphi
procedure TMyControl.MouseMove(Shift: TShiftState; X,
Y: Integer);
begin
if ShowHintWindow then
begin
HintWindow.ActivateHint( ClientToScreen(Point(X, Y)), AHint);
end;
inherited MouseMove(Shift, X, Y);
end;
Call the HideHint method when you want to hide the popup hint window:
Delphi
procedure TMyControl.MouseMove(Shift: TShiftState; X,
Y: Integer);
begin
if ShowHintWindow then
begin
HintWindow.ActivateHint( ClientToScreen(Point(X, Y)), AHint);
end
else
HintWindow.HideHint;
inherited MouseMove(Shift, X, Y);
end;