LCL: TCustomTreeView.DoPaint use of cdPrePaint and cdPostPaint, issue #21761, patch from David Jenkins

git-svn-id: trunk@36820 -
This commit is contained in:
juha 2012-04-16 19:10:44 +00:00
parent 82de387f29
commit cae1ee33c9
2 changed files with 5 additions and 5 deletions

View File

@ -2879,7 +2879,7 @@ type
function GetNodeDrawAreaHeight: integer;
function GetNodeDrawAreaWidth: integer;
function IsCustomDrawn(Target: TCustomDrawTarget;
Stage: TCustomDrawStage): Boolean;
Stage: TCustomDrawStage): Boolean; virtual;
function IsNodeVisible(ANode: TTreeNode): Boolean;
function IsNodeHeightFullVisible(ANode: TTreeNode): Boolean;
function IsInsertMarkVisible: boolean; virtual;

View File

@ -4412,7 +4412,7 @@ begin
UpdateScrollbars;
with Canvas do
begin
if Assigned(FOnCustomDraw) or Assigned(FOnAdvancedCustomDraw) then
if IsCustomDrawn(dtControl, cdPrePaint) then
begin
DrawRect := ClientRect;
if not CustomDraw(DrawRect, cdPrePaint) then exit;
@ -4474,7 +4474,7 @@ begin
LineTo((ClientWidth - ScrollBarWidth) - 1 - a, (ClientHeight - ScrollBarWidth) - 1 - a);
LineTo(a, (ClientHeight-ScrollBarWidth) - 1 - a);
end;
if Assigned(FOnCustomDraw) or Assigned(FOnAdvancedCustomDraw) then
if IsCustomDrawn(dtControl, cdPostPaint) then
begin
DrawRect := ClientRect;
if not CustomDraw(DrawRect, cdPostPaint) then exit;
@ -4838,7 +4838,7 @@ begin
Exit;
NodeSelected := (Node.Selected) or (Node.MultiSelected);
Canvas.Font.Color := Font.Color;
if Assigned(OnCustomDrawItem) or Assigned(FOnAdvancedCustomDrawItem) then
if IsCustomDrawn(dtItem, cdPrePaint) then
begin
DrawState := [];
if NodeSelected then
@ -4922,7 +4922,7 @@ begin
// draw insert mark
DrawInsertMark;
end;
if Assigned(OnCustomDrawItem) or Assigned(FOnAdvancedCustomDrawItem) then
if IsCustomDrawn(dtItem, cdPostPaint) then
begin
DrawState:=[];
if Node.Selected then