From 0a02156ed8cc18e654b48e33d0dc43f5ca855f0a Mon Sep 17 00:00:00 2001 From: Joachim Marder Date: Thu, 6 Sep 2018 22:51:14 +0200 Subject: [PATCH] Preparations for issue #770: Removed THintAnimationType.hatSystemDefault, we onyl deliver the actual hint animation type now that should be used. --- Source/VirtualTrees.pas | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Source/VirtualTrees.pas b/Source/VirtualTrees.pas index 7e7e5a3be..31677ab4b 100644 --- a/Source/VirtualTrees.pas +++ b/Source/VirtualTrees.pas @@ -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; @@ -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 @@ -5638,7 +5632,6 @@ constructor TVirtualTreeHintWindow.Create(AOwner: TComponent); DoubleBuffered := False; // we do our own buffering FHintWindowDestroyed := False; - FAnimationType := hatSystemDefault end; //----------------------------------------------------------------------------------------------------------------------