LCL: implemented THintInfo.ReshowTimeout, issue #27496

git-svn-id: trunk@47918 -
This commit is contained in:
mattias 2015-02-20 15:47:36 +00:00
parent 76f8ed6f80
commit a6d416e72e
3 changed files with 10 additions and 5 deletions

View File

@ -13426,8 +13426,8 @@ While CanFocus checks all control parents it does not check whether a form contr
</element> </element>
<!-- variable Visibility: default --> <!-- variable Visibility: default -->
<element name="THintInfo.ReshowTimeout"> <element name="THintInfo.ReshowTimeout">
<short/> <short>If set to a value &gt;0 call after value milliseconds OnShowHint again</short>
<descr/> <descr>Use this update the hint text while it is showing.</descr>
<seealso/> <seealso/>
</element> </element>
<!-- variable Visibility: default --> <!-- variable Visibility: default -->

View File

@ -213,7 +213,7 @@ begin
//if a hint is visible immediately query the app to show a new hint... //if a hint is visible immediately query the app to show a new hint...
if FHintTimerType = ahttHideHint then if FHintTimerType = ahttHideHint then
ShowHintWindow(Info); ShowHintWindow(Info);
//...if there's no hint window visible at this point than schedule a new query //...if there's no hint window visible at this point then schedule a new query
if (FHintTimerType = ahttNone) or (FHintWindow = nil) or not FHintWindow.Visible then if (FHintTimerType = ahttNone) or (FHintWindow = nil) or not FHintWindow.Visible then
StartHintTimer(HintPause, ahttShowHint); StartHintTimer(HintPause, ahttShowHint);
end; end;
@ -864,7 +864,10 @@ begin
FHintWindow.ActivateHint(HintWinRect, HintInfo.HintStr); FHintWindow.ActivateHint(HintWinRect, HintInfo.HintStr);
FHintRect := HintInfo.CursorRect; FHintRect := HintInfo.CursorRect;
// start hide timer // start hide timer
StartHintTimer(HintInfo.HideTimeout,ahttHideHint); if HintInfo.ReshowTimeout>0 then
StartHintTimer(HintInfo.ReshowTimeout,ahttReshowHint)
else
StartHintTimer(HintInfo.HideTimeout,ahttHideHint);
end end
else else
HideHint; HideHint;
@ -912,7 +915,7 @@ begin
{$endif} {$endif}
StopHintTimer; StopHintTimer;
case FHintTimerType of case FHintTimerType of
ahttShowHint: ahttShowHint,ahttReshowHint:
begin begin
if not GetCursorPos(CursorPos) then if not GetCursorPos(CursorPos) then
HideHint HideHint

View File

@ -220,6 +220,8 @@ begin
FActivating := True; FActivating := True;
try try
Assert(ControlCount = 0, 'THintWindow.ActivateRendered: ControlCount > 0'); Assert(ControlCount = 0, 'THintWindow.ActivateRendered: ControlCount > 0');
if Caption<>AHint then
Invalidate;
Caption := AHint; Caption := AHint;
ActivateSub(Visible and (Caption <> AHint)); ActivateSub(Visible and (Caption <> AHint));
finally finally