Skip to content

Commit

Permalink
Preparations for issue JAM-Software#770: Removed THintAnimationType.h…
Browse files Browse the repository at this point in the history
…atSystemDefault, we onyl deliver the actual hint animation type now that should be used.
  • Loading branch information
joachimmarder authored and Sharlikran committed Oct 17, 2018
1 parent a86e7b0 commit 0a02156
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -863,19 +863,17 @@ TVTHintData = record
THintAnimationType = (
hatNone, // no animation at all, just display hint/tooltip
hatFade, // fade in the hint/tooltip, like in Windows 2000
hatSlide, // slide in the hint/tooltip, like in Windows 98
hatSystemDefault // use what the system is using (slide for Win9x, slide/fade for Win2K+, depends on settings)
hatSlide // slide in the hint/tooltip, like in Windows 98
);

// The trees need an own hint window class because of Unicode output and adjusted font.
TVirtualTreeHintWindow = class(THintWindow)
private
strict private
FHintData: TVTHintData;
FBackground,
FDrawBuffer,
FTarget: TBitmap;
FTextHeight: Integer;
FAnimationType: THintAnimationType; // none, fade in, slide in animation (just like those animations used
function DoGetAnimationType: THintAnimationType; virtual;
function AnimationCallback(Step, StepSize: Integer; Data: Pointer): Boolean;
procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
Expand Down Expand Up @@ -5603,20 +5601,16 @@ function TVirtualTreeHintWindow.DoGetAnimationType: THintAnimationType;
Animation: BOOL;

begin
Result := FAnimationType;
if Result = hatSystemDefault then
SystemParametersInfo(SPI_GETTOOLTIPANIMATION, 0, @Animation, 0);
if not Animation then
Result := hatNone
else
begin
SystemParametersInfo(SPI_GETTOOLTIPANIMATION, 0, @Animation, 0);
if not Animation then
Result := hatNone
SystemParametersInfo(SPI_GETTOOLTIPFADE, 0, @Animation, 0);
if Animation then
Result := hatFade
else
begin
SystemParametersInfo(SPI_GETTOOLTIPFADE, 0, @Animation, 0);
if Animation then
Result := hatFade
else
Result := hatSlide;
end;
Result := hatSlide;
end;

//Disable animation if hot tracking is ON as it causes problems
Expand All @@ -5638,7 +5632,6 @@ constructor TVirtualTreeHintWindow.Create(AOwner: TComponent);

DoubleBuffered := False; // we do our own buffering
FHintWindowDestroyed := False;
FAnimationType := hatSystemDefault
end;

//----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 0a02156

Please sign in to comment.