You've already forked lazarus-ccr
* Synchronize with main VTV repository up to svn rev 198
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2910 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -27,26 +27,14 @@ unit VirtualTrees;
|
|||||||
// (C) 1999-2001 digital publishing AG. All Rights Reserved.
|
// (C) 1999-2001 digital publishing AG. All Rights Reserved.
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// April 2010
|
|
||||||
// - Bug fix: Removed active column changing from TBaseVirtualTree.WMKeyDown to re-gain standard conforming
|
|
||||||
// behaviour for VK_NEXT and VK_PRIOR
|
|
||||||
// - Bug fix: Paint option toUseExplorerTheme works properly without defining columns
|
|
||||||
// - Bug fix: TBaseVirtualTree.PrepareBitmaps now correctly closes the theme handle
|
|
||||||
// January 2010
|
|
||||||
// - 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
|
|
||||||
// July 2009
|
|
||||||
// - Bug fix: TWorkerThread will no longer reference the tree after it has been destroyed (Mantis issue #384)
|
|
||||||
// - Bug fix: TBaseVirtualTree.InternalConnectNode checked the expanded state of the wrong node if Mode was
|
|
||||||
// amAddChildFirst or amAddChildLast
|
|
||||||
// June 2009
|
// June 2009
|
||||||
|
// - Improvement: 'hidden nodes' are now called 'filtered nodes'
|
||||||
|
// - Improvement: converted line endings back to CR/LF
|
||||||
|
// - Improvement: new events TBaseVirtualTree.OnCanSplitterResizeNode and TBaseVirtualTree.OnCanSplitterResizeHeader
|
||||||
|
// - Improvement: made TVirtualTreeColumns.DoCanSplitterResize virtual
|
||||||
|
// - Improvement: made some methods of TVirtualTreeHintWindow protected to make subclassing easier
|
||||||
// - Bug fix: fixed some issues concerning the vista theme handling
|
// - Bug fix: fixed some issues concerning the vista theme handling
|
||||||
// - Improvement: removed hidden node handling in this branch
|
// - Improvement: unified source code indentation
|
||||||
// - Improvement: reverted header click handling to old version to keep compatibility in this branch
|
|
||||||
// - Improvement: removed TVTPaintOption toHideTreeLinesIfThemed
|
|
||||||
// May 2009
|
// May 2009
|
||||||
// - Improvement: new TVTMiscOption toEditOnClick, toEditOnDblClick to control if editing can be started with a single
|
// - Improvement: new TVTMiscOption toEditOnClick, toEditOnDblClick to control if editing can be started with a single
|
||||||
// click or a double click
|
// click or a double click
|
||||||
@ -362,9 +350,9 @@ const
|
|||||||
{$define ContextMenuBeforeMouseUp}
|
{$define ContextMenuBeforeMouseUp}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
VTMajorVersion = 4;
|
VTMajorVersion = 5;
|
||||||
VTMinorVersion = 8;
|
VTMinorVersion = 0;
|
||||||
VTReleaseVersion = 7;
|
VTReleaseVersion = 0;
|
||||||
VTTreeStreamVersion = 2;
|
VTTreeStreamVersion = 2;
|
||||||
VTHeaderStreamVersion = 6; // The header needs an own stream version to indicate changes only relevant to the header.
|
VTHeaderStreamVersion = 6; // The header needs an own stream version to indicate changes only relevant to the header.
|
||||||
|
|
||||||
@ -534,7 +522,7 @@ type
|
|||||||
vsMultiline, // Node text is wrapped at the cell boundaries instead of being shorted.
|
vsMultiline, // Node text is wrapped at the cell boundaries instead of being shorted.
|
||||||
vsHeightMeasured, // Node height has been determined and does not need a recalculation.
|
vsHeightMeasured, // Node height has been determined and does not need a recalculation.
|
||||||
vsToggling, // Set when a node is expanded/collapsed to prevent recursive calls.
|
vsToggling, // Set when a node is expanded/collapsed to prevent recursive calls.
|
||||||
vsHidden // Indicates that the node should not be painted (without effecting its children).
|
vsFiltered // Indicates that the node should not be painted (without effecting its children).
|
||||||
);
|
);
|
||||||
TVirtualNodeStates = set of TVirtualNodeState;
|
TVirtualNodeStates = set of TVirtualNodeState;
|
||||||
|
|
||||||
@ -724,7 +712,7 @@ type
|
|||||||
toFixedIndent, // Draw the tree with a fixed indent.
|
toFixedIndent, // Draw the tree with a fixed indent.
|
||||||
toUseExplorerTheme, // Use the explorer theme if run under Windows Vista (or above).
|
toUseExplorerTheme, // Use the explorer theme if run under Windows Vista (or above).
|
||||||
toHideTreeLinesIfThemed, // Do not show tree lines if theming is used.
|
toHideTreeLinesIfThemed, // Do not show tree lines if theming is used.
|
||||||
toShowHiddenNodes // Draw nodes even if they are hidden.
|
toShowFilteredNodes // Draw nodes even if they are filtered out.
|
||||||
);
|
);
|
||||||
TVTPaintOptions = set of TVTPaintOption;
|
TVTPaintOptions = set of TVTPaintOption;
|
||||||
|
|
||||||
@ -1306,7 +1294,7 @@ type
|
|||||||
function AdjustHoverColumn(const P: TPoint): Boolean;
|
function AdjustHoverColumn(const P: TPoint): Boolean;
|
||||||
procedure AdjustPosition(Column: TVirtualTreeColumn; Position: Cardinal);
|
procedure AdjustPosition(Column: TVirtualTreeColumn; Position: Cardinal);
|
||||||
function CanSplitterResize(P: TPoint; Column: TColumnIndex): Boolean;
|
function CanSplitterResize(P: TPoint; Column: TColumnIndex): Boolean;
|
||||||
procedure DoCanSplitterResize(P: TPoint; Column: TColumnIndex; var Allowed: Boolean);
|
procedure DoCanSplitterResize(P: TPoint; Column: TColumnIndex; var Allowed: Boolean); virtual;
|
||||||
procedure DrawButtonText(DC: HDC; Caption: String; Bounds: TRect; Enabled, Hot: Boolean; DrawFormat: Cardinal;
|
procedure DrawButtonText(DC: HDC; Caption: String; Bounds: TRect; Enabled, Hot: Boolean; DrawFormat: Cardinal;
|
||||||
WrapCaption: Boolean);
|
WrapCaption: Boolean);
|
||||||
procedure DrawXPButton(DC: HDC; const ButtonR: TRect; DrawSplitter, Down, Hover: Boolean);
|
procedure DrawXPButton(DC: HDC; const ButtonR: TRect; DrawSplitter, Down, Hover: Boolean);
|
||||||
@ -1498,6 +1486,7 @@ type
|
|||||||
procedure SetSortDirection(const Value: TSortDirection);
|
procedure SetSortDirection(const Value: TSortDirection);
|
||||||
procedure SetStyle(Value: TVTHeaderStyle);
|
procedure SetStyle(Value: TVTHeaderStyle);
|
||||||
protected
|
protected
|
||||||
|
function CanSplitterResize(P: TPoint): Boolean;
|
||||||
procedure ChangeScale(M, D: Integer); virtual;
|
procedure ChangeScale(M, D: Integer); virtual;
|
||||||
function DetermineSplitterIndex(const P: TPoint): Boolean; virtual;
|
function DetermineSplitterIndex(const P: TPoint): Boolean; virtual;
|
||||||
procedure DoAfterAutoFitColumn(Column: TColumnIndex); virtual;
|
procedure DoAfterAutoFitColumn(Column: TColumnIndex); virtual;
|
||||||
@ -1506,6 +1495,7 @@ type
|
|||||||
function DoBeforeAutoFitColumn(Column: TColumnIndex; SmartAutoFitType: TSmartAutoFitType): Boolean; virtual;
|
function DoBeforeAutoFitColumn(Column: TColumnIndex; SmartAutoFitType: TSmartAutoFitType): Boolean; virtual;
|
||||||
procedure DoBeforeColumnWidthTracking(Column: TColumnIndex; Shift: TShiftState); virtual;
|
procedure DoBeforeColumnWidthTracking(Column: TColumnIndex; Shift: TShiftState); virtual;
|
||||||
procedure DoBeforeHeightTracking(Shift: TShiftState); virtual;
|
procedure DoBeforeHeightTracking(Shift: TShiftState); virtual;
|
||||||
|
procedure DoCanSplitterResize(P: TPoint; var Allowed: Boolean); virtual;
|
||||||
function DoColumnWidthDblClickResize(Column: TColumnIndex; P: TPoint; Shift: TShiftState): Boolean; virtual;
|
function DoColumnWidthDblClickResize(Column: TColumnIndex; P: TPoint; Shift: TShiftState): Boolean; virtual;
|
||||||
function DoColumnWidthTracking(Column: TColumnIndex; Shift: TShiftState; var TrackPoint: TPoint; P: TPoint): Boolean; virtual;
|
function DoColumnWidthTracking(Column: TColumnIndex; Shift: TShiftState; var TrackPoint: TPoint; P: TPoint): Boolean; virtual;
|
||||||
function DoGetPopupMenu(Column: TColumnIndex; Position: TPoint): TPopupMenu; virtual;
|
function DoGetPopupMenu(Column: TColumnIndex; Position: TPoint): TPopupMenu; virtual;
|
||||||
@ -2010,6 +2000,7 @@ type
|
|||||||
TVTBeforeGetMaxColumnWidthEvent = procedure(Sender: TVTHeader; Column: TColumnIndex; var UseSmartColumnWidth: Boolean) of object;
|
TVTBeforeGetMaxColumnWidthEvent = procedure(Sender: TVTHeader; Column: TColumnIndex; var UseSmartColumnWidth: Boolean) of object;
|
||||||
TVTAfterGetMaxColumnWidthEvent = procedure(Sender: TVTHeader; Column: TColumnIndex; var MaxWidth: Integer) of object;
|
TVTAfterGetMaxColumnWidthEvent = procedure(Sender: TVTHeader; Column: TColumnIndex; var MaxWidth: Integer) of object;
|
||||||
TVTCanSplitterResizeColumnEvent = procedure(Sender: TVTHeader; P: TPoint; Column: TColumnIndex; var Allowed: Boolean) of object;
|
TVTCanSplitterResizeColumnEvent = procedure(Sender: TVTHeader; P: TPoint; Column: TColumnIndex; var Allowed: Boolean) of object;
|
||||||
|
TVTCanSplitterResizeHeaderEvent = procedure(SendeR: TVTHeader; P: TPoint; var Allowed: Boolean) of object;
|
||||||
|
|
||||||
// move, copy and node tracking events
|
// move, copy and node tracking events
|
||||||
TVTNodeMovedEvent = procedure(Sender: TBaseVirtualTree; Node: PVirtualNode) of object;
|
TVTNodeMovedEvent = procedure(Sender: TBaseVirtualTree; Node: PVirtualNode) of object;
|
||||||
@ -2022,6 +2013,8 @@ type
|
|||||||
var TrackPoint: TPoint; P: TPoint; var Allowed: Boolean) of object;
|
var TrackPoint: TPoint; P: TPoint; var Allowed: Boolean) of object;
|
||||||
TVTNodeHeightDblClickResizeEvent = procedure(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
|
TVTNodeHeightDblClickResizeEvent = procedure(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
Shift: TShiftState; P: TPoint; var Allowed: Boolean) of object;
|
Shift: TShiftState; P: TPoint; var Allowed: Boolean) of object;
|
||||||
|
TVTCanSplitterResizeNodeEvent = procedure(Sender: TBaseVirtualTree; P: TPoint; Node: PVirtualNode;
|
||||||
|
Column: TColumnIndex; var Allowed: Boolean) of object;
|
||||||
|
|
||||||
// drag'n drop/OLE events
|
// drag'n drop/OLE events
|
||||||
TVTCreateDragManagerEvent = procedure(Sender: TBaseVirtualTree; out DragManager: IVTDragManager) of object;
|
TVTCreateDragManagerEvent = procedure(Sender: TBaseVirtualTree; out DragManager: IVTDragManager) of object;
|
||||||
@ -2269,6 +2262,7 @@ type
|
|||||||
// parent node (probably another tree, but within the same application)
|
// parent node (probably another tree, but within the same application)
|
||||||
FOnNodeCopying: TVTNodeCopyingEvent; // called when an node is copied to another parent node (probably in
|
FOnNodeCopying: TVTNodeCopyingEvent; // called when an node is copied to another parent node (probably in
|
||||||
// another tree, but within the same application, can be cancelled)
|
// another tree, but within the same application, can be cancelled)
|
||||||
|
FOnCanSplitterResizeNode: TVTCanSplitterResizeNodeEvent; // called to query the application wether resizing a node is allowed
|
||||||
FOnNodeHeightTracking: TVTNodeHeightTrackingEvent; // called when a node's height is being changed via mouse
|
FOnNodeHeightTracking: TVTNodeHeightTrackingEvent; // called when a node's height is being changed via mouse
|
||||||
FOnNodeHeightDblClickResize: TVTNodeHeightDblClickResizeEvent; // called when a node's vertical splitter is double clicked
|
FOnNodeHeightDblClickResize: TVTNodeHeightDblClickResizeEvent; // called when a node's vertical splitter is double clicked
|
||||||
FOnNodeCopied: TVTNodeCopiedEvent; // call after a node has been copied
|
FOnNodeCopied: TVTNodeCopiedEvent; // call after a node has been copied
|
||||||
@ -2315,6 +2309,7 @@ type
|
|||||||
FOnColumnWidthTracking: TVTColumnWidthTrackingEvent;
|
FOnColumnWidthTracking: TVTColumnWidthTrackingEvent;
|
||||||
FOnGetHeaderCursor: TVTGetHeaderCursorEvent; // triggered to allow the app. to use customized cursors for the header
|
FOnGetHeaderCursor: TVTGetHeaderCursorEvent; // triggered to allow the app. to use customized cursors for the header
|
||||||
FOnCanSplitterResizeColumn: TVTCanSplitterResizeColumnEvent;
|
FOnCanSplitterResizeColumn: TVTCanSplitterResizeColumnEvent;
|
||||||
|
FOnCanSplitterResizeHeader: TVTCanSplitterResizeHeaderEvent;
|
||||||
|
|
||||||
// paint events
|
// paint events
|
||||||
FOnAfterPaint, // triggered when the tree has entirely been painted
|
FOnAfterPaint, // triggered when the tree has entirely been painted
|
||||||
@ -2399,9 +2394,9 @@ type
|
|||||||
function GetDisabled(Node: PVirtualNode): Boolean;
|
function GetDisabled(Node: PVirtualNode): Boolean;
|
||||||
function GetDragManager: IVTDragManager;
|
function GetDragManager: IVTDragManager;
|
||||||
function GetExpanded(Node: PVirtualNode): Boolean;
|
function GetExpanded(Node: PVirtualNode): Boolean;
|
||||||
|
function GetFiltered(Node: PVirtualNode): Boolean;
|
||||||
function GetFullyVisible(Node: PVirtualNode): Boolean;
|
function GetFullyVisible(Node: PVirtualNode): Boolean;
|
||||||
function GetHasChildren(Node: PVirtualNode): Boolean;
|
function GetHasChildren(Node: PVirtualNode): Boolean;
|
||||||
function GetHidden(Node: PVirtualNode): Boolean;
|
|
||||||
function GetMultiline(Node: PVirtualNode): Boolean;
|
function GetMultiline(Node: PVirtualNode): Boolean;
|
||||||
function GetNodeHeight(Node: PVirtualNode): Cardinal;
|
function GetNodeHeight(Node: PVirtualNode): Cardinal;
|
||||||
function GetNodeParent(Node: PVirtualNode): PVirtualNode;
|
function GetNodeParent(Node: PVirtualNode): PVirtualNode;
|
||||||
@ -2456,7 +2451,7 @@ type
|
|||||||
procedure SetFullyVisible(Node: PVirtualNode; Value: Boolean);
|
procedure SetFullyVisible(Node: PVirtualNode; Value: Boolean);
|
||||||
procedure SetHasChildren(Node: PVirtualNode; Value: Boolean);
|
procedure SetHasChildren(Node: PVirtualNode; Value: Boolean);
|
||||||
procedure SetHeader(const Value: TVTHeader);
|
procedure SetHeader(const Value: TVTHeader);
|
||||||
procedure SetHidden(Node: PVirtualNode; Value: Boolean);
|
procedure SetFiltered(Node: PVirtualNode; Value: Boolean);
|
||||||
procedure SetImages(const Value: TCustomImageList);
|
procedure SetImages(const Value: TCustomImageList);
|
||||||
procedure SetIndent(Value: Cardinal);
|
procedure SetIndent(Value: Cardinal);
|
||||||
procedure SetLineMode(const Value: TVTLineMode);
|
procedure SetLineMode(const Value: TVTLineMode);
|
||||||
@ -2556,6 +2551,7 @@ type
|
|||||||
function CalculateSelectionRect(X, Y: Integer): Boolean; virtual;
|
function CalculateSelectionRect(X, Y: Integer): Boolean; virtual;
|
||||||
function CanAutoScroll: Boolean; virtual;
|
function CanAutoScroll: Boolean; virtual;
|
||||||
function CanShowDragImage: Boolean; virtual;
|
function CanShowDragImage: Boolean; virtual;
|
||||||
|
function CanSplitterResizeNode(P: TPoint; Node: PVirtualNode; Column: TColumnIndex): Boolean;
|
||||||
procedure Change(Node: PVirtualNode); virtual;
|
procedure Change(Node: PVirtualNode); virtual;
|
||||||
procedure ChangeScale(M, D: Integer); override;
|
procedure ChangeScale(M, D: Integer); override;
|
||||||
//lcl
|
//lcl
|
||||||
@ -2591,6 +2587,8 @@ type
|
|||||||
procedure DoBeforePaint(Canvas: TCanvas); virtual;
|
procedure DoBeforePaint(Canvas: TCanvas); virtual;
|
||||||
function DoCancelEdit: Boolean; virtual;
|
function DoCancelEdit: Boolean; virtual;
|
||||||
procedure DoCanEdit(Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean); virtual;
|
procedure DoCanEdit(Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean); virtual;
|
||||||
|
procedure DoCanSplitterResizeNode(P: TPoint; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
|
var Allowed: Boolean); virtual;
|
||||||
procedure DoChange(Node: PVirtualNode); virtual;
|
procedure DoChange(Node: PVirtualNode); virtual;
|
||||||
procedure DoCheckClick(Node: PVirtualNode; NewCheckState: TCheckState); virtual;
|
procedure DoCheckClick(Node: PVirtualNode; NewCheckState: TCheckState); virtual;
|
||||||
procedure DoChecked(Node: PVirtualNode); virtual;
|
procedure DoChecked(Node: PVirtualNode); virtual;
|
||||||
@ -2867,6 +2865,8 @@ type
|
|||||||
property OnBeforePaint: TVTPaintEvent read FOnBeforePaint write FOnBeforePaint;
|
property OnBeforePaint: TVTPaintEvent read FOnBeforePaint write FOnBeforePaint;
|
||||||
property OnBeforeTreeExport: TVTTreeExportEvent read FOnBeforeTreeExport write FOnBeforeTreeExport;
|
property OnBeforeTreeExport: TVTTreeExportEvent read FOnBeforeTreeExport write FOnBeforeTreeExport;
|
||||||
property OnCanSplitterResizeColumn: TVTCanSplitterResizeColumnEvent read FOnCanSplitterResizeColumn write FOnCanSplitterResizeColumn;
|
property OnCanSplitterResizeColumn: TVTCanSplitterResizeColumnEvent read FOnCanSplitterResizeColumn write FOnCanSplitterResizeColumn;
|
||||||
|
property OnCanSplitterResizeHeader: TVTCanSplitterResizeHeaderEvent read FOnCanSplitterResizeHeader write FOnCanSplitterResizeHeader;
|
||||||
|
property OnCanSplitterResizeNode: TVTCanSplitterResizeNodeEvent read FOnCanSplitterResizeNode write FOnCanSplitterResizeNode;
|
||||||
property OnChange: TVTChangeEvent read FOnChange write FOnChange;
|
property OnChange: TVTChangeEvent read FOnChange write FOnChange;
|
||||||
property OnChecked: TVTChangeEvent read FOnChecked write FOnChecked;
|
property OnChecked: TVTChangeEvent read FOnChecked write FOnChecked;
|
||||||
property OnChecking: TVTCheckChangingEvent read FOnChecking write FOnChecking;
|
property OnChecking: TVTCheckChangingEvent read FOnChecking write FOnChecking;
|
||||||
@ -2989,6 +2989,8 @@ type
|
|||||||
{$endif}
|
{$endif}
|
||||||
function GetDisplayRect(Node: PVirtualNode; Column: TColumnIndex; TextOnly: Boolean; Unclipped: Boolean = False;
|
function GetDisplayRect(Node: PVirtualNode; Column: TColumnIndex; TextOnly: Boolean; Unclipped: Boolean = False;
|
||||||
ApplyCellContentMargin: Boolean = False): TRect;
|
ApplyCellContentMargin: Boolean = False): TRect;
|
||||||
|
function GetEffectivelyFiltered(Node: PVirtualNode): Boolean;
|
||||||
|
function GetEffectivelyVisible(Node: PVirtualNode): Boolean;
|
||||||
function GetFirst(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetFirst(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
function GetFirstChecked(State: TCheckState = csCheckedNormal; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetFirstChecked(State: TCheckState = csCheckedNormal; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
function GetFirstChild(Node: PVirtualNode): PVirtualNode;
|
function GetFirstChild(Node: PVirtualNode): PVirtualNode;
|
||||||
@ -2999,11 +3001,11 @@ type
|
|||||||
function GetFirstNoInit(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetFirstNoInit(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
function GetFirstSelected(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetFirstSelected(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
function GetFirstVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
function GetFirstVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
||||||
IncludeHidden: Boolean = False): PVirtualNode;
|
IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetFirstVisibleChild(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetFirstVisibleChild(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetFirstVisibleChildNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetFirstVisibleChildNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetFirstVisibleNoInit(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
function GetFirstVisibleNoInit(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
||||||
IncludeHidden: Boolean = False): PVirtualNode;
|
IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
procedure GetHitTestInfoAt(X, Y: Integer; Relative: Boolean; var HitInfo: THitInfo); virtual;
|
procedure GetHitTestInfoAt(X, Y: Integer; Relative: Boolean; var HitInfo: THitInfo); virtual;
|
||||||
function GetLast(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetLast(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
function GetLastInitialized(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetLastInitialized(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
@ -3011,11 +3013,11 @@ type
|
|||||||
function GetLastChild(Node: PVirtualNode): PVirtualNode;
|
function GetLastChild(Node: PVirtualNode): PVirtualNode;
|
||||||
function GetLastChildNoInit(Node: PVirtualNode): PVirtualNode;
|
function GetLastChildNoInit(Node: PVirtualNode): PVirtualNode;
|
||||||
function GetLastVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
function GetLastVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
||||||
IncludeHidden: Boolean = False): PVirtualNode;
|
IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetLastVisibleChild(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetLastVisibleChild(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetLastVisibleChildNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetLastVisibleChildNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetLastVisibleNoInit(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
function GetLastVisibleNoInit(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
||||||
IncludeHidden: Boolean = False): PVirtualNode;
|
IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetMaxColumnWidth(Column: TColumnIndex; UseSmartColumnWidth: Boolean = False): Integer;
|
function GetMaxColumnWidth(Column: TColumnIndex; UseSmartColumnWidth: Boolean = False): Integer;
|
||||||
function GetNext(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function GetNext(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
function GetNextChecked(Node: PVirtualNode; State: TCheckState = csCheckedNormal;
|
function GetNextChecked(Node: PVirtualNode; State: TCheckState = csCheckedNormal;
|
||||||
@ -3029,8 +3031,8 @@ type
|
|||||||
function GetNextSibling(Node: PVirtualNode): PVirtualNode;
|
function GetNextSibling(Node: PVirtualNode): PVirtualNode;
|
||||||
function GetNextVisible(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
function GetNextVisible(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
||||||
function GetNextVisibleNoInit(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
function GetNextVisibleNoInit(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
||||||
function GetNextVisibleSibling(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetNextVisibleSibling(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetNextVisibleSiblingNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetNextVisibleSiblingNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetNodeAt(X, Y: Integer): PVirtualNode; overload;
|
function GetNodeAt(X, Y: Integer): PVirtualNode; overload;
|
||||||
function GetNodeAt(X, Y: Integer; Relative: Boolean; var NodeTop: Integer): PVirtualNode; overload;
|
function GetNodeAt(X, Y: Integer; Relative: Boolean; var NodeTop: Integer): PVirtualNode; overload;
|
||||||
function GetNodeData(Node: PVirtualNode): Pointer;
|
function GetNodeData(Node: PVirtualNode): Pointer;
|
||||||
@ -3047,14 +3049,14 @@ type
|
|||||||
function GetPreviousSibling(Node: PVirtualNode): PVirtualNode;
|
function GetPreviousSibling(Node: PVirtualNode): PVirtualNode;
|
||||||
function GetPreviousVisible(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
function GetPreviousVisible(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
||||||
function GetPreviousVisibleNoInit(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
function GetPreviousVisibleNoInit(Node: PVirtualNode; ConsiderChildrenAbove: Boolean = True): PVirtualNode;
|
||||||
function GetPreviousVisibleSibling(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetPreviousVisibleSibling(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetPreviousVisibleSiblingNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetPreviousVisibleSiblingNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function GetSortedCutCopySet(Resolve: Boolean): TNodeArray;
|
function GetSortedCutCopySet(Resolve: Boolean): TNodeArray;
|
||||||
function GetSortedSelection(Resolve: Boolean): TNodeArray;
|
function GetSortedSelection(Resolve: Boolean): TNodeArray;
|
||||||
procedure GetTextInfo(Node: PVirtualNode; Column: TColumnIndex; const AFont: TFont; var R: TRect;
|
procedure GetTextInfo(Node: PVirtualNode; Column: TColumnIndex; const AFont: TFont; var R: TRect;
|
||||||
out Text: String); virtual;
|
out Text: String); virtual;
|
||||||
function GetTreeRect: TRect;
|
function GetTreeRect: TRect;
|
||||||
function GetVisibleParent(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function GetVisibleParent(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
function HasAsParent(Node, PotentialParent: PVirtualNode): Boolean;
|
function HasAsParent(Node, PotentialParent: PVirtualNode): Boolean;
|
||||||
function InsertNode(Node: PVirtualNode; Mode: TVTNodeAttachMode; UserData: Pointer = nil): PVirtualNode;
|
function InsertNode(Node: PVirtualNode; Mode: TVTNodeAttachMode; UserData: Pointer = nil): PVirtualNode;
|
||||||
procedure InvalidateChildren(Node: PVirtualNode; Recursive: Boolean);
|
procedure InvalidateChildren(Node: PVirtualNode; Recursive: Boolean);
|
||||||
@ -3063,8 +3065,6 @@ type
|
|||||||
procedure InvalidateToBottom(Node: PVirtualNode);
|
procedure InvalidateToBottom(Node: PVirtualNode);
|
||||||
procedure InvertSelection(VisibleOnly: Boolean);
|
procedure InvertSelection(VisibleOnly: Boolean);
|
||||||
function IsEditing: Boolean;
|
function IsEditing: Boolean;
|
||||||
function IsEffectivelyHidden(Node: PVirtualNode): Boolean;
|
|
||||||
function IsEffectivelyVisible(Node: PVirtualNode): Boolean;
|
|
||||||
function IsMouseSelecting: Boolean;
|
function IsMouseSelecting: Boolean;
|
||||||
function IterateSubtree(Node: PVirtualNode; Callback: TVTGetNodeProc; Data: Pointer; Filter: TVirtualNodeStates = [];
|
function IterateSubtree(Node: PVirtualNode; Callback: TVTGetNodeProc; Data: Pointer; Filter: TVirtualNodeStates = [];
|
||||||
DoInit: Boolean = False; ChildNodesOnly: Boolean = False): PVirtualNode;
|
DoInit: Boolean = False; ChildNodesOnly: Boolean = False): PVirtualNode;
|
||||||
@ -3130,7 +3130,9 @@ type
|
|||||||
property HasChildren[Node: PVirtualNode]: Boolean read GetHasChildren write SetHasChildren;
|
property HasChildren[Node: PVirtualNode]: Boolean read GetHasChildren write SetHasChildren;
|
||||||
property HotNode: PVirtualNode read FCurrentHotNode;
|
property HotNode: PVirtualNode read FCurrentHotNode;
|
||||||
property IsDisabled[Node: PVirtualNode]: Boolean read GetDisabled write SetDisabled;
|
property IsDisabled[Node: PVirtualNode]: Boolean read GetDisabled write SetDisabled;
|
||||||
property IsHidden[Node: PVirtualNode]: Boolean read GetHidden write SetHidden;
|
property IsEffectivelyFiltered[Node: PVirtualNode]: Boolean read GetEffectivelyFiltered;
|
||||||
|
property IsEffectivelyVisible[Node: PVirtualNode]: Boolean read GetEffectivelyVisible;
|
||||||
|
property IsFiltered[Node: PVirtualNode]: Boolean read GetFiltered write SetFiltered;
|
||||||
property IsVisible[Node: PVirtualNode]: Boolean read GetVisible write SetVisible;
|
property IsVisible[Node: PVirtualNode]: Boolean read GetVisible write SetVisible;
|
||||||
property MultiLine[Node: PVirtualNode]: Boolean read GetMultiline write SetMultiline;
|
property MultiLine[Node: PVirtualNode]: Boolean read GetMultiline write SetMultiline;
|
||||||
property NodeHeight[Node: PVirtualNode]: Cardinal read GetNodeHeight write SetNodeHeight;
|
property NodeHeight[Node: PVirtualNode]: Cardinal read GetNodeHeight write SetNodeHeight;
|
||||||
@ -3526,6 +3528,8 @@ type
|
|||||||
property OnBeforePaint;
|
property OnBeforePaint;
|
||||||
property OnBeforeTreeExport;
|
property OnBeforeTreeExport;
|
||||||
property OnCanSplitterResizeColumn;
|
property OnCanSplitterResizeColumn;
|
||||||
|
property OnCanSplitterResizeHeader;
|
||||||
|
property OnCanSplitterResizeNode;
|
||||||
property OnChange;
|
property OnChange;
|
||||||
property OnChecked;
|
property OnChecked;
|
||||||
property OnChecking;
|
property OnChecking;
|
||||||
@ -3772,6 +3776,8 @@ type
|
|||||||
property OnBeforePaint;
|
property OnBeforePaint;
|
||||||
property OnBeforeTreeExport;
|
property OnBeforeTreeExport;
|
||||||
property OnCanSplitterResizeColumn;
|
property OnCanSplitterResizeColumn;
|
||||||
|
property OnCanSplitterResizeHeader;
|
||||||
|
property OnCanSplitterResizeNode;
|
||||||
property OnChange;
|
property OnChange;
|
||||||
property OnChecked;
|
property OnChecked;
|
||||||
property OnChecking;
|
property OnChecking;
|
||||||
@ -5467,15 +5473,15 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
if toShowHiddenNodes in ToBeSet + ToBeCleared then
|
if toShowFilteredNodes in ToBeSet + ToBeCleared then
|
||||||
begin
|
begin
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
InterruptValidation;
|
InterruptValidation;
|
||||||
Run := GetFirst;
|
Run := GetFirst;
|
||||||
while Assigned(Run) do
|
while Assigned(Run) do
|
||||||
begin
|
begin
|
||||||
if vsHidden in Run.States then
|
if vsFiltered in Run.States then
|
||||||
if toShowHiddenNodes in ToBeSet then
|
if toShowFilteredNodes in ToBeSet then
|
||||||
begin
|
begin
|
||||||
Inc(FVisibleCount);
|
Inc(FVisibleCount);
|
||||||
AdjustTotalHeight(Run.Parent, Run.NodeHeight, True);
|
AdjustTotalHeight(Run.Parent, Run.NodeHeight, True);
|
||||||
@ -9398,6 +9404,15 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function TVTHeader.CanSplitterResize(P: TPoint): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := hoHeightResize in FOptions;
|
||||||
|
DoCanSplitterResize(P, Result);
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TVTHeader.SetStyle(Value: TVTHeaderStyle);
|
procedure TVTHeader.SetStyle(Value: TVTHeaderStyle);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -9575,6 +9590,14 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
procedure TVTHeader.DoCanSplitterResize(P: TPoint; var Allowed: Boolean);
|
||||||
|
begin
|
||||||
|
if Assigned(TreeView.FOnCanSplitterResizeHeader) then
|
||||||
|
TreeView.FOnCanSplitterResizeHeader(Self, P, Allowed);
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TVTHeader.DoColumnWidthDblClickResize(Column: TColumnIndex; P: TPoint; Shift: TShiftState): Boolean;
|
function TVTHeader.DoColumnWidthDblClickResize(Column: TColumnIndex; P: TPoint; Shift: TShiftState): Boolean;
|
||||||
|
|
||||||
// Queries the application whether a double click on the column splitter should resize the column.
|
// Queries the application whether a double click on the column splitter should resize the column.
|
||||||
@ -9983,7 +10006,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
IsInHeader := InHeader(P);
|
IsInHeader := InHeader(P);
|
||||||
IsVSplitterHit := (hoHeightResize in FOptions) and InHeaderSplitterArea(P);
|
IsVSplitterHit := InHeaderSplitterArea(P) and CanSplitterResize(P);
|
||||||
IsHSplitterHit := HSplitterHit;
|
IsHSplitterHit := HSplitterHit;
|
||||||
|
|
||||||
if IsVSplitterHit or IsHSplitterHit then
|
if IsVSplitterHit or IsHSplitterHit then
|
||||||
@ -10211,7 +10234,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
//todo: see a way to store the user defined cursor.
|
//todo: see a way to store the user defined cursor.
|
||||||
IsHSplitterHit := IsInHeader and HSplitterHit;
|
IsHSplitterHit := IsInHeader and HSplitterHit;
|
||||||
IsVSplitterHit := (hoHeightResize in FOptions) and InHeaderSplitterArea(P);
|
IsVSplitterHit := InHeaderSplitterArea(P) and CanSplitterResize(P);
|
||||||
|
|
||||||
if IsVSplitterHit or IsHSplitterHit then
|
if IsVSplitterHit or IsHSplitterHit then
|
||||||
begin
|
begin
|
||||||
@ -12549,7 +12572,7 @@ begin
|
|||||||
while Assigned(Child) do
|
while Assigned(Child) do
|
||||||
begin
|
begin
|
||||||
FixupTotalHeight(Child);
|
FixupTotalHeight(Child);
|
||||||
if IsEffectivelyVisible(Child) then
|
if IsEffectivelyVisible[Child] then
|
||||||
Inc(Node.TotalHeight, Child.TotalHeight);
|
Inc(Node.TotalHeight, Child.TotalHeight);
|
||||||
Child := Child.NextSibling;
|
Child := Child.NextSibling;
|
||||||
end;
|
end;
|
||||||
@ -12678,6 +12701,14 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function TBaseVirtualTree.GetFiltered(Node: PVirtualNode): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := vsFiltered in Node.States;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetFullyVisible(Node: PVirtualNode): Boolean;
|
function TBaseVirtualTree.GetFullyVisible(Node: PVirtualNode): Boolean;
|
||||||
|
|
||||||
// Determines whether the given node has the visibility flag set as well as all its parents are expanded.
|
// Determines whether the given node has the visibility flag set as well as all its parents are expanded.
|
||||||
@ -12702,14 +12733,6 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetHidden(Node: PVirtualNode): Boolean;
|
|
||||||
|
|
||||||
begin
|
|
||||||
Result := vsHidden in Node.States;
|
|
||||||
end;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function TBaseVirtualTree.GetMultiline(Node: PVirtualNode): Boolean;
|
function TBaseVirtualTree.GetMultiline(Node: PVirtualNode): Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -12993,7 +13016,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
repeat
|
repeat
|
||||||
Node := Node.NextSibling;
|
Node := Node.NextSibling;
|
||||||
Result := IsEffectivelyVisible(Node);
|
Result := IsEffectivelyVisible[Node];
|
||||||
until Result or (Node.NextSibling = nil);
|
until Result or (Node.NextSibling = nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -13013,7 +13036,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
repeat
|
repeat
|
||||||
Node := Node.PrevSibling;
|
Node := Node.PrevSibling;
|
||||||
Result := IsEffectivelyVisible(Node);
|
Result := IsEffectivelyVisible[Node];
|
||||||
until Result or (Node.PrevSibling = nil);
|
until Result or (Node.PrevSibling = nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -13113,7 +13136,7 @@ var
|
|||||||
begin
|
begin
|
||||||
// Find first visible child.
|
// Find first visible child.
|
||||||
Run := Parent.FirstChild;
|
Run := Parent.FirstChild;
|
||||||
while Assigned(Run) and not IsEffectivelyVisible(Run) do
|
while Assigned(Run) and not IsEffectivelyVisible[Run] do
|
||||||
Run := Run.NextSibling;
|
Run := Run.NextSibling;
|
||||||
|
|
||||||
Result := Assigned(Run) and (Run = Node);
|
Result := Assigned(Run) and (Run = Node);
|
||||||
@ -13131,7 +13154,7 @@ var
|
|||||||
begin
|
begin
|
||||||
// Find last visible child.
|
// Find last visible child.
|
||||||
Run := Parent.LastChild;
|
Run := Parent.LastChild;
|
||||||
while Assigned(Run) and not IsEffectivelyVisible(Run) do
|
while Assigned(Run) and not IsEffectivelyVisible[Run] do
|
||||||
Run := Run.PrevSibling;
|
Run := Run.PrevSibling;
|
||||||
|
|
||||||
Result := Assigned(Run) and (Run = Node);
|
Result := Assigned(Run) and (Run = Node);
|
||||||
@ -13771,7 +13794,7 @@ begin
|
|||||||
if vsExpanded in Node.States then
|
if vsExpanded in Node.States then
|
||||||
begin
|
begin
|
||||||
AdjustTotalHeight(Node, NewHeight, True);
|
AdjustTotalHeight(Node, NewHeight, True);
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
Inc(Integer(FVisibleCount), Count);
|
Inc(Integer(FVisibleCount), Count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -13997,9 +14020,9 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TBaseVirtualTree.SetHidden(Node: PVirtualNode; Value: Boolean);
|
procedure TBaseVirtualTree.SetFiltered(Node: PVirtualNode; Value: Boolean);
|
||||||
|
|
||||||
// Sets the hidden flag of the given node according to Value.
|
// Sets the 'filtered' flag of the given node according to Value and updates all dependent states.
|
||||||
|
|
||||||
var
|
var
|
||||||
NeedUpdate: Boolean;
|
NeedUpdate: Boolean;
|
||||||
@ -14007,14 +14030,14 @@ var
|
|||||||
begin
|
begin
|
||||||
Assert(Assigned(Node) and (Node <> FRoot), 'Invalid parameter.');
|
Assert(Assigned(Node) and (Node <> FRoot), 'Invalid parameter.');
|
||||||
|
|
||||||
if Value <> (vsHidden in Node.States) then
|
if Value <> (vsFiltered in Node.States) then
|
||||||
begin
|
begin
|
||||||
InterruptValidation;
|
InterruptValidation;
|
||||||
NeedUpdate := False;
|
NeedUpdate := False;
|
||||||
if Value then
|
if Value then
|
||||||
begin
|
begin
|
||||||
Include(Node.States, vsHidden);
|
Include(Node.States, vsFiltered);
|
||||||
if (vsExpanded in Node.Parent.States) and not (toShowHiddenNodes in FOptions.FPaintOptions) then
|
if (vsExpanded in Node.Parent.States) and not (toShowFilteredNodes in FOptions.FPaintOptions) then
|
||||||
AdjustTotalHeight(Node.Parent, -Integer(NodeHeight[Node]), True);
|
AdjustTotalHeight(Node.Parent, -Integer(NodeHeight[Node]), True);
|
||||||
if VisiblePath[Node] then
|
if VisiblePath[Node] then
|
||||||
begin
|
begin
|
||||||
@ -14029,8 +14052,8 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Exclude(Node.States, vsHidden);
|
Exclude(Node.States, vsFiltered);
|
||||||
if (vsExpanded in Node.Parent.States) and not (toShowHiddenNodes in FOptions.FPaintOptions) then
|
if (vsExpanded in Node.Parent.States) and not (toShowFilteredNodes in FOptions.FPaintOptions) then
|
||||||
AdjustTotalHeight(Node.Parent, Integer(NodeHeight[Node]), True);
|
AdjustTotalHeight(Node.Parent, Integer(NodeHeight[Node]), True);
|
||||||
|
|
||||||
if VisiblePath[Node] then
|
if VisiblePath[Node] then
|
||||||
@ -14207,7 +14230,7 @@ begin
|
|||||||
UpdateEditBounds;
|
UpdateEditBounds;
|
||||||
|
|
||||||
// Stay away from touching the node cache while it is being validated.
|
// Stay away from touching the node cache while it is being validated.
|
||||||
if not (tsValidating in FStates) and FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if not (tsValidating in FStates) and FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
begin
|
begin
|
||||||
InvalidateCache;
|
InvalidateCache;
|
||||||
if FUpdateCount = 0 then
|
if FUpdateCount = 0 then
|
||||||
@ -14340,7 +14363,7 @@ begin
|
|||||||
if FSelectionCount = 0 then
|
if FSelectionCount = 0 then
|
||||||
ResetRangeAnchor;
|
ResetRangeAnchor;
|
||||||
end;
|
end;
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
InvalidateNode(Node);
|
InvalidateNode(Node);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -14444,7 +14467,7 @@ begin
|
|||||||
if Node.Align <> Value then
|
if Node.Align <> Value then
|
||||||
begin
|
begin
|
||||||
Node.Align := Value;
|
Node.Align := Value;
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
InvalidateNode(Node);
|
InvalidateNode(Node);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -17280,6 +17303,16 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function TBaseVirtualTree.CanSplitterResizeNode(P: TPoint; Node: PVirtualNode; Column: TColumnIndex): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := (toNodeHeightResize in FOptions.FMiscOptions) and Assigned(Node) and (Node <> FRoot) and
|
||||||
|
(Column > NoColumn) and (coFixed in FHeader.FColumns[Column].FOptions);
|
||||||
|
DoCanSplitterResizeNode(P, Node, Column, Result);
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TBaseVirtualTree.Change(Node: PVirtualNode);
|
procedure TBaseVirtualTree.Change(Node: PVirtualNode);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -17484,8 +17517,8 @@ begin
|
|||||||
Node := Node.FirstChild;
|
Node := Node.FirstChild;
|
||||||
while Assigned(Node) do
|
while Assigned(Node) do
|
||||||
begin
|
begin
|
||||||
if (vsVisible in Node.States) and (not (vsHidden in Node.States) or
|
if (vsVisible in Node.States) and (not (vsFiltered in Node.States) or
|
||||||
(toShowHiddenNodes in FOptions.FPaintOptions)) then
|
(toShowFilteredNodes in FOptions.FPaintOptions)) then
|
||||||
Inc(Result, CountVisibleChildren(Node) + 1);
|
Inc(Result, CountVisibleChildren(Node) + 1);
|
||||||
Node := Node.NextSibling;
|
Node := Node.NextSibling;
|
||||||
end;
|
end;
|
||||||
@ -17636,7 +17669,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// Iterate through all siblings and stop when one visible is found.
|
// Iterate through all siblings and stop when one visible is found.
|
||||||
Run := Node.FirstChild;
|
Run := Node.FirstChild;
|
||||||
while Assigned(Run) and not IsEffectivelyVisible(Run) do
|
while Assigned(Run) and not IsEffectivelyVisible[Run] do
|
||||||
Run := Run.NextSibling;
|
Run := Run.NextSibling;
|
||||||
if Assigned(Run) then
|
if Assigned(Run) then
|
||||||
Exclude(Node.States, vsAllChildrenHidden)
|
Exclude(Node.States, vsAllChildrenHidden)
|
||||||
@ -18207,6 +18240,16 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
procedure TBaseVirtualTree.DoCanSplitterResizeNode(P: TPoint; Node: PVirtualNode; Column: TColumnIndex;
|
||||||
|
var Allowed: Boolean);
|
||||||
|
|
||||||
|
begin
|
||||||
|
if Assigned(FOnCanSplitterResizeNode) then
|
||||||
|
FOnCanSplitterResizeNode(Self, P, Node, Column, Allowed);
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TBaseVirtualTree.DoChange(Node: PVirtualNode);
|
procedure TBaseVirtualTree.DoChange(Node: PVirtualNode);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -20776,7 +20819,7 @@ begin
|
|||||||
if not (vsInitialized in Run.States) then
|
if not (vsInitialized in Run.States) then
|
||||||
Run := nil;
|
Run := nil;
|
||||||
isVisibleOnly:
|
isVisibleOnly:
|
||||||
if not FullyVisible[Run] or IsEffectivelyHidden(Run) then
|
if not FullyVisible[Run] or IsEffectivelyFiltered[Run] then
|
||||||
Run := nil;
|
Run := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -21047,9 +21090,8 @@ begin
|
|||||||
NodeSelected := IsAnyHit and (vsSelected in HitInfo.HitNode.States);
|
NodeSelected := IsAnyHit and (vsSelected in HitInfo.HitNode.States);
|
||||||
FullRowDrag := toFullRowDrag in FOptions.FMiscOptions;
|
FullRowDrag := toFullRowDrag in FOptions.FMiscOptions;
|
||||||
IsHeightTracking := (Message.Msg = LM_LBUTTONDOWN) and
|
IsHeightTracking := (Message.Msg = LM_LBUTTONDOWN) and
|
||||||
(toNodeHeightResize in FOptions.FMiscOptions) and (hiOnItem in HitInfo.HitPositions) and
|
(hiOnItem in HitInfo.HitPositions) and
|
||||||
([hiUpperSplitter, hiLowerSplitter] * HitInfo.HitPositions <> []) and
|
([hiUpperSplitter, hiLowerSplitter] * HitInfo.HitPositions <> []);
|
||||||
((HitInfo.HitColumn > NoColumn) and (coFixed in FHeader.FColumns[HitInfo.HitColumn].Options));
|
|
||||||
|
|
||||||
// Dragging might be started in the inherited handler manually (which is discouraged for stability reasons)
|
// Dragging might be started in the inherited handler manually (which is discouraged for stability reasons)
|
||||||
// the test for manual mode is done below (after the focused node is set).
|
// the test for manual mode is done below (after the focused node is set).
|
||||||
@ -21067,7 +21109,7 @@ begin
|
|||||||
else
|
else
|
||||||
FHeightTrackNode := HitInfo.HitNode;
|
FHeightTrackNode := HitInfo.HitNode;
|
||||||
|
|
||||||
if Assigned(FHeightTrackNode) and (FHeightTrackNode <> FRoot) then
|
if CanSplitterResizeNode(Point(Message.XPos, Message.YPos), FHeightTrackNode, HitInfo.HitColumn) then
|
||||||
begin
|
begin
|
||||||
FHeightTrackColumn := HitInfo.HitColumn;
|
FHeightTrackColumn := HitInfo.HitColumn;
|
||||||
NodeRect := GetDisplayRect(FHeightTrackNode, FHeightTrackColumn, False);
|
NodeRect := GetDisplayRect(FHeightTrackNode, FHeightTrackColumn, False);
|
||||||
@ -21412,7 +21454,7 @@ begin
|
|||||||
// Keep the current total height value of Node as it has already been applied
|
// Keep the current total height value of Node as it has already been applied
|
||||||
// but might change in the load and fixup code. We have to adjust that afterwards.
|
// but might change in the load and fixup code. We have to adjust that afterwards.
|
||||||
LastTotalHeight := Node.TotalHeight;
|
LastTotalHeight := Node.TotalHeight;
|
||||||
WasFullyVisible := FullyVisible[Node] and not IsEffectivelyHidden(Node);
|
WasFullyVisible := FullyVisible[Node] and not IsEffectivelyFiltered[Node];
|
||||||
|
|
||||||
// Read in the new nodes.
|
// Read in the new nodes.
|
||||||
ReadNode(Stream, Version, Node);
|
ReadNode(Stream, Version, Node);
|
||||||
@ -21426,7 +21468,7 @@ begin
|
|||||||
|
|
||||||
// New nodes are always visible, so the visible node count has been increased already.
|
// New nodes are always visible, so the visible node count has been increased already.
|
||||||
// If Node is now invisible we have to take back this increment and don't need to add any visible child node.
|
// If Node is now invisible we have to take back this increment and don't need to add any visible child node.
|
||||||
if not FullyVisible[Node] or IsEffectivelyHidden(Node) then
|
if not FullyVisible[Node] or IsEffectivelyFiltered[Node] then
|
||||||
begin
|
begin
|
||||||
if WasFullyVisible then
|
if WasFullyVisible then
|
||||||
Dec(FVisibleCount);
|
Dec(FVisibleCount);
|
||||||
@ -21667,9 +21709,9 @@ begin
|
|||||||
AdjustTotalCount(Destination.Parent, Node.TotalCount, True);
|
AdjustTotalCount(Destination.Parent, Node.TotalCount, True);
|
||||||
|
|
||||||
// Add the new node's height only if its parent is expanded.
|
// Add the new node's height only if its parent is expanded.
|
||||||
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible(Node) then
|
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible[Node] then
|
||||||
AdjustTotalHeight(Destination.Parent, Node.TotalHeight, True);
|
AdjustTotalHeight(Destination.Parent, Node.TotalHeight, True);
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
||||||
end;
|
end;
|
||||||
amInsertAfter:
|
amInsertAfter:
|
||||||
@ -21697,9 +21739,9 @@ begin
|
|||||||
AdjustTotalCount(Destination.Parent, Node.TotalCount, True);
|
AdjustTotalCount(Destination.Parent, Node.TotalCount, True);
|
||||||
|
|
||||||
// Add the new node's height only if its parent is expanded.
|
// Add the new node's height only if its parent is expanded.
|
||||||
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible(Node) then
|
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible[Node] then
|
||||||
AdjustTotalHeight(Destination.Parent, Node.TotalHeight, True);
|
AdjustTotalHeight(Destination.Parent, Node.TotalHeight, True);
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
||||||
end;
|
end;
|
||||||
amAddChildFirst:
|
amAddChildFirst:
|
||||||
@ -21733,9 +21775,9 @@ begin
|
|||||||
Include(Destination.States, vsHasChildren);
|
Include(Destination.States, vsHasChildren);
|
||||||
AdjustTotalCount(Destination, Node.TotalCount, True);
|
AdjustTotalCount(Destination, Node.TotalCount, True);
|
||||||
// Add the new node's height only if its parent is expanded.
|
// Add the new node's height only if its parent is expanded.
|
||||||
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible(Node) then
|
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible[Node] then
|
||||||
AdjustTotalHeight(Destination, Node.TotalHeight, True);
|
AdjustTotalHeight(Destination, Node.TotalHeight, True);
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
||||||
end;
|
end;
|
||||||
amAddChildLast:
|
amAddChildLast:
|
||||||
@ -21764,9 +21806,9 @@ begin
|
|||||||
Include(Destination.States, vsHasChildren);
|
Include(Destination.States, vsHasChildren);
|
||||||
AdjustTotalCount(Destination, Node.TotalCount, True);
|
AdjustTotalCount(Destination, Node.TotalCount, True);
|
||||||
// Add the new node's height only if its parent is expanded.
|
// Add the new node's height only if its parent is expanded.
|
||||||
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible(Node) then
|
if (vsExpanded in Destination.Parent.States) and IsEffectivelyVisible[Node] then
|
||||||
AdjustTotalHeight(Destination, Node.TotalHeight, True);
|
AdjustTotalHeight(Destination, Node.TotalHeight, True);
|
||||||
if FullyVisible[Node] and not IsEffectivelyHidden(Node) then
|
if FullyVisible[Node] and not IsEffectivelyFiltered[Node] then
|
||||||
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
Inc(FVisibleCount, CountVisibleChildren(Node) + 1);
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
@ -21780,7 +21822,7 @@ begin
|
|||||||
if (Mode <> amNoWhere) and (Node.Parent <> FRoot) then
|
if (Mode <> amNoWhere) and (Node.Parent <> FRoot) then
|
||||||
begin
|
begin
|
||||||
// If we have added a visible node then simply remove the all-children-hidden flag.
|
// If we have added a visible node then simply remove the all-children-hidden flag.
|
||||||
if IsEffectivelyVisible(Node) then
|
if IsEffectivelyVisible[Node] then
|
||||||
Exclude(Node.Parent.States, vsAllChildrenHidden)
|
Exclude(Node.Parent.States, vsAllChildrenHidden)
|
||||||
else
|
else
|
||||||
// If we have added an invisible node and this is the only child node then
|
// If we have added an invisible node and this is the only child node then
|
||||||
@ -21841,7 +21883,7 @@ begin
|
|||||||
Node.States := Node.States - [vsChecking];
|
Node.States := Node.States - [vsChecking];
|
||||||
Parent := Node.Parent;
|
Parent := Node.Parent;
|
||||||
Dec(Parent.ChildCount);
|
Dec(Parent.ChildCount);
|
||||||
AdjustHeight := (vsExpanded in Parent.States) and IsEffectivelyVisible(Node);
|
AdjustHeight := (vsExpanded in Parent.States) and IsEffectivelyVisible[Node];
|
||||||
if Parent.ChildCount = 0 then
|
if Parent.ChildCount = 0 then
|
||||||
begin
|
begin
|
||||||
Parent.States := Parent.States - [vsAllChildrenHidden, vsHasChildren];
|
Parent.States := Parent.States - [vsAllChildrenHidden, vsHasChildren];
|
||||||
@ -22085,14 +22127,13 @@ begin
|
|||||||
P := ScreenToClient(P);
|
P := ScreenToClient(P);
|
||||||
GetHitTestInfoAt(P.X, P.Y, True, HitInfo);
|
GetHitTestInfoAt(P.X, P.Y, True, HitInfo);
|
||||||
if (hiOnItem in HitInfo.HitPositions) and
|
if (hiOnItem in HitInfo.HitPositions) and
|
||||||
([hiUpperSplitter, hiLowerSplitter] * HitInfo.HitPositions <> []) and
|
([hiUpperSplitter, hiLowerSplitter] * HitInfo.HitPositions <> []) then
|
||||||
((hitInfo.HitColumn > NoColumn) and (coFixed in FHeader.FColumns[HitInfo.HitColumn].FOptions)) then
|
|
||||||
begin
|
begin
|
||||||
if hiUpperSplitter in HitInfo.HitPositions then
|
if hiUpperSplitter in HitInfo.HitPositions then
|
||||||
Node := GetPreviousVisible(HitInfo.HitNode, True)
|
Node := GetPreviousVisible(HitInfo.HitNode, True)
|
||||||
else
|
else
|
||||||
Node := HitInfo.HitNode;
|
Node := HitInfo.HitNode;
|
||||||
if Assigned(Node) and (Node <> FRoot) then
|
if CanSplitterResizeNode(P, Node, HitInfo.HitColumn) then
|
||||||
NewCursor := crVertSplit;
|
NewCursor := crVertSplit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -24724,7 +24765,7 @@ begin
|
|||||||
Run := Node.LastChild;
|
Run := Node.LastChild;
|
||||||
while Assigned(Run) do
|
while Assigned(Run) do
|
||||||
begin
|
begin
|
||||||
if ParentVisible and IsEffectivelyVisible(Run) then
|
if ParentVisible and IsEffectivelyVisible[Run] then
|
||||||
Dec(FVisibleCount);
|
Dec(FVisibleCount);
|
||||||
|
|
||||||
Include(Run.States, vsDeleting);
|
Include(Run.States, vsDeleting);
|
||||||
@ -25255,7 +25296,7 @@ begin
|
|||||||
|
|
||||||
// Check whether the node is visible (determine indentation level btw.).
|
// Check whether the node is visible (determine indentation level btw.).
|
||||||
Temp := Node;
|
Temp := Node;
|
||||||
if not IsEffectivelyVisible(Temp) then
|
if not IsEffectivelyVisible[Temp] then
|
||||||
Exit;
|
Exit;
|
||||||
Indent := 0;
|
Indent := 0;
|
||||||
while Temp <> FRoot do
|
while Temp <> FRoot do
|
||||||
@ -25415,6 +25456,27 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function TBaseVirtualTree.GetEffectivelyFiltered(Node: PVirtualNode): Boolean;
|
||||||
|
|
||||||
|
// Checks if a node is effectively filtered out. This depends on the nodes state and the paint options.
|
||||||
|
|
||||||
|
begin
|
||||||
|
if Assigned(Node) then
|
||||||
|
Result := (vsFiltered in Node.States) and not (toShowFilteredNodes in FOptions.FPaintOptions)
|
||||||
|
else
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function TBaseVirtualTree.GetEffectivelyVisible(Node: PVirtualNode): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result := (vsVisible in Node.States) and not IsEffectivelyFiltered[Node];
|
||||||
|
end;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetFirst(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetFirst(ConsiderChildrenAbove: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the first node in the tree while optionally considering toChildrenAbove.
|
// Returns the first node in the tree while optionally considering toChildrenAbove.
|
||||||
@ -25586,7 +25648,7 @@ end;
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetFirstVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
function TBaseVirtualTree.GetFirstVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
||||||
IncludeHidden: Boolean = False): PVirtualNode;
|
IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the first visible node in the tree while optionally considering toChildrenAbove.
|
// Returns the first visible node in the tree while optionally considering toChildrenAbove.
|
||||||
// If necessary nodes are initialized on demand.
|
// If necessary nodes are initialized on demand.
|
||||||
@ -25677,13 +25739,13 @@ begin
|
|||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
|
||||||
if Assigned(Result) and not IncludeHidden and IsEffectivelyHidden(Result) then
|
if Assigned(Result) and not IncludeFiltered and IsEffectivelyFiltered[Result] then
|
||||||
Result := GetNextVisible(Result);
|
Result := GetNextVisible(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetFirstVisibleChild(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetFirstVisibleChild(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the first visible child node of Node. If necessary nodes are initialized on demand.
|
// Returns the first visible child node of Node. If necessary nodes are initialized on demand.
|
||||||
|
|
||||||
@ -25692,13 +25754,14 @@ begin
|
|||||||
Node := FRoot;
|
Node := FRoot;
|
||||||
Result := GetFirstChild(Node);
|
Result := GetFirstChild(Node);
|
||||||
|
|
||||||
if Assigned(Result) and (not (vsVisible in Result.States) or (not IncludeHidden and IsEffectivelyHidden(Node))) then
|
if Assigned(Result) and (not (vsVisible in Result.States) or
|
||||||
Result := GetNextVisibleSibling(Result, IncludeHidden);
|
(not IncludeFiltered and IsEffectivelyFiltered[Node])) then
|
||||||
|
Result := GetNextVisibleSibling(Result, IncludeFiltered);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetFirstVisibleChildNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetFirstVisibleChildNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the first visible child node of Node.
|
// Returns the first visible child node of Node.
|
||||||
|
|
||||||
@ -25706,14 +25769,15 @@ begin
|
|||||||
if Node = nil then
|
if Node = nil then
|
||||||
Node := FRoot;
|
Node := FRoot;
|
||||||
Result := Node.FirstChild;
|
Result := Node.FirstChild;
|
||||||
if Assigned(Result) and (not (vsVisible in Result.States) or (not IncludeHidden and IsEffectivelyHidden(Node))) then
|
if Assigned(Result) and (not (vsVisible in Result.States) or
|
||||||
Result := GetNextVisibleSiblingNoInit(Result, IncludeHidden);
|
(not IncludeFiltered and IsEffectivelyFiltered[Node])) then
|
||||||
|
Result := GetNextVisibleSiblingNoInit(Result, IncludeFiltered);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetFirstVisibleNoInit(Node: PVirtualNode = nil;
|
function TBaseVirtualTree.GetFirstVisibleNoInit(Node: PVirtualNode = nil;
|
||||||
ConsiderChildrenAbove: Boolean = True; IncludeHidden: Boolean = False): PVirtualNode;
|
ConsiderChildrenAbove: Boolean = True; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the first visible node in the tree or given subtree while optionally considering toChildrenAbove.
|
// Returns the first visible node in the tree or given subtree while optionally considering toChildrenAbove.
|
||||||
// No initialization is performed.
|
// No initialization is performed.
|
||||||
@ -25786,7 +25850,7 @@ begin
|
|||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
|
||||||
if Assigned(Result) and not IncludeHidden and IsEffectivelyHidden(Result) then
|
if Assigned(Result) and not IncludeFiltered and IsEffectivelyFiltered[Result] then
|
||||||
Result := GetNextVisibleNoInit(Result);
|
Result := GetNextVisibleNoInit(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -26031,7 +26095,7 @@ end;
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetLastVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
function TBaseVirtualTree.GetLastVisible(Node: PVirtualNode = nil; ConsiderChildrenAbove: Boolean = True;
|
||||||
IncludeHidden: Boolean = False): PVirtualNode;
|
IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the very last visible node in the tree while optionally considering toChildrenAbove.
|
// Returns the very last visible node in the tree while optionally considering toChildrenAbove.
|
||||||
// The nodes are intialized all the way down including the result node.
|
// The nodes are intialized all the way down including the result node.
|
||||||
@ -26040,13 +26104,13 @@ var
|
|||||||
Next: PVirtualNode;
|
Next: PVirtualNode;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := GetLastVisibleChild(Node, IncludeHidden);
|
Result := GetLastVisibleChild(Node, IncludeFiltered);
|
||||||
if not ConsiderChildrenAbove or not (toChildrenAbove in FOptions.FPaintOptions) then
|
if not ConsiderChildrenAbove or not (toChildrenAbove in FOptions.FPaintOptions) then
|
||||||
while Assigned(Result) do
|
while Assigned(Result) do
|
||||||
begin
|
begin
|
||||||
// Test if there is a next last visible child. If not keep the node from the last run.
|
// Test if there is a next last visible child. If not keep the node from the last run.
|
||||||
// Otherwise use the next last visible child.
|
// Otherwise use the next last visible child.
|
||||||
Next := GetLastVisibleChild(Result, IncludeHidden);
|
Next := GetLastVisibleChild(Result, IncludeFiltered);
|
||||||
if Next = nil then
|
if Next = nil then
|
||||||
Break;
|
Break;
|
||||||
Result := Next;
|
Result := Next;
|
||||||
@ -26055,7 +26119,7 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetLastVisibleChild(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetLastVisibleChild(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Determines the last visible child of the given node and initializes it if necessary.
|
// Determines the last visible child of the given node and initializes it if necessary.
|
||||||
|
|
||||||
@ -26068,8 +26132,9 @@ begin
|
|||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
|
||||||
if Assigned(Result) and (not (vsVisible in Result.States) or (not IncludeHidden and IsEffectivelyHidden(Node))) then
|
if Assigned(Result) and (not (vsVisible in Result.States) or
|
||||||
Result := GetPreviousVisibleSibling(Result, IncludeHidden);
|
(not IncludeFiltered and IsEffectivelyFiltered[Node])) then
|
||||||
|
Result := GetPreviousVisibleSibling(Result, IncludeFiltered);
|
||||||
|
|
||||||
if Assigned(Result) and not (vsInitialized in Result.States) then
|
if Assigned(Result) and not (vsInitialized in Result.States) then
|
||||||
InitNode(Result);
|
InitNode(Result);
|
||||||
@ -26077,7 +26142,7 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetLastVisibleChildNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetLastVisibleChildNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Determines the last visible child of the given node without initialization.
|
// Determines the last visible child of the given node without initialization.
|
||||||
|
|
||||||
@ -26090,14 +26155,15 @@ begin
|
|||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
|
||||||
if Assigned(Result) and (not (vsVisible in Result.States) or (not IncludeHidden and IsEffectivelyHidden(Node))) then
|
if Assigned(Result) and (not (vsVisible in Result.States) or
|
||||||
Result := GetPreviousVisibleSiblingNoInit(Result, IncludeHidden);
|
(not IncludeFiltered and IsEffectivelyFiltered[Node])) then
|
||||||
|
Result := GetPreviousVisibleSiblingNoInit(Result, IncludeFiltered);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetLastVisibleNoInit(Node: PVirtualNode = nil;
|
function TBaseVirtualTree.GetLastVisibleNoInit(Node: PVirtualNode = nil;
|
||||||
ConsiderChildrenAbove: Boolean = True; IncludeHidden: Boolean = False): PVirtualNode;
|
ConsiderChildrenAbove: Boolean = True; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the very last visible node in the tree while optionally considering toChildrenAbove.
|
// Returns the very last visible node in the tree while optionally considering toChildrenAbove.
|
||||||
// No initialization is performed.
|
// No initialization is performed.
|
||||||
@ -26106,13 +26172,13 @@ var
|
|||||||
Next: PVirtualNode;
|
Next: PVirtualNode;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := GetLastVisibleChildNoInit(Node, IncludeHidden);
|
Result := GetLastVisibleChildNoInit(Node, IncludeFiltered);
|
||||||
if not ConsiderChildrenAbove or not (toChildrenAbove in FOptions.FPaintOptions) then
|
if not ConsiderChildrenAbove or not (toChildrenAbove in FOptions.FPaintOptions) then
|
||||||
while Assigned(Result) do
|
while Assigned(Result) do
|
||||||
begin
|
begin
|
||||||
// Test if there is a next last visible child. If not keep the node from the last run.
|
// Test if there is a next last visible child. If not keep the node from the last run.
|
||||||
// Otherwise use the next last visible child.
|
// Otherwise use the next last visible child.
|
||||||
Next := GetLastVisibleChildNoInit(Result, IncludeHidden);
|
Next := GetLastVisibleChildNoInit(Result, IncludeFiltered);
|
||||||
if Next = nil then
|
if Next = nil then
|
||||||
Break;
|
Break;
|
||||||
Result := Next;
|
Result := Next;
|
||||||
@ -26418,7 +26484,8 @@ begin
|
|||||||
if Assigned(Result) and (GetNodeLevel(Result) <> NodeLevel) then
|
if Assigned(Result) and (GetNodeLevel(Result) <> NodeLevel) then
|
||||||
Result := GetNextLevel(Result, NodeLevel);
|
Result := GetNextLevel(Result, NodeLevel);
|
||||||
end
|
end
|
||||||
else if StartNodeLevel = NodeLevel then
|
else
|
||||||
|
if StartNodeLevel = NodeLevel then
|
||||||
begin
|
begin
|
||||||
Result := Node.NextSibling;
|
Result := Node.NextSibling;
|
||||||
if not Assigned(Result) then // i.e. start node was a last sibling
|
if not Assigned(Result) then // i.e. start node was a last sibling
|
||||||
@ -26665,7 +26732,7 @@ begin
|
|||||||
until False;
|
until False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until not Assigned(Result) or IsEffectivelyVisible(Result);
|
until not Assigned(Result) or IsEffectivelyVisible[Result];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -26764,13 +26831,13 @@ begin
|
|||||||
until False;
|
until False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until not Assigned(Result) or IsEffectivelyVisible(Result);
|
until not Assigned(Result) or IsEffectivelyVisible[Result];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetNextVisibleSibling(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetNextVisibleSibling(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the next visible sibling after Node. Initialization is done implicitly.
|
// Returns the next visible sibling after Node. Initialization is done implicitly.
|
||||||
|
|
||||||
@ -26780,12 +26847,13 @@ begin
|
|||||||
Result := Node;
|
Result := Node;
|
||||||
repeat
|
repeat
|
||||||
Result := GetNextSibling(Result);
|
Result := GetNextSibling(Result);
|
||||||
until not Assigned(Result) or ((vsVisible in Result.States) and (IncludeHidden or not IsEffectivelyHidden(Result)));
|
until not Assigned(Result) or ((vsVisible in Result.States) and
|
||||||
|
(IncludeFiltered or not IsEffectivelyFiltered[Result]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetNextVisibleSiblingNoInit(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetNextVisibleSiblingNoInit(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the next visible sibling after Node.
|
// Returns the next visible sibling after Node.
|
||||||
|
|
||||||
@ -26795,7 +26863,8 @@ begin
|
|||||||
Result := Node;
|
Result := Node;
|
||||||
repeat
|
repeat
|
||||||
Result := Result.NextSibling;
|
Result := Result.NextSibling;
|
||||||
until not Assigned(Result) or ((vsVisible in Result.States) and (IncludeHidden or not IsEffectivelyHidden(Result)));
|
until not Assigned(Result) or ((vsVisible in Result.States) and
|
||||||
|
(IncludeFiltered or not IsEffectivelyFiltered[Result]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -27277,7 +27346,7 @@ begin
|
|||||||
if Assigned(Result) and not (vsInitialized in Result.States) then
|
if Assigned(Result) and not (vsInitialized in Result.States) then
|
||||||
InitNode(Result);
|
InitNode(Result);
|
||||||
end;
|
end;
|
||||||
until not Assigned(Result) or IsEffectivelyVisible(Result);
|
until not Assigned(Result) or IsEffectivelyVisible[Result];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -27377,13 +27446,13 @@ begin
|
|||||||
until False;
|
until False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until not Assigned(Result) or IsEffectivelyVisible(Result);
|
until not Assigned(Result) or IsEffectivelyVisible[Result];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetPreviousVisibleSibling(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetPreviousVisibleSibling(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the previous visible sibling before Node. Initialization is done implicitly.
|
// Returns the previous visible sibling before Node. Initialization is done implicitly.
|
||||||
|
|
||||||
@ -27393,7 +27462,8 @@ begin
|
|||||||
Result := Node;
|
Result := Node;
|
||||||
repeat
|
repeat
|
||||||
Result := GetPreviousSibling(Result);
|
Result := GetPreviousSibling(Result);
|
||||||
until not Assigned(Result) or ((vsVisible in Result.States) and (IncludeHidden or not IsEffectivelyHidden(Result)));
|
until not Assigned(Result) or ((vsVisible in Result.States) and
|
||||||
|
(IncludeFiltered or not IsEffectivelyFiltered[Result]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -27409,7 +27479,8 @@ begin
|
|||||||
Result := Node;
|
Result := Node;
|
||||||
repeat
|
repeat
|
||||||
Result := Result.PrevSibling;
|
Result := Result.PrevSibling;
|
||||||
until not Assigned(Result) or ((vsVisible in Result.States) and (IncludeHidden or not IsEffectivelyHidden(Result)));
|
until not Assigned(Result) or ((vsVisible in Result.States) and
|
||||||
|
(IncludeFiltered or not IsEffectivelyFiltered[Result]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -27592,7 +27663,7 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetVisibleParent(Node: PVirtualNode; IncludeHidden: Boolean = False): PVirtualNode;
|
function TBaseVirtualTree.GetVisibleParent(Node: PVirtualNode; IncludeFiltered: Boolean = False): PVirtualNode;
|
||||||
|
|
||||||
// Returns the first (nearest) parent node of Node which is visible.
|
// Returns the first (nearest) parent node of Node which is visible.
|
||||||
// This method is one of the seldom cases where the hidden root node could be returned.
|
// This method is one of the seldom cases where the hidden root node could be returned.
|
||||||
@ -27602,7 +27673,7 @@ begin
|
|||||||
Assert(Node <> FRoot, 'Node must not be the hidden root node.');
|
Assert(Node <> FRoot, 'Node must not be the hidden root node.');
|
||||||
|
|
||||||
Result := Node.Parent;
|
Result := Node.Parent;
|
||||||
while (Result <> FRoot) and (not FullyVisible[Result] or (not IncludeHidden and IsEffectivelyHidden(Result))) do
|
while (Result <> FRoot) and (not FullyVisible[Result] or (not IncludeFiltered and IsEffectivelyFiltered[Result])) do
|
||||||
Result := Result.Parent;
|
Result := Result.Parent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -27789,7 +27860,7 @@ begin
|
|||||||
if (Node = nil) or (Node = FRoot) then
|
if (Node = nil) or (Node = FRoot) then
|
||||||
Invalidate
|
Invalidate
|
||||||
else
|
else
|
||||||
if (vsInitialized in Node.States) and IsEffectivelyVisible(Node) then
|
if (vsInitialized in Node.States) and IsEffectivelyVisible[Node] then
|
||||||
begin
|
begin
|
||||||
R := GetDisplayRect(Node, -1, False);
|
R := GetDisplayRect(Node, -1, False);
|
||||||
if R.Top < ClientHeight then
|
if R.Top < ClientHeight then
|
||||||
@ -27869,27 +27940,6 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.IsEffectivelyHidden(Node: PVirtualNode): Boolean;
|
|
||||||
|
|
||||||
// Checks if a node will effectively be hidden as this depends on the nodes state and the paint options.
|
|
||||||
|
|
||||||
begin
|
|
||||||
if Assigned(Node) then
|
|
||||||
Result := (vsHidden in Node.States) and not (toShowHiddenNodes in FOptions.FPaintOptions)
|
|
||||||
else
|
|
||||||
Result := False;
|
|
||||||
end;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function TBaseVirtualTree.IsEffectivelyVisible(Node: PVirtualNode): Boolean;
|
|
||||||
|
|
||||||
begin
|
|
||||||
Result := (vsVisible in Node.States) and not IsEffectivelyHidden(Node);
|
|
||||||
end;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function TBaseVirtualTree.IsMouseSelecting: Boolean;
|
function TBaseVirtualTree.IsMouseSelecting: Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -30000,7 +30050,7 @@ begin
|
|||||||
// Iterate through the child nodes without initializing them. We have to determine the entire height.
|
// Iterate through the child nodes without initializing them. We have to determine the entire height.
|
||||||
Child := Node.FirstChild;
|
Child := Node.FirstChild;
|
||||||
repeat
|
repeat
|
||||||
if IsEffectivelyVisible(Child) then
|
if IsEffectivelyVisible[Child] then
|
||||||
Inc(HeightDelta, Child.TotalHeight);
|
Inc(HeightDelta, Child.TotalHeight);
|
||||||
Child := Child.NextSibling;
|
Child := Child.NextSibling;
|
||||||
until Child = nil;
|
until Child = nil;
|
||||||
@ -31769,7 +31819,6 @@ var
|
|||||||
PaintInfo: TVTPaintInfo;
|
PaintInfo: TVTPaintInfo;
|
||||||
Dummy: TColumnIndex;
|
Dummy: TColumnIndex;
|
||||||
LineImage: TLineImage;
|
LineImage: TLineImage;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Length(S) = 0 then
|
if Length(S) = 0 then
|
||||||
S := Text[Node, Column];
|
S := Text[Node, Column];
|
||||||
|
Reference in New Issue
Block a user