Skip to content

Commit a34341a

Browse files
- Bug fix: TBaseVirtualTree.AdjustTotalHeight now longer calculates wrong total heights if nodes have been made invisible
- Bug fix: TCustomVirtualStringTree.OnMeasureTextWidth now works as intended - Bug fix: Added missing $IFDEFs concerning theming support - Bug fix: Removed default from properties TVirtualTreeColumn.Color and TVirtualTreeColumn.BiDiMode
1 parent 8f39355 commit a34341a

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

Source/VirtualTrees.pas

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
// (C) 1999-2001 digital publishing AG. All Rights Reserved.
2525
//----------------------------------------------------------------------------------------------------------------------
2626
//
27+
// January 2010
28+
// - Bug fix: TBaseVirtualTree.AdjustTotalHeight now longer calculates wrong total heights if nodes have been
29+
// made invisible
30+
// - Bug fix: TCustomVirtualStringTree.OnMeasureTextWidth now works as intended
31+
// - Bug fix: Added missing $IFDEFs concerning theming support
32+
// - Bug fix: Removed default from properties TVirtualTreeColumn.Color and TVirtualTreeColumn.BiDiMode
2733
// July 2009
2834
// - Bug fix: TWorkerThread will no longer reference the tree after it has been destroyed (Mantis issue #384)
2935
// - Bug fix: TBaseVirtualTree.InternalConnectNode checked the expanded state of the wrong node if Mode was
@@ -275,14 +281,14 @@
275281
// For full document history see help file.
276282
//
277283
// Credits for their valuable assistance and code donations go to:
278-
// Freddy Ertl, Marian Aldenhövel, Thomas Bogenrieder, Jim Kuenemann, Werner Lehmann, Jens Treichler,
279-
// Paul Gallagher (IBO tree), Ondrej Kelle, Ronaldo Melo Ferraz, Heri Bender, Roland Bedürftig (BCB)
284+
// Freddy Ertl, Marian Aldenh�vel, Thomas Bogenrieder, Jim Kuenemann, Werner Lehmann, Jens Treichler,
285+
// Paul Gallagher (IBO tree), Ondrej Kelle, Ronaldo Melo Ferraz, Heri Bender, Roland Bed�rftig (BCB)
280286
// Anthony Mills, Alexander Egorushkin (BCB), Mathias Torell (BCB), Frank van den Bergh, Vadim Sedulin, Peter Evans,
281287
// Milan Vandrovec (BCB), Steve Moss, Joe White, David Clark, Anders Thomsen, Igor Afanasyev, Eugene Programmer,
282288
// Corbin Dunn, Richard Pringle, Uli Gerhardt, Azza, Igor Savkic, Daniel Bauten, Timo Tegtmeier, Dmitry Zegebart,
283289
// Andreas Hausladen
284290
// Beta testers:
285-
// Freddy Ertl, Hans-Jürgen Schnorrenberg, Werner Lehmann, Jim Kueneman, Vadim Sedulin, Moritz Franckenstein,
291+
// Freddy Ertl, Hans-J�rgen Schnorrenberg, Werner Lehmann, Jim Kueneman, Vadim Sedulin, Moritz Franckenstein,
286292
// Wim van der Vegt, Franc v/d Westelaken
287293
// Indirect contribution (via publicly accessible work of those persons):
288294
// Alex Denissov, Hiroyuki Hori (MMXAsm expert)
@@ -1283,14 +1289,14 @@ TVirtualTreeColumn = class(TCollectionItem)
12831289
property Owner: TVirtualTreeColumns read GetOwner;
12841290
published
12851291
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
1286-
property BiDiMode: TBiDiMode read FBiDiMode write SetBiDiMode stored IsBiDiModeStored default bdLeftToRight;
1292+
property BiDiMode: TBiDiMode read FBiDiMode write SetBiDiMode stored IsBiDiModeStored;
12871293
property CaptionAlignment: TAlignment read GetCaptionAlignment write SetCaptionAlignment
12881294
stored IsCaptionAlignmentStored default taLeftJustify;
12891295
property CaptionText: UnicodeString read FCaptionText stored False;
12901296
property CheckType: TCheckType read FCheckType write SetCheckType default ctCheckBox;
12911297
property CheckState: TCheckState read FCheckState write SetCheckState default csUncheckedNormal;
12921298
property CheckBox: Boolean read FCheckBox write SetCheckBox default False;
1293-
property Color: TColor read FColor write SetColor stored IsColorStored default clWindow;
1299+
property Color: TColor read FColor write SetColor stored IsColorStored;
12941300
property Hint: UnicodeString read FHint write FHint stored False;
12951301
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1;
12961302
property Layout: TVTHeaderColumnLayout read FLayout write SetLayout default blGlyphLeft;
@@ -3959,7 +3965,7 @@ implementation
39593965

39603966
// Do not modify the copyright in any way! Usage of this unit is prohibited without the copyright notice
39613967
// in the compiled binary file.
3962-
Copyright: string = 'Virtual Treeview © 1999, 2009 Mike Lischke';
3968+
Copyright: string = 'Virtual Treeview 1999, 2010 Mike Lischke';
39633969

39643970
var
39653971
StandardOLEFormat: TFormatEtc = (
@@ -13789,8 +13795,7 @@ procedure TBaseVirtualTree.AdjustTotalHeight(Node: PVirtualNode; Value: Integer;
1378913795
begin
1379013796
Run := Node;
1379113797
repeat
13792-
if vsVisible in Run.States then
13793-
Inc(Integer(Run.TotalHeight), Difference);
13798+
Inc(Integer(Run.TotalHeight), Difference);
1379413799
// If the node is not visible or the parent node is not expanded or we are already at the top
1379513800
// then nothing more remains to do.
1379613801
if not (vsVisible in Run.States) or (Run = FRoot) or
@@ -25074,8 +25079,10 @@ procedure TBaseVirtualTree.PrepareCell(var PaintInfo: TVTPaintInfo; WindowOrgX,
2507425079
end;
2507525080
end;
2507625081

25077-
if Theme <> 0 then
25078-
CloseThemeData(Theme);
25082+
{$ifdef ThemeSupport}
25083+
if Theme <> 0 then
25084+
CloseThemeData(Theme);
25085+
{$endif ThemeSupport}
2507925086
end;
2508025087

2508125088
//----------------------------------------------------------------------------------------------------------------------
@@ -33894,9 +33901,9 @@ function TCustomVirtualStringTree.DoTextMeasuring(Canvas: TCanvas; Node: PVirtua
3389433901
DrawTextW(Canvas.Handle, PWideChar(Text), Length(Text), R, DrawFormat, False);
3389533902
Size.cx := R.Right - R.Left;
3389633903
end;
33904+
Result := Size.cx;
3389733905
if Assigned(FOnMeasureTextWidth) then
3389833906
FOnMeasureTextWidth(Self, Canvas, Node, Column, Text, Result);
33899-
Result := Size.cx;
3390033907
end;
3390133908

3390233909
//----------------------------------------------------------------------------------------------------------------------
@@ -34265,7 +34272,7 @@ function TCustomVirtualStringTree.ContentToHTML(Source: TVSTTextSourceType; Capt
3426534272

3426634273
// Renders the current tree content (depending on Source) as HTML text encoded in UTF-8.
3426734274
// If Caption is not empty then it is used to create and fill the header for the table built here.
34268-
// Based on ideas and code from Frank van den Bergh and Andreas Hörstemeier.
34275+
// Based on ideas and code from Frank van den Bergh and Andreas H�rstemeier.
3426934276

3427034277
type
3427134278
UCS2 = Word;
@@ -34779,7 +34786,7 @@ function TCustomVirtualStringTree.CanExportNode(Node: PVirtualNode ): Boolean;
3477934786
function TCustomVirtualStringTree.ContentToRTF(Source: TVSTTextSourceType): AnsiString;
3478034787

3478134788
// Renders the current tree content (depending on Source) as RTF (rich text).
34782-
// Based on ideas and code from Frank van den Bergh and Andreas Hörstemeier.
34789+
// Based on ideas and code from Frank van den Bergh and Andreas H�rstemeier.
3478334790

3478434791
var
3478534792
Fonts: TStringList;

0 commit comments

Comments
 (0)