@@ -120,7 +120,7 @@ TVirtualTreeClass = class of TBaseVirtualTree;
120
120
// to compile (conversion done by BCB is wrong).
121
121
TCacheEntry = record
122
122
Node: PVirtualNode;
123
- AbsoluteTop: TDimension ;
123
+ AbsoluteTop: TNodeHeight ;
124
124
end;
125
125
126
126
TCache = array of TCacheEntry;
@@ -531,7 +531,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
531
531
FOffsetY: TDimension; // Determines left and top scroll offset.
532
532
FEffectiveOffsetX: TDimension; // Actual position of the horizontal scroll bar (varies depending on bidi mode).
533
533
FRangeX,
534
- FRangeY: TDimension ; // current virtual width and height of the tree
534
+ FRangeY: TNodeHeight ; // current virtual width and height of the tree
535
535
FBottomSpace: TDimension; // Extra space below the last node.
536
536
537
537
FDefaultPasteMode: TVTNodeAttachMode; // Used to determine where to add pasted nodes to.
@@ -739,8 +739,8 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
739
739
procedure ClearNodeBackground(const PaintInfo: TVTPaintInfo; UseBackground, Floating: Boolean; R: TRect);
740
740
function CompareNodePositions(Node1, Node2: PVirtualNode; ConsiderChildrenAbove: Boolean = False): Integer;
741
741
procedure DrawLineImage(const PaintInfo: TVTPaintInfo; X, Y, H, VAlign: TDimension; Style: TVTLineType; Reverse: Boolean);
742
- function FindInPositionCache(Node: PVirtualNode; var CurrentPos: TDimension ): PVirtualNode; overload;
743
- function FindInPositionCache(Position: TDimension; var CurrentPos: TDimension ): PVirtualNode; overload;
742
+ function FindInPositionCache(Node: PVirtualNode; var CurrentPos: TNodeHeight ): PVirtualNode; overload;
743
+ function FindInPositionCache(Position: TDimension; var CurrentPos: TNodeHeight ): PVirtualNode; overload;
744
744
procedure FixupTotalCount(Node: PVirtualNode);
745
745
procedure FixupTotalHeight(Node: PVirtualNode);
746
746
function GetBottomNode: PVirtualNode;
@@ -904,7 +904,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
904
904
procedure AddToSelection(const NewItems: TNodeArray; NewLength: Integer; ForceInsert: Boolean = False); overload; virtual;
905
905
procedure AdjustPaintCellRect(var PaintInfo: TVTPaintInfo; var NextNonEmpty: TColumnIndex); virtual;
906
906
procedure AdjustPanningCursor(X, Y: TDimension); virtual;
907
- procedure AdjustTotalHeight(Node: PVirtualNode; Value: TDimension ; relative: Boolean = False);
907
+ procedure AdjustTotalHeight(Node: PVirtualNode; Value: TNodeHeight ; relative: Boolean = False);
908
908
procedure AdviseChangeEvent(StructureChange: Boolean; Node: PVirtualNode; Reason: TChangeReason); virtual;
909
909
function AllocateInternalDataArea(Size: Cardinal): Cardinal; virtual;
910
910
procedure Animate(Steps, Duration: Cardinal; Callback: TVTAnimationCallback; Data: Pointer); virtual;
@@ -1235,7 +1235,7 @@ TBaseVirtualTree = class abstract(TVTBaseAncestor)
1235
1235
property MinusBM: TBitmap read FMinusBM;
1236
1236
property PlusBM: TBitmap read FPlusBM;
1237
1237
property RangeX: TDimension read GetRangeX;// Returns the width of the virtual tree in pixels, (not ClientWidth). If there are columns it returns the total width of all of them; otherwise it returns the maximum of the all the line's data widths.
1238
- property RangeY: TDimension read FRangeY;
1238
+ property RangeY: TNodeHeight read FRangeY;
1239
1239
property RootNodeCount: Cardinal read GetRootNodeCount write SetRootNodeCount default 0;
1240
1240
property ScrollBarOptions: TScrollBarOptions read FScrollBarOptions write SetScrollBarOptions;
1241
1241
property SelectionBlendFactor: Byte read FSelectionBlendFactor write FSelectionBlendFactor default 128;
@@ -2211,12 +2211,12 @@ procedure TBaseVirtualTree.AdjustTotalCount(Node: PVirtualNode; Value: Integer;
2211
2211
2212
2212
//----------------------------------------------------------------------------------------------------------------------
2213
2213
2214
- procedure TBaseVirtualTree.AdjustTotalHeight(Node: PVirtualNode; Value: TDimension ; Relative: Boolean = False);
2214
+ procedure TBaseVirtualTree.AdjustTotalHeight(Node: PVirtualNode; Value: TNodeHeight ; Relative: Boolean = False);
2215
2215
2216
2216
// Sets a node's total height to the given value and recursively adjusts the parent's total height.
2217
2217
2218
2218
var
2219
- Difference: TDimension ;
2219
+ Difference: TNodeHeight ;
2220
2220
Run: PVirtualNode;
2221
2221
2222
2222
begin
@@ -2997,7 +2997,7 @@ procedure TBaseVirtualTree.DrawLineImage(const PaintInfo: TVTPaintInfo; X, Y, H,
2997
2997
2998
2998
//----------------------------------------------------------------------------------------------------------------------
2999
2999
3000
- function TBaseVirtualTree.FindInPositionCache(Node: PVirtualNode; var CurrentPos: TDimension ): PVirtualNode;
3000
+ function TBaseVirtualTree.FindInPositionCache(Node: PVirtualNode; var CurrentPos: TNodeHeight ): PVirtualNode;
3001
3001
3002
3002
// Looks through the position cache and returns the node whose top position is the largest one which is smaller or equal
3003
3003
// to the position of the given node.
@@ -3030,7 +3030,7 @@ function TBaseVirtualTree.FindInPositionCache(Node: PVirtualNode; var CurrentPos
3030
3030
3031
3031
//----------------------------------------------------------------------------------------------------------------------
3032
3032
3033
- function TBaseVirtualTree.FindInPositionCache(Position: TDimension; var CurrentPos: TDimension ): PVirtualNode;
3033
+ function TBaseVirtualTree.FindInPositionCache(Position: TDimension; var CurrentPos: TNodeHeight ): PVirtualNode;
3034
3034
3035
3035
// Looks through the position cache and returns the node whose top position is the largest one which is smaller or equal
3036
3036
// to the given vertical position.
@@ -9328,7 +9328,9 @@ function TBaseVirtualTree.DetermineScrollDirections(X, Y: TDimension): TScrollDi
9328
9328
// yet elapsed.
9329
9329
if ((Int64(timeGetTime) - FDragScrollStart) < FAutoScrollDelay) then
9330
9330
Result := [];
9331
- end;
9331
+ end
9332
+ else
9333
+ OutputDebugString('Ooops');
9332
9334
end;
9333
9335
end;
9334
9336
end;
@@ -11029,7 +11031,7 @@ function TBaseVirtualTree.DoValidateCache(): Boolean;
11029
11031
Index: Cardinal;
11030
11032
CurrentNode,
11031
11033
Temp: PVirtualNode;
11032
- CurrentTop: TDimension ;
11034
+ CurrentTop: TNodeHeight ;
11033
11035
begin
11034
11036
EntryCount := 0;
11035
11037
if not (tsStopValidation in FStates) then
@@ -16851,7 +16853,7 @@ function TBaseVirtualTree.GetDisplayRect(Node: PVirtualNode; Column: TColumnInde
16851
16853
var
16852
16854
Temp: PVirtualNode;
16853
16855
LeftOffset: TDimension;
16854
- TopOffset: TDimension ;
16856
+ TopOffset: TNodeHeight ;
16855
16857
CacheIsAvailable: Boolean;
16856
16858
TextWidth: TDimension;
16857
16859
CurrentBidiMode: TBidiMode;
@@ -18463,7 +18465,7 @@ function TBaseVirtualTree.GetNodeAt(X, Y: TDimension; Relative: Boolean; var Nod
18463
18465
18464
18466
var
18465
18467
AbsolutePos,
18466
- CurrentPos: TDimension ;
18468
+ CurrentPos: TNodeHeight ;
18467
18469
18468
18470
begin
18469
18471
if Y < 0 then
@@ -22616,7 +22618,7 @@ procedure TBaseVirtualTree.UpdateVerticalRange;
22616
22618
DoShowScrollBar(SB_VERT, True);
22617
22619
22618
22620
ScrollInfo.nMin := 0;
22619
- ScrollInfo.nMax := FRangeY;
22621
+ ScrollInfo.nMax := IfThen( FRangeY < MaxInt, FRangeY, MaxInt); // TScrollInfo values are signed 32bit only
22620
22622
ScrollInfo.nPos := -FOffsetY;
22621
22623
ScrollInfo.nPage := Max(0, ClientHeight + 1);
22622
22624
0 commit comments