lcl: formatting

git-svn-id: trunk@27757 -
This commit is contained in:
paul 2010-10-19 01:11:31 +00:00
parent 94ca121303
commit 9b70fb4a72

View File

@ -4083,13 +4083,15 @@ var
Node: TTreeNode; Node: TTreeNode;
InsertMarkRect: TRect; InsertMarkRect: TRect;
begin begin
if [tvsUpdating,tvsPainting]*FStates<>[] then exit; if [tvsUpdating,tvsPainting] * FStates <> [] then Exit;
Include(FStates, tvsPainting); Include(FStates, tvsPainting);
if (tvoAutoItemHeight in fOptions) then if (tvoAutoItemHeight in fOptions) then
UpdateDefaultItemHeight; UpdateDefaultItemHeight;
UpdateScrollbars; UpdateScrollbars;
with Canvas do begin with Canvas do
if Assigned(FOnCustomDraw) or Assigned(FOnAdvancedCustomDraw) then begin begin
if Assigned(FOnCustomDraw) or Assigned(FOnAdvancedCustomDraw) then
begin
DrawRect := ClientRect; DrawRect := ClientRect;
if not CustomDraw(DrawRect, cdPrePaint) then exit; if not CustomDraw(DrawRect, cdPrePaint) then exit;
end; end;
@ -4097,7 +4099,8 @@ begin
Node := TopItem; Node := TopItem;
//write('[TCustomTreeView.DoPaint] A Node=',DbgS(Node)); //write('[TCustomTreeView.DoPaint] A Node=',DbgS(Node));
//if Node<>nil then DebugLn(' Node.Text=',Node.Text) else DebugLn(''); //if Node<>nil then DebugLn(' Node.Text=',Node.Text) else DebugLn('');
while Node<>nil do begin while Node <> nil do
begin
DoPaintNode(Node); DoPaintNode(Node);
Node := Node.GetNextVisible; Node := Node.GetNextVisible;
//write('[TCustomTreeView.DoPaint] B Node=',DbgS(Node)); //write('[TCustomTreeView.DoPaint] B Node=',DbgS(Node));
@ -4107,8 +4110,8 @@ begin
(ClientWidth - ScrollBarWidth) - BorderWidth, (ClientWidth - ScrollBarWidth) - BorderWidth,
(ClientHeight - ScrollBarWidth) - BorderWidth); (ClientHeight - ScrollBarWidth) - BorderWidth);
// draw insert mark for new root node // draw insert mark for new root node
if (InsertMarkType=tvimAsFirstChild) if (InsertMarkType = tvimAsFirstChild) and (Items.Count = 0) then
and (Items.Count=0) then begin begin
Pen.Color := FTreeLineColor; Pen.Color := FTreeLineColor;
Brush.Color := FSelectedColor; Brush.Color := FSelectedColor;
InsertMarkRect := SpaceRect; InsertMarkRect := SpaceRect;
@ -4131,7 +4134,8 @@ begin
// draw border // draw border
HalfBorderWidth := BorderWidth shr 1; HalfBorderWidth := BorderWidth shr 1;
Pen.Color := clGray; Pen.Color := clGray;
for a:=0 to BorderWidth-1 do begin for a := 0 to BorderWidth - 1 do
begin
if a = HalfBorderWidth then if a = HalfBorderWidth then
Pen.Color := clBlack; Pen.Color := clBlack;
MoveTo(a, (ClientHeight-ScrollBarWidth) - 1 - a); MoveTo(a, (ClientHeight-ScrollBarWidth) - 1 - a);
@ -4139,14 +4143,16 @@ begin
LineTo((ClientWidth - ScrollBarWidth) - 1 - a, a); LineTo((ClientWidth - ScrollBarWidth) - 1 - a, a);
end; end;
Pen.Color := clWhite; Pen.Color := clWhite;
for a:=0 to BorderWidth-1 do begin for a := 0 to BorderWidth - 1 do
begin
if a = HalfBorderWidth then if a = HalfBorderWidth then
Pen.Color := clLtGray; Pen.Color := clLtGray;
MoveTo((ClientWidth - ScrollBarWidth) - 1 - a, a); MoveTo((ClientWidth - ScrollBarWidth) - 1 - a, a);
LineTo((ClientWidth - ScrollBarWidth) - 1 - a, (ClientHeight - ScrollBarWidth) - 1 - a); LineTo((ClientWidth - ScrollBarWidth) - 1 - a, (ClientHeight - ScrollBarWidth) - 1 - a);
LineTo(a, (ClientHeight-ScrollBarWidth) - 1 - a); LineTo(a, (ClientHeight-ScrollBarWidth) - 1 - a);
end; end;
if Assigned(FOnCustomDraw) or Assigned(FOnAdvancedCustomDraw) then begin if Assigned(FOnCustomDraw) or Assigned(FOnAdvancedCustomDraw) then
begin
DrawRect := ClientRect; DrawRect := ClientRect;
if not CustomDraw(DrawRect, cdPostPaint) then exit; if not CustomDraw(DrawRect, cdPostPaint) then exit;
end; end;