@@ -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];
@@ -14481,7 +14491,7 @@ procedure TBaseVirtualTree.PrepareBitmaps(NeedButtons, NeedLines: Boolean);
14481
14491
14482
14492
{$ifdef ThemeSupport}
14483
14493
{$ifdef Windows}
14484
- if Theme <> 0 then
14494
+ if tsUseThemes in FStates then
14485
14495
CloseThemeData(Theme);
14486
14496
{$endif}
14487
14497
{$endif ThemeSupport}
@@ -22767,7 +22777,7 @@ procedure TBaseVirtualTree.HandleMouseDown(var Message: TLMMouse; var HitInfo: T
22767
22777
else // No MultiSelect, hence we can start a drag anywhere in the row.
22768
22778
FullRowDrag := toFullRowDrag in FOptions.FMiscOptions;
22769
22779
22770
- IsHeightTracking := (Message.Msg = LM_LBUTTONDOWN ) and
22780
+ IsHeightTracking := (Message.Msg = WM_LBUTTONDOWN ) and
22771
22781
(hiOnItem in HitInfo.HitPositions) and
22772
22782
([hiUpperSplitter, hiLowerSplitter] * HitInfo.HitPositions <> []);
22773
22783
@@ -24448,10 +24458,10 @@ procedure TBaseVirtualTree.PaintNodeButton(Canvas: TCanvas; Node: PVirtualNode;
24448
24458
IsHot: Boolean;
24449
24459
{$ifdef Windows}
24450
24460
Theme: HTHEME;
24451
- {$endif}
24452
24461
Glyph: Integer;
24453
24462
State: Integer;
24454
24463
Pos: TRect;
24464
+ {$endif}
24455
24465
24456
24466
begin
24457
24467
IsHot := (toHotTrack in FOptions.FPaintOptions) and (FCurrentHotNode = Node) and FHotNodeButtonHit;
@@ -24464,11 +24474,11 @@ procedure TBaseVirtualTree.PaintNodeButton(Canvas: TCanvas; Node: PVirtualNode;
24464
24474
24465
24475
if tsUseExplorerTheme in FStates then
24466
24476
begin
24477
+ {$ifdef Windows}
24467
24478
Glyph := IfThen(IsHot, TVP_HOTGLYPH, TVP_GLYPH);
24468
24479
State := IfThen(vsExpanded in Node.States, GLPS_OPENED, GLPS_CLOSED);
24469
24480
Pos := Rect(XPos, R.Top + ButtonY, XPos + FPlusBM.Width, R.Top + ButtonY + FPlusBM.Height);
24470
24481
24471
- {$ifdef Windows}
24472
24482
Theme := OpenThemeData(Handle, 'TREEVIEW');
24473
24483
DrawThemeBackground(Theme, Canvas.Handle, Glyph, State, Pos, nil);
24474
24484
CloseThemeData(Theme);
@@ -33635,7 +33645,7 @@ procedure TCustomVirtualStringTree.InitializeTextProperties(var PaintInfo: TVTPa
33635
33645
end;
33636
33646
end;
33637
33647
if Canvas.Font.Color = clDefault then
33638
- Canvas.Font.Color := clWindowText ;
33648
+ Canvas.Font.Color := GetDefaultColor(dctFont) ;
33639
33649
end;
33640
33650
end;
33641
33651
@@ -33749,6 +33759,8 @@ procedure TCustomVirtualStringTree.PaintStaticText(const PaintInfo: TVTPaintInfo
33749
33759
with PaintInfo do
33750
33760
begin
33751
33761
Canvas.Font := Font;
33762
+ if Font.Color = clDefault then
33763
+ Canvas.Font.Color := GetDefaultColor(dctFont);
33752
33764
if toFullRowSelect in FOptions.FSelectionOptions then
33753
33765
begin
33754
33766
if Node = FDropTargetNode then
@@ -33766,6 +33778,8 @@ procedure TCustomVirtualStringTree.PaintStaticText(const PaintInfo: TVTPaintInfo
33766
33778
else
33767
33779
Canvas.Font.Color := FColors.NodeFontColor;
33768
33780
end;
33781
+ if Canvas.Font.Color = clDefault then
33782
+ Canvas.Font.Color := GetDefaultColor(dctFont);
33769
33783
end;
33770
33784
33771
33785
DrawFormat := DT_NOPREFIX or DT_VCENTER or DT_SINGLELINE;
@@ -34210,6 +34224,7 @@ function TCustomVirtualStringTree.DoShortenString(Canvas: TCanvas; Node: PVirtua
34210
34224
Done: Boolean;
34211
34225
34212
34226
begin
34227
+ Result := '';
34213
34228
Done := False;
34214
34229
if Assigned(FOnShortenString) then
34215
34230
FOnShortenString(Self, Canvas, Node, Column, S, Width, Result, Done);
0 commit comments