Skip to content

Commit

Permalink
Further work on issue JAM-Software#770:
Browse files Browse the repository at this point in the history
* Turned property HintWindowDestroyed into a function
* Removed WMNCPaint)=, it seems to have no effect and the base implementation seems to work fine.
* TVirtualTreeHintWindow.WMShowWindow() no longer finalizes FHintData, should be done by the compiler just fine.
  • Loading branch information
joachimmarder authored and Sharlikran committed Oct 17, 2018
1 parent e361cfc commit 5ef7327
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -861,16 +861,14 @@ TVirtualTreeHintWindow = class(THintWindow)
FHintData: TVTHintData;
FTextHeight: Integer;
procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
function GetHintWindowDestroyed: Boolean;
procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT;
procedure WMShowWindow(var Message: TWMShowWindow); message WM_SHOWWINDOW;
strict protected
procedure CreateParams(var Params: TCreateParams); override;
procedure Paint; override;

property HintData: TVTHintData read FHintData;
property HintWindowDestroyed: Boolean read GetHintWindowDestroyed;
function HintWindowDestroyed(): Boolean;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
Expand Down Expand Up @@ -5595,7 +5593,7 @@ procedure TVirtualTreeHintWindow.CMTextChanged(var Message: TMessage);

//----------------------------------------------------------------------------------------------------------------------

function TVirtualTreeHintWindow.GetHintWindowDestroyed;
function TVirtualTreeHintWindow.HintWindowDestroyed;

// This function exists to inform descendants if the hint window has been destroyed.

Expand All @@ -5613,15 +5611,6 @@ procedure TVirtualTreeHintWindow.WMEraseBkgnd(var Message: TWMEraseBkgnd);
Message.Result := 1;
end;

//----------------------------------------------------------------------------------------------------------------------

procedure TVirtualTreeHintWindow.WMNCPaint(var Message: TMessage);

// The control is fully painted by own code so don't paint any borders.

begin
Message.Result := 0;
end;

//----------------------------------------------------------------------------------------------------------------------

Expand All @@ -5632,10 +5621,6 @@ procedure TVirtualTreeHintWindow.WMShowWindow(var Message: TWMShowWindow);
begin
if not Message.Show then
begin
// Don't touch the last hint rectangle stored in the associated tree to avoid flickering in certain situations.
Finalize(FHintData);
ZeroMemory (@FHintData, SizeOf(FHintData));

// If the hint window destruction flag to stop any hint window animation was set by a tree
// during its destruction then reset it here to allow other tree instances to still use
// this hint window.
Expand Down

0 comments on commit 5ef7327

Please sign in to comment.