@@ -6134,6 +6134,8 @@ function TVirtualTreeHintWindow.CalcHintRect(MaxWidth: Integer; const AHint: str
6134
6134
DoPaintText(Node, Self.Canvas, Column, ttNormal);
6135
6135
//force the default hint font color
6136
6136
Canvas.Font.Color := Screen.HintFont.Color;
6137
+ if Canvas.Font.Color = clDefault then
6138
+ Canvas.Font.Color := clInfoText;
6137
6139
end;
6138
6140
6139
6141
//let THintWindow do the job
@@ -8331,7 +8333,7 @@ procedure TVirtualTreeColumns.DrawButtonText(DC: HDC; Caption: String; Bounds: T
8331
8333
else
8332
8334
TextColor := FHeader.Treeview.FColors.HeaderFontColor;
8333
8335
if TextColor = clDefault then
8334
- TextColor := clBtnText ;
8336
+ TextColor := FHeader.Treeview.GetDefaultColor(dctFont) ;
8335
8337
SetTextColor(DC, ColorToRGB(TextColor));
8336
8338
DrawText(DC, PChar(Caption), Length(Caption), Bounds, DrawFormat);
8337
8339
end;
@@ -9521,8 +9523,13 @@ procedure TVirtualTreeColumns.PaintHeader(TargetCanvas: TCanvas; R: TRect; const
9521
9523
ColImageInfo.Index := GetCheckImage(nil, FCheckType, FCheckState, IsEnabled);
9522
9524
ColImageInfo.XPos := GlyphPos.X;
9523
9525
ColImageInfo.YPos := GlyphPos.Y;
9526
+ if ColImageInfo.Images <> nil then begin
9524
9527
w := ColImageInfo.Images.Width;
9525
9528
h := ColImageInfo.Images.Height;
9529
+ end else begin
9530
+ w := 0;
9531
+ h := 0;
9532
+ end;
9526
9533
PaintCheckImage(TargetCanvas, ColImageInfo, False);
9527
9534
end;
9528
9535
end;
@@ -9627,6 +9634,9 @@ procedure TVirtualTreeColumns.PaintHeader(TargetCanvas: TCanvas; R: TRect; const
9627
9634
// Use shortcuts for the images and the font.
9628
9635
Images := FHeader.FImages;
9629
9636
Font := FHeader.FFont;
9637
+ if Font.Color = clDefault then
9638
+ Font.Color := FHeader.Treeview.GetDefaultColor(dctFont);
9639
+
9630
9640
{$IF LCL_FullVersion >= 2000000}
9631
9641
if Images <> nil then
9632
9642
ImagesRes := Images.ResolutionForPPI[FHeader.ImagesWidth, Font.PixelsPerInch, Header.TreeView.GetCanvasScaleFactor];
@@ -14480,9 +14490,11 @@ procedure TBaseVirtualTree.PrepareBitmaps(NeedButtons, NeedLines: Boolean);
14480
14490
end;
14481
14491
14482
14492
{$ifdef ThemeSupport}
14483
- // if Theme <> 0 then
14484
- // CloseThemeData(Theme);
14493
+ {$ifdef Windows}
14494
+ if tsUseThemes in FStates then
14495
+ CloseThemeData(Theme);
14485
14496
{$endif}
14497
+ {$endif ThemeSupport}
14486
14498
end;
14487
14499
14488
14500
//----------------------------------------------------------------------------------------------------------------------
@@ -22765,7 +22777,7 @@ procedure TBaseVirtualTree.HandleMouseDown(var Message: TLMMouse; var HitInfo: T
22765
22777
else // No MultiSelect, hence we can start a drag anywhere in the row.
22766
22778
FullRowDrag := toFullRowDrag in FOptions.FMiscOptions;
22767
22779
22768
- IsHeightTracking := (Message.Msg = LM_LBUTTONDOWN ) and
22780
+ IsHeightTracking := (Message.Msg = WM_LBUTTONDOWN ) and
22769
22781
(hiOnItem in HitInfo.HitPositions) and
22770
22782
([hiUpperSplitter, hiLowerSplitter] * HitInfo.HitPositions <> []);
22771
22783
@@ -24446,10 +24458,10 @@ procedure TBaseVirtualTree.PaintNodeButton(Canvas: TCanvas; Node: PVirtualNode;
24446
24458
IsHot: Boolean;
24447
24459
{$ifdef Windows}
24448
24460
Theme: HTHEME;
24449
- {$endif}
24450
24461
Glyph: Integer;
24451
24462
State: Integer;
24452
24463
Pos: TRect;
24464
+ {$endif}
24453
24465
24454
24466
begin
24455
24467
IsHot := (toHotTrack in FOptions.FPaintOptions) and (FCurrentHotNode = Node) and FHotNodeButtonHit;
@@ -24462,11 +24474,11 @@ procedure TBaseVirtualTree.PaintNodeButton(Canvas: TCanvas; Node: PVirtualNode;
24462
24474
24463
24475
if tsUseExplorerTheme in FStates then
24464
24476
begin
24477
+ {$ifdef Windows}
24465
24478
Glyph := IfThen(IsHot, TVP_HOTGLYPH, TVP_GLYPH);
24466
24479
State := IfThen(vsExpanded in Node.States, GLPS_OPENED, GLPS_CLOSED);
24467
24480
Pos := Rect(XPos, R.Top + ButtonY, XPos + FPlusBM.Width, R.Top + ButtonY + FPlusBM.Height);
24468
24481
24469
- {$ifdef Windows}
24470
24482
Theme := OpenThemeData(Handle, 'TREEVIEW');
24471
24483
DrawThemeBackground(Theme, Canvas.Handle, Glyph, State, Pos, nil);
24472
24484
CloseThemeData(Theme);
@@ -24798,7 +24810,7 @@ procedure TBaseVirtualTree.PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX,
24798
24810
if not IsRectEmpty(InnerRect) then
24799
24811
{$ifdef ThemeSupport}
24800
24812
{$ifdef Windows}
24801
- if Theme <> 0 then
24813
+ if tsUseExplorerTheme in FStates then
24802
24814
begin
24803
24815
// If the node is also hot, its background will be drawn later.
24804
24816
if not (toHotTrack in FOptions.FPaintOptions) or (Node <> FCurrentHotNode) or
@@ -24819,7 +24831,7 @@ procedure TBaseVirtualTree.PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX,
24819
24831
24820
24832
{$ifdef ThemeSupport}
24821
24833
{$ifdef Windows}
24822
- if (Theme <> 0 ) and (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) and
24834
+ if (tsUseExplorerTheme in FStates ) and (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) and
24823
24835
((Column = FCurrentHotColumn) or (toFullRowSelect in FOptions.FSelectionOptions)) then
24824
24836
DrawBackground(IfThen((vsSelected in Node.States) and not (toAlwaysHideSelection in FOptions.FPaintOptions),
24825
24837
TREIS_HOTSELECTED, TREIS_HOT));
@@ -24844,7 +24856,7 @@ procedure TBaseVirtualTree.PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX,
24844
24856
{$ifdef ThemeSupport}
24845
24857
{$ifdef Windows}
24846
24858
if not (toExtendedFocus in FOptions.FSelectionOptions) and (toFullRowSelect in FOptions.FSelectionOptions) and
24847
- (Theme <> 0 ) then
24859
+ (tsUseExplorerTheme in FStates ) then
24848
24860
FocusRect := RowRect
24849
24861
else
24850
24862
{$endif}
@@ -24879,11 +24891,10 @@ procedure TBaseVirtualTree.PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX,
24879
24891
end;
24880
24892
end;
24881
24893
{$ifdef ThemeSupport}
24882
- //todo
24883
- {
24884
- if Theme <> 0 then
24894
+ {$ifdef Windows}
24895
+ if tsUseExplorerTheme in FStates then
24885
24896
CloseThemeData(Theme);
24886
- }
24897
+ {$endif }
24887
24898
{$endif ThemeSupport}
24888
24899
end;
24889
24900
@@ -33634,7 +33645,7 @@ procedure TCustomVirtualStringTree.InitializeTextProperties(var PaintInfo: TVTPa
33634
33645
end;
33635
33646
end;
33636
33647
if Canvas.Font.Color = clDefault then
33637
- Canvas.Font.Color := clWindowText ;
33648
+ Canvas.Font.Color := GetDefaultColor(dctFont) ;
33638
33649
end;
33639
33650
end;
33640
33651
@@ -33748,6 +33759,8 @@ procedure TCustomVirtualStringTree.PaintStaticText(const PaintInfo: TVTPaintInfo
33748
33759
with PaintInfo do
33749
33760
begin
33750
33761
Canvas.Font := Font;
33762
+ if Font.Color = clDefault then
33763
+ Canvas.Font.Color := GetDefaultColor(dctFont);
33751
33764
if toFullRowSelect in FOptions.FSelectionOptions then
33752
33765
begin
33753
33766
if Node = FDropTargetNode then
@@ -33765,6 +33778,8 @@ procedure TCustomVirtualStringTree.PaintStaticText(const PaintInfo: TVTPaintInfo
33765
33778
else
33766
33779
Canvas.Font.Color := FColors.NodeFontColor;
33767
33780
end;
33781
+ if Canvas.Font.Color = clDefault then
33782
+ Canvas.Font.Color := GetDefaultColor(dctFont);
33768
33783
end;
33769
33784
33770
33785
DrawFormat := DT_NOPREFIX or DT_VCENTER or DT_SINGLELINE;
@@ -34209,6 +34224,7 @@ function TCustomVirtualStringTree.DoShortenString(Canvas: TCanvas; Node: PVirtua
34209
34224
Done: Boolean;
34210
34225
34211
34226
begin
34227
+ Result := '';
34212
34228
Done := False;
34213
34229
if Assigned(FOnShortenString) then
34214
34230
FOnShortenString(Self, Canvas, Node, Column, S, Width, Result, Done);
0 commit comments