@@ -9,7 +9,7 @@ interface
9
9
uses
10
10
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
11
11
Dialogs, ImgList, VirtualTrees, StdCtrls, ExtCtrls, VirtualTrees.BaseTree, System.ImageList,
12
- VirtualTrees.Types;
12
+ VirtualTrees.Types, VirtualTrees.BaseAncestorVCL, VirtualTrees.AncestorVCL ;
13
13
14
14
type
15
15
THeaderOwnerDrawForm = class (TForm)
@@ -96,7 +96,7 @@ procedure THeaderOwnerDrawForm.HeaderCustomDrawTreeAdvancedHeaderDraw(Sender: TV
96
96
Size: TSize;
97
97
SourceRect,
98
98
TargetRect: TRect;
99
-
99
+ OldFont: TFont;
100
100
begin
101
101
with PaintInfo do
102
102
begin
@@ -142,15 +142,25 @@ procedure THeaderOwnerDrawForm.HeaderCustomDrawTreeAdvancedHeaderDraw(Sender: TV
142
142
end ;
143
143
if hpeText in Elements then
144
144
begin
145
- TargetCanvas.Font.Name := ' Webdings' ;
146
- TargetCanvas.Font.Charset := SYMBOL_CHARSET;
147
- TargetCanvas.Font.Size := 60 ;
148
- if IsHoverIndex then
149
- TargetCanvas.Font.Color := $80FF;
150
- S := ' û' ;
151
- Size := TargetCanvas.TextExtent(S);
152
- SetBkMode(TargetCanvas.Handle, TRANSPARENT);
153
- TargetCanvas.TextOut(PaintRectangle.Left + 10 , Paintrectangle.Bottom - Size.cy, S);
145
+ // store current font
146
+ OldFont := TFont.Create();
147
+ try
148
+ OldFont.Assign(TargetCanvas.Font);
149
+ // draw world map
150
+ TargetCanvas.Font.Name := ' Webdings' ;
151
+ TargetCanvas.Font.Charset := SYMBOL_CHARSET;
152
+ TargetCanvas.Font.Size := 60 ;
153
+ if IsHoverIndex then
154
+ TargetCanvas.Font.Color := $80FF;
155
+ S := ' û' ;
156
+ Size := TargetCanvas.TextExtent(S);
157
+ SetBkMode(TargetCanvas.Handle, TRANSPARENT);
158
+ TargetCanvas.TextOut(PaintRectangle.Left + 10 , Paintrectangle.Bottom - Size.cy, S);
159
+ // restore previous font
160
+ TargetCanvas.Font.Assign(OldFont);
161
+ finally
162
+ OldFont.Free();
163
+ end ;
154
164
end ;
155
165
// Other elements go here.
156
166
end ;
0 commit comments