Skip to content

Commit

Permalink
Fixed issue JAM-Software#1248 by removing own WMPrintClient() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmarder authored and salvadorbs committed Sep 26, 2024
1 parent d96e52c commit f8c34d7
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions Source/VirtualTrees.BaseTree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,6 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
procedure WMPaste(var Message: TLMNoParams); message LM_PASTE;
{$ifdef EnablePrintFunctions}
procedure WMPrint(var Message: TWMPrint); message WM_PRINT;
procedure WMPrintClient(var Message: TWMPrintClient); message WM_PRINTCLIENT;
{$endif}
procedure WMRButtonDblClk(var Message: TLMRButtonDblClk); message LM_RBUTTONDBLCLK;
procedure WMRButtonDown(var Message: TLMRButtonDown); message LM_RBUTTONDOWN;
Expand Down Expand Up @@ -8400,40 +8399,6 @@ procedure TBaseVirtualTree.WMPrint(var Message: TWMPrint);
{$ifdef DEBUG_VTV}Logger.ExitMethod([lcMessages],'WMPrint');{$endif}
end;

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

procedure TBaseVirtualTree.WMPrintClient(var Message: TWMPrintClient);

var
Window: TRect;
Target: TPoint;
Canvas: TCanvas;

begin
{$ifdef DEBUG_VTV}Logger.EnterMethod([lcMessages],'WMPrintClient');{$endif}
// Draw only if the window is visible or visibility is not required.
if ((Message.Flags and PRF_CHECKVISIBLE) = 0) or IsWindowVisible(Handle) then
begin
// Determine area of the entire tree to be displayed in the control.
Window := ClientRect;
Target := Window.TopLeft;

// The Window rectangle is given in client coordinates. We have to convert it into
// a sliding window of the tree image.
OffsetRect(Window, FEffectiveOffsetX, -FOffsetY);

Canvas := TCanvas.Create;
try
Canvas.Handle := Message.DC;
PaintTree(Canvas, Window, Target, [poBackground, poDrawFocusRect, poDrawDropMark, poDrawSelection, poGridLines]);
finally
Canvas.Handle := 0;
Canvas.Free;
end;
end;
{$ifdef DEBUG_VTV}Logger.ExitMethod([lcMessages],'WMPrintClient');{$endif}
end;

{$endif}
//----------------------------------------------------------------------------------------------------------------------

Expand Down

0 comments on commit f8c34d7

Please sign in to comment.