Files

6470 lines
236 KiB
TeX
Raw Blame History

@@ckButtonDisabled
<COMBINE Check button image indices>
@@ckCheckMixedDisabled
<COMBINE Check button image indices>
simple button
@@ckEmpty
<COMBINE Check button image indices>
an empty image used as place holder radio buttons
@@ckRadioCheckedDisabled
<COMBINE Check button image indices>
check boxes
@@TBaseVirtualTree
TBaseVirtualTree is the main and base class for all other Virtual Treeview descendants. This class implements most of the
base features and abilities and can be used to derive new classes, which want to hide most of the details of the tree,
which other descendants like TVirtualStringTree publish. Do not use the base treeview as object. It is not meant to be
instantiated directly, instead via an descendant.
@@TBaseVirtualTree.AdjustCoordinatesByIndent@TVTPaintInfo@Integer
During painting of the main column some coordinates must be adjusted due to the tree lines.
The offset resulting from the tree lines and indentation level is given in Indent.
@@TBaseVirtualTree.AdjustImageBorder@TCustomImageList@TBidiMode@Integer@TRect@TVTImageInfo
Depending on the width of the image list as well as the given bidi mode R must be adjusted.
@@TBaseVirtualTree.AdjustTotalCount@PVirtualNode@Integer@Boolean
Sets a node's total count to the given value and recursively adjusts the parent's total count
(actually, the adjustment is done iteratively to avoid function call overheads).
@@TBaseVirtualTree.AdjustTotalHeight@PVirtualNode@Integer@Boolean
Sets a node's total height to the given value and recursively adjusts the parent's total height.
@@TBaseVirtualTree.CalculateCacheEntryCount
Calculates the size of the position cache.
@@TBaseVirtualTree.CalculateVerticalAlignments@Boolean@Boolean@PVirtualNode@Integer@Integer
Calculates the vertical alignment of the given node and its associated expand/collapse button during
a node paint cycle depending on the required node alignment style.
@@TBaseVirtualTree.ChangeCheckState@PVirtualNode@TCheckState
Sets the check state of the node according to the given value and the node's check type.
If the check state must be propagated to the parent nodes and one of them refuses to change then
nothing happens and False is returned, otherwise True.
@@TBaseVirtualTree.ClearNodeBackground@TVTPaintInfo@Boolean@Boolean@TRect
Erases a nodes background depending on what the application decides to do.
UseBackground determines whether or not to use the background picture, while Floating indicates
that R is given in coordinates of the small node bitmap or the superordinated target bitmap used in PaintTree.
@@TBaseVirtualTree.CMDenySubclassing@TMessage
If a Windows XP Theme Manager component is used in the application it will try to subclass all controls which do not
explicitly deny this. Virtual Treeview knows how to handle XP themes so it does not need subclassing.
@@TBaseVirtualTree.CMHintShow@TCMHintShow
Determines hint message (tooltip) and out-of-hint rect.
Note: A special handling is needed here because we cannot pass wide strings back to the caller.
I had to introduce the hint data record anyway so we can use this to pass the hint string.
We still need to set a dummy hint string in the message to make the VCL showing the hint window.
@@TBaseVirtualTree.CMHintShowPause@TCMHintShowPause
Tells the application that the tree (and only the tree) does not want a delayed tool tip.
Normal hints / header hints use the default delay (except the first time).
@@TBaseVirtualTree.CollectSelectedNodesLTR@Integer@Integer@Integer@TAlignment@TRect@TRect
Helper routine used when a draw selection takes place. This version handles left-to-right directionality.
In the process of adding or removing nodes the current selection is modified which requires to pack it after
the function returns. Another side effect of this method is that a temporary list of nodes will be created
(see also InternalCacheNode) which must be inserted into the current selection by the caller.
@@TBaseVirtualTree.CollectSelectedNodesRTL@Integer@Integer@Integer@TAlignment@TRect@TRect
Helper routine used when a draw selection takes place. This version handles right-to-left directionality.
See also comments in CollectSelectedNodesLTR.
@@TBaseVirtualTree.DrawLineImage@TVTPaintInfo@Integer@Integer@Integer@Integer@TVTLineType@Boolean
Draws (depending on Style) one of the 5 line types of the tree.
If Reverse is True then a right-to-left column is being drawn, hence horizontal lines must be mirrored.
X and Y describe the left upper corner of the line image rectangle, while H denotes its height (and width).
@@TBaseVirtualTree.FAlignment
@@TBaseVirtualTree.FAnimationDuration
@@TBaseVirtualTree.FAnimationType
@@TBaseVirtualTree.FAutoExpandDelay
amount of milliseconds to wait until a node is expanded if it is the
drop target
@@TBaseVirtualTree.FAutoScrollDelay
amount of milliseconds to wait until autoscrolling becomes active
@@TBaseVirtualTree.FAutoScrollInterval
determines speed of auto scrolling
@@TBaseVirtualTree.FBackground
A background image loadable at design and runtime.
@@TBaseVirtualTree.FButtonFillMode
for rectangular tree buttons only: how to fill them
@@TBaseVirtualTree.FButtonStyle
style of the tree buttons
@@TBaseVirtualTree.FChangeDelay
used to delay OnChange event
@@TBaseVirtualTree.FCheckImageKind
light or dark, cross marks or tick marks
@@TBaseVirtualTree.FCheckImages
Reference to global image list to be used for the check images.
@@TBaseVirtualTree.FCheckNode
node which "captures" an check event
@@TBaseVirtualTree.FClipboardFormats
a list of clipboard format descriptions enabled for this tree
@@TBaseVirtualTree.FColors
class comprising all customizable colors in the tree
@@TBaseVirtualTree.FDefaultPasteMode
Used to determine where to add pasted nodes to.
@@TBaseVirtualTree.FDottedBrush
used to paint dotted lines without special pens
@@TBaseVirtualTree.FDragImage
drag image management
@@TBaseVirtualTree.FDragImageKind
determines whether or not and what to show in the drag image
@@TBaseVirtualTree.FDragManager
drag'n drop, cut'n paste
@@TBaseVirtualTree.FDragOperations
determines which operations are allowed during drag'n drop
@@TBaseVirtualTree.FDragScrollStart
Contains the start time when a tree does auto scrolling as drop target.
@@TBaseVirtualTree.FDragSelection
temporary copy of FSelection used during drag'n drop
@@TBaseVirtualTree.FDragThreshold
used to determine when to actually start a drag'n drop operation
@@TBaseVirtualTree.FDragType
used to switch between OLE and VCL drag'n drop
@@TBaseVirtualTree.FDrawSelectionMode
determines the paint mode for draw selection
@@TBaseVirtualTree.FDrawSelShiftState
keeps the initial shift state when the user starts selection with
the mouse
@@TBaseVirtualTree.FDropTargetNode
node currently selected as drop target
@@TBaseVirtualTree.FEditDelay
determines time to elapse before a node goes into edit mode
@@TBaseVirtualTree.FEditLink
used to comunicate with an application defined editor
@@TBaseVirtualTree.FFontChanged
flag for keeping informed about font changes in the off screen buffer
@@TBaseVirtualTree.FHeaderRect
Space which the header currently uses in the control (window coords).
@@TBaseVirtualTree.FHintData
used while preparing the hint window
@@TBaseVirtualTree.FHintMode
determines the kind of the hint window
@@TBaseVirtualTree.FHotCursor
can be set to additionally indicate the current hot node
@@TBaseVirtualTree.FIncrementalSearch
Used to determine whether and how incremental search is to be used.
@@TBaseVirtualTree.FindInPositionCache@Cardinal@Cardinal
Looks through the position cache and returns the node whose top position is the largest one which is smaller or equal
to the given vertical position.
The returned node does not necessarily occupy the given position but is the nearest one to start
iterating from to approach the real node for a given position. CurrentPos receives the actual position of the found
node which is needed for further iteration.
@@TBaseVirtualTree.FindInPositionCache@PVirtualNode@Cardinal
Looks through the position cache and returns the node whose top position is the largest one which is smaller or equal
to the position of the given node.
@@TBaseVirtualTree.FLastClickPos
Used for retained drag start and wheel mouse scrolling.
@@TBaseVirtualTree.FLastDropMode
set while dragging and used to track changes
@@TBaseVirtualTree.FLastHintRect
Area which the must must leave to reshow a hint.
@@TBaseVirtualTree.FLastSearchNode
Reference to node which was last found as search fit.
@@TBaseVirtualTree.FLastSelectionLevel
keeps the last node level for constrained multiselection
@@TBaseVirtualTree.FLastStructureChangeReason
used for delayed structur change event
@@TBaseVirtualTree.FLastVCLDragTarget
A node cache for VCL drag'n drop (keywords: DragLeave on DragDrop).
@@TBaseVirtualTree.FLineMode
tree lines or bands etc.
@@TBaseVirtualTree.FLineStyle
style of the tree lines
@@TBaseVirtualTree.FMargin
horizontal border distance
@@TBaseVirtualTree.FNodeAlignment
determines how to interpret the align member of a node
@@TBaseVirtualTree.FNodeDataSize
number of bytes to allocate with each node (in addition to its base
structure and the internal data), if -1 then do callback
@@TBaseVirtualTree.FOldFontChange
helper method pointer for tracking font changes in the off screen buffer
@@TBaseVirtualTree.FOnAdvancedHeaderDraw
Used when owner draw is enabled for the header and a column
is set to owner draw mode. But only if OnHeaderDrawQueryElements
returns at least one element to be drawn by the application.
In this case OnHeaderDraw is not used.
@@TBaseVirtualTree.FOnAfterCellPaint
triggered after a column of an item has been painted
@@TBaseVirtualTree.FOnAfterItemErase
triggered after an item's background has been erased
@@TBaseVirtualTree.FOnAfterItemPaint
triggered after an item has been painted
@@TBaseVirtualTree.FOnBeforeCellPaint
triggered when a column of an item is about to be painted
@@TBaseVirtualTree.FOnBeforeItemErase
triggered when an item's background is about to be erased
@@TBaseVirtualTree.FOnBeforeItemPaint
triggered when an item is about to be painted
@@TBaseVirtualTree.FOnChange
selection change
@@TBaseVirtualTree.FOnChecking
called just before a node's check state is changed
@@TBaseVirtualTree.FOnCompareNodes
used during sort
@@TBaseVirtualTree.FOnCreateDataObject
called to allow for app./descentant defined data objects
@@TBaseVirtualTree.FOnCreateDragManager
called to allow for app./descendant defined drag managers
@@TBaseVirtualTree.FOnCreateEditor
called when a node goes into edit mode, this allows applications
to supply their own editor
@@TBaseVirtualTree.FOnDragAllowed
used to get permission for manual drag in mouse down
@@TBaseVirtualTree.FOnDragDrop
called on release of mouse button (if drop was allowed)
@@TBaseVirtualTree.FOnDragOver
called for every mouse move
@@TBaseVirtualTree.FOnEditCancelled
called when editing has been cancelled
@@TBaseVirtualTree.FOnEdited
called when editing has successfully been finished
@@TBaseVirtualTree.FOnEditing
called just before a node goes into edit mode
@@TBaseVirtualTree.FOnFocusChanged
called when the focus goes to a new node and/or column
@@TBaseVirtualTree.FOnFocusChanging
called when the focus is about to go to a new node and/or column
(can be cancelled)
@@TBaseVirtualTree.FOnFreeNode
called when a node is about to be destroyed, user data can and should
be freed in this event
@@TBaseVirtualTree.FOnGetCursor
called to allow the app. to set individual cursors
@@TBaseVirtualTree.FOnGetHeaderCursor
triggered to allow the app. to use customized cursors for the header
@@TBaseVirtualTree.FOnGetHelpContext
called when a node specific help theme should be called
@@TBaseVirtualTree.FOnGetImage
used to retrieve the image index of a given node
@@TBaseVirtualTree.FOnGetLineStyle
triggered when a custom line style is used and the pattern brush
needs to be build
@@TBaseVirtualTree.FOnGetNodeDataSize
called if NodeDataSize is -1
@@TBaseVirtualTree.FOnGetPopupMenu
called when the popup for a node needs to be shown
@@TBaseVirtualTree.FOnGetUserClipboardFormats
gives application/descentants the opportunity to
add own clipboard formats on the fly
@@TBaseVirtualTree.FOnHeaderDragged
header (column) drag'n drop
@@TBaseVirtualTree.FOnHeaderDraggedOut
header (column) drag'n drop, which did not result in a valid drop.
@@TBaseVirtualTree.FOnHeaderDragging
header (column) drag'n drop
@@TBaseVirtualTree.FOnHeaderDraw
Used when owner draw is enabled for the header and a column is set
to owner draw mode.
@@TBaseVirtualTree.FOnHeaderDrawQueryElements
Used for advanced header painting to query the
application for the elements, which are drawn by it and which should
be drawn by the tree.
@@TBaseVirtualTree.FOnHotChange
called when the current "hot" node (that is, the node under the mouse)
changes and hot tracking is enabled
@@TBaseVirtualTree.FOnIncrementalSearch
triggered on every key press (not key down)
@@TBaseVirtualTree.FOnInitChildren
called when a node's children are needed (expanding etc.)
@@TBaseVirtualTree.FOnInitNode
called when a node needs to be initialized (child count etc.)
@@TBaseVirtualTree.FOnKeyAction
used to selectively prevent key actions (full expand on Ctrl+'+' etc.)
@@TBaseVirtualTree.FOnMeasureItem
Triggered when a node is about to be drawn and its height was not yet
determined by the application.
@@TBaseVirtualTree.FOnNodeCopied
call after a node has been copied
@@TBaseVirtualTree.FOnNodeCopying
called when an node is copied to another parent node (probably in
another tree, but within the same application, can be cancelled)
@@TBaseVirtualTree.FOnNodeMoved
called after a node and its children have been moved to another
parent node (probably another tree, but within the same application)
@@TBaseVirtualTree.FOnNodeMoving
called just before a node is moved from one parent node to another
(this can be cancelled)
@@TBaseVirtualTree.FOnPaintBackground
triggered if a part of the tree's background must be erased which is
not covered by any node
@@TBaseVirtualTree.FOnRenderOLEData
application/descendant defined clipboard formats
@@TBaseVirtualTree.FOnResetNode
called when a node is set to be uninitialized
@@TBaseVirtualTree.FOnScroll
called when one or both paint offsets changed
@@TBaseVirtualTree.FOnStateChange
Called whenever a state in the tree changes.
@@TBaseVirtualTree.FOnStructureChange
structural change like adding nodes etc.
@@TBaseVirtualTree.FOnUpdating
called from BeginUpdate, EndUpdate, BeginSynch and EndSynch
@@TBaseVirtualTree.FPanningCursor
Current wheel panning cursor.
@@TBaseVirtualTree.FPanningImage
A little 32x32 bitmap to indicate the panning reference point.
@@TBaseVirtualTree.FPanningWindow
Helper window for wheel panning
@@TBaseVirtualTree.FPendingCheckState
the new state the check node will get if all wents fine
@@TBaseVirtualTree.FPositionCache
array which stores node references ordered by vertical positions
(see also DoValidateCache for more information)
@@TBaseVirtualTree.FRangeAnchor
anchor node for selection with the keyboard, determines start of a
selection range
@@TBaseVirtualTree.FScrollBarOptions
common properties of horizontal and vertical scrollbar
@@TBaseVirtualTree.FScrollDirections
directions to scroll client area into depending on mouse position
@@TBaseVirtualTree.FSearchBuffer
Collects a sequence of keypresses used to do incremental searching.
@@TBaseVirtualTree.FSearchDirection
Direction to incrementally search the tree.
@@TBaseVirtualTree.FSearchStart
Where to start iteration on each key press.
@@TBaseVirtualTree.FSearchTimeout
Number of milliseconds after which to stop incremental searching.
@@TBaseVirtualTree.FSelection
list of currently selected nodes
@@TBaseVirtualTree.FSelectionBlendFactor
Determines the factor by which the selection rectangle is to be
faded if enabled.
@@TBaseVirtualTree.FSelectionCount
number of currently selected nodes (size of FSelection might differ)
@@TBaseVirtualTree.FSelectionCurveRadius
radius for rounded selection rectangles
@@TBaseVirtualTree.FSingletonNodeArray
Contains only one element for quick addition of single nodes
to the selection.
@@TBaseVirtualTree.FStartIndex
index to start validating cache from
@@TBaseVirtualTree.FStates
various active/pending states the tree needs to consider
@@TBaseVirtualTree.FSynchUpdateCount
synchronizer, causes all events which are usually done via timers
to happen immediately, regardless of the normal update state
@@TBaseVirtualTree.FTempNodeCache
used at various places to hold temporarily a bunch of node refs.
@@TBaseVirtualTree.FTempNodeCount
number of nodes in FTempNodeCache
@@TBaseVirtualTree.FTextMargin
space between the node's text and its horizontal bounds
@@TBaseVirtualTree.FTotalInternalDataSize
Cache of the sum of the necessary internal data size for all tree
classes derived from this base class.
@@TBaseVirtualTree.FUpdateCount
update stopper, updates of the tree control are only done if = 0
@@TBaseVirtualTree.FVCLDragEffect
A cache for VCL drag'n drop to keep the current drop effect.
@@TBaseVirtualTree.FVisibleCount
number of currently visible nodes
@@TBaseVirtualTree.FWantTabs
If True then the tree also consumes the tab key.
@@TBaseVirtualTree.GetDragManager
Returns the internal drag manager interface. If this does not yet exist then it is created here.
@@TBaseVirtualTree.GetFullyVisible@PVirtualNode
Determines whether the given node has the visibility flag set as well as all its parents are expanded.
@@TBaseVirtualTree.GetVisible@PVirtualNode
Determines if the given node marked as being visible.
@@TBaseVirtualTree.GetVisiblePath@PVirtualNode
Determines if all parents of the given node are expanded and have the visibility flag set.
@@TBaseVirtualTree.HandleDrawSelection@Integer@Integer
Handles multi-selection with a focus rectangle.
Result is True if something changed in selection.
@@TBaseVirtualTree.HasVisibleNextSibling@PVirtualNode
Helper method to determine if the given node has a visible sibling. This is needed to
draw correct tree lines.
@@TBaseVirtualTree.InitializeFirstColumnValues@TVTPaintInfo
Determines initial index, position and cell size of the first visible column.
@@TBaseVirtualTree.InitRootNode@Cardinal
Reinitializes the root node.
@@TBaseVirtualTree.InterruptValidation
Waits until the worker thread has stopped validating the caches of this tree.
@@TBaseVirtualTree.IsFirstVisibleChild@PVirtualNode@PVirtualNode
Helper method to check if Node is the same as the first visible child of Parent.
@@TBaseVirtualTree.IsLastVisibleChild@PVirtualNode@PVirtualNode
Helper method to check if Node is the same as the last visible child of Parent.
@@TBaseVirtualTree.PrepareBitmaps@Boolean@Boolean
initializes the contents of the internal bitmaps
@@TBaseVirtualTree.PrepareCell@TVTPaintInfo@Integer@Integer
This method is called immediately before a cell's content is drawn und is responsible to paint selection colors etc.
@@TBaseVirtualTree.ReadOldOptions@TReader
Migration helper routine to silently convert forms containing the old tree options member into the new
sub-options structure.
@@TBaseVirtualTree.SetChildCount@PVirtualNode@Cardinal
Changes a node's child structure to accomodate the new child count. This is used to add or delete
child nodes to/from the end of the node's child list. To insert or delete a specific node a separate
routine is used.
@@TBaseVirtualTree.SetFullyVisible@PVirtualNode@Boolean
This method ensures that a node is visible and all its parent nodes are expanded and also visible
if Value is True. Otherwise the visibility flag of the node is reset but the expand state
of the parent nodes stays untouched.
@@TBaseVirtualTree.SetVisible@PVirtualNode@Boolean
Sets the visibility style of the given node according to Value.
@@TBaseVirtualTree.SetVisiblePath@PVirtualNode@Boolean
If Value is True then all parent nodes of Node are expanded.
@@TBaseVirtualTree.TileBackground@TBitmap@TCanvas@TPoint@TRect
Draws the given source graphic so that it tiles into the given rectangle which is relative to the target bitmap.
The graphic is aligned so that it always starts at the upper left corner of the target canvas.
Offset gives the position of the target window in an possible superordinated surface.
@@TBaseVirtualTree.WMContextMenu@TWMContextMenu
This method is called when a popup menu is about to be displayed.
We have to cancel some pending states here to avoid interferences.
@@TBaseVirtualTree.WMHScroll@TWMHScroll
local functions
@@TBaseVirtualTree.WMKeyDown@TWMKeyDown
Keyboard event handling for node focus, selection, node specific popup menus and help invokation.
For a detailed description of every action done here read the help.
@@TBlendMode.bmConstantAlpha
apply given constant alpha
@@TBlendMode.bmConstantAlphaAndColor
blend the destination color with the given constant color und the constant alpha value
@@TBlendMode.bmMasterAlpha
use alpha value of source pixel and multiply it with the constant alpha value
@@TBlendMode.bmPerPixelAlpha
use alpha value of the source pixel
@@TChangeReason.crAccumulated
used for delayed changes
@@TChangeReason.crChildAdded
one or more child nodes have been added
@@TChangeReason.crChildDeleted
one or more child nodes have been deleted
@@TChangeReason.crIgnore
used as placeholder
@@TChangeReason.crNodeAdded
a node has been added
@@TChangeReason.crNodeCopied
a node has been duplicated
@@TChangeReason.crNodeMoved
a node has been moved to a new place
@@TCheckImageKind
Summary
Determines which images should be used for checkboxes and radio buttons.
Description
Provided with the tree are nine different image sets for the check images used when toCheckSupport is enabled in
TreeOptions.
<TABLE noborder>
<IMAGE Check images overview>
</TABLE>
Eight of the nine lists are predefined while one is a custom check image list, which can be filled by the application.
Use ckCustom as CheckImageKind value and assign an image list to the CustomCheckImages property to enable custom images.
The order of the images in the image lists is always as listed below. Make sure you have the same amount of images in
your custom image list, if you want own check images.
* empty image (ckEmpty)
<B>Radio buttons:</B>
* uncheck normal (ckRadioUncheckedNormal)
* unchecked hot (ckRadioUncheckedHot)
* unchecked pressed (ckRadioUncheckedPressed)
* unchecked disabled (ckRadioUncheckedDisabled)
* checked normal (ckRadioCheckedNormal)
* checked hot (ckRadioCheckedHot)
* checked pressed (ckRadioCheckedPressed)
* checked disabled (ckRadioCheckedDisabled)
<B>Check boxes:</B>
* unchecked normal (ckCheckUncheckedNormal)
* unchecked hot (ckCheckUncheckedHot)
* unchecked pressed (ckCheckUncheckedPressed)
* unchecked disabled (ckCheckUncheckedDisabled)
* checked normal (ckCheckCheckedNormal)
* checked hot (ckCheckCheckedHot)
* checked pressed (ckCheckCheckedPressed)
* checked disabled (ckCheckCheckedDisabled)
* mixed normal (ckCheckMixedNormal)
* mixed hot (ckCheckMixedHot)
* mixed pressed (ckCheckMixedPressed)
* mixed disabled (ckCheckMixedDisabled)
<B>Node buttons:</B>
* button normal (ckButtonNormal)
* button hot (ckButtonHot)
* button pressed (ckButtonPressed)
* button disabled (ckButtonDisabled)
@@TCheckImageKind.ckCustom
application defined check images
@@TCheckImageKind.ckDarkCheck
black cross
@@TCheckImageKind.ckDarkTick
black tick mark
@@TCheckImageKind.ckFlat
flat images (no 3D border)
@@TCheckImageKind.ckLightCheck
gray cross
@@TCheckImageKind.ckLightTick
gray tick mark
@@TCheckImageKind.ckSystemFlat
Flat system defined check images.
@@TCheckImageKind.ckXP
Windows XP style
@@TCheckState.csCheckedNormal
checked and not pressed
@@TCheckState.csCheckedPressed
checked and pressed
@@TCheckState.csMixedNormal
3-state check box and not pressed
@@TCheckState.csMixedPressed
3-state check box and pressed
@@TCheckState.csUncheckedNormal
unchecked and not pressed
@@TCheckState.csUncheckedPressed
unchecked and pressed
@@TClipboardFormatList.Add@string@TVirtualTreeClass@Cardinal@TFormatEtc
Adds the given data to the internal list. The priority value is used to sort formats for importance. Larger priority
values mean less priority.
@@TClipboardFormatList.EnumerateFormats@TVirtualTreeClass@TFormatEtcArray@TClipboardFormats
Returns a list of format records for the given class. If assigned the AllowedFormats is used to limit the
enumerated formats to those described in the list.
@@TClipboardFormatList.EnumerateFormats@TVirtualTreeClass@TStrings
Returns a list of format descriptions for the given class.
@@TClipboardFormatList.Sort
local function
@@TClipboardFormatListEntry.Description
The string used to register the format with Windows.
@@TClipboardFormatListEntry.FormatEtc
The definition of the format in the IDataObject.
@@TClipboardFormatListEntry.Priority
Number which determines the order of formats used in IDataObject.
@@TClipboardFormatListEntry.TreeClass
The tree class which supports rendering this format.
@@TClipboardFormats
Summary
List of strings describing clipboard formats.
Description
This class is an extended string list which allows to enter description strings for clipboard formats which are checked
agains registered formats and only accepted if the particular format could be found. This way there is an unambiqious and
portable description of allowed clipboard formats possible.
@@TClipboardFormats.Add@string
Summary
Adds a new format to the internal list.
Description
Adds or inserts a new format to the internal list but restricts additions to the clipbard formats to only those which are
registered with the owner tree or one of its ancestors.
@@TClipboardFormats.Insert@Integer@string
<COMBINE TClipboardFormats.Add@string>
@@TCustomVirtualStringTree.FDefaultText
text to show if there's no OnGetText event handler (e.g. at design time)
@@TCustomVirtualStringTree.FEllipsisWidth
width of '...' for the current font
@@TCustomVirtualStringTree.FInternalDataOffset
offset to the internal data of the string tree
@@TCustomVirtualStringTree.FOnNewText
used to notify the application about an edited node caption
@@TCustomVirtualStringTree.FOnPaintText
triggered before either normal or fixed text is painted to allow
even finer customization (kind of sub cell painting)
@@TCustomVirtualStringTree.FOnShortenString
used to allow the application a customized string shortage
@@TCustomVirtualStringTree.FTextHeight
true size of the font
@@TEnumFormatEtc
@@THeaderState.hsAutoSizing
auto size chain is in progess, do not trigger again on WM_SIZE
@@THeaderState.hsDragging
header dragging is in progress (only if enabled)
@@THeaderState.hsDragPending
left button is down, user might want to start dragging a column
@@THeaderState.hsLoading
The header currently loads from stream, so updates are not necessary.
@@THintAnimationType.hatFade
fade in the hint/tooltip, like in Windows 2000
@@THintAnimationType.hatNone
no animation at all, just display hint/tooltip
@@THintAnimationType.hatSlide
slide in the hint/tooltip, like in Windows 98
@@THintAnimationType.hatSystemDefault
use what the system is using (slide for Win9x, slide/fade for Win2K+, depends on settings)
@@THitPosition.hiAbove
above the client area (if relative) or the absolute tree area
@@THitPosition.hiBelow
below the client area (if relative) or the absolute tree area
@@THitPosition.hiNowhere
no node is involved (possible only if the tree is not as tall as the client area)
@@THitPosition.hiOnItem
on the bitmaps/buttons or label associated with an item
@@THitPosition.hiOnItemButton
on the button associated with an item
@@THitPosition.hiOnItemCheckbox
on the checkbox if enabled
@@THitPosition.hiOnItemIndent
in the indentation area in front of a node
@@THitPosition.hiOnItemLabel
on the normal text area associated with an item
@@THitPosition.hiOnItemLeft
in the area to the left of a node's text area (e.g. when right aligned or centered)
@@THitPosition.hiOnItemRight
in the area to the right of a node's text area (e.g. if left aligned or centered)
@@THitPosition.hiOnNormalIcon
on the "normal" image
@@THitPosition.hiOnStateIcon
on the state image
@@THitPosition.hiToLeft
to the left of the client area (if relative) or the absolute tree area
@@THitPosition.hiToRight
to the right of the client area (if relative) or the absolute tree area
@@TItemEraseAction.eaColor
Use the provided color to erase the background instead the one of the tree.
@@TItemEraseAction.eaDefault
The tree should erase the item's background (bitmap or solid).
@@TItemEraseAction.eaNone
Do nothing. Let the application paint the background.
@@TScrollBarOptions
@@TScrollBarOptions.FScrollBars
used to hide or show vertical and/or horizontal scrollbar
@@TScrollBarOptions.FScrollBarStyle
kind of scrollbars to use
@@TStringEditLink
Summary
TStringEditLink is the standard node editor of a TVirtualStringTree.
Description
TStringEditLink implements the interface IVTEditLink. This is a simple node editor which wraps a TEdit and is not Unicode
aware. A virtual string tree will use this node editor if the event OnCreateEditor is not handled and a node must be
edited. After the node's text has been edited the event OnNewText will be fired and the application should replace the
\old text with the new and edited text.
The node editor instance will automatically be destroyed via reference counting when it is not needed anymore. Never
destroy it explicitly - except when you know what you are doing.
Remarks
If you want to modify some aspects of how the node editor works, i.e. suppress some characters or initialize it with a
different text but the node's text, you can inherit your own class from TStringEditLink and return an instance of it in
the OnCreateEditor event.
@@TStringEditLink.BeginEdit
Summary
This function will be called by the virtual string tree when the editing starts.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringEditLink.CancelEdit
Summary
This function will be called by the virtual string tree when the current editing is about to be cancelled.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringEditLink.EndEdit
Summary
This function will be called by the virtual string tree when the current editing is being finished.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringEditLink.FColumn
The column of the node.
@@TStringEditLink.FEdit
A normal custom edit control.
@@TStringEditLink.FNode
The node to be edited.
@@TStringEditLink.FStopping
Set to True when the edit link requests stopping the edit action.
@@TStringEditLink.FTextBounds
Smallest rectangle around the text.
@@TStringEditLink.FTree
A back reference to the tree calling.
@@TStringEditLink.GetBounds
Summary
The virtual string tree uses this function to get the current bounding rect of the node editor.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringEditLink.PrepareEdit@TBaseVirtualTree@PVirtualNode@TColumnIndex
Summary
This function is called by a virtual string tree to initialize the node editor.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringEditLink.ProcessMessage@TMessage
Summary
This function is used to forward messages being directed to the virtual string tree.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringEditLink.SetBounds@TRect
Summary
The virtual string tree calls this function to initialize the bounding rect of the node editor.
Description
Please see interface IVTEditLink for a detailed explanation of this interface function.
@@TStringTreeOptions
Summary
Options class used in the string tree and its descentants.
Description
This options class publishes all properties inherited from its ancestor and does not add any further functionality.
@@TToggleAnimationData.Brush
the brush to be used to erase uncovered parts
@@TToggleAnimationData.DC
the DC of the window to erase unconvered parts
@@TToggleAnimationData.Window
copy of the tree's window handle
@@TVirtualDrawTree
Summary
Descendant of TBaseVirtualTree, which passes node paint events through to the application (similar to a draw grid)
Description
This tree implementation enhances the base tree to allow the application to draw its own stuff into the tree window.
@@TVirtualNode.Align
line/button alignment
@@TVirtualNode.CheckState
indicates the current check state (e.g. checked, pressed etc.)
@@TVirtualNode.CheckType
indicates which check type shall be used for this node
@@TVirtualNode.Data
this is a placeholder, each node gets extra data determined by NodeDataSize
@@TVirtualNode.Dummy
dummy value to fill DWORD boundary
@@TVirtualNode.NodeHeight
height in pixels
@@TVirtualNode.States
states describing various properties of the node (expanded, initialized etc.)
@@TVirtualNodeState.vsAllChildrenHidden
Set if vsHasChildren is set and no child node has the vsVisible flag set.
@@TVirtualNodeState.vsChecking
Node's check state is changing, avoid propagation.
@@TVirtualNodeState.vsClearing
A node's children are being deleted. Don't register structure change event.
@@TVirtualNodeState.vsCutOrCopy
Node is selected as cut or copy and paste source.
@@TVirtualNodeState.vsDeleting
Set when the node is about to be freed.
@@TVirtualNodeState.vsDisabled
Set if node is disabled.
@@TVirtualNodeState.vsExpanded
Set if the node is expanded.
@@TVirtualNodeState.vsHasChildren
Indicates the presence of child nodes without actually setting them.
@@TVirtualNodeState.vsHeightMeasured
Node height has been determined and does not need a recalculation.
@@TVirtualNodeState.vsInitialized
Set after the node has been initialized.
@@TVirtualNodeState.vsInitialUserData
Set if (via AddChild or InsertNode) initial user data has been set which requires OnFreeNode.
@@TVirtualNodeState.vsMultiline
Node text is wrapped at the cell boundaries instead of being shorted.
@@TVirtualNodeState.vsSelected
Set if the node is in the current selection.
@@TVirtualNodeState.vsVisible
Indicate whether the node is visible or not (independant of the expand states of its parents).
@@TVirtualTreeColumn.ComputeHeaderLayout@HDC@TRect@Boolean@Boolean@TPoint@TPoint@TRect
Description
The layout of a column header is determined by a lot of factors. This method takes them all into account and determines
all necessary positions and bounds:
* for the header text
* the header glyph
* the sort glyph
Summary
Calculates the layout of a column header.
@@TVirtualTreeColumn.GetRect
Summary
\Returns the rectangle this column occupies in the header (relative to (0, 0) of the non-client area).
Description
\Returns the rectangle this column occupies in the header (relative to (0, 0) of the non-client area).
@@TVirtualTreeColumns.AdjustAutoSize@TColumnIndex@Boolean
Description
Called only if the header is in auto-size mode which means a column needs to be so large that it fills all the horizontal
space not occupied by the other columns. CurrentIndex (if not InvalidColumn) describes which column has just been
resized.
Summary
Called when columns must be sized so that the fit the client area.
@@TVirtualTreeColumns.AdjustDownColumn@TPoint
Description
If this column is allowed to be clicked then it is also kept for later use.
Summary
Determines the column from the given position and returns it.
@@TVirtualTreeColumns.AdjustHoverColumn@TPoint
Summary
Determines the new hover column index and returns true if the index actually changed else False.
Description
Determines the new hover column index and returns true if the index actually changed else False.
@@TVirtualTreeColumns.AdjustPosition@TVirtualTreeColumn@Cardinal
Summary
Reorders the column position array so that the given column gets the given position.
Description
Reorders the column position array so that the given column gets the given position.
@@TVirtualTreeColumns.AnimatedResize@TColumnIndex@Integer
Summary
Resizes the given column animated by scrolling the window DC.
Description
Resizes the given column animated by scrolling the window DC.
@@TVirtualTreeColumns.ColumnFromPosition@TColumnPosition
Summary
\Returns the index of the column at the given position.
Description
\Returns the index of the column at the given position.
@@TVirtualTreeColumns.ColumnFromPosition@TPoint@Boolean
Summary
Determines the current column based on the position passed in P.
Description
Determines the current column based on the position passed in P.
@@TVirtualTreeColumns.DrawXPButton@HDC@TRect@Boolean@Boolean@Boolean
Summary
Helper procedure to draw an Windows XP like header button.
Description
Helper procedure to draw an Windows XP like header button.
@@TVirtualTreeColumns.Equals@TVirtualTreeColumns
Summary
Compares itself with the given set of columns.
Description
Equals returns true if all published properties are the same (including column order), otherwise false is returned.
@@TVirtualTreeColumns.FClearing
True if columns are being deleted entirely.
@@TVirtualTreeColumns.FClickIndex
last clicked column
@@TVirtualTreeColumns.FDragIndex
index of column currently being dragged
@@TVirtualTreeColumns.FDropBefore
True if drop position is in the left half of a column, False for the right
side to drop the dragged column to
@@TVirtualTreeColumns.FDropTarget
current target column (index) while dragging
@@TVirtualTreeColumns.FHeaderBitmap
backbuffer for drawing
@@TVirtualTreeColumns.FixPositions
Summary
Fixes column positions after loading from DFM.
Description
Fixes column positions after loading from DFM.
@@TVirtualTreeColumns.FNeedPositionsFix
True if FixPositions must still be called after DFM loading.
@@TVirtualTreeColumns.GetColumnAndBounds@TPoint@Integer@Integer@Boolean
Summary
\Returns the column where the mouse is currently in as well as the left and right bound of this column.
Description
<B>Left</B> and <B>Right</B> are undetermined if no column is involved.
@@TVirtualTreeColumns.GetColumnBounds@TColumnIndex@Integer@Integer
Summary
\Returns the left and right bound of the given column.
Description
If <B>Column</B> is NoColumn then the entire client width is returned.
@@TVirtualTreeColumns.GetFirstVisibleColumn
Summary
\Returns the index of the first visible column or "InvalidColumn" if either no columns are defined or all columns are
hidden.
Description
\Returns the index of the first visible column or "InvalidColumn" if either no columns are defined or all columns are
hidden.
@@TVirtualTreeColumns.GetLastVisibleColumn
Summary
\Returns the index of the last visible column or "InvalidColumn" if either no columns are defined or all columns are
hidden.
Description
\Returns the index of the last visible column or "InvalidColumn" if either no columns are defined or all columns are
hidden.
@@TVirtualTreeColumns.GetNextColumn@TColumnIndex
Summary
\Returns the next column in display order. Column is the index of an item in the collection (a column).
Description
\Returns the next column in display order. Column is the index of an item in the collection (a column).
@@TVirtualTreeColumns.GetNextVisibleColumn@TColumnIndex
Summary
\Returns the next visible column in display order, Column is an index into the columns list.
Description
\Returns the next visible column in display order, Column is an index into the columns list.
@@TVirtualTreeColumns.GetPreviousColumn@TColumnIndex
Summary
\Returns the previous column in display order, Column is an index into the columns list.
Description
\Returns the previous column in display order, Column is an index into the columns list.
@@TVirtualTreeColumns.GetPreviousVisibleColumn@TColumnIndex
Summary
\Returns the previous column in display order, Column is an index into the columns list.
Description
\Returns the previous column in display order, Column is an index into the columns list.
@@TVirtualTreeColumns.GetVisibleColumns
Summary
\Returns a list of all currently visible columns in actual order.
Description
\Returns a list of all currently visible columns in actual order.
@@TVirtualTreeColumns.HandleClick@TPoint@TMouseButton@Boolean@Boolean
Summary
Generates a click event if the mouse button has been released over the same column it was pressed first.
Description
Alternatively, <B>Force</B> might be set to true to indicate that the down index does not matter (right, middle and
double click).
@@TVirtualTreeColumns.IndexChanged@Integer@Integer
Summary
Called by a column when its index in the collection changes.
Description
If <B>NewIndex</B> is -1 then the column is about to be removed otherwise it is moved to a new index. The method will
then update the position array to reflect the change.
@@TVirtualTreeColumns.InitializePositionArray
Summary
Ensures that the column position array contains as much entries as columns are defined.
Description
The array is resized and initialized with default values if needed.
@@TVirtualTreeColumns.IsValidColumn@TColumnIndex
Summary
Determines whether the given column is valid or not, that is, whether it is one of the current columns.
Description
Determines whether the given column is valid or not, that is, whether it is one of the current columns.
@@TVirtualTreeColumns.UpdatePositions@Boolean
Summary
Recalculates the left border of every column and updates their position property according to the PostionToIndex array,
which primarily determines where each column is placed visually.
@@TVirtualTreeHintWindow
Summary
Internally used hint window class to support Unicode hints.
Description
TVirtualTreeHintWindow replaces Delphi's own hint window, but only for the tree controls. For the rest of the application
the hint stays at it is. This means not the global HintWindowClass variable is changed but only the locally used class by
properly responding to CM_HINTSHOW.
@@TVirtualTreeHintWindow.InternalPaint@Integer@Integer
local functions
@@TVirtualTreeHintWindow.IsHintMsg@TMsg
The VCL is a bit too generous when telling that an existing hint can be cancelled. Need to specify further here.
@@TVirtualTreeHintWindow.WMEraseBkgnd@TWMEraseBkgnd
The control is fully painted by own code so don't erase its background as this causes flickering.
@@TVirtualTreeHintWindow.WMNCPaint@TMessage
The control is fully painted by own code so don't paint any borders.
@@TVirtualTreeHintWindow.WMShowWindow@TWMShowWindow
Clear hint data when the window becomes hidden.
@@TVirtualTreeOptions
Summary
Collects all binary options of the tree control into one place for easier access.
Description
TVirtualTreeOptions does not add any new functionality to TCustomVirtualTreeOptions but is the publicly available class.
@@TVSTTextSourceType.tstAll
All nodes are rendered. Initialization is done on the fly.
@@TVSTTextSourceType.tstCutCopySet
Only nodes currently marked as being in the cut/copy clipboard set are rendered.
@@TVSTTextSourceType.tstInitialized
Only initialized nodes are rendered.
@@TVSTTextSourceType.tstSelected
Only selected nodes are rendered.
@@TVSTTextSourceType.tstVisible
Only visible nodes are rendered.
@@TVSTTextType.ttNormal
normal label of the node, this is also the text which can be edited
@@TVSTTextType.ttStatic
static (non-editable) text after the normal text
@@TVTAnimationOption.toAnimatedToggle
Expanding and collapsing a node is animated (quick window scroll).
@@TVTAutoOption.toAutoChangeScale
Change default node height automatically if the system's font scale is set to big fonts.
@@TVTAutoOption.toAutoDeleteMovedNodes
Delete nodes which where moved in a drag operation (if not directed otherwise).
@@TVTAutoOption.toAutoDropExpand
Expand node if it is the drop target for more than certain time.
@@TVTAutoOption.toAutoExpand
Nodes are expanded (collapsed) when getting (losing) the focus.
@@TVTAutoOption.toAutoFreeOnCollapse
Frees any child node after a node has been collapsed (HasChildren flag stays there).
@@TVTAutoOption.toAutoHideButtons
Node buttons are hidden when there are child nodes, but all are invisible.
@@TVTAutoOption.toAutoScroll
Scroll if mouse is near the border while dragging or selecting.
@@TVTAutoOption.toAutoScrollOnExpand
Scroll as many child nodes in view as possible after expanding a node.
@@TVTAutoOption.toAutoSort
Sort tree when Header.SortColumn or Header.SortDirection change or sort node if
child nodes are added.
@@TVTAutoOption.toAutoSpanColumns
Large entries continue into next column(s) if there's no text in them (no clipping).
@@TVTAutoOption.toAutoTristateTracking
Checkstates are automatically propagated for tri state check boxes.
@@TVTAutoOption.toDisableAutoscrollOnFocus
Disable scrolling a column entirely into view if it gets focused.
@@TVTButtonFillMode.fmShaded
color gradient, Windows XP style (legacy code, use toThemeAware on Windows XP instead)
@@TVTButtonFillMode.fmTransparent
transparent color, use the item's background color
@@TVTButtonFillMode.fmTreeColor
solid color, uses the tree's background color
@@TVTButtonFillMode.fmWindowColor
solid color, uses clWindow
@@TVTButtonStyle.bsRectangle
traditional Windows look (plus/minus buttons)
@@TVTButtonStyle.bsTriangle
traditional Macintosh look
@@TVTColors
Summary
Collects all color related options for the tree control.
Description
TVTColors makes it much more conventient to adjust Virtual Treeview's colors. Since everything is in one place you can
also easily compare all colors.
@@TVTDataObject.FAdviseHolder
Reference to an OLE supplied implementation for advising.
@@TVTDataObject.FForClipboard
Determines which data to render with GetData.
@@TVTDataObject.FInternalStgMediumArray
The available formats in the DataObject
@@TVTDataObject.FOwner
The tree which provides clipboard or drag data.
@@TVTDragImage.FColorKey
color to make fully transparent regardless of any other setting
@@TVTDragImage.FFade
determines whether to fade the drag image from center to borders or not
@@TVTDragImage.FOwner
the actual drag image to blend to screen
@@TVTDragImage.FRestriction
determines in which directions the drag image can be moved
@@TVTDragImage.FStates
Determines the states of the drag image class.
@@TVTDragImage.FTransparency
alpha value of the drag image (0 - fully transparent, 255 - fully opaque)
@@TVTDragImage.GetVisible
True if the drag image is currently hidden (used only when dragging)
Returns True if the internal drag image is used (i.e. the system does not natively support drag images) and
the internal image is currently visible on screen.
@@TVTDragImage.RecaptureBackground@TBaseVirtualTree@TRect@HRGN@Boolean@Boolean
Note
The passed rectangle is given in client coordinates of the current drop target tree (given in Tree). The caller does not
check if the given rectangle is actually within the drag image. Hence this method must do all the checks. This method
does nothing if the system manages the drag image.
Summary
Notification by the drop target tree to update the background image because something in the tree has changed.
@@TVTDragImage.ShowDragImage
Summary
Shows the drag image after it has been hidden by HideDragImage.
Description
Also this method does nothing if the system manages the drag image.
@@TVTDragImageKind.diComplete
show a complete drag image with all columns, only visible columns are shown
@@TVTDragImageKind.diMainColumnOnly
show only the main column (the tree column)
@@TVTDragImageKind.diNoImage
don't show a drag image at all
@@TVTDragManager.FDataObject
A reference to the data object passed in by DragEnter (only used when the owner
tree is the current drop target).
@@TVTDragManager.FDropTargetHelper
Win2k > Drag image support
@@TVTDragManager.FFullDragging
True, if full dragging is currently enabled in the system.
@@TVTDragManager.FIsDropTarget
True if the owner is currently the drop target.
@@TVTDrawSelectionMode.smBlendedRectangle
alpha blending, uses special colors (see TVTColors)
@@TVTDrawSelectionMode.smDottedRectangle
same as DrawFocusRect
@@TVTHeader.DetermineSplitterIndex@TPoint
Note
The hit test is checking from right to left to make enlarging of zero-sized columns possible.
Description
\Result is rrue if column border was hit (with -3..+5 pixels tolerance). For continuous resizing the current track index
and the column's left border are set.
Summary
Tries to find the index of that column whose right border corresponds to <B>P</B>.
@@TVTHeader.FDragImage
drag image management during header drag
@@TVTHeader.FDragStart
initial mouse drag position
@@TVTHeader.FImageChangeLink
connections to the image list to get notified about changes
@@TVTHeader.FLeftTrackPos
left border of this column to quickly calculate its width on resize
@@TVTHeader.FMainColumn
the column which holds the tree
@@TVTHeader.FStates
used to keep track of internal states the header can enter
@@TVTHeader.FStyle
button style
@@TVTHeader.FTrackStart
client coordinates of the tracking start point
@@TVTHeaderOption.hoAutoResize
adjust a column so that the header never exceeds client width of owner control
@@TVTHeaderOption.hoColumnResize
resizing columns is allowed
@@TVTHeaderOption.hoDblClickResize
allows a column to resize itself to its largest entry
@@TVTHeaderOption.hoDrag
dragging columns is allowed
@@TVTHeaderOption.hoHotTrack
header captions are highlighted when mouse is over a particular column
@@TVTHeaderOption.hoOwnerDraw
header items with the owner draw style can be drawn by the application via event
@@TVTHeaderOption.hoRestrictDrag
header can only be dragged horizontally
@@TVTHeaderOption.hoShowHint
show application defined header hint
@@TVTHeaderOption.hoShowImages
show images
@@TVTHeaderOption.hoShowSortGlyphs
allow visible sort glyphs
@@TVTHeaderOption.hoVisible
header is visible
@@TVTHeaderStyle.hsFlatButtons
flatter look than hsThickButton, like an always raised flat TToolButton
@@TVTHeaderStyle.hsPlates
flat TToolButton look and feel (raise on hover etc.)
@@TVTHeaderStyle.hsThickButtons
TButton look and feel
@@TVTHeaderStyle.hsXPStyle
Windows XP style
@@TVTHintData.DefaultHint
used only if there is no node specific hint string available
or a header hint is about to appear
@@TVTHintData.HintRect
used for draw trees only, string trees get the size from the hint string
@@TVTHintData.HintText
set when size of the hint window is calculated
@@TVTHintMode.hmDefault
show the hint of the control
@@TVTHintMode.hmHint
show node specific hint string returned by the application
@@TVTHintMode.hmHintAndDefault
same as hmHint but show the control's hint if no node is concerned
@@TVTHintMode.hmTooltip
show the text of the node if it isn't already fully shown
@@TVTImageInfo.Ghosted
flag to indicate that the image must be drawn slightly lighter
@@TVTImageInfo.Index
index in the associated image list
@@TVTIncrementalSearch.isAll
search every node in tree, initialize if necessary
@@TVTIncrementalSearch.isInitializedOnly
search only initialized nodes, skip others
@@TVTIncrementalSearch.isNone
disable incremental search
@@TVTIncrementalSearch.isVisibleOnly
search only visible nodes, initialize if necessary
@@TVTInternalPaintOption.poBackground
draw background image if there is any and it is enabled
@@TVTInternalPaintOption.poColumnColor
erase node's background with the column's color
@@TVTInternalPaintOption.poDrawDropMark
draw drop mark if a node is currently the drop target
@@TVTInternalPaintOption.poDrawFocusRect
draw focus rectangle around the focused node
@@TVTInternalPaintOption.poDrawSelection
draw selected nodes with the normal selection color
@@TVTInternalPaintOption.poGridLines
draw grid lines if enabled
@@TVTInternalPaintOption.poMainOnly
draw only the main column
@@TVTInternalPaintOption.poSelectedOnly
draw only selected nodes
@@TVTLineMode.lmBands
looks similar to a Nassi-Schneidermann diagram
@@TVTLineMode.lmNormal
usual tree lines (as in TTreeview)
@@TVTLineStyle.lsCustomStyle
application provides a line pattern
@@TVTLineStyle.lsDotted
usual dotted lines (default)
@@TVTLineStyle.lsSolid
simple solid lines
@@TVTLineType.ltBottomRight
a line from bottom to the center and from there to the right
@@TVTLineType.ltLeft
a line from top to bottom at the left
@@TVTLineType.ltLeftBottom
a combination of ltLeft and a line at the bottom from left to right
@@TVTLineType.ltNone
no line at all
@@TVTLineType.ltRight
a line from center to the right
@@TVTLineType.ltTopDown
a line from top to bottom
@@TVTLineType.ltTopDownRight
a line from top to bottom and from center to the right
@@TVTLineType.ltTopRight
a line from bottom to center and from there to the right
special styles for alternative drawings of tree lines
@@TVTMiscOption.toAcceptOLEDrop
Register tree as OLE accepting drop target
@@TVTMiscOption.toCheckSupport
Show checkboxes/radio buttons.
@@TVTMiscOption.toEditable
Node captions can be edited.
@@TVTMiscOption.toFullRepaintOnResize
Fully invalidate the tree when its window is resized (CS_HREDRAW/CS_VREDRAW).
@@TVTMiscOption.toGridExtensions
Use some special enhancements to simulate and support grid behavior.
@@TVTMiscOption.toInitOnSave
Initialize nodes when saving a tree to a stream.
@@TVTMiscOption.toReadOnly
The tree does not allow to be modified in any way. No action is executed and
node editing is not possible.
@@TVTMiscOption.toReportMode
Tree behaves like TListView in report mode.
@@TVTMiscOption.toToggleOnDblClick
Toggle node expansion state when it is double clicked.
@@TVTMiscOption.toWheelPanning
Support for mouse panning (wheel mice only). This option and toMiddleClickSelect are
mutal exclusive, where panning has precedence.
@@TVTNodeAlignment.naFromBottom
the align member specifies amount of units (usually pixels) from top border of the node
@@TVTNodeAlignment.naFromTop
align is to be measured from bottom
@@TVTNodeAlignment.naProportional
align is to be measure in percent of the entire node height and relative to top
@@TVTNodeAttachMode.amAddChildFirst
add node as first child of destination
@@TVTNodeAttachMode.amAddChildLast
add node as last child of destination
@@TVTNodeAttachMode.amInsertAfter
insert node just after destionation (as sibling of destination)
@@TVTNodeAttachMode.amInsertBefore
insert node just before destination (as sibling of destination)
@@TVTNodeAttachMode.amNoWhere
just for simplified tests, means to ignore the Add/Insert command
@@TVTPaintInfo.Alignment
how to align within the node rectangle
@@TVTPaintInfo.BidiMode
directionality to be used for painting
@@TVTPaintInfo.BrushOrigin
the alignment for the brush used to draw dotted lines
@@TVTPaintInfo.Canvas
the canvas to paint on
@@TVTPaintInfo.Column
the node's column index to paint
@@TVTPaintInfo.ImageInfo
info about each possible node image
@@TVTPaintInfo.Node
the node to paint
@@TVTPaintInfo.NodeWidth
the actual node width
@@TVTPaintInfo.PaintOptions
a copy of the paint options passed to PaintTree
@@TVTPaintInfo.Position
the column position of the node
@@TVTPaintOption.toAlwaysHideSelection
Do not draw node selection, regardless of focused state.
@@TVTPaintOption.toFullVertGridLines
Display vertical lines over the full client area, not only the space occupied by nodes.
This option only has an effect if toShowVertGridLines is enabled too.
@@TVTPaintOption.toGhostedIfUnfocused
Ghosted images are still shown as ghosted if unfocused (otherwise the become non-ghosted
images).
@@TVTPaintOption.toHideFocusRect
Avoid drawing the dotted rectangle around the currently focused node.
@@TVTPaintOption.toHideSelection
Selected nodes are drawn as unselected nodes if the tree is unfocused.
@@TVTPaintOption.toHotTrack
Track which node is under the mouse cursor.
@@TVTPaintOption.toPopupMode
Paint tree as would it always have the focus (useful for tree combo boxes etc.)
@@TVTPaintOption.toShowBackground
Use the background image if there's one.
@@TVTPaintOption.toShowButtons
Display collapse/expand buttons left to a node.
@@TVTPaintOption.toShowDropmark
Show the dropmark during drag'n drop operations.
@@TVTPaintOption.toShowHorzGridLines
Display horizontal lines to simulate a grid.
@@TVTPaintOption.toShowRoot
Show lines also at top level (does not show the hidden/internal root node).
@@TVTPaintOption.toShowTreeLines
Display tree lines to show hierarchy of nodes.
@@TVTPaintOption.toShowVertGridLines
Display vertical lines (depending on columns) to simulate a grid.
@@TVTPaintOption.toThemeAware
Draw UI elements (header, tree buttons etc.) according to the current theme if
enabled (Windows XP+ only, application must be themed).
@@TVTPaintOption.toUseBlendedImages
Enable alpha blending for ghosted nodes or those which are being cut/copied.
@@TVTPaintOption.toUseBlendedSelection
Enable alpha blending for node selections.
@@TVTSearchStart.ssAlwaysStartOver
always use the first/last node (depending on direction) to search from
@@TVTSearchStart.ssFocusedNode
use the currently focused node
@@TVTSearchStart.ssLastHit
use the last found node
@@TVTSelectionOption.toCenterScrollIntoView
Center nodes vertically in the client area when scrolling into view.
@@TVTSelectionOption.toDisableDrawSelection
Prevent user from selecting with the selection rectangle in multiselect mode.
@@TVTSelectionOption.toExtendedFocus
Entries other than in the main column can be selected, edited etc.
@@TVTSelectionOption.toFullRowSelect
Hit test as well as selection highlight are not constrained to the text of a node.
@@TVTSelectionOption.toLevelSelectConstraint
Constrain selection to the same level as the selection anchor.
@@TVTSelectionOption.toMiddleClickSelect
Allow selection, dragging etc. with the middle mouse button. This and toWheelPanning
are mutual exclusive.
@@TVTSelectionOption.toMultiSelect
Allow more than one node to be selected.
@@TVTSelectionOption.toRightClickSelect
Allow selection, dragging etc. with the right mouse button.
@@TVTSelectionOption.toSiblingSelectConstraint
constrain selection to nodes with same parent
@@TVTSelectionOption.toSimpleDrawSelection
Simplifies draw selection, so a node's caption does not need to intersect with the
selection rectangle.
@@TVTStringOption.toAutoAcceptEditChange
Automatically accept changes during edit if the user finishes editing other then
VK_RETURN or ESC. If not set then changes are cancelled.
@@TVTStringOption.toSaveCaptions
If set then the caption is automatically saved with the tree node, regardless of what is
saved in the user data.
@@TVTStringOption.toShowStaticText
Show static text in a caption which can be differently formatted than the caption
but cannot be edited.
@@TVTUpdateState.usBegin
The tree just entered the update state (BeginUpdate call for the first time).
@@TVTUpdateState.usBeginSynch
The tree just entered the synch update state (BeginSynch call for the first time).
@@TVTUpdateState.usEnd
The tree just left the update state (EndUpdate called for the last level).
@@TVTUpdateState.usEndSynch
The tree just left the synch update state (EndSynch called for the last level).
@@TVTUpdateState.usSynch
Begin/EndSynch has been called but the tree did not change the update state.
@@TVTUpdateState.usUpdate
Begin/EndUpdate has been called but the tree did not change the update state.
@@VirtualTrees.pas
Version 4.0.0
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
Alternatively, you may redistribute this library, use and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation;
either version 2.1 of the License, or (at your option) any later version.
You may obtain a copy of the LGPL at http://www.gnu.org/copyleft/.
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
specific language governing rights and limitations under the License.
The original code is VirtualTrees.pas, released September 30, 2000.
The initial developer of the original code is digital publishing AG (Munich, Germany, www.digitalpublishing.de),
written by Dipl. Ing. Mike Lischke (public@lischke-online.de, www.lischke-online.de).
Portions created by digital publishing AG are Copyright
(C) 1999-2001 digital publishing AG. All Rights Reserved.
----------------------------------------------------------------------------------------------------------------------
September 2003
- Improvement: Edit property of TStringEditLink promoted to public.
- Improvement: ShortenString better takes right-to-left contexts into account.
- Improvement: toAlwaysHideSelection introduced. Allows to hide node selections entirely.
- Improvement: toUseBlendedSelection introduced. Allows to have translucent node selections.
- Bug fix: Mantis bug entries #140, 144, 125, 122, 129.
- Improvement: Mantis feature request #113, toSimpleDrawSelection introduced.
- Improvement: ComputeNodeHeight introduced. Helper method to delegate node height calculation to the tree.
- Improvement: Alt key might be pressed when clicking in the tree. This allows to start drawing the selection
rectangle also on node captions and images (which would otherwise start dragging).
August 2003
- Bug fix: ValidateCache was not always called in ToggleNode when InvalidateCache was used.
- Bug fix: FLastHintRect was sometimes not reset preventing so a new hint to appear.
- Bug fix: Redundant ChangeCheckState in HandleMouseDown removed.
- Bug fix: OnHeaderDblClick was triggered even if the colum was set to be unclickable.
- Bug fix: Wheel panning and scrolling was not possible if toAutoScroll was not set. This option has another meaning
and should not impact wheel handling.
- Bug fix: VT control could not be set as ActiveControl at design time.
- Bug fix: In method ContentToText it could be that the text contained the separator char as regular character, so
it was necessary to wrap the text with quotation marks then.
- Bug fix: Bidi mode and aligment was not correctly considered in UpdateEditBounds when grid extensions were enabled.
July 2003
- Improvement: Check for nil hint data in TVirtualTreeHintWindow.CalcHintRect just to be on the safe side.
- Improvedment: TVirtualTreeColumn.ComputeHeaderLayout is now virtual to allow descentants to change the layout.
- Improvement: toFullVertGridLines, vertical grid lines can be drawn over the full client are height.
- Improvement: flickering on column resizing is gone.
- Improvement: System conformal border width calculation for certain tasks.
- Improvement: Animation parameter for TVTHeader.AutoFitColumns to avoid the size animation (default: True).
- Improvement: ParentFont property for the header. Default is False to stay compatible with older tree versions.
- Bug fix: cursor rectangle for spanned columns in normal hint mode was too small.
- Feature: the implementation is now more than 30.000 lines in size.
- Bug fix: Access violation fixed, which was sometimes caused by setting VT to edit mode if the old edit link
was not freed yet (because it was still handling a message).
- Improvement: Hint animation now does no longer stop quick switches to new hints.
- Improvement: ParentBackground property published.
- Bug fix: vsAllChildrenHidden and vsExpanded are now removed from a node's state if there are no child nodes anymore
- Improvement: column width limit to 10000 is now only applied on non-NT systems (Win9x/Me).
- Improvement: single letter mode in incremental search is not used if the current node also fits
the repeated character.
June 2003
- Bug fix: correct theme change handling when switching to classic mode.
- Improvement: new event OnMeasureItem, new handling for application driven node heights.
TCustomVirtualStringTree.ComputeNodeHeight implementation to easy node height computation for multi line nodes.
- Improvement: Header is nil'ed when the tree is destroyed and checked before used in TBaseVirtualTree.Notification
in order to avoid potential problems accessing an invalid address.
- Bug fix: The cut and copy pending states in the tree and participating nodes were not removed.
- Bug fix: csPaintCopy was not considered when painting (used for TWinControl.PaintTo, e.g. in Form.Print).
- Bug fix: DT_NOPREFIX added for header text output.
May 2003
- Bug fix: Thread safe check for current tree reference in the worker thread, as it can be reset before it was used.
- Bug fix: Color change for non-standard background colors after all columns were hidden.
- Improvement: new node background erase action (eaNone).
For full document history see help file.
Credits for their valuable assistance and code donations go to:
Freddy Ertl, Marian Aldenh<6E>vel, Thomas Bogenrieder, Jim Kuenemann, Werner Lehmann, Jens Treichler,
Paul Gallagher (IBO tree), Ondrej Kelle, Ronaldo Melo Ferraz, Heri Bender, Roland Bed<65>rftig (BCB)
Anthony Mills, Alexander Egorushkin (BCB), Mathias Torell (BCB), Frank van den Bergh, Vadim Sedulin, Peter Evans,
Milan Vandrovec (BCB), Steve Moss (system check images), Joe White, David Clark (local node memory manager),
Anders Thomsen, Igor Afanasyev, Eugene Programmer
Beta testers:
Freddy Ertl, Hans-J<>rgen Schnorrenberg, Werner Lehmann, Jim Kueneman, Vadim Sedulin, Moritz Franckenstein,
Wim van der Vegt, Franc v/d Westelaken
Indirect contribution (via publicly accessible work of those persons):
Alex Denissov, Hiroyuki Hori (MMXAsm expert)
Documentation:
Markus Spoettl and toolsfactory GbR (http://www.doc-o-matic.com/, sponsoring Virtual Treeview
with a free copy of the Doc-O-Matic help authoring system), Sven H. (Step by step tutorial)
CLX:
Dmitri Dmitrienko (initial developer)
@@Check button image indices
@@ckButtonHot
<COMBINE Check button image indices>
@@ckButtonNormal
<COMBINE Check button image indices>
@@ckButtonPressed
<COMBINE Check button image indices>
@@ckCheckCheckedDisabled
<COMBINE Check button image indices>
@@ckCheckCheckedHot
<COMBINE Check button image indices>
@@ckCheckCheckedNormal
<COMBINE Check button image indices>
@@ckCheckCheckedPressed
<COMBINE Check button image indices>
@@ckCheckMixedHot
<COMBINE Check button image indices>
@@ckCheckMixedNormal
<COMBINE Check button image indices>
@@ckCheckMixedPressed
<COMBINE Check button image indices>
@@ckCheckUncheckedDisabled
<COMBINE Check button image indices>
@@ckCheckUncheckedHot
<COMBINE Check button image indices>
@@ckCheckUncheckedNormal
<COMBINE Check button image indices>
@@ckCheckUncheckedPressed
<COMBINE Check button image indices>
@@ckRadioCheckedHot
<COMBINE Check button image indices>
@@ckRadioCheckedNormal
<COMBINE Check button image indices>
@@ckRadioCheckedPressed
<COMBINE Check button image indices>
@@ckRadioUncheckedDisabled
<COMBINE Check button image indices>
@@ckRadioUncheckedHot
<COMBINE Check button image indices>
@@ckRadioUncheckedNormal
<COMBINE Check button image indices>
@@ckRadioUncheckedPressed
<COMBINE Check button image indices>
@@EVirtualTreeError
Description
EVirtualTreeError is a normal exception derivation especially for Virtual Treeview. This class does not add much value to
its parent class but is rather there to better tell when an exception particularly from Virtual Treeview was raised.
@@TBufferedString
@@TBaseVirtualTree.Alignment
Summary
Determines the horizontal alignment of text if no columns are defined.
Description
This property is only used if there are no columns defined and applies only to the node captions. Right alignment means
here the right client area border and left aligned means the node buttons/lines etc. (both less the text margin).
@@TBaseVirtualTree.AnimationDuration
Summary
Determines the maximum duration the tree can use to play an animation.
Description
The value is specified in milliseconds and per default there are 200 ms as time frame, which is the recommended duration
for such operations. On older systems (particularly Windows 95 and Windows 98) the animation process might not get enough
CPU time to avoid expensive animations to finish properly. Still the animation loop tries to stay as close as possible to
the given time.
@@TBaseVirtualTree.AutoExpandDelay
Summary
Time delay after which a node gets expanded if it is the current drop target.
Description
This value is specified in milliseconds and determines when to expand a node if it is the current drop target. This value
is only used if voAutoDropExpand in Options is set.
@@TBaseVirtualTree.AutoScrollDelay
Summary
Time which determines when auto scrolling should start.
Description
Once the mouse pointer has been moved near to a border a timer is started using the interval specified by
AutoScrollDelay. When the timer has fired auto scrolling starts provided it is enabled (see also TreeOptions). The value
is specified in milliseconds.
@@TBaseVirtualTree.AutoScrollInterval
Summary
Time interval between scroll events when doing auto scroll.
Description
This property determines the speed how the tree is scrolled vertically or horizontally when auto scrolling is in
progress. The value is given in milliseconds.
@@TBaseVirtualTree.Background
Summary
Holds a background image for the tree.
Description
Virtual Treeview supports a fixed background image which does not scroll but can be adjusted by BackgroundOffsetX and
BackgroundOffsetY.
@@TBaseVirtualTree.BackgroundOffsetX
Summary
Horizontal offset of the background image.
Description
Determines the horizontal offset of the left border of the background image. This value is relative to the target canvas
where the tree is painted to (usually the tree window).
@@TBaseVirtualTree.BackgroundOffsetY
Summary
Vertical offset of the background image.
Description
Determines the vertical offset of the top border of the background image. This value is relative to the target canvas
where the tree is painted to (usually the tree window).
@@TBaseVirtualTree.BorderStyle
Summary
Same as TForm.BorderStyle.
Description
See TForm.BorderStyle.
@@TBaseVirtualTree.ButtonFillMode
Summary
Determines how to fill the background of the node buttons.
Description
This property is used to specify how the interior of the little plus and minus node buttons should be drawn, if
ButtonStyle is bsTriangle.
@@TBaseVirtualTree.ButtonStyle
Summary
Determines the look of node buttons.
Description
Determines the look of node buttons.
@@TBaseVirtualTree.ChangeDelay
Summary
Time which determines when the OnChange event should be triggered after the actual change event.
Description
In order to accumulate many quick changes in the tree you can use this delay value to specify after which wait time the
OnChange event should occur. A value of 0 means to trigger OnChange immediately after the change (usually a selection or
focus change) happend. Any value \> 0 will start a timer which then triggers OnChange.
\Note that there is the synchronous mode (started by BeginSynch) which effectively circumvents the change delay for the
duration of the synchronous mode (stopped by EndSynch) regardless of the ChangeDelay setting.
@@TBaseVirtualTree.CheckImageKind
Summary
Determines which images should be used for checkboxes and radio buttons.
Description
CheckImageKind can be used to switch the image set, which should be used for the tree. Read the description about
TCheckImageKind for a list of all images, which can be used. CheckImageKind can also be set to ckCustom, which allows to
supply a customized set of images to the tree. In order to have that working you must assign an image list
(TCustomImageList) to the CustomCheckImages property.
@@TCheckState
Summary
\Returns the current state of a node's check box, radio button or node button.
Description
The check states include both, transient and fluent (temporary) states. The only temporary state defined so far is the
pressed state.
@@TBaseVirtualTree.CheckState
Summary
Read or set the check state of a node.
Description
The CheckState property can be used to read the current check state of a node or to set a new one. Virtual Treeview
ensures that invalid check states (e.g. csMixedPressed for radio buttons) do not cause an error.
@@TBaseVirtualTree.CheckType
Summary
Read or set the check type of a node.
Description
The CheckType property can be used to read the current check type of a node or to set a new one. Setting a new check type
will reset a the node's check state to csUncheckedNormal.
@@TBaseVirtualTree.ChildCount
Summary
Read or set the number of child nodes of a node.
Description
ChildCount can be used to read the current number of child nodes or to change it. Assigning a lower value than there was
before will automatically delete as many child nodes (starting from the last child) as there are more than what was set.
Increasing the value will add new child nodes. Note: code behind this property is very effective, so it using ChildCount
is highly recommended over manipulating the child count using AddChild, InsertNode and DeleteNode.
@@TBaseVirtualTree.ChildrenInitialized
Summary
Read whether a node's child count has been initialized already.
Description
This read only property is used to determine whether a node's child count has been set. Alternatively, the child count
value is not considered if vsHasChildren is not in the node states.
@@TBaseVirtualTree.ClipboardFormats
Summary
Special class to keep a list of clipboard format descriptions.
Description
This TStringList descendant is used to keep a number of clipboard format descriptions, which are usually used to register
clipboard formats with the system. Using a string list for this task allows to store enabled clipboard formats in the
DFM.
@@TBaseVirtualTree.Colors
Summary
A collection of colors used in the tree.
Description
This property holds an instance of the TVTColors class, which is used to customize many of the colors used in a tree.
Placing them all in a specialized class helps organizing the colors in the object inspector and improves general
management.
@@TBaseVirtualTree.CustomCheckImages
Summary
Assign your own image list to get the check images you like most.
Description
The CustomCheckImages property is used when custom check images are enabled (see also ckCustom in TCheckImageKind).
See Also
TCheckImageKind
@@TBaseVirtualTree.DefaultNodeHeight
Summary
Read or set the height new nodes get as initial value.
Description
This property allows to read the current initial height for new nodes and to set a new value. Note that changing the
property value does <B>not</B> change the height of existing nodes. Only new nodes are affected.
@@TBaseVirtualTree.DefaultPasteMode
Summary
Read or set the value, which determines where to add pasted nodes to.
Description
The default paste mode is an attach mode, which is used when pasting data from the clipboard into the tree. Usually, you
will want new nodes to be added as child nodes to the currently focused node (and this is also the default value), but
you can also specify to add nodes only as siblings.
See Also
TVTNodeAttachMode
@@TBaseVirtualTree.HintAnimation
Summary
Read or set the current hint animation type.
Description
With this property you can specify what animation you would like to play when displaying a hint. For some applications it
might not be good to animate hints, hence you can entirely switch them off. Usually however you will leave the system
standard. This way the user can decide whether and which hint animation he or she likes.
@@TBaseVirtualTree.DragHeight
Summary
Read or set the vertical limit of the internal drag image.
Description
The DragHeight property (as well as the DragWidth property) are only for compatibility reason in the tree. If a platform
does not support the IDropTargetHelper interface (Windows 9x/Me, Windows NT 4.0) then Virtual Treeview uses its own
implementation of a DragImage. Since displaying a translucent drag image is performance hungry you should limit the image
size shown for the drag operation.
@@TBaseVirtualTree.DragWidth
Summary
Read or set the horizontal limit of the internal drag image.
Description
The DragWidth property (as well as the DragHeight property) are only for compatibility reason in the tree. If a platform
does not support the IDropTargetHelper interface (Windows 9x/Me, Windows NT 4.0) then Virtual Treeview uses its own
implementation of a DragImage. Since displaying a translucent drag image is performance hungry you should limit the image
size shown for the drag operation.
@@TBaseVirtualTree.DragImage
Summary
Holds the instance of the internal drag image.
Description
For older systems where the IDropTargetHelper interface is not supported Virtual Treeview simulates the translucent drag
image during drag'n drop. The property DragImage makes the internal drag image instance accessible for special handling.
The class itself is always created but is usually not visible when the IDropTargetHelper interface is supported.
@@TBaseVirtualTree.DragImageKind
Summary
Read or set what should be shown in the drag image.
Description
DragImageKind allows to switch parts of the drag image off and on.
@@TBaseVirtualTree.DragManager
Summary
Holds the reference to the internal drag manager.
Description
The drag manager is the central point for the drag'n drop support in Virtual Treeview. Usually you do not need to access
it but sometimes it might be necessary so the reference is accessible through this property.
See Also
TVTDragManager
@@TBaseVirtualTree.DragOperations
Summary
Read or set which drag operations may be allowed in the tree.
Description
Using this property you can determine, which actions may be performed when a drag operation is finished. The default
value includes move, copy and link, where link is rather an esoteric value and only there because it is supported by OLE.
The values used directly determine which image is shown for the drag cursor. The specified drag operations do not tell
which actions will actually be performed but only, which actions are allowed. They still can be modified during drag'n
drop by using a modifier key like the control, shift or alt key or can entirely be ignored by the drop handler.
@@TBaseVirtualTree.DragSelection
Summary
Keeps a temporary list of nodes during drag'n drop.
Description
This list is a local copy of the current selection array and is only used during a drag operation.
@@TBaseVirtualTree.DragType
Summary
Read or set which subsystem should be used for dragging.
Description
Traditionally, Delphi only supports its own drag mechanism, which is not compatible with the rest of the system. This VCL
dragging also does not support to transport random data nor does it support drag operations between applications. Thus
Virtual Treeview also supports the generally used OLE dragging, which in turn is incompatible with VCL dragging.
Depending on your needs you can enable either VCL or OLE dragging as both together cannot be started. However, Virtual
Treeview is able to act as drop target for both kind of data, independant of what is set in DragType.
@@TBaseVirtualTree.DrawSelectionMode
Summary
Read or set how multiselection with the mouse is to be visualized.
Description
Virtuall Treeview allows to display two different selection rectangles when doing multiselection with the mouse. One is
the traditiional dotted focus rectangle and the other one is a translucent color rectangle. The latter is the preferred
\one but the former is set as default (for compatibility reasons).
@@TBaseVirtualTree.DropTargetNode
Summary
Contains the current drop target node if the tree is currently the target of a drag'n drop operation.
Description
The drop target node has no meaning except during drag'n drop and only if the tree it belongs to is itself the current
drop target. But even then DropTargetNode might be nil, particularly when the mouse hovers over an area in the tree,
which is not covered by a node.
@@TBaseVirtualTree.EditDelay
Summary
Read or set the maximum time between two single clicks on the same node, which should start node editing.
Description
A node edit operation can be started using the keyboard (F2 key), in code using EditNode or by clicking twice on the same
node (but not doing a double click). EditDelay is the maxmimum time distance between both clicks in which the edit
\operation is started.
See Also
<LINK Editing.htm, Editors and editing>
@@TBaseVirtualTree.EditLink
Summary
Keeps a reference to the internal edit link during a node edit operation.
Description
During an edit operation a link is established between the tree and the editor for the current node. By default a simple
TEdit control is used as editor but due to the great customization possibilities there can be any node editor you may
want. In order to communicate with this potentially unknown node editor the edit link is used. The EditLink property
holds this link during the edit operation, so you can manipulate the interface.
@@TBaseVirtualTree.Expanded
Summary
Read or set the expanded state of a particular node.
Description
Using this property you can expand or collapse the given node. This method uses the central ToggleNode method.
@@TBaseVirtualTree.FocusedColumn
Summary
Read or set the currently focused collumn.
Description
When toExtendedFocus in TVTSelectionOptions is enabled then the user can select node cells in others than the main column
(the column with the tree structure). In order to keep track, which column is currently selected FocusedColumn is used
(similar to FocusedNode).
See Also
FocusedNode, TVTSelectionOptions
@@TBaseVirtualTree.FocusedNode
Summary
Read or set the currently focused node.
Description
One node (and only one) in the tree view can have the current input focus, marked as dotted rectangle around the node's
caption. Having the input focus means this node can be edited by pressing F2 or clicking on it and user keyboard input is
interpreted with respect to the focused node (e.g. tree navigation, expansion/collapsing etc.). If extended focus is
enabled then also the FocusedColumn property is taken into account. Read there for more info about column focus.
See Also
FocusedColumn, TVTSelectionOptions
@@TBaseVirtualTree.Font
Summary
Same as TWinControl.Font.
Description
See TWinControl.Font.
@@TBaseVirtualTree.FullyVisible
Summary
Read or set whether a node is fully visible or not.
Description
Beside the fact that a node can be out of the client area there are two possibilities for it to be hidden. One is the
vsVisible state in TVirtualNodeState, which hides the node regardles of the current state of another node, if not
specified. The other one is that one or more parent nodes might be collapsed, hiding so their entire child nodes
structure. The visibility flag itself can be checked using the IsVisible property, while the expansion state of parents
nodes can be examined via the VisiblePath property. If both are true then the node is said to be fully visible.
See Also
IsVisible, VisiblePath, vsVisible, TVirtualNodeStates
@@TBaseVirtualTree.HasChildren
Summary
Read or set whether a node has got children.
Description
A node can be set to have children by assigning true to this property. Internally this will add the vsHasChildren state
to the node but not add any child nodes. This state in turn will cause the node to be drawn with a plus sign in front of
its caption, denoting so it can be expanded and will show child nodes. As long as the child nodes are not touch in any
way (e.g. by expanding the parent node or by navigatin or searching/sorting the tree) there will be no actual child
nodes. They simply do not exist yet. However they will be created as soon as an access is done.
Setting the HasChildren property to false will delete any existing child node.
See Also
vsHasChildren, TVirtualNodeStates
@@TBaseVirtualTree.Header
Summary
Provides access to the header instance.
Description
This property is used to allow access to the header instance, which manages all aspects of the tree's header image as
well as the column settings.
See Also
TVTHeader
@@TBaseVirtualTree.HeaderRect
Summary
\Returns the non-client-area rectangle used for the header.
Description
Use this property to determine the extents used by the header of Virtual Treeview.
@@TBaseVirtualTree.HintMode
Summary
Read or set what type of hint you want for the tree view.
Description
Virtual Treeview supports several hints modes. This includes the normal hint used for any other TControl class as well as
a node specific hint, which is individual for each node or even each cell.
@@TBaseVirtualTree.HotCursor
Summary
Read or set which cursor should be used for hot nodes.
Description
When you enable toHotTrack in TreeOptions.PaintOptions then the node, which is currently under the mouse pointer becomes
the hot node. This is a special state, which can be used for certain effects. Hot nodes have by default an underlined
caption and may cause the cursor to change to what ever you like. The HotCursor property is used to specify, which cursor
is to be used.
See Also
HotNode, TVTPaintOptions
@@TBaseVirtualTree.HotNode
Summary
Read, which node is currently the hot node.
Description
When you enable toHotTrack in TreeOptions.PaintOptions then the node, which is currently under the mouse pointer becomes
the hot node. The property HotNode can be used to access this node for special handling.
See Also
HotCursor, toHotTrack, TVTPaintOptions
@@TBaseVirtualTree.Images
Summary
Read or set the tree's normal image list.
Description
Just like with TListView and TTreeview also Virtual Treeview can take an image list for its normal images. Additionally,
there are image lists for state images and check images.
See Also
StateImages, CheckImages
@@TBaseVirtualTree.IncrementalSearch
Summary
Read or set the current incremental search mode.
Description
Virtual Treeview can do an incremental search by calling back the application when comparing node captions. The
IncrementalSearch property determines whether incremental search is enabled and which nodes should be searched through.
See Also
IncrementalSearchDirection, IncrementalSearchStart, IncrementalSearchTimeout
@@TBaseVirtualTree.IncrementalSearchDirection
Summary
Read or set the direction to be used for incremental search.
Description
When incremental search is enabled then Virtual Treeview can search forward and backward from the start point given by
IncrementalSearchStart.
See Also
IncrementalSearch, IncrementalSearchStart, IncrementalSearchTime123out
@@TBaseVirtualTree.IncrementalSearchStart
Summary
Read or set where to start incremental search.
Description
When incremental search is enabled in the tree view then you can specify here, where to start the next incremental search
\operation from.
See Also
IncrementalSearch, IncrementalSearchDirection, IncrementalSearchTimeout
@@TBaseVirtualTree.IncrementalSearchTimeout
Summary
Read or set the maximum time, which is allowed between two consecutive key strokes so that incremental search stays
active.
Description
When incremental search is enabled in Virtual Treeview then you can specify here after what time incremental search
should stop when no keyboard input is encountered any longer. This property so determines also the speed at which users
have to type letters to keep the incremental search rolling.
See Also
IncrementalSearch, IncrementalSearchDirection, IncrementalSearchStart
@@TBaseVirtualTree.Indent
Summary
Read or set the indentation amount for node levels.
Description
Each new level in the tree (child nodes of a parent node) are visually shifted to distinguish betwenn them and their
parent node (that's the tree layout after all). The Indent property determines the shift distance in pixels.
@@TBaseVirtualTree.IsDisabled
Summary
Read or set the enabled state of the given node.
Description
A node can have many different states. One of them is its enabled state, which can be set via this property. Enabling a
node means it can be focused and selected, so it can take part in clipboard and drag'n drop operations, and can be
edited.
@@TBaseVirtualTree.IsVisible
Summary
Read or set the visibility state of the given node.
Description
A node can be made invisible using this property. That means, even if its parent nodes all are expanded the node is not
shown and the visual image is as would the node not exist. However it still can be searched or take part in certain other
\operations.
@@TBaseVirtualTree.LastDropMode
Summary
Read how the last drop operation finished.
Description
In the case you don't handle drag'n drop operations directly in OnDragDrop it might be necessary to know how the last
drag operation finshed. Read more in the drag mode enumeration about what is possible.
@@TBaseVirtualTree.LineMode
Summary
Read or set the mode of the tree lines.
Description
Apart from the usual lines Virtual Treeview also supports a special draw mode named bands. This allows for neat visual
effects.
@@TBaseVirtualTree.LineStyle
Summary
Read or set the mode of the tree lines.
Description
Virtual Treeview allows to customize the lines used to display the node hierarchy. The default style is a dotted pattern,
but you can also make solid lines or specify your own line pattern.
@@TBaseVirtualTree.Margin
Summary
Read or set the tree's node margin.
Description
The node margin is the distance between the cell bounds and its content like the lines, images, check box and so on.
However this border is only applied to the left and right side of the node cell.
\Note: there is also a TextMargin property in TVirtualStringTree, which is an additional border for the cell text only.
See Also
TVirtualStringTree.TextMargin
@@TBaseVirtualTree.MultiLine
Summary
Read or toggle the multiline feature for a given node.
Description
Since multiline support for nodes requires extra processing this behavior is switchable. When switched on the node is
wrapped into the available space until the node height is exhausted. By including carriage return/line feed pairs you can
explicitely specify where to start new lines. The node's height is not automatically adjusted to the given text. Instead
there is an event (OnMeasureItem), which can be used to compute a node's height before it is displayed the first time. In
addition an application can use the ComputeNodeHeight method to compute the height of the node depending on its caption
text.
@@TBaseVirtualTree.NodeAlignment
Summary
Read or set the node alignment value.
Description
Nodes have got an align member, which is used to determine the vertical position of the node's images and tree lines. The
NodeAlignment property specifies how to interpret the value in the align member.
See Also
TVirtualNode
@@TBaseVirtualTree.NodeDataSize
Summary
Read or set the extra data size for each node.
Description
A node can have an area for user data, which can be used to store application defined, node specific data in. Use
GetNodeData to get the address of this area. In addition to assigning a value here you can also use the OnGetNodeDataSize
event, which is called when NodeDataSize is -1.
See Also
<LINK DataHandling.htm, Data handling>
@@TBaseVirtualTree.NodeHeight
Summary
Read or set a node's height.
Description
Each node can have its individual height, which is stored in the node's record. You could directly assign a value to this
member but I strongly discourage this as it does not update certain other structures in the tree. Instead use the
NodeHeight property here to modify a node's height.
@@TBaseVirtualTree.NodeParent
Summary
Read or set a node's parent node.
Description
When reading this property then either the node's real parent node is returned or nil if the parent node is the internal,
hidden root node. When writing to this property you will effectively move a node to a new location.
See Also
MoveTo, CopyTo
@@TBaseVirtualTree.OffsetX
<COMBINE TBaseVirtualTree.OffsetXY>
@@TBaseVirtualTree.OffsetXY
Summary
Read or set the tree's current horizontal and vertical scroll offsets.
Description
Virtual Treeview allows to retrieve or set the internal scroll offset directly, without sending WM_HSCROLL/WM_VSCROLL
message around. This allows also to link two or more trees together. This scroll offset is given in pixels and is always
less or equal 0.
@@TBaseVirtualTree.OffsetY
<COMBINE TBaseVirtualTree.OffsetXY>
@@TBaseVirtualTree.OnAdvancedHeaderDraw
Summary
Header paint support event.
Description
The OnAdvancedHeaderDraw event is used when owner draw is enabled for the header and a column is set to owner draw mode.
It can be used to custom draw only certain parts of the header instead the whole thing. A good example for this event is
customizing the background of the header for only one column. With the standard custom draw method (OnHeaderDraw) you are
in an all-or-nothing situation and have to paint everything in the header including the text, images and sort direction
indicator. OnAdvancedHeaderDraw however uses OnHeaderDrawQueryElements to ask for the elements the application wants to
draw and acts accordingly.
See Also
OnHeaderDrawQueryElements, OnHeaderDraw
@@TBaseVirtualTree.OnAfterCellPaint
Summary
Paint support event.
Description
This event is called whenever a cell has been painted. A cell is defined as being one part of a node bound to a certain
column. This event is called several times per node (the amount is determined by visible columns and size of the part to
draw).
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnAfterItemErase
Summary
Paint support event.
Description
Called after the background of a node has been erased (erasing can also be filling with a background image). This event
is called once per node in a paint cycle.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnAfterItemPaint
Summary
Paint support event.
Description
Called after a node has been drawn. This event is called once per node.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnAfterPaint
Summary
Paint support event.
Description
Called after all nodes which needed an update have been drawn. This event is called once per paint cycle.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnBeforeCellPaint
Summary
Paint support event.
Description
This event is called immediately before a cell is painted.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnBeforeItemErase
Summary
Paint support event.
Description
Called when the background of a node is about to be erased.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnBeforeItemPaint
Summary
Paint support event.
Description
Called after the background of a node has been drawn and just before the node itself is painted. In this event the
application gets the opportunity to decide whether a node should be drawn normally or should be skipped. The application
can draw the node itself if necessary or leave the node area blank.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnBeforePaint
Summary
Paint support event.
Description
Called as very first event in a paint cycle. In this event has the application the opportunity to do some special
preparation of the canvas onto which the tree is painted, e.g. setting a special viewport and origin or a different
mapping mode.
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TBaseVirtualTree.OnChange
Summary
Navigation support event.
Description
Called when a node's selection state has changed.
@@TBaseVirtualTree.OnChecked
Summary
Check support event.
Description
Triggered when a node's check state has changed.
@@TBaseVirtualTree.OnChecking
Summary
Check support event.
Description
Triggered when a node's check state is about to change and allows to prevent the change.
@@TBaseVirtualTree.OnCollapsed
Summary
Miscellaneous event.
Description
Triggered after a node has been collapsed, that is, its child nodes are no longer displayed.
@@TBaseVirtualTree.OnCollapsing
Summary
Miscellaneous event.
Description
Triggered when a node is about to be collapsed and allows to prevent collapsing the node by setting <B>Allowed</B> to
false.
@@TBaseVirtualTree.OnColumnClick
Summary
Header and column support event.
Description
Triggered when the user released a mouse button over the same column in the client area on which the button was pressed
previously.
See Also
OnHeaderClick
@@TBaseVirtualTree.OnColumnDblClick
Summary
Header and column support event.
Description
Same as OnColumnClick but for double clicks.
See Also
OnColumnClick, OnHeaderDblClick
@@TBaseVirtualTree.OnColumnResize
Summary
Header and column support routine.
Description
Triggered when a column is being resized. During resize OnColumnResize is frequently hence you should make any code in
the associated event handle a short and fast as possible.
@@TBaseVirtualTree.OnCompareNodes
Summary
Sort and search support event.
Description
This event is the core event for all comparations between nodes. It is important that you <B>write a handler</B> for this
event if you want <B>to sort nodes</B>!
<B>Result</B> must be set to less than 0 if <B>Node1</B> is considered as being before <B>Node2</B>, equal to 0 if both a
considered being the same and greater than 0 if the first node is considered as being after node 2. Keep in mind that you
don't need to take sort direction into account. This is automatically handled by the tree. Simply return a comparation
\result as would there be an ascending sort order.
Below is some sample code taken from the Advanced Demo:
<CODE>
<B>procedure</B> TMainForm.VDT1CompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: Integer;
<B>var</B> Result: Integer);
<COLOR Blue>// used to sort the image draw tree</COLOR>
<B>var</B>
Data1,
Data2: PImageData;
<B>begin</B>
Data1 := Sender.GetNodeData(Node1);
Data2 := Sender.GetNodeData(Node2);
<COLOR Blue>// folder are always before files</COLOR>
<B>if</B> Data1.IsFolder \<\> Data2.IsFolder <B>then</B>
<B>begin</B>
<COLOR Blue>// one of both is a folder the other a file</COLOR>
<B>if</B> Data1.IsFolder <B>then</B>
\Result := <COLOR Pink>-1</COLOR>
<B>else</B>
\Result := <COLOR Pink>1</COLOR>;
<B>end
<COLOR Blue> </COLOR>else</B><COLOR Blue> // both are of same type (folder or file)</COLOR>
\Result := CompareText(Data1.FullPath, Data2.FullPath);
<B>end</B>;
</CODE>
See Also
SortTree, Sort
@@TBaseVirtualTree.OnCreateDataObject
Summary
Drag'n drop support event.
Description
This event is called when the tree's drag manager needs a data object interface to start a drag'n drop operation.
Descentants (which override DoGetDataObject) or the application can return an own IDataObject implementation to support
special formats.
@@TBaseVirtualTree.OnCreateDragManager
Summary
Drag'n drop support event.
Description
This event is usually not used but allows power users to create their own drag manager to have different actions and/or
formats than the internal drag manager.
@@TBaseVirtualTree.OnCreateEditor
Summary
Editing support event.
Description
Allows to supply a customized node editor without changing the tree. TBaseVirtualTree triggers this event and raises an
exception if there no editor is returned. If you don't want this then disable edit support for nodes in
TreeOptions.MiscOptions. Descentants like TCustomVirtualStringTree supply a generic and simple string editor.
See Also
<LINK Editing.htm, Editors and editing>
@@TBaseVirtualTree.OnDragAllowed
Summary
Drag'n drop support event.
Description
This event is called in the mouse button down handler to determine whether the application allows to start a drag
\operation. Since this check is done in sync with the other code it is much prefered over doing a <B>manual</B>
BeginDrag.
Note
The OnDragAllowed event is called only if the current DragMode is dmManual.
@@TBaseVirtualTree.OnDragDrop
Summary
Drag'n drop support event.
Description
Triggered when either a VCL or a OLE drop action occured. Accepting drag and drop actions is not trivial. In order to
maintain a minimum compatibility with the VCL drag'n drop system Virtual Tree accepts not only OLE drop actions but also
those issued by the Delphi VCL (which is totally different to the OLE way, unfortunately), provided toAcceptOLEDrop is
set in TreeOptions.MiscOptions. The code snippet below is taken from a sample project provided with Virtual Tree. It
shows a general way to deal with dropped data. The following check list can be used as orientation and additional comment
to the code:
1. Determine what kind of drop data is passed. If <B>DataObject</B> is nil or <B>Formats</B> is empty then the drag
source is a VCL control. The event is not triggered for OLE drag'n drop if there is no OLE format is available (which
should never occur).
2. If the event is triggered by a VCL control then use <B>Source</B> to access either the control or the drag
\object, depending on the circumstances of the action.
3. For OLE drag'n drop iterate through the <B>Formats</B> list to find a format you can handle.
4. If you find CF_VIRTUALTREE then the source of the drag operation is a Virtual Treeview. Since this is the native
tree format you can pass it to the <B>Sender</B>'s ProcessDrop method which will take care to retrieve the data and act
depending on <B>Effect</B> and <B>Mode</B>. No further action by the application is usually required in this case.
5. If you do not find CF_VIRTUALTREE then the operation has been initiated by another application, e.g. the
Explorer (then you will find CF_HDROP or CF_SHELLIDLIST in formats) or Notepad (then you will get CF_TEXT and perhaps
CF_UNICODETEXT) etc., depending on the data which is actually dropped.
6. Use the provided <B>DataObject</B> to get the drop data via IDataObject.GetData and act depending on the format
you get.
7. Finally set <B>Effect</B> to either DROPEFFECT_COPY, DROPEFFECT_MOVE or DROPEFFECT_NONE to indicate which
\operation needs to be finished in <B>Sender</B> when the event returns. If you return DROPEFFECT_MOVE then all marked
nodes in the source tree will be deleted, otherwise they stay where they are.
<CODE>
<B>procedure</B> TMainForm.VTDragDrop(Sender: TBaseVirtualTree; Source: TObject; DataObject: IDataObject;
<B>const</B> Formats: <B>array</B> <B>of</B> Word; Shift: TShiftState; Pt: TPoint; <B>var</B> Effect: Integer; Mode: TDropMode);
<B>var</B>
I: Integer;
AttachMode: TVTNodeAttachMode;
<B>begin</B>
<B>if</B> Length(Formats) \> 0 <B>then</B>
<B>begin</B>
<COLOR Blue> // OLE drag'n drop
// If the native tree format is listed then use this and accept the drop, otherwise recject (ignore) it.
// It is recommend by Microsoft to order available clipboard formats in decreasing detail richness so
// the first best format which we can accept is usually the best format we can get at all.</COLOR>
<B>for</B> I := 0 <B>to</B> High(Formats) <B>do</B>
<B>if</B> Formats[I] = CF_VIRTUALTREE <B>then</B>
<B>begin</B>
<B>case</B> Mode <B>of</B>
dmAbove:
AttachMode := amInsertBefore;
dmOnNode:
AttachMode := amAddChildLast;
dmBelow:
AttachMode := amInsertAfter;
<B>else</B>
<B>if</B> Assigned(Source) <B>and</B> (Source is TBaseVirtualTree) <B>and</B> (Sender \<\> Source) <B>then</B>
AttachMode := amInsertBefore
<B>else</B>
AttachMode := amNowhere;
<B>end</B>;
<COLOR Blue>// in the case the drop target does an optimized move Effect is set to DROPEFFECT_NONE
// to indicate this also to the drag source (so the source doesn't need to take any further action)</COLOR>
Sender.ProcessDrop(DataObject, Sender.DropTargetNode, Effect, AttachMode);
Break;
<B>end</B>;
<B> end
else
begin</B>
<COLOR Blue>// VCL drag'n drop, Effects contains by default both move and copy effect suggestion,
// as usual the application has to find out what operation is finally to do</COLOR>
Beep;
<B> end;
end;
</B>
</CODE>
@@TBaseVirtualTree.OnDragOver
Summary
Drag'n drop support event.
Description
Triggered when Sender is the potential target of a drag'n drop operation. You can use this event to allow or deny a drop
\operation by setting Allowed to True or False, respectively. For conditions of OLE or VCL drag source see OnDragDrop.
See Also
OnDragDrop
@@TBaseVirtualTree.OnEditCancelled
Summary
Editing support event.
Description
Triggered when an edit action has been cancelled.
See Also
<LINK Editing.htm, Editors and editing>
@@TBaseVirtualTree.OnEdited
Summary
Editing support event.
Description
Triggered when an edit action has successfully been finished.
See Also
<LINK Editing.htm, Editors and editing>
@@TBaseVirtualTree.OnEditing
Summary
Editing support event.
Description
Triggered when a node is about to be edited. Use <B>Allowed</B> to allow or deny this action.
See Also
<LINK Editing.htm, Editors and editing>
@@TBaseVirtualTree.OnExpanded
Summary
Misscellaneous event.
Description
Triggered after a node has been expanded.
@@TBaseVirtualTree.OnExpanding
Summary
Miscellaneous event.
Description
Triggered just before a node is expanded. Use <B>Allowed</B> to allow or deny this action.
@@TBaseVirtualTree.OnFocusChanged
Summary
Navigation support event.
Description
Triggered after the focused node changed. When examining <B>Node</B> keep in mind that it can be nil, meaning there is no
focused node.
@@TBaseVirtualTree.OnFocusChanging
Summary
Navigation support event.
Description
Triggered when the node focus is about to change. You can use <B>Allowed</B> to allow or deny a focus change. Keep in
mind that either the old or the new node can be nil.
@@TBaseVirtualTree.OnFreeNode
Summary
Data management node.
Description
Triggered when a node is about to be freed. This is the ideal place to free/disconnect your own data you associated with <B>Node</B>.
Keep in mind, that data which is stored directly in the node does not need to be free by the application. This is part of
the node record and will be freed when the node is freed. You should however finalize the data in such a case if it
contains references to external memory objects (e.g. variants, strings, interfaces).
@@TBaseVirtualTree.OnGetCursor
Summary
Miscellaneous event.
Description
This event is triggered from the WM_SETCURSOR message to allow the application use several individual cursors for a tree.
The Cursor property allows to set one cursor for the whole control but not to use separate cursors for different tree
parts.
@@TBaseVirtualTree.OnGetHeaderCursor
Summary
Header and column support event.
Description
This event is triggered from the WM_SETCURSOR message to allow the application to define individual cursors for the
header part of the tree control.
@@TBaseVirtualTree.OnGetHelpContext
Summary
Miscellaneous event.
Description
This event is usually triggered when the user pressed F1 while the tree has the focus. The tree is iteratively traversed
all the way up to the top level parent of the given node until a valid help context index is returned (via this event).
When the loop reaches the top level without getting a help index then the tree control's help index is used. If the tree
itself does not have a help context index then a further traversal is initiated going up parent by parent of each control
in the current window hierarchy until either a valid index is found or there is no more window parent.
@@TBaseVirtualTree.OnGetImageIndex
Summary
Display management event.
Description
This event is triggered whenever the tree needs the index of an image, be it the normal, the selected or the state image.
The event should be as fast as possible because it is at times frequently called when the layout of the node must be
determined, e.g. while doing draw selection with the mouse or painting the tree. <B>Kind</B> determines which image is
needed and <B>Column</B> determines for which column of the node the image is needed. This value can be -1 to indicate
there is no column used. The parameter <B>Ghosted</B> can be set to true to blend the image 50% against the tree
background and can be used for instance in explorer trees to mark hidden file system objects. Additionally nodes are also
drawn with a ghosted icon if the are part of a cut set during a pending cut-to-clipboard operation. In this case changing
the ghosted parameter has no effect.
Note
Blending nodes can be switched by using toUseBlendImages in TreeOptions.PaintOptions.
@@TBaseVirtualTree.OnGetLineStyle
Summary
Display management event.
Description
This event is used to customize the appearance of the tree and grid lines and is only triggered if the LineStyle property
is set to lsCustomStyle. The event must return a pointer to an array containing bits for an 8 x 8 pixel image with word
aligned entries. For more info see PrepareBitmaps and the Windows APIs CreateBitmap and CreatePatternBrush.
Note
It is important that you do not use dynamically allocated memory in this event (also no local variables on the stack). If
you do so then either the memory is not valid on return of the event (if allocated on stack) or will never be freed (if
allocated with a memory manager). Instead use a constant array and return its address.
See Also
PrepareBitmaps
@@TBaseVirtualTree.OnGetNodeDataSize
Summary
Data management event.
Description
Triggered when access to a node's data happens the first time but the actual data size is not yet set. Usually you would
specify the size of the data you want to have added to each node by NodeDataSize, e.g. SizeOf(TMyRecord) is quite usual
there (where TMyRecord is the structure you want to have stored in the node). Sometimes, however it is not possible to
determine the node size in advance, so you can leave NodeDataSize being -1 (the default value) and the OnGetNodeDataSize
event is triggered as soon as the first regular node is created (the hidden root node does not have user data but
\internal data which is determined by other means).
See Also
NodeDataSize, <LINK DataHandling.htm, Data handling>
@@TBaseVirtualTree.OnGetPopupMenu
Summary
Miscellaneous event.
Description
This event allows the application to return a popup menu which is specific to a certain node. The tree does an automatic
traversal all the way up to the top level node which is the parent of a given node to get a popup menu. If <B>Menu</B> is
set then the traversal stops. Otherwise it continues until either a menu is set, AskParent is set to False or the top
level parent has been reached.
@@TBaseVirtualTree.OnGetUserClipboardFormats
Summary
Drag'n drop and clipboard support event.
Description
Whenever the tree needs to specify the available clipboard formats for a clipboard or drag'n drop operation it calls this
event too, to allow the application or descentants (which would override DoGetUserClipboardFormats) to specify own
formats which can be rendered. Since the build-in data object does not know how to render formats which are specified
here you have to supply a handler for the OnRenderOLEData event or an own IDataObject implementation to fully support
your own formats.
Use the <B>Formats</B> parameter which is an open array and add the identifiers of your formats (which you got when you
registered the format).
@@TBaseVirtualTree.OnHeaderClick
Summary
Header & column support event.
Description
This event is triggered when the user clicks on a header button and is usually a good place to set the current SortColumn
and SortDirection.
See Also
SortColumn, SortDirection
@@TBaseVirtualTree.OnHeaderDblClick
Summary
Header & column support event.
Description
Unlike OnHeaderClick this event is triggered for double clicks on any part of the header and comes with more detailed
information like shift state, which mouse button caused the event and the mouse position.
See Also
OnHeaderClick
@@TBaseVirtualTree.OnHeaderDragged
Summary
Header & column support event.
Description
Triggered after the user has released the left mouse button when a header drag operation was active. <B>Column</B>
contains the index of the column which was dragged. Use this index for the Columns property of the header to find out the
current position. <B>OldPosition</B> is the position which <B>Column</B> occupied before it was dragged around.
@@TBaseVirtualTree.OnHeaderDraggedOut
Summary
Header & column support event.
Description
When during a header drag operation the mouse moves out of the header rectangle and the mouse button is released then an
OnHeaderDraggedOut event will be fired with the target mouse position in screen coordinates.
@@TBaseVirtualTree.OnHeaderDragging
Summary
Header & column support event.
Description
Triggered just before dragging of a header button starts. Set <B>Allowed</B> to False if you want to prevent the drag
\operation of the given column.
@@TBaseVirtualTree.OnHeaderDraw
Summary
Header & column support event.
Description
If you set the hoOwnerDraw style in TVTHeader.Options and a column has been set to vsOwnerDraw (see also
TVirtualTreeColumn.Style) then OnDrawHeader is called whenever a column needs painting.
@@TBaseVirtualTree.OnHeaderDrawQueryElements
Summary
Header & column support event.
Description
Used for advanced header painting to query the application for the elements, which are drawn by it and which should be
drawn by the tree.
See Also
OnAdvancedHeaderDraw
@@TBaseVirtualTree.OnHeaderMouseDown
Summary
Header & column support event.
Description
This event is similar to OnHeaderClick but comes with more detailed information like shift state, which mouse button
caused the event and the mouse position.
@@TBaseVirtualTree.OnHeaderMouseMove
Summary
Header & column support event.
Description
This event is triggered when the mouse pointer is moved over the header area.
@@TBaseVirtualTree.OnHeaderMouseUp
Summary
Header & column support event.
Description
This event is very much like OnHeaderMouseDown but is triggered when a mouse button is released.
@@TBaseVirtualTree.OnHotChange
Summary
Navigation support event.
Description
This event is triggered if hot tracking is enabled (see also TreeOptions.PaintOptions) and when the mouse pointer moves
from one node caption to another. In full row select mode most parts of a node are considered as being part of the
caption.
@@TBaseVirtualTree.OnIncrementalSearch
Summary
Miscellaneous event.
Description
This event is integral part of the incremental search functionality (see also Keyboard, hotkeys and incremental search).
It is triggered during search for a node which matches the given string. Similar to other compare routines return a value
\< 0 if the node's caption is considered as being before the given text, = 0 if it is the same and \> 0 if it is
considered being after the given text.
<CODE>
<B>procedure</B> TfrmProperties.VST3IncrementalSearch(Sender: TBaseVirtualTree; Node: PVirtualNode; <B>const</B> Text: WideString;
<B>var</B> Result: Integer);
<B>var</B>
S, PropText: <B>string</B>;
<B>begin</B>
<COLOR Blue>// Note: This code requires a proper Unicode/WideString comparison routine which I did not want to link here for
// size and clarity reasons. For now strings are (implicitly) converted to ANSI to make the comparison work.
// Search is not case sensitive.</COLOR>
S := Text;
<B>if</B> Node.Parent = Sender.RootNode <B>then</B>
<B>begin</B>
<COLOR Blue>// root nodes</COLOR>
<B>if</B> Node.Index = 0 <B>then</B>
PropText := <COLOR Pink>'Description'</COLOR>
<B>else</B>
PropText := <COLOR Pink>'Origin'</COLOR>;
<B>end
else
begin</B>
PropText := PropertyTexts[Node.Parent.Index, Node.Index, ptkText];
<B>end</B>;
<COLOR Blue>// By using StrLIComp we can specify a maximum length to compare. This allows us to find also nodes
// which match only partially.</COLOR>
\Result := StrLIComp(PChar(S), PChar(PropText), Min(Length(S), Length(PropText)))
<B>end</B>;
</CODE>
Note
Usually incremental search allows to match also partially. Hence it is recommended to do comparison only up to the length
\of the shorter string.
@@TBaseVirtualTree.OnInitChildren
Summary
Node management event.
Description
In order to allow the tree only to fill content where needed it is possible to set the vsHasChildren style in a node's
initializaton whithout really adding any child nodes. These child nodes must be initialized first when they are about to
be displayed or another access (like search, iteration etc.) occurs.
The application usually prepares data needed to fill child nodes when they are initialized and retrieves the actual
number. Set <B>ChildCount</B> to the number of children you want.
See Also
<LINK Paradigm.htm, The virtual paradigm>
@@TBaseVirtualTree.OnInitNode
Summary
Node management event.
Description
This event is important to connect the tree to your internal data. It is the ideal place to put references or whatever
you need into a node's data area. You can set some initial states like selection, expansion state or that a node has
child nodes.
See Also
<LINK Paradigm.htm, The virtual paradigm>
@@TBaseVirtualTree.OnKeyAction
Summary
Miscellaneous event.
Description
This event is a convinient way for the application or descentant trees to change the semantic of a certain key stroke. It
is triggered when the user presses a key and allows either to process that key normally (leave <B>DoDefault</B> being
True) or change it to another key instead (set <B>DoDefault</B> to False then). This way a key press can change its
meaning or entirely be ignored (if <B>CharCode</B> is set to 0).
@@TBaseVirtualTree.OnLoadNode
Summary
Streaming support event.
Description
This event is typically triggered when serialized tree data must be restored, e.g. when loading the tree from file or
stream or during a clipboard/drag'n drop operation. You should only read in what you wrote out in OnSaveNode. For safety
there is a check in the loader code which tries to keep the internal serialization structure intact in case the
application does not read correctly.
See Also
OnSaveNode, LoadFromStream, SaveToStream, AddFromStream, VTTreeStreamVersion, TVTHeader.LoadFromStream,
TVTHeader.SaveToStream
@@TBaseVirtualTree.OnMeasureItem
Summary
Miscellaneous event.
Description
Virtual Treeview supports individual node heights. However it might sometimes unpractical to set this height in advance
(e.g. during OnInitNode). Another scenario might be that multi line nodes must size themselves to accomodate the entire
node text without clipping. For such and similar cases the event OnMeasureItem is for. It is queried once for each node
and allows to specify the node's future height. If you later want to have a new height applied (e.g. because the node's
text changed) then call InvalidateNode for it and its vsHeightMeasured state is reset causing so the tree to trigger the
OnMeasureItem event again when the node is painted the next time.
See Also
InvalidateNode, vsHeightMeasured
@@TBaseVirtualTree.OnNodeCopied
Summary
Miscellaneous event.
Description
This event is triggered during drag'n drop after a node has been copied to a new location. Sender is the target tree
where the copy operation took place.
@@TBaseVirtualTree.OnNodeCopying
Summary
Miscellaneous event.
Description
This event is triggered when a node is about to be copied to a new location. Use <B>Allowed</B> to allow or deny the
action. <B>Sender</B> is the target tree where the copy operation will take place.
@@TBaseVirtualTree.OnNodeMoved
Summary
Miscellaneous event.
Description
This event is very much like OnNodeCopied but used for moving nodes instead.
@@TBaseVirtualTree.OnNodeMoving
Summary
Miscellaneous event.
Description
This event is very much like OnNodeCopying but used for moving nodes instead.
@@TBaseVirtualTree.OnPaintBackground
Summary
Paint support event.
Description
This event is triggered when the tree has finished its painting and there is an area which is not covered by nodes. For
nodes there are various events to allow background customizaton. For the free area in the tree window there is this
event.
@@TBaseVirtualTree.OnRenderOLEData
Summary
Drag'n drop and clipboard support event.
Description
This event is triggered when the data in a clipboard or drag'n drop operation must be rendered but the built-in data
\object does not know the requested format. This is usually the case when the application (or descentants) have specified
their own formats in OnGetUserClipboardFormats.
@@TBaseVirtualTree.OnResetNode
Summary
Node management event.
Description
For large trees or simply because the content changed it is sometimes necessary to discard a certain node and release all
its children. This can be done with ResetNode which will trigger this event.
See Also
ResetNode
@@TBaseVirtualTree.OnSaveNode
Summary
Streaming support event.
Description
This event is triggered whenever a certain node must be serialized into a stream, e.g. for saving to file or for copying
to another tree/node during a clipboard or drag'n drop operation. Make sure you only store non-transient data into the
stream. Pointers (including long/wide string references) are transient and the application cannot assume to find the data
a pointer references on saving at the same place when the node is loaded (see also OnLoadNode). This is even more
essential for nodes which are moved or copied between different trees in different processes (applications). Storing
strings however is easily done by writing the strings as a whole into the stream.
Note
For exchanging data between different trees and for general stability improvement I strongly recommend that you insert a
kind of identifier as first stream entry when saving a node. This identifier can then be used to determine what data will
follow when loading the node later and does normally not required to be stored in the node data.
See Also
OnLoadNode, LoadFromStream, SaveToStream, AddFromStream, VTTreeStreamVersion, TVTHeader.LoadFromStream,
TVTHeader.SaveToStream
@@TBaseVirtualTree.OnScroll
Summary
Miscellaneous event.
Description
This event is triggered when the tree is scrolled horizontally or vertically. You can use it to synchronize scrolling of
several trees or other controls.
See Also
OffsetXY
@@TBaseVirtualTree.OnStateChange
Summary
Miscellaneous event.
Description
For special effects or in order to increase performance it is sometimes useful to know when the tree changes one of its
\internal states like tsIncrementalSearching or tsOLEDragging. The OnStateChange event is triggered each time such a
change occurs letting so the application take measures for it.
@@TBaseVirtualTree.OnStructureChange
Summary
Miscellaneous event.
Description
This event is triggered when a change in the tree structure is made. That means whenever a node is created or destroyed
\or a node's child list is change (because a child node was moved, copied etc.) then OnStructureChange is executed.
@@TBaseVirtualTree.OnUpdating
Summary
Miscellaneous event.
Description
This event is triggered when the application or the tree call BeginUpdate or EndUpdate and indicate so when a larger
update operation takes place. This can for instance be used to show a hour glass wait cursor.
@@TBaseVirtualTree.RootNode
Summary
Reference to the internal root node which is the anchor of the entire tree node hierarchy.
Description
For anchoring the tree hierarchy an internal tree node is maintained which is mostly just like any other tree node but
has sometimes differently handled. The root node is always expanded and initialized. Its parent member points to the
treeview to which the node belongs to and its PreviousSibling and NextSibling members point to the root node itself to
make it possible to actually recognize this node.
Note
You should not use the root node to iterate through the tree. It is only publicly accessible because it is the parent of
all top level nodes and can be used to test a node whether it is a top level node or not.
@@TBaseVirtualTree.RootNodeCount
Summary
Read or set the number of nodes on the top level.
Description
Usually setting RootNodeCount is all what is needed to initially fill the tree. When one of the top level nodes is
initialized you can set its ivsHasChildren style. This will then cause to ask to initialize the child nodes. Recursively
applied, you can use this principle to create tree nodes on demand (e.g. when their parent is expanded).
@@TBaseVirtualTree.ScrollBarOptions
Summary
Reference to the scroll bar options class.
Description
Like many other aspects in Virtual Treeview also scrollbars can be customized. See the class itself for further
descriptions.
@@TBaseVirtualTree.SearchBuffer
Summary
Current input string for incremental search.
Description
When incremental search is active you can use SearchBuffer to get the input string typed by the user, which created the
last match.
See Also
IncrementalSearch
@@TBaseVirtualTree.Selected
Summary
Property to modify or determine the selection state of a node.
Description
This array property is used to test whether a given node is selected or to switch its selection state. Note that the
selection state has nothing to do with the <LINK TBaseVirtualTree.FocusedNode, focused state>. Only one node can be
focused while any number of nodes can be selected (read: can be marked with the selection flag to paint their caption
differently). Selection is mainly used to mark nodes for clipboard and drag'n drop operations.
@@TBaseVirtualTree.SelectedCount
Summary
Contains the number of selected nodes.
Description
If multiselection is enabled (toMultiSelect) then SelectedCount will contain the actual number of selected nodes. In
\order to change the selection state of a node use Selected or AddToSelection/RemoveFromSelection.
@@TBaseVirtualTree.SelectionBlendFactor
Summary
Read or set the current blend factor for the multi selection rectangle and the node selection rectangle.
Description
For a visually appealing tree some operations use alpha blending. One of these operations is multi selection using the
mouse. Another one is the rectangle drawn around the caption of selected nodes. Both rectangles use the
SelectionBlendFactor to determine how much of the underlying tree image and how much of the rectangles should be seen.
The factor can be in the range of [0..255] where 0 means the rectangle is fully transparent and 255 it is fully opaque.
If you don't like to use blended node selection rectangles then switch them off by removing toUseBlendedSelection from
TVTPaintOptions. For selecting a certain multi selection rectangle style use DrawSelectionMode.
Note
Alpha blending is only enabled when the current processor supports MMX instructions. If MMX is not supported then a
dotted draw selection rectangle and an opaque node selection rectangle is used.
See Also
DrawSelectionMode, TVTPaintOptions
@@TBaseVirtualTree.SelectionCurveRadius
Summary
Read or set the current corner radius for node selection rectangles.
Description
This is a special property to determine the radius of the corners of the selection rectangle for a node caption. Virtual
Treeview supports not only simple rectangular selection marks but also such with rounded corners. This feature, however,
is only available if blended node selection rectangles are disabled.
See Also
SelectionBlendFactor, DrawSelectionMode, TVTPaintOptions
@@TBaseVirtualTree.StateImages
Summary
Reference to the images list which is used for the state images.
Description
Each node can (in each column) have several images. One is the check image which is supplied by internal image lists or a
special external list (see also CustomCheckImages). Another one is the state image and yet another one the
normal/selected image.
See Also
CheckImages, Images
@@TBaseVirtualTree.TextMargin
Summary
Read or set the distance of the node caption to its borders.
Description
TextMargin is used to define a border like area within the content rectangle of a node. This rectangle is the area of the
node less the space used for indentation, images, lines and node margins and usually contains the text of a node. In
\order to support finer adjustment there is another margin, which only applies to the left and right border in the
content rectangle. This is the text margin.
See Also
Margin
@@TBaseVirtualTree.TopNode
Summary
The top node is the node which is currently at the top border of the client area.
Description
This property is a reference to the node which is the first node which is at least partially visible in the client area.
@@TBaseVirtualTree.TotalCount
Summary
\Returns the number of nodes in the tree.
Description
Use this property to get the overall number of nodes currently in the tree. This will validate all nodes in the control
so that also not yet created child nodes are counted.
Note
This property is quite counter productive as it causes the entire tree to be validated when queried. This means that each
node is initialized, including its children and grandchildren etc. creating so a full blown treeview (if not already
done) which might keep much memory allocated (not counted the time necessary to validate all nodes). Therefore I
discourage the use of the property unless it is really necessary.
@@TBaseVirtualTree.TotalInternalDataSize
Summary
Keeps the currently accumulated data size for one node.
Description
Each node in the tree not only supports user data but also an interal area where TVirtualBaseTree descentants can store
their own data per node. This internal data area must be allocated by a tree class, that means it must register its need
for internal data. The internal data size registered by each descendant is accumulated in the TotalInternalDataSize
member and is used to compute the user data offset in the node record.
See Also
<LINK DataHandling.htm, Data handling>
@@TBaseVirtualTree.TreeOptions
Summary
Reference to the tree's options.
Description
The tree options are one of the main switchs to modify a treeview's behavior. Virtual Treeview supports customizing tree
\options by descentants. This allows very fine adjustments for derived tree classes, including the decision which
properties should be published. For more information about the base options see TCustomVirtualTreeOptions and its
descentants.
@@TBaseVirtualTree.TreeStates
Summary
Property which keeps a set of flags which indicate current operation and states of the tree.
Description
Often it is extremly helpful to know what action is currently happening in the tree. TreeStates gives you this
information, be it that the caches are currently validated, a drag operation is in progress, the tree has delayed data on
the clipboard or a large update operation is under work. You can greatly optimize your code with this knowledge.
See Also
OnStateChange
@@TBaseVirtualTree.VerticalAlignment
Summary
Used to set a node's vertical button aligment with regard to the entire node rectangle.
Description
The given value is interpreted differently depending on the value of NodeAlignment. By default the alignment used
relatively with regard to the top bound. In this case a range of 0 through 100 must be used which denotes the relative
pixel amount in percent. The other variants work with absolute pixel values from top or bottom bound.
@@TBaseVirtualTree.VisibleCount
Summary
Number of currently visible nodes.
Description
Visible nodes are those nodes which have the vsVisible flag set in their states.
@@TBaseVirtualTree.VisiblePath
Summary
Property to set or determine a node parent's expand states.
Description
A node has a visible path when all of its parent nodes are expanded. Setting this property to True will expand all parent
nodes of <B>Node</B> if not yet done.
See Also
Visible
@@TBaseVirtualTree.WantTabs
Summary
Read or set whether the tree wants to process tabs on its own.
Description
Usually tab kex strokes advance the input focus from one control to another on a form. For special processing however it
is necessary to let the control decide what to do with the given tabulator character. Virtual Treeview needs this
character mainly for its grid emulation.
@@TBaseVirtualTree.AbsoluteIndex@PVirtualNode
Summary
Reads the overall index of a node.
Description
Indicates the index of the tree node relative to the first tree node in a tree.
Note
Similar to TotalCount also with AbsoluteIndex the entire tree will be validated, with all consequences like high memory
usage etc. And since Virtual Treeview is a highly changing environment there is not much sense to use the absolute index.
You cannot use it in any method or property of the control.
@@TBaseVirtualTree.AddChild@PVirtualNode@Pointer
Summary
Creates and adds a new child node to given node.
Description
The new node will be created as last child of <B>Parent</B> and is returned as result.
Note
Using AddChild is not recommended. The method is merely there for easier migration from TTreeview. The reason is that the
method has to validate the node and does some other processing, which prevents the tree from utilizings its virtual
paradigm. Important advantages will so disappear. If possible you should restructure your design and try to use the right
way: via OnInitNode and OnInitChildren.
See Also
InsertNode, OnInitNode, OnInitChildren
@@TBaseVirtualTree.AddFromStream@TStream@PVirtualNode
Summary
Adds the content from the given stream to the given node.
Description
AddFromStream restores the subtree stored in Stream and adds it to TargetNode. The content of the stream must have been
saved previously with SaveToStream.
See Also
SaveToStream
@@TBaseVirtualTree.AddToSelection@PVirtualNode
Summary
Adds one or more nodes to the current selection.
Description
AddToSelection either takes a single node or an array of nodes and adds them to the current seletion in the tree. In this
process also the vsSelected state of the node is set. <B>NewLength</B> is the amount of nodes to add (necessary to allow <B>NewItems</B>
to be larger than the actual used entries). <B>ForceInsert</B> is true if nodes must be inserted without consideration of
level select constraint or already set selected flags (e.g. when loading from stream).
Note
In the case <B>ForceInsert</B> is true the caller is responsible for making sure the new nodes aren't already in the
selection array!
@@TBaseVirtualTree.AddToSelection@TNodeArray@Integer@Boolean
<COMBINEWITH TBaseVirtualTree.AddToSelection@TNodeArray@Integer@Boolean>
@@TBaseVirtualTree.AdjustPaintCellRect@TVTPaintInfo@TColumnIndex
Summary
Used in descentants to modify the clip rectangle of the current column while painting a certain node.
Description
The rectangle for the given cell (node, column pair in <B>PaintInfo</B>) can be adjusted by descendants to make room for
special drawings, if necessary.
@@TBaseVirtualTree.AdjustPanningCursor@Integer@Integer
Summary
Loads the proper cursor which indicates into which direction scrolling is done.
Description
Wheel mice support a special mode for their wheel, which is used in many applications. By pressing the wheel (which is
also a button) you can start so called <I>wheell panning</I>. In this mode the tree window is smoothly scrolled in the
direction to which the mouse pointer is moved. As soon as you release the wheel button wheel panning is stopped. A second
form of this feature is referred to as <I>wheel scrolling</I>. It is basically the same as wheel panning but is entered
when you release the wheel button before you moved the mouse. In this mode you can move the mouse and do the tree
scrolling without holding the wheel all the time. To stop this mode simple turn the wheel, or click any mouse button.
Also pressing ESC will cause to leave the wheel scrolling mode.
Depending on the direction the tree content is scroll also the mouse cursor must be adjusted to indicate this direction.
AdjustPanningCursor does this.
@@TBaseVirtualTree.AdviseChangeEvent@Boolean@PVirtualNode@TChangeReason
Summary
Used to register a delayed change event.
Description
Often there can be many change events in a row and calling the application for each of them might be too time costly. So
they are by default accumulated until a certain time has elapsed (ChangeDelay) or, if BeginUpdate was called, until
EndUpdate is executed. If <B>StructureChange</B> is False then we have a selection change event (without a specific
reason) otherwise it is a structure change.
There are two possibilities to avoid delayed change events. One is the permanent way by setting ChangeDelay to 0, the
\other one is to enter the synchronous mode by calling BeginSynch.
@@TBaseVirtualTree.AllocateInternalDataArea@Cardinal
Summary
Registration method to allocate tree internal data per node.
Description
This method is used for descentants to specify their need for internal data. Each node contains some extra reserved bytes
between the node's normal members and the user data area. This internal area can be used to cache additional information,
e.g. the string tree keeps here the width of the node's caption in the main column for quick hit tests when doing draw
selection with the mouse.
A tree implementation must call this method only once and before any node is created (except the hidden root node which
is handled accordingly). The result value is the offset from the start of the node to the internal data area of the node
for this tree class. I recommend to implement an access method called InternalData (as shown in TCustomVirtualStringTree)
which does the pointer mathematic.
See Also
<LINK DataHandling.htm, Data handling>, TotalInternalDataSize
@@TBaseVirtualTree.Animate@Cardinal@Cardinal@TVTAnimationCallback@Pointer
Summary
Support method for animated actions in the tree view.
Description
This method is a general purpose helper to do an animation and is used for hint fading, animated node toggling etc. The
method automatically takes care that the animation is done within the specified time interval. For each step in the
animation loop the provided callback is called which gets Data passed as parameter.
@@TBaseVirtualTree.Assign@TPersistent
Summary
Used to copy properties from another Virtual Treeview.
Description
Although this method assignes most tree properties it does not assign the header and the nodes to the new tree. There is
an own method (TVTHeader.Assign) for the header assignment. In order to copy the nodes you must save them to a stream and
restore them in the other control-
@@TBaseVirtualTree.BeginDrag@Boolean@Integer
Summary
Starts an OLE drag'n drop operation.
Description
This method is called within the mouse down handler when DragMode is set to dmAutomatic. Manual start of a drag operation
is not recommended as it confuses the correct mouse down handling which is quite complex in Virtual Treevew. If you
selectively want to allow to start a drag operation then use the OnDragAllowed event which is called when DragMode is
dmManual.
@@TBaseVirtualTree.BeginSynch
Summary
Enters the tree into a special synchronized mode.
Description
Similar to BeginUpdate does BeginSynch provide a mechanism to bring certain events into a common line. That means,
whenever you need to make sure change events are called before a modification in the tree is finished (e.g. when changing
the focus or selection) then use the synchronous mode started with BeginSynch (and stopped with EndSynch).
@@TBaseVirtualTree.BeginUpdate
Summary
Locks the tree view to perform several update operations.
Description
Call this method when a long lasting operation begins which might involve manipulation of many nodes.
@@TBaseVirtualTree.CalculateSelectionRect@Integer@Integer
Summary
Support method for draw selection.
Description
Recalculates old and new selection rectangle given that X, Y are new mouse coordinates. The function returns true if
there was a change since the last call.
@@TBaseVirtualTree.CanAutoScroll
Summary
Determines whether the tree can currently auto scroll its window.
Description
This method was created because the conditions when the tree may automatically scroll its content are quite complex.
Additionally, tree descendants might want to add further limitations. Thus the determination has been put into an own
method which returns true if the tree is allowed to scroll, otherwise False.
@@TBaseVirtualTree.CancelCutOrCopy
Summary
Canceles any pending cut or copy clipboard operation.
Description
This method is used to stop any pending clipboard operation. No data is transfered nor are nodes deleted.
@@TBaseVirtualTree.CancelEditNode
Summary
Cancel the current edit operation, if there is any.
Description
Used to stop the current edit operation.The node editor will get a CancelEdit call so that the node is not changed.
@@TBaseVirtualTree.CanEdit@PVirtualNode@TColumnIndex
Summary
Determines whether a node can be edited or not.
Description
The method is called when the tree is about to start a node edit operation. Returns true if editing is allowed, otherwise
false.
@@TBaseVirtualTree.CanFocus
Summary
Support method to determine whether the tree window can receive the input focus.
Description
The method adds a check for the parent form of the control.
@@TBaseVirtualTree.CanShowDragImage
Summary
Determines whether a drag image should be shown.
Description
This overridable method is used to determine whether a drag image can be shown or not.
@@TBaseVirtualTree.Change@PVirtualNode
Summary
Central method called when a node's selection state changes.
Description
The Change method is called to trigger the change notifcation chain. Depending on the sync and the update states of the
tree as well as the ChangeDelay value either the application is directly notified about the change or a timer is started
to accumulate several change events into one.
See Also
BeginSynch, EndSynch, BeginUpdate, EndUpdate, ChangeDelay
@@TBaseVirtualTree.ChangeScale@Integer@Integer
Summary
Helper method called by the VCL when control resizing is due.
Description
ChangeScale is a method introduced by TControl. In Virtual Treeview it is responsible to change the tree's and the
header's fonts as well as to compute the new default node height.
See Also
TVTHeader.ChangeScale, DefaultNodeHeight
@@TBaseVirtualTree.CheckParentCheckState@PVirtualNode@TCheckState
Summary
Helper method for recursive check state changes.
Description
Checks all siblings of node to determine which check state Node's parent must get.
@@TBaseVirtualTree.Clear
Summary
Clears the tree and removes all nodes.
Description
All pending operations are stopped and the tree is ready to receive new nodes.
@@TBaseVirtualTree.ClearSelection
Summary
Removes all nodes from the current selection.
Description
ClearSelection empties the internal selection cache and resets the vsSelected state from all nodes, which were in this
array.
@@TBaseVirtualTree.ClearTempCache
Summary
Helper method to clear the internal temporary node cache.
Description
The internal node cache is used when more than one node is involved in certain operations (e.g. including a range of
nodes into the current selection).
@@TBaseVirtualTree.ColumnIsEmpty@PVirtualNode@TColumnIndex
Summary
Used to determine if a cell is considered as being empty.
Description
An empty cell might be used for the automatic column spanning feature. Descentants can override this method to modify the
tree's behavior.
See Also
toAutoSpanColumns
@@TBaseVirtualTree.CopyTo@PVirtualNode@TBaseVirtualTree@TVTNodeAttachMode@Boolean
<COMBINE TBaseVirtualTree.CopyTo@PVirtualNode@PVirtualNode@TVTNodeAttachMode@Boolean>
@@TBaseVirtualTree.CopyTo@PVirtualNode@PVirtualNode@TVTNodeAttachMode@Boolean
Summary
Copies <B>Source</B> and all its child nodes to <B>Target</B>.
Description
<B>Mode</B> is used to specify further where to add the new node actually (as sibling of <B>Target</B> or as child of
Target). Result is the newly created node to which source has been copied if <B>ChildrenOnly</B> is False or just
contains <B>Target</B> in the other case. <B>ChildrenOnly</B> determines whether to copy also the source node or only its
child nodes.
The variant taking a tree reference as target can be used to transfer nodes to a different tree, without determining its
root node first. However one can also pass in any virtual tree node as target, as long as it belongs to a tree. The
\owning tree is automatically determined.
@@TBaseVirtualTree.MoveTo@PVirtualNode@TBaseVirtualTree@TVTNodeAttachMode@Boolean
<COMBINE TBaseVirtualTree.MoveTo@PVirtualNode@PVirtualNode@TVTNodeAttachMode@Boolean>
@@TBaseVirtualTree.MoveTo@PVirtualNode@PVirtualNode@TVTNodeAttachMode@Boolean
Summary
Moves <B>Source</B> and all its child nodes to <B>Target</B>.
Description
Moves the given node (and all its children) to <B>Target</B>. <B>Source</B> must belong to the tree instance which calls
this MoveTo method. <B>Mode</B> determines how to connect <B>Source</B> to <B>Target</B>. This method might involve a
change of the tree if <B>Target</B> belongs to a different tree than <B>Source</B>.
The variant taking a tree reference as target can be used to transfer nodes to a different tree, without determining its
root node first. However one can also pass in any virtual tree node as target, as long as it belongs to a tree. The
\owning tree is automatically determined and an optimized path is taken if the operation happens within one tree. In this
case simply the source node is disconnected from the old place and reconnected at the new location.
@@TBaseVirtualTree.CopyToClipBoard
Summary
Copies all currently selected nodes to the clipboard.
Description
CopyToClipboard causes the tree to copy the currently selected nodes to the clipboard. Actually, Virtual Treeview
maintains socalled delayed rendering. This means the participating nodes are marked as being in the current clipboard set
(see vsCutOrCopy in TVirtualNodeStates) and only an IDataObject interface is placed onto the clipboard but no data yet.
This avoids not only possibly huge memory requirements but it also avoids rendering data in a format which is not
necessary. The application which pastes the clipboard content later will get the IDataObject interface and requests the
format it can handle. The actual data is then rendered when the target application calls IDataObject.GetData, which
results in a call to RenderOLEData.
@@TBaseVirtualTree.CutToClipBoard
Summary
Copies the currently selected nodes to the clipboard and removes them once a consumer has taken the data.
Description
Similar to CopyToClipboard only the nodes are deleted after they have been pasted into the target.
@@TBaseVirtualTree.DeleteChildren@PVirtualNode@Boolean
Summary
Removes all child nodes from the given node.
Description
The method works recursively: all grandchildren and their children are removed as well.
@@TBaseVirtualTree.DeleteNode@PVirtualNode@Boolean
Summary
Removes the given node from the tree.
Description
This method deletes the given node. If the node was initialized or had gotten initial data via the AddChild or InsertNode
then the event OnFreeNode is called to allow the application to free any user data attached to a node.
@@TBaseVirtualTree.DeleteSelectedNodes
Summary
Removes all currently selected nodes form the tree.
Description
All nodes in the current selection are affected.
@@TBaseVirtualTree.DoCancelEdit
Summary
Called when the tree should stop editing without accepting changed values.
Description
This method calls the edit link's IEditLink.CancelEdit method and stops the edit mode if this call returns True. If
stopping is allowed then the event OnEditCancelled is triggered and a message is sent to release the edit link
asynchronously.
@@TBaseVirtualTree.DoDragging@TPoint
Summary
\Internal method which handles drag' drop.
Description
This method starts the OLE drag'n drop operation and returns after this operation is finished.
@@TBaseVirtualTree.DoEdit
Summary
Initiates editing of the currently set focused column and edit node.
Description
This method takes care for editor creation and initialization. You can look for tsEditing in TreeStates to know whether
editing is currently active.
See Also
tsEditing, OnCreateEditor, IVTEditLink
@@TBaseVirtualTree.DoEndEdit
Summary
Stops the current edit operation and takes over the new content.
Description
The method also sends a message to the tree window to asynchronously release the edit link which communicates to the
actual editor. The edit link is responsible to propagate any changes made in its node editor to the tree.
Note
TVirtualStringTree overrides this method to tell the application about the new caption by calling OnNewText.
See Also
DoEdit, OnNewText, EditNode
@@TBaseVirtualTree.DoFocusNode@PVirtualNode@Boolean
Summary
\Internal method to set the focused node.
Description
This methods is called by the property setter for the focused node as well as from other places to do the actual change.
It takes the parameter Ask to optionally switch off (Ask = False) triggering the OnFocusChanging event.
@@TBaseVirtualTree.DoGetAnimationType
Summary
Determines the type of animation to be used.
Description
Windows 98 and Windows 2000 introduced two ways of animating hints when they appear: a sliding window and a fading
window. Virtual Treeview implements both animation types and also supports system dependent animations. This allows to
use the animation type enabled in the particular system on which the tree currently runs. Additonally, there is a check
for MMX to do a fallback if fade animation is specified but no MMX available. In this case sliding is used. Starting with
Windows 2000 and Windows ME the hint animation can even be be switched off entirely. Also this case is handled by this
method.
@@TBaseVirtualTree.DoGetNodeWidth@PVirtualNode@TColumnIndex@TCanvas
Summary
Overridable method which always retuns 0.
Description
Descentants override this method to return a value which describes the width of a node. This is the inner width of the
node excluding tree lines etc. So TVirtualStringTree returns the width of the node caption (plus text margin).
@@TBaseVirtualTree.DoGetPopupMenu@PVirtualNode@TColumnIndex@TPoint
Summary
Overridable method which triggers the OnGetPopup event.
Description
This method does an automatic parent traversal in the tree hierarchy to find a matching popup menu.
@@TBaseVirtualTree.DoPaintDropMark@TCanvas@PVirtualNode@TRect
Summary
Overridable method which draws the small line on top of a nodes image depending on the current drop state.
Description
This method draws a simple polyline using Colors.DropMarkColor. Descentant can override this method to customize the
appearance of the drop mark.
@@TBaseVirtualTree.DoPaintNode@TVTPaintInfo
Summary
Overridable method which does nothing.
Description
Descentants override this method to paint the content of the node. For instance string trees draw the node's caption.
@@TBaseVirtualTree.DoPopupMenu@PVirtualNode@TColumnIndex@TPoint
Summary
Overridable method which shows the popup menu for the given node.
Description
<B>Node</B> and <B>Column</B> describe the cell for which the menu should be shown. <B>Position</B> determines the place
(in client coordinates of the tree window) where to show the menu.
@@TBaseVirtualTree.DoScroll@Integer@Integer
Summary
Overridable method which triggers the OnScroll event.
Description
This method is the ideal place if you want to synchronize other controls with the tree. The event is triggered whenever
the tree is scrolled (by the user or programmatically). <B>DeltaX</B> and <B>DeltaY</B> contain the relative values the
position changed about.
@@TBaseVirtualTree.DoSetOffsetXY@TPoint@TScrollUpdateOptions@PRect
Summary
\Internal core routine to set the tree's scroll position.
Description
The method takes the <B>Value</B> structure which contains the new absolute scroll positions, both horizontal and
vertical. <B>Options</B> specifies what should happen in the update process. A combination of the following values is
possible:
* <COLOR Blue>suoRepaintHeader</COLOR>, If suoUpdateNCArea is also set then invalidate the header to refresh its
screen image, otherwise it is ignored.
* <COLOR Blue>suoRepaintScrollbars</COLOR>, If suoUpdateNCArea is also set then repaint both scrollbars after
updating them, otherwise it is ignored.
* <COLOR Blue>suoScrollClientArea</COLOR>, Scroll and invalidate the proper part of the client area.
* <COLOR Blue>suoUpdateNCArea</COLOR>, Update non-client area (scrollbars, header).
@@TBaseVirtualTree.DoTimerScroll
Summary
Callback method which is triggered whenever the scroll timer fires.
Description
This method is called to do an automatic tree scroll when the user selects nodes with the mouse (multiselection only).
@@TBaseVirtualTree.DragDrop@IDataObject@Integer@TPoint@Integer
Summary
Helper method, which is used when a drag operation is finished.
Description
This method is called by the TVTDragManager.Drop and prepares the list of available clipboard formats to be passed to
DoDragDrop.
@@TBaseVirtualTree.DragFinished
Summary
Called when a drag operation is finished (accepted or cancelled).
Description
This method is nternally used ito make up for the swallowed mouse-up messages during drag' drop.
@@TBaseVirtualTree.Dragging
Summary
\Returns true if a drag'n drop operation is in progress.
Description
The method returns true if currently a drag'n drop operation is in progress, which involves this tree view.
@@TBaseVirtualTree.EditNode@PVirtualNode@TColumnIndex
Summary
Starts editing the given node if allowed to.
Description
This method can be used by the application to manually start editiing of a particular node. Column determines hereby in
which column the node should be edited. This parameter determines the target column regardless whether toExtendedFocus is
set in TreeOptions.SelectionOptions or not. The given node must be enabled, otherwise edit start fails.
See Also
DoEdit
@@TBaseVirtualTree.EndEditNode
Summary
Stops node editing if it was started before.
Description
EndEditNode stops node editing and accepts the result (which must be set by the edit link).
See Also
<LINK Editing.htm, Editors and editing>, EditNode, DoEdit
@@TBaseVirtualTree.EndSynch
Summary
Counterpart to BeginSynch.
Description
Counts down the internal synchronous mode counter and ends synchronous mode when this counter reaches zero.
See Also
BeginSynch, BeginUpdate, EndUpdate
@@TBaseVirtualTree.EndUpdate
Summary
Resets the update lock set by BeginUpdate.
Description
This method is the counterpart to BeginUpdate and decreases the internal update count value. If this value reaches 0 then
updates of the tree window will be allowed again. Additionally, some pending operations, which might be started during
the update lock, are finished. This includes tasks like updating the selection list, validating the cache and sorting the
tree if in auto sort mode.
@@TBaseVirtualTree.FindNodeInSelection@PVirtualNode@Integer@Integer@Integer
Summary
Helper method to find the given node in the current selection.
Description
This method does a binary search of the given node in the internal selection array which is sorted by memory references.
The search is limited to the area given by <B>LowBound</B> and <B>HighBound</B>. If the node could be found then true is
returned and <B>Index</B> is set to the found node position.
@@TBaseVirtualTree.FinishCutOrCopy
Summary
Stops any pending cut or copy clipboard operation.
Description
This method is used by the tree (and can be used by the application too) to stop any pending cut or copy clipboard
\operation. If a cut operation is pending then nodes currently marked with the vsCutOrCopy state are deleted.
@@TBaseVirtualTree.FlushClipboard
Summary
Renders all pending clipboard data.
Description
Used to render the data which is currently on the clipboard and finishes so the delayed rendering. This method is useful
if the tree is about to be destroyed but data from this tree is still on the clipboard and should stay there. If this
method is not used then any pending clipboard operation is cancelled on tree destruction (by the tree instance which
currently has data on the clipboard) and the clipboard itself is cleared.
@@TBaseVirtualTree.FullCollapse@PVirtualNode
Summary
Collapses all nodes in the tree.
Description
Call this method to bring all nodes in the tree into a collapsed state. This method is used to reset the vsExpanded state
in all nodes in the tree. Nodes which are not yet initialized are also not expanded by definition and therefore do not
need initialization.
See Also
FullExpand
@@TBaseVirtualTree.FullExpand@PVirtualNode
Summary
Expands all nodes in the tree.
Description
Call this method to bring all nodes in the tree into an expanded state. This method expands every node in the tree and
initializes nodes which are not yet initialized to expand them too if necessary. Since this will validate every node in
the tree it is counterproductive and against the <LINK Paradigm.htm, Virtual Paradigm>.
@@TBaseVirtualTree.GetColumnClass
Summary
\Returns the class to be used to manage columns in the tree.
Description
GetColumnClass is a special purpose method to return a certain class which is used by the tree for the columns.
TVirtualBaseTree always returns TVirtualTreeColumn but descentants can override this method to return own classes.
@@TBaseVirtualTree.GetDisplayRect@PVirtualNode@TColumnIndex@Boolean@Boolean
Summary
\Returns the visible region used by the given node in client coordinates.
Description
If the given node cannot be found (because one of its parents is collapsed or it is invisible) then an empty rectangle is
returned. If <B>TextOnly</B> is true then only the text bounds are returned, that is, the resulting rectangle's left and
right border are updated according to the bidi mode, alignment and text width of the node. If <B>Unclipped</B> is true
(which only makes sense if also <B>TextOnly</B> is true) then the calculated text rectangle is not clipped if the text
does not entirely fit into the text space. This is special handling needed for hints.
If Column is NoColumn then the entire client width is used before determining the node's width otherwise the bounds of
the particular column are used.
Note
<B>Column</B> must be a valid column and is used independent of whether the header is visible or not.
@@TBaseVirtualTree.GetFirst
Summary
Group of node navigation functions.
Description
This group of navigation functions is used to return the first node in the tree or first sub node with various
properties.
<TABLE>
GetFirst First node in the tree with initialization.
GetFirstChild First child node with initialization.
GetFirstCutCopy First node in cut/copy set (no initialization needed).
GetFirstInitialized First initialized node in the tree (no initialization needed).
GetFirstNoInit First node in the tree without initialization.
GetFirstVisible First visible node in the tree with initialization.
GetFirstVisibleChild First visible child of a node with initialization.
GetFirstVisibleChildNoInit First visible child of a node without initialization.
GetFirstVisibleNoInit First visible node in the tree without initialization.
</TABLE>
@@TBaseVirtualTree.GetFirstChild@PVirtualNode
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstCutCopy
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstInitialized
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstNoInit
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstSelected
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstVisible
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstVisibleChild@PVirtualNode
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstVisibleChildNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetFirstVisibleNoInit
<COMBINE TBaseVirtualTree.GetFirst>
@@TBaseVirtualTree.GetHeaderClass
Summary
\Returns the header class to be used by the tree.
Description
As with several other classes in Virtual Treeview (e.g. drag manager, options etc.) also a customized header class is
supported, which allows applications or descendant classes to implement their very own header class with special
behavior. This is a further element to make Virtual Treeview as flexible as possible.
@@TBaseVirtualTree.GetHitTestInfoAt@Integer@Integer@Boolean@THitInfo
Summary
\Returns information about the node at the given position.
Description
This method returns information about the given hit position. If the position is not within the client area then the
\result is either of hiAbove, hiBelow, hiToLeft or hiToRight, depending on the side. If the position is within the client
area but no node is hit (e.g. when the tree is empty) then hiNowhere is returned, otherwise the node is examined and <B>HitInfo</B>
is filled with information about which node is hit by this position, which column is involved and where on the node is
the hit (e.g. the caption, the expand/collapse button or the state image).
The parameter <B>Relative</B> is used to tell the method how to interpret the given coordinates. If this property is true
then <B>X</B> and <B>Y</B> are given in client coordinates of the tree window, otherwise they represent absolute
coordinates of the <LINK TreeImage.htm, virtual tree image>.
@@TBaseVirtualTree.GetLast@PVirtualNode
Summary
Group of node navigation functions.
Description
This group of navigation functions is used to return the last node in the tree or last sub node with various properties.
<TABLE>
GetLast Last node in the tree with initialization.
GetLastChild Last child node with initialization.
GetLastChildNoInit Last child node without initialiization.
GetLastInitialized Last initialized node in the tree (no initialization needed).
GetLastNoInit Last node in the tree without initialization.
GetLastVisible Last visible node in the tree with initialization.
GetLastVisibleChild Last visible child of a node with initialization.
GetLastVisibleChildNoInit Last visible child of a node without initialization.
GetLastVisibleNoInit Last visible node in the tree without initialization.
</TABLE>
@@TBaseVirtualTree.CountLevelDifference@PVirtualNode@PVirtualNode
Summary
Determines the level difference of two nodes.
Description
This method counts how many indentation levels the given nodes are apart. If both nodes have the same parent then the
difference is 0 otherwise the result is basically GetNodeLevel(Node2) - GetNodeLevel(Node1), but with sign. If the result
is negative then Node2 is less intended than Node1.
@@TBaseVirtualTree.CountVisibleChildren@PVirtualNode
Summary
Determines the number of visible child nodes of the given node.
Description
CountVisibleChildren iterates through all child nodes of <B>Node</B> and counts how many of them have the vsVisible state
set.
@@TBaseVirtualTree.Create@TComponent
Summary
Constructor of the control
Description
The constructor initializes certain properties to their default values.
@@TBaseVirtualTree.CreateParams@TCreateParams
Summary
Prepares the creation of the controls window handle.
Description
CreateParams is overriden to allow to set certain window styles for the control.
@@TBaseVirtualTree.CreateWnd
Summary
Initializes data, which depends on the window handle.
Description
Some properties must be preset first after the window handle was created. CreateWnd is the perfect place for this.
@@TBaseVirtualTree.DefineProperties@TFiler
Summary
Helper method to customize loading and saving persistent tree data.
Description
There were heavy changes in some properties during development of VT. This method helps to make migration easier by
reading old properties manually and put them into the new properties as appropriate. These old properties are never
written again and silently disappear.
Another task of this method is to work around the problem that TCollection is not streamed correctly when using Visual
Form Inheritance (VFI).
@@TBaseVirtualTree.Destroy
Summary
Destructor of the control.
Description
Frees any allocated data in the tree. All pending operations will be stopped and any remaining node is freed.
@@TBaseVirtualTree.DetermineHiddenChildrenFlag@PVirtualNode
Summary
Determines whether all children of a given node are hidden.
Description
Virtual Treeview supports a feature, which is called <COLOR Blue>node button auto hide</COLOR>. What happens is that when
all children of a node are hidden then the expand button for this node is automatically removed. In order to know about
the visibility state of the child nodes an internal flag is maintained, which allows to quickly decide about the button
display. DetermineHidenChildren is the update method for cases where more than one child node changed.
See Also
vsVisible, toAutoHideButtons
@@TBaseVirtualTree.DetermineHiddenChildrenFlagAllNodes
Summary
Determines whether all children of all nodes are hidden.
Description
As extension to DeterminHiddenChildren this method iteratively determines the hidden children flag for all existing nodes
in the tree. This is only used for large updates. No node will be initialized in this process.
@@TBaseVirtualTree.DetermineHitPositionLTR@THitInfo@Integer@Integer@TAlignment
Summary
Determines the hit position within a node with left-to-right and right-to-left orientation.
Description
This method, together with its counter part DetermineHitPositionRTL, is used in the process of figuring out where the a
given position is located in relation to a node.
@@TBaseVirtualTree.DetermineHitPositionRTL@THitInfo@Integer@Integer@TAlignment
<COMBINE TBaseVirtualTree.DetermineHitPositionLTR@THitInfo@Integer@Integer@TAlignment>
@@TBaseVirtualTree.DoAutoScroll@Integer@Integer
Summary
Enables or disables the auto scroll timer.
Description
This method determines whether the tree needs to be scrolled (the mouse is near the borders) and enables or disables the
\internal scroll timer which triggers the DoTimerScroll method.
@@TBaseVirtualTree.DragCanceled
Summary
Called by the VCL when a drag'n drop operation was canceled by the user.
Description
DragCanceled is used to do some housekeeping in the tree.
@@TBaseVirtualTree.GetLastChild@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastChildNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastInitialized@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastVisible@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastVisibleChild@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastVisibleChildNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetLastVisibleNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetLast@PVirtualNode>
@@TBaseVirtualTree.GetMaxColumnWidth@TColumnIndex
Summary
\Returns the width of the largest node in the given column.
Description
This method is mainly used to determine a minimal width of the given column without having to shorten a node caption.
Since the method has to go through all visible nodes and initialize them to learn about their width it might be time
consuming to call this method and circumvents also the virtual approach of the tree.
@@TBaseVirtualTree.GetMaxRightExtend
Summary
Determines the maximum with of the currently visible part of the tree.
Description
This method is similar to GetMaxColumnWidth, but determines the width of the tree if no columns are used. This method is
used for determining the horizontal scroll range for the columnless case.
@@TBaseVirtualTree.GetNativeClipboardFormats@TFormatEtcArray
Summary
Used to let descendants and the application add their own supported clipboard formats.
Description
GetNativeClipboardFormats returns the supported clipboard formats of the tree in the native CF_* form as used in
IDataObject. This includes all formats which are listed in the ClipboardFormats property as well as any changes made by
the OnGetUserClipboardFormats event if a handler for it is attached.
@@TBaseVirtualTree.GetNext@PVirtualNode
Summary
Group of node navigation functions.
Description
This group of navigation functions is used to return the next node relative to a given node in the tree with various
properties.
<TABLE>
GetNext Next node in the tree with initialization.
GetNextCutCopy Next node in the cut/copy set (no initialization needed).
GetNextInitialized Next initialized node in the tree (no initialization needed).
GetNextNoInit Next node in the tree without initialization.
GetNextSelected Next selected node (no initialization needed).
GetNextSibling Next sibling node with initialization.
GetNextVisible Next visible node in the tree with initialization.
GetNextVisibleNoInit Next visible node in the tree without initialization.
GetNextVisibleSibling Next visible sibling node with initialization.
GetNextVisibleSiblingNoInit Next visible sibling node without initialization.
</TABLE>
@@TBaseVirtualTree.GetNextCutCopy@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextInitialized@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextSelected@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextSibling@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextVisible@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextVisibleNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextVisibleSibling@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNextVisibleSiblingNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetNext@PVirtualNode>
@@TBaseVirtualTree.GetNodeData@PVirtualNode
Summary
\Returns the address of the user data area of the given node.
Description
GetNodeData returns the address of the user data area for <B>Node</B>. It is strongly recommended to use this method
instead directly accessing @Node.Data. Some trees require internal data for their own use which is also stored after
Node.Data and the actual user data (application data) follows then this internal data. GetNodeData takes care of this
situation.
@@TBaseVirtualTree.GetNodeLevel@PVirtualNode
Summary
\Returns the indentation level of the given node.
Description
GetNodeLevel returns the level of <B>Node</B>. This level is determined by the number of parent nodes (excluding the
hidden root node). Top level nodes have the level 0, their direct child nodes have level 1 etc.
@@TBaseVirtualTree.GetOptionsClass
Summary
Customization helper to determine which options class the tree should use.
Description
GetOptionsClass is a special purpose method to return a certain class which is used by the tree for its options.
TVirtualBaseTree always returns TCustomVirtualTreeOptions but descendants can override this method to return own classes.
For ease of use it makes much sense to always use the same name for the tree's options (which is TreeOptions). By using a
customized options class, however, the wrong type is returned by this property. Hence it is meaningful to override
TreeOptions and return the derived options class. To make this work the tree descendant must additionally provide new
access methods for this property. An example can be seen in TVirtualStringTree:
<CODE>
TVirtualStringTree = <B>class</B>(TCustomVirtualStringTree)
<B>private</B>
<B>function</B> GetOptions: TStringTreeOptions;
<B>procedure</B> SetOptions(<B>const</B> Value: TStringTreeOptions);
<B>protected</B>
<B>function</B> GetOptionsClass: TTreeOptionsClass; <B>override</B>;
<B>public</B>
<B>property</B> Canvas;
<B>published</B>
...
<B>property</B> TreeOptions: TStringTreeOptions <B>read</B> GetOptions <B>write</B> SetOptions;
...
<B>end</B>;
...
//----------------- TVirtualStringTree ---------------------------------------------------------------------------------
<B>function</B> TVirtualStringTree.GetOptions: TStringTreeOptions;
<B>begin</B>
\Result := FOptions <B>as</B> TStringTreeOptions;
<B>end</B>;
//----------------------------------------------------------------------------------------------------------------------
<B>procedure</B> TVirtualStringTree.SetOptions(<B>const</B> Value: TStringTreeOptions);
<B>begin</B>
FOptions.Assign(Value);
<B>end</B>;
//----------------------------------------------------------------------------------------------------------------------
<B>function</B> TVirtualStringTree.GetOptionsClass: TTreeOptionsClass;
<B>begin</B>
\Result := TStringTreeOptions;
<B>end</B>;
</CODE>
@@TBaseVirtualTree.GetPrevious@PVirtualNode
Summary
Group of node navigation functions.
Description
This group of navigation functions is used to return the previous node relative to a given node in the tree with various
properties.
<TABLE>
GetPrevious Previous node in the tree with initialization.
GetPreviousInitialized Previous initialized node in the tree (no initialization needed).
GetPreviousNoInit Previous node in the tree without initialization.
GetPreviousSibling Previous sibling node with initialization.
GetPreviousVisible Previous visible node in the tree with initialization.
GetPreviousVisibleNoInit Previous visible node in the tree without initialization.
GetPreviousVisibleSibling Previous visible sibling node with initialization.
GetPreviousVisibleSiblingNoInit Previous visible sibling node without initialization.
</TABLE>
@@TBaseVirtualTree.GetPreviousInitialized@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetPreviousNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetPreviousSibling@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetPreviousVisible@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetPreviousVisibleNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetPreviousVisibleSibling@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetPreviousVisibleSiblingNoInit@PVirtualNode
<COMBINE TBaseVirtualTree.GetPrevious@PVirtualNode>
@@TBaseVirtualTree.GetSortedCutCopySet@Boolean
Summary
\Returns a sorted list of nodes, which are marked for s cut or copy clipboard operation.
Description
\Returns a list of nodes which are flagged with vsCutOrCopy, sorted in logical order, that is, as they appear in the
tree. If <B>Resolve</B> is true then nodes which are children of other cut/copy nodes are not put into the new array.
This feature is particularly important when doing drag'n drop as in this case all selected node plus their children need
to be considered. A selected node, which is a child (grand child etc.) of another selected node is then automatically
included and doesn't need to be explicitly mentioned in the returned selection array.
Note
The caller is responsible for freeing the array. Allocation is done here. Usually, though, freeing the array doesn't need
additional attention as it is automatically freed by Delphi when it gets out of scope.
@@TBaseVirtualTree.GetSortedSelection@Boolean
Summary
\Returns a sorted list of all currently selected nodes.
Description
\Returns a list of selected nodes sorted in logical order, that is, as they appear in the tree. If <B>Resolve</B> is true
then nodes which are children of other selected nodes are not put into the new array. This feature is in particuar
important when doing drag'n drop as in this case all selected node plus their children need to be considered. A selected
node which is child (grand child etc.) of another selected node is then automatically included and doesn't need to be
explicitely mentioned in the returned selection array.
Note
The caller is responsible for freeing the array. Allocation is done here. Usually, though, freeing the array doesn't need
additional attention as it is automatically freed by Delphi when it gets out of scope.
@@TBaseVirtualTree.GetTextInfo@PVirtualNode@TColumnIndex@TFont@TRect@WideString
Summary
Helper method for node editors, hints etc.
Description
GetTextInfo is used to define a base access method for node data and the associated font from node editors and for hints.
@@TBaseVirtualTree.GetTreeFromDataObject@IDataObject
Summary
OLE drag'n drop and clipboard support method.
Description
\Returns the owner/sender of the given data object by means of a special clipboard format or nil if the sender is in
another process or no virtual tree at all.
@@TBaseVirtualTree.GetTreeRect
Summary
\Returns the size of the virtual tree image.
Description
GetTreeRect can be used to determine the full size of the <LINK TreeImage.htm, tree image> as used for painting etc.
@@TBaseVirtualTree.GetVisibleParent@PVirtualNode
Summary
\Returns the first (nearest) parent node, which is visible.
Description
GetVisibleParent returns the first (nearest) parent node of <B>Node</B> which is visible. This method is one of the
seldom cases (if not the only one) where the hidden root node could be returned.
@@TBaseVirtualTree.HasAsParent@PVirtualNode@PVirtualNode
Summary
Determines if the given node has got another node as one of its parents.
Description
Determines whether <B>Node</B> has got <B>PotentialParent</B> as one of its parents.
@@TBaseVirtualTree.HasPopupMenu@PVirtualNode@TColumnIndex@TPoint
Summary
Determines whether there is a pop up menu assigned to the tree.
Description
This overridable method is used to determine whether there is a pop up menu assigned to the tree or can be retrieve via
the OnGetPopupMenu event for a particular node. This is necessary for the tree to know how to deal with various condition
in an mouse button down event.
@@TBaseVirtualTree.InsertNode@PVirtualNode@TVTNodeAttachMode@Pointer
Summary
Inserts a new node and returns it to the caller.
Description
Adds a new node relative to <B>Node</B>. The final position is determined by <B>Mode</B>. <B>UserData</B> can be used to
set the first 4 bytes of the user data area to an initial value, which can be used in OnInitNode and will also cause to
trigger the OnFreeNode event (if \<\> <B>nil</B>) even if the node is not yet "officially" initialized.
InsertNode is a compatibility method and will implicitly validates the given node if the new node is to be added as child
node. This is however against the virtual paradigm and hence I dissuade from its usage.
@@TBaseVirtualTree.InternalData@PVirtualNode
Summary
\Returns the address of the internal data for a tree class.
Description
In TBaseVirtualTreeview this method returns nil but should be overridden in descendants to allow proper access to the
\internal data of <B>Node</B> if the descendant tree has allocated internal data.
See Also
<LINK DataHandling.htm, Data handling>
@@TBaseVirtualTree.InvalidateCache
Summary
Empties the internal node cache and marks it as invalid.
Description
Marks the internal node cache as being invalid. This will cause a cache validation run next time ValidateCache is called.
The internal node cache is used to speed up display in Virtual Treeview. It contains node references with a distance of
CacheThreshold nodes along with their vertical absolute position, which makes it possible to quickly find the position of
a node for display, hit tests and so on.
@@TBaseVirtualTree.InvalidateChildren@PVirtualNode@Boolean
Summary
Invalidates all children of the given node.
Description
Invalidates <B>Node</B> and its immediate children. If <B>Recursive</B> is true then all grandchildren are invalidated as
well. The node itself is initialized if necessary and its child nodes are recreated (and initialized too if <B>Recursive</B>
is true).
@@TBaseVirtualTree.InvalidateColumn@TColumnIndex
Summary
Invalidates the client area part of a column.
Description
Invalidates the client area part of a column.
@@TBaseVirtualTree.InvalidateNode@PVirtualNode
Summary
Invalidates the given node.
Description
InvalidateNode initiates repaint of the given node by calling InvalidateRect with the node's display rectangel and
\returns this rectangle.
@@TBaseVirtualTree.InvalidateToBottom@PVirtualNode
Summary
Invalidates the client area starting with the top position of the given node.
Description
InvalidateToBottom initiates repaint of client area starting at given node. If this node is not visible or not yet
initialized then nothing happens.
@@TBaseVirtualTree.InvertSelection@Boolean
Summary
Inverts the current selection.
Description
InvertSelection inverts the current selection, so nodes, which are selected become unselected and vice versa. If <B>VisibleOnly</B>
is true then only visible nodes are considered.
@@TBaseVirtualTree.IsEditing
Summary
Tells the caller whether the tree is currently in edit mode.
Description
Just a simple shortcut to test the tsEditing state.
@@TBaseVirtualTree.IsMouseSelecting
Summary
Tell the caller whether the tree is currently in draw selection mode.
Description
IsMouseSelecting returns true if draw selection by the user is active or pending.
@@TBaseVirtualTree.IterateSubtree@PVirtualNode@TVTGetNodeProc@Pointer@TVirtualNodeStates@Boolean@Boolean
Summary
Iterator method to go through all nodes of a given sub tree.
Description
IterateSubtree iterates through all children and grandchildren etc. of <B>Node</B> (or the entire tree if <B>Node</B> =
nil) and calls for each node the provided callback method (which must not be empty). <B>Filter</B> determines which nodes
are to be considered (an empty set denotes all nodes). If <B>DoInit</B> is true then nodes which aren't initialized yet
will be initialized.
During execution of the callback the application can set <B>Abort</B> to true. In this case the iteration is stopped and
the last accessed node (the one on which the callback set <B>Abort</B> to true) is returned to the caller. Otherwise (no
abort) nil is returned.
Note
An application should <B>not</B> modify the content of the tree (e.g. delete nodes) during the iteration, otherwise the
\outcome is unpredictable and may result in an access violation.
@@TBaseVirtualTree.LoadFromFile@TFileName
Summary
Loads previously streamed out tree data back in again.
Description
LoadFromFile clears the current content of the tree and loads a new structure from the given file.
See Also
AddFromStream
@@TBaseVirtualTree.LoadFromStream@TStream
<COMBINE TBaseVirtualTree.LoadFromFile@TFileName>
@@TBaseVirtualTree.Paint
Summary
TControl's Paint method used here to display the tree.
Description
Overriden method to paint the tree image. The actual work is however done in PaintTree.
@@TBaseVirtualTree.PaintTree@TCanvas@TRect@TPoint@TVTInternalPaintOptions@TPixelFormat
Summary
Main paint routine for the tree image.
Description
PaintTree is the core paint routine used to draw any part of the tree image to any canvas. It is responsible for
maintaining the paint cycles per node as well as coordinating drawing of the various parts of the tree image. <B>TargetCanvas</B>
is the canvas to which to draw the tree image. This is usually the tree window itself but could well be a bitmap or
printer canvas. <B>Window</B> determines which part of the entire tree image to draw. The full size of the virtual image
is determined by GetTreeRect. <B>Target</B> is the position in <B>TargetCanvas</B> where to draw the tree part specified
by <B>Window</B>. <B>PaintOptions</B> determines what of the tree to draw. For different tasks usually different parts
need to be drawn, with a full image in the window, selected only nodes for a drag image etc.
See Also
<LINK TreeImage.htm, Tree image and tree window>
@@TBaseVirtualTree.PasteFromClipboard
Summary
Inserts the content of the clipboard into the tree.
Description
PasteFromClipboar reads what is currently on the clipboard into the tree (if the format is supported). If the application
wants to have text or special formats to be inserted then it must implement its own code (OLE). Here only the native tree
format is accepted.
@@TBaseVirtualTree.ProcessDrop@IDataObject@PVirtualNode@Integer@TVTNodeAttachMode
Summary
Helper method to ease OLE drag'n drop operations.
Description
ProcessDrop can be used in a OnDragDrop handler to let the tree view handle a drop operation of native tree data. The
method only prepares some variables and calls then the more universal ProcessOLEData method.
@@TBaseVirtualTree.ProcessOLEData@TBaseVirtualTree@IDataObject@PVirtualNode@TVTNodeAttachMode@Boolean
Summary
Takes serialized OLE tree data and reconstructs the former structure.
Description
PrcessOLEData recreates the (sub) tree structure serialized into memory and provided by DataObject. The new nodes are
attached to the passed node or the hidden root node if <B>TargetNode</B> is nil, according to <B>Mode</B>. <B>Optimized</B>
can be set to true if the entire operation happens within the same process (i.e. sender and receiver of the OLE operation
are located in the same process). <B>Optimized</B> = true makes only sense if the operation to carry out is a move hence
it is also the indication of the operation to be done here. <B>Source</B> is the source of the OLE data and only of use
(and usually assigned) when an OLE operation takes place in the same application.
The function returns true on success, i.e. the CF_VIRTUALTREE format is supported by the data object and the structure
could be recreated, otherwise false.
@@TBaseVirtualTree.ReinitChildren@PVirtualNode@Boolean
Summary
Forces all child nodes of Node to be reinitialized.
Description
ReinitChildren forces all child nodes of <B>Node</B> to be reinitialized. If <B>Recursive</B> is true then also the
grandchildren are reinitialized.
@@TBaseVirtualTree.ReinitNode@PVirtualNode@Boolean
Summary
Forces a reinitialization of the given node.
Description
ReinitNode forces <B>Node</B> and all its children (if <B>Recursive</B> is true) to be initialized again without
modifying any data in the nodes nor deleting children (unless the application requests a different amount).
@@TBaseVirtualTree.RemoveFromSelection@PVirtualNode
Summary
Removes the given node from the current selection.
Description
Removes the vsSelected style from <B>Node's</B> states and also removes <B>Node</B> from the internal selection array.
@@TBaseVirtualTree.RenderOLEData@TFormatEtc@TStgMedium@Boolean
Summary
Renders pending OLE data.
Description
RenderOLData is called by TVTDataObject.GetData when a consumer of clipboard data actually requests the data. The base
tree view only renders the native tree format, which is a chunk based stream of node data. The format to be rendered is
specified in FormatEtcIn.cfFormat and is one of the formats which are returned from GetNativeClipboardFormats.
Descendants may override RenderOLEData in order to render other formats like HTML text. In TBaseVirtualTreeview this
method calls the OnRenderOLEData event for all formats, except CF_VIRTUALTREE.
@@TBaseVirtualTree.RepaintNode@PVirtualNode
Summary
Causes the treeview to repaint the given node.
Description
RepaintNode causes an immediate repaint of <B>Node</B> and returns once repainting has finished.
@@TBaseVirtualTree.ResetNode@PVirtualNode
Summary
Resets the given node to uninitialized.
Description
ResetNode deletes all children of <B>Node</B> and marks it as being uninitialized.
@@TBaseVirtualTree.SaveToFile@TFileName
Summary
Saves the entire content of the tree into a file or stream.
Description
Saves the entire content of the tree into a file or stream.
See Also
LoadFromStream, AddFromStream
@@TBaseVirtualTree.SaveToStream@TStream@PVirtualNode
<COMBINE TBaseVirtualTree.SaveToFile@TFileName>
@@TBaseVirtualTree.ScrollIntoView@PVirtualNode@Boolean@Boolean
Summary
Scrolls the tree so that the given node comes in the client area.
Description
ScrollIntoView scrolls the tree so that the given node is in the client area and returns true if the tree really has been
scrolled (e.g. to avoid further updates) else it returns false. If extened focus is enabled then the tree will also
horizontally scrolled if needed. All collapsed parents of the node are expanded, forming so a visible path to <B>Node</B>.
@@TBaseVirtualTree.SelectAll@Boolean
Summary
Selects all nodes in the tree.
Description
SelectAll select all existing nodes in the tree. If <B>VisibleOnly</B> is true then only visible nodes are selected.
@@TBaseVirtualTree.SelectNodes@PVirtualNode@PVirtualNode@Boolean
Summary
Selects a range of nodes.
Description
SelectNodes selects a range of nodes and unselects all other possibly selected nodes which are not in this range if <B>AddOnly</B>
is false. <B>EndNode</B> must be visible while <B>StartNode</B> does not necessarily, as in the case where the last
focused node is the start node but it is a child of a node which has been collapsed previously. In this case the first
visible parent node is used as start node. <B>StartNode</B> can be nil in which case the very first node in the tree is
used.
@@TBaseVirtualTree.Sort@PVirtualNode@TColumnIndex@TSortDirection@Boolean
Summary
Sorts the given node.
Description
Sort sorts the child nodes of <B>Node</B>. The application is queried about how to sort via the OnCompareNodes event. <B>Column</B>
is simply passed to the the compare function so the application can also sort in a particular column. In order to free
the application from taking care about the sort direction the parameter <B>Direction</B> is used. This way the
application can always compare as would the node be sorted in increasing direction , while Sort reorders nodes according
to this flag.
@@TBaseVirtualTree.SortTree@TColumnIndex@TSortDirection@Boolean
Summary
Sorts the entire tree view.
Description
SortTree sorts the entire tree by applying Sort to every node which has got children.
Note
This method initializes all nodes in the tree which may not only take quite a while but is also against the <LINK Paradigm.htm, virtual paradigm>
and therefore usually not recommended.
@@TBaseVirtualTree.ToggleNode@PVirtualNode
Summary
Changes a node's expand state to the opposite state.
Description
Toggle node expands <B>Node</B> if it is collapsed currently and vice versa.
@@TBaseVirtualTree.ToggleSelection@PVirtualNode@PVirtualNode
Summary
Toggles the selection state of a range of nodes.
Description
ToggleSelection switchs the selection state of a range of nodes, so selected nodes become unselected and vice versa. This
method is specifically designed to help selecting ranges with the keyboard and considers therefore the range anchor.
@@TBaseVirtualTree.UnselectNodes@PVirtualNode@PVirtualNode
Summary
Deselects a range of nodes.
Description
UnselectNodes deselects a given range of nodes. <B>EndNode</B> must be visible while <B>StartNode</B> is not required to
be so as in the case where the last focused node is the start node but it is a child of a node which has been collapsed
previously. In this case the first visible parent node is used as start node. <B>StartNode</B> can be nil in which case
the very first node in the tree is used.
@@TBaseVirtualTree.UpdateHorizontalScrollBar@Boolean
<COMBINE TBaseVirtualTree.UpdateScrollBars@Boolean>
@@TBaseVirtualTree.UpdateScrollBars@Boolean
Summary
Applies changes to the horizontal and vertical scrollbars.
Description
UpdateScrollbars (and its counterparts for vertical and horizontal scrollbars) is the core method to set the scrollbar's
properties like range, page size etc.
@@TBaseVirtualTree.UpdateVerticalScrollBar@Boolean
<COMBINE TBaseVirtualTree.UpdateScrollBars@Boolean>
@@TBaseVirtualTree.UseRightToLeftReading
Summary
Helper method for right-to-left layout.
Description
UseRightToLeftReading had to be overriden in order to overcome a limitation introduced by the VCL. The VCL only allows a
window to be in right-to-left reading order if the operating system is prepared to handle this (e.g. an arabic Windows
98). Virtual Treeview however does most of the RTL stuff handle itself, also on non-RTL system.
@@TBaseVirtualTree.ValidateCache
Summary
Initiates the validation of the internal node cache.
Description
If the node cache is marked as being invalid then this method puts the tree into the worker thread's list and awakes then
the thread so that the validation is performed in the background.
See Also
InvalidateCache
@@TBaseVirtualTree.ValidateChildren@PVirtualNode@Boolean
Summary
Validates all children of a given node.
Description
ValidateChildren ensures that the children of the given node (and all their children, if <B>Recursive</B> is true) are
initialized. <B>Node</B> must already be initialized. If <B>nil</B> is passed to the method the hidden root node is used
(which makes only sense if <B>Recursive</B> is true, in which case the entire tree is validated).
@@TBaseVirtualTree.ValidateNode@PVirtualNode@Boolean
Summary
Validates a given node.
Description
ValidateNode ensures that the given node (and all its children, if <B>Recursive</B> is true) are initialized. If <B>Node</B>
is <B>nil</B> then the hidden root node is used (which makes only sense if <B>Recursive</B> is true, in which case the
entire tree is validated).
@@TBaseVirtualTree.ValidateNodeDataSize@Integer
Summary
Helper method for node data size initalization.
Description
ValidateNodeDataSize is called from MakeNewNode if the currently set node data size is -1, which indicates it has not yet
been determined. The method calls the event OnGetNodeDataSize allowing so the application to compute now its data
requirement.
@@TBaseVirtualTree.WndProc@TMessage
Summary
Redirected window procedure to do some special processing.
Description
WndProc has been overriden to allow the header to handle certain messages (which are forwarded by the tree) as well as to
do some other special handling internal to the tree.
@@TBaseVirtualTree.WriteChunks@TStream@PVirtualNode
Summary
Writes the core chunks for the given node to the given stream.
Description
WriteChunks is part of the streaming system in Virtual Treeview and writes the core chunks for <B>Node</B> into <B>Stream.
</B>Descentants can optionally override this method to add other node specific chunks. This streaming is used when the
tree must be saved to disk or a stream used e.g. for clipboard operations.
Note
Keep in mind that this method is also called for the hidden root node. Using this fact in descendants you can create a
kind of "global" chunk set not directly bound to a specific node.
See Also
WriteNode, SaveToStream
@@TBaseVirtualTree.WriteNode@TStream@PVirtualNode
Summary
Writes the cover (envelop) chunk for the given node to the given stream.
Description
WriteNode writes the cover chunk for <B>Node</B> to <B>Stream</B> and initiates writing child nodes and chunks. This
method is part of the streaming system used in Virtual Treeview.
See Also
WriteChunks, WriteToStream
@@TClipboardFormats.Create@TBaseVirtualTree
Summary
Constructor of the class.
Description
Create initializes the class.
@@TCustomStringTreeOptions
Summary
Enhanced options class for string trees.
Description
This class enhances the base class TCustomVirtualTreeOptions by options related to a string tree.
@@TCustomStringTreeOptions.AssignTo@TPersistent
Summary
Used to copy the options class.
Description
You can either call this method directly or use the Assign method of the target class to do the assignment. Implementing
AssignTo instead of Assign allows for future enhancements. TPersistent will automatically call AssignTo if there was no
Assign method.
@@TCustomStringTreeOptions.Create@TBaseVirtualTree
Summary
The constructor of the class.
Description
The constructor initializes the class.
@@TCustomStringTreeOptions.StringOptions
Summary
The new options introduced by the class.
Description
StringOptions provides access to the newly introduced options by which the base class is extended.
@@TCustomVirtualDrawTree
Summary
Simple owner draw descendant of the base tree.
Description
TCustomVirtualDrawTree is a simple TBaseVirtualTree descendant, which publishes the paint method through an event. This
allows an application for self drawn tree views without overriding the base class.
@@TCustomVirtualDrawTree.OnDrawHint
Summary
Triggered when a node hint or tooltip must be drawn.
Description
Use an event handler for OnDrawHint to draw the hint or tooltip for the given node. You must implement this event and
OnGetHintSize to get a hint at all.
@@TCustomVirtualDrawTree.DoDrawHint@TCanvas@PVirtualNode@TRect@TColumnIndex
Summary
Overridable method which triggers OnDrawHint.
Description
You can override DoDrawHint to customize the behavior for this request.
@@TCustomVirtualDrawTree.DoGetHintSize@PVirtualNode@TColumnIndex@TRect
Summary
Overridable method which triggers OnGetHintSize.
Description
You can override OnGetHintSize to customize the behavior for this request.
@@TCustomVirtualDrawTree.DoGetNodeWidth@PVirtualNode@TColumnIndex@TCanvas
Summary
Overridable method which triggers OnGetNodeWidth.
Description
You can override OnGetNodeWidth to customize the behavior for this request.
@@TCustomVirtualDrawTree.DoPaintNode@TVTPaintInfo
Summary
Overridable method which triggers OnPaintNode.
Description
You can override OnPaintNode to customize the behavior for this request.
@@TCustomVirtualDrawTree.OnDrawNode
Summary
Triggered when a node must be drawn.
Description
Use an event handler for OnDrawNode to draw the actual content for the given node.
@@TCustomVirtualDrawTree.OnGetHintSize
Summary
Triggered when a node hint or tooltip is about to show.
Description
Use an event handler for OnGetHintSize to return the size of the tooltip/hint window for the given node. You must
implement this event and OnDrawHint to get a hint at all.
@@TCustomVirtualDrawTree.OnGetNodeWidth
Summary
Triggered when a node is about to be drawn.
Description
Use an event handler for OnGetNodeWidth to return your calculated width for the given node. Since the draw does not know
the width of a node you have to tell it yourself.
@@TCustomVirtualStringTree
Summary
Descendant of TBaseVirtualTree, which is able to manage node captions on its own
Description
TCustomVirtualStringTree enhances the base tree to display and edit node captions. It implements a generic node editor
which can be used as reference to build your own one.
@@TCustomVirtualStringTree.OnGetHint
Summary
Virtual string tree event to query for a custom hint text.
Description
Write an event handler for this event to specify a custom hint for the passed node and column. The TextType will always
be ttNormal. This event will only be fired if HintMode is not hmTooltip. The delay for hints can be set as usual: adjust
the properties HintPause and HintShortPause of the global Application object.
@@TCustomVirtualStringTree.OnGetText
Summary
Virtual string tree event to query for a node's normal or static text.
Description
This is one of the fundamental string tree events which must always be handled. The string tree will fire this event
every time when it needs to know about the text of a specific node and column. This is mainly the case when the node
appears in the visible area of the tree view (in other words it is not scrolled out of view) but also on some other
\occasions, including streaming, drag and drop and calculating the width of the node.
The node text is distinguished between two text types:
* Normal text: If TextType is ttNormal return the main node caption for the specified column.
* Static text: All text that you return when TextType is ttStatic will be displayed right beside the normal text (or
left to it if the column's BidiMode is not bdLeftToRight, i.e. the column has right-to-left layout). Static text is used
\only for informational purposes; it cannot be selected or dragged and if the column is not wide enough to show all text
it will not be shortened with an ellipsis (...) as normal text. The string tree will only query for static text if the
StringOptions (see TreeOptions) include toShowStaticText. This is off by default.
When this event is fired the text parameter will always be initialized with the value of property DefaultText. To handle
the event get your node data and then extract the string for the appropriate column and TextType.
See Also
OnPaintText
Note
Be sure that your event handler only contains absolutely necessary code. This event will be fired very often - easily a
few hundred times for medium sized trees with some columns defined when the tree is repainted completely.
For example it is far too slow to use Locate() on some Dataset, a database query result or table, and then get the text
from some TField. This may only work with in-memory tables or a client dataset. When you initialize your node data do
some caching and use these cached values to display the data.
@@TCustomVirtualStringTree.OnNewText
Summary
Virtual string tree event to pass edited text.
Description
A string tree will fire this event after a node has been edited successfully (not canceled with Escape). The event
handler must store the new text in the node data.
This event will only be used for the default node caption editor. Other custom node editors may or may not use this event
to pass their edited data to the application. Editing for the whole tree is only possible if the MiscOptions (see
TreeOptions) include toEditable. If only certain columns or nodes should be editable write an event handler for
OnEditing.
See Also
OnCreateEditor, OnEdited
@@TCustomVirtualStringTree.OnPaintText
Summary
Event to change text formatting for particular nodes.
Description
Write an event handler for this event to render nodes with different fonts, font sizes, styles or colors. According to
the parameters each column of each node and even normal and static text can be painted in different ways.
Note
The string tree view manages an internal width for each node's main column. This is done because computing this width is
quite costly and the width is needed on several occasions. If you change the font which is used to paint a node's text,
for example to bold face style, its width changes but the tree view does not know this - it still relies on its cached
node width. This may result in cut off selection rectangles among others.
Hence if the width of a node changes after its initialization because it is now formatted differently than before force a
recalculation of the node width by calling InvalidateNode (when the conditions for the changed formatting are met - not
in the event handler for OnPaintText).
See Also
<LINK PaintCycles.htm, Paint cycles and stages>
@@TCustomVirtualStringTree.OnShortenString
Summary
String tree event for custom handling of string abbreviations.
Description
If the text of a node does not fit into its cell (in grid mode) or is too wide for the width of the tree view it is being
abbreviated with an ellipsis (...). By default the ellipsis is added to the end of the node text.
Occasionally you may want to shorten the node text at a different position, for example if the node text is a path string
and not the last folder or filename should be cut off but rather some mid level folders if possible.
In the handler S must be processed (shortened) and returned in Result. If Done is set to true (default value is false)
the tree view takes over the shortening. This is useful if not all nodes or columns need
@@TCustomVirtualStringTree.AdjustPaintCellRect@TVTPaintInfo@TColumnIndex
Summary
Method which can be used by descentants to adjust the given rectangle during a paint cycle.
Description
For some special behaviour, like the auto span column feature, it is necessary to tell the base treeview which rectangle
is to be considered as the current paint cell when drawing the tree. <B>ClipRect</B> is set to a rectangle which
corresponds to the current node and the current column in the paint cycle.
@@TCustomVirtualStringTree.ContentToHTML@TVSTTextSourceType@WideString
<COMBINE TCustomVirtualStringTree.ContentToClipboard@Word@TVSTTextSourceType>
@@TCustomVirtualStringTree.ContentToRTF@TVSTTextSourceType
<COMBINE TCustomVirtualStringTree.ContentToClipboard@Word@TVSTTextSourceType>
@@TCustomVirtualStringTree.ContentToText@TVSTTextSourceType@Char
<COMBINE TCustomVirtualStringTree.ContentToClipboard@Word@TVSTTextSourceType>
@@TCustomVirtualStringTree.ContentToUnicode@TVSTTextSourceType@WideChar
<COMBINE TCustomVirtualStringTree.ContentToClipboard@Word@TVSTTextSourceType>
@@TCustomVirtualTreeOptions
Summary
Organizes all tree options into subproperties for easier managment.
Description
There are a lot of options available which control certain aspects of Virtual Treeview. Because there might only be at
most 32 members in a published set and also for better overview these options have been splitted into several subsets,
each related to a particular feature group like painting or node selection. With this implementation you can even derive
an own option class and modify which options should be shown in Delphi's object inspector for your class.
@@TCustomVirtualTreeOptions.AnimationOptions
Summary
Options related to animations.
Description
These options can be used to switch certain animation effects in a tree.
@@TCustomVirtualTreeOptions.AutoOptions
Summary
Options related to automatic actions.
Description
These options can be used to switch certain actions in a tree which happen automatically under certain circumstances.
@@TCustomVirtualTreeOptions.MiscOptions
Summary
Options not related to any other category.
Description
These options can be used to switch miscellanous aspects in a tree.
@@TCustomVirtualTreeOptions.Owner
Summary
Owner tree to which the property class belongs.
Description
Owner tree to which the property class belongs.
@@TCustomVirtualTreeOptions.PaintOptions
Summary
Options related to painting.
Description
These options can be used to switch visual aspects of a tree.
@@TCustomVirtualTreeOptions.SelectionOptions
Summary
Options related to the way nodes can be selected.
Description
These options can be used to switch the way how nodes can be selected in a tree.
@@TCustomVirtualTreeOptions.AssignTo@TPersistent
Summary
Used to copy this option class to another option collection.
Description
This is the usual method to support streaming or simply copying of this class. To stay open for future enhancements in
form of new descentants not Assign but AssignTo has been used. AssignTo is called by TPersistent if there is no Assign
method.
@@TCustomVirtualTreeOptions.Create@TBaseVirtualTree
Summary
Constructor of the class.
Description
Used to assign default values to all sub lists.
@@TStringEditLink.Create
Summary
Constructor of the class.
Description
The constructor of the edit link also creates an instance of a simple node editor control. It is by default hidden and
first displayed if the tree directs the link to do so.
@@TStringEditLink.Destroy
Summary
Destructor of the class.
Description
Frees the internal editor control.
@@TVirtualTreeColumn
Summary
Represents a column in a Virtual Treeview.
Description
This enhanced collection item, which is organized within the TCollection descentant TVirtualTreeColumns, manages all
aspects of a single column.
@@TVirtualTreeColumns
Summary
Collection class, which holds the columns for the tree.
Description
This class is an enhanced collection which manages general aspects of columns like ordering, traversion, streaming,
painting, dragging etc.
@@TVirtualStringTree
Summary
Descentant of TBaseVirtualTree which is able to manage node captions on its own.
Description
TVirtualStringTree adds no new functionality to TCustomVirtualStringTree but is publicly available version and appears in
the component palette.
@@TBaseVirtualTree.LastClickPos
Summary
Used for retained drag start and wheel mouse scrolling.
Description
This internal positions is made public to allow descendants to modify mainly the right click behavior of the tree
control.
@@TBaseVirtualTree.OnGetCellIsEmpty
Summary
Triggered when the tree control needs to know whether a given column is empty.
Description
Virtual Treeview supports the concept of column spanning where one cell with too much text to fit into its own space can
expand to the right cell neighbors if they are empty. To make this work it is necessary to know if a cell is considered
as being empty, whatever this means to an application. The string tree descendant simply checks the text for the given
cell and calls back its ancestor if there is no text to further refine if the cell must stay as if it contained
something. The ancestor (TBaseVirtualTree) now triggers OnGetCellIsEmpty to let the application decide.
@@TVTColors.DropMarkColor
Summary
Color of the drop mark.
Description
Since the drop metapher has been extended to include dropping <B>on</B> node, <B>above</B> a node or <B>below</B> a node
(e.g. to determine adding as child, previous sibling or next sibling) there must be an indication where the node would
actually be placed when it would be dropped. This indication is the drop mark, whose color can be set via the
DropMarkColor property.
@@TVTDataObject
Summary
Implementation of an IDataObject interface.
Description
This class is used for OLE drag'n drop and clipboard operations. It allows not only to transfer various kinds of data
between trees but also to transfer this data between different processes. Additionally, every OLE aware application (like
Word) can take part in the data transfer. This makes it easy to copy some of the tree's content for documentation
purposes.
@@TVTDataObject.CanonicalIUnknown@IUnknown
Summary
Helper method for setting data in the IDataObject.
Description
In SetData the class can get a circular reference if the client calls GetData then calls SetData with the same StgMedium.
Because the unkForRelease for the IDataObject can be marshalled it is necessary to get pointers that can be correctly
compared. CanonicalIUknown uses COM object identity for this task. An explicit call to the IUnknown::QueryInterface
method, requesting the IUnknown interface, will always return the same pointer. See the IDragSourceHelper article by
Raymond Chen at MSDN.
@@TVTDataObject.Create@TBaseVirtualTree@Boolean
Summary
Constructor of the class.
Description
Create is used only for initialization.
@@TVTDataObject.DAdvise@TFormatEtc@Integer@IAdviseSink@Integer
Summary
Implementation of the IDataObject.DAdvise method.
Description
Advise sinks are used to have an opportunity for clients to get notified if something changes in the data object.
TVTDataObject uses the data advise holder APIs to provide the advise sink service.
@@TVTDataObject.Destroy
Summary
Destructor of the class.
Description
Cleans up the object.
@@TVTDataObject.DUnadvise@Integer
Summary
Implementation of the IDataObject.DUnAdvise method.
Description
DUnadvice reverses the call to DAdvise.
@@TVTDataObject.EnumDAdvise@IEnumStatData
Summary
Implementation of the IDataObject.EnumDAdvise method.
Description
EnumDAdvice does nothing but forwards the call to the internal advise holder class, which the responds accordingly.
That's why we use data advise holders after all.
@@TVTDataObject.EnumFormatEtc@Integer@IEnumFormatEtc
Summary
Implementation of the IDataObject.EnumFormatEtc method.
Description
This method creates a FormatEtc enumerator class which is used to enumerate all data formats supported by the owner tree.
@@TVTDataObject.EqualFormatEtc@TFormatEtc@TFormatEtc
Summary
Compares two TFormatEtc structures.
Description
\Returns true if both records are considered the same. That means if they have at least one common storage format and all
\other entries have the same values.
@@TVTDataObject.FindFormatEtc@TFormatEtc@TFormatEtcArray
Summary
Searchs the given array for a the given format.
Description
\Returns true if the given format is part of the array.
@@TVTDataObject.FindInternalStgMedium@TClipFormat
Summary
\Returns a storage medium for a given clipboard format.
Description
The class keeps an internal list of clipboard format/storage medium relations. For some operations data is set in certain
formats which is later retrieve by locating it using this method.
@@TVTDataObject.GetCanonicalFormatEtc@TFormatEtc@TFormatEtc
Summary
Implementation of the IDataObject.GetCanonicalFormatEtc method.
Description
The implementation of this method simply consists of a result value telling the caller to use the EnumFormatEtc method.
@@TVTDataObject.GetData@TFormatEtc@TStgMedium
Summary
Implementation of the IDataObject.GetData method.
Description
Whenever drag'n drop or clipboard data actually needs to be rendered then this method is called by the OLE subsystem. The
class automatically returns the CF_VTREFERENCE format and any data previously set by the SetData method (e.g. by the
Shell). For any other format the owner tree is asked to render the OLE data.
See Also
RenderOLEData
@@TVTDataObject.GetDataHere@TFormatEtc@TStgMedium
Summary
Implementation of the IDataObject.GetDataHere method.
Description
GetDataHere is an alternative data retrival method to GetData, but the caller provides the storage place where to store
the actual data. Since Virtual Treeview has a very limited spectrum of what it can use this method is not fully
implmented.
@@TVTDataObject.HGlobalClone@THandle
Summary
Helper method for SetData.
Description
This method copies a HGlobal memory block.
@@TVTDataObject.QueryGetData@TFormatEtc
Summary
Implementation of the IDataObject.QueryGetData method.
Description
This method is called by OLE subsystem to determine which data formats are offered by the owner tree. It uses the
\internal clipboard format list to get a list of available and allowed formats. Currently following formats are
supported:
<B>TBaseVirtualTree</B>
* Virtual Treeview reference and process identifier
* native serialized tree data
<B>TCustomVirtualStringTree</B>
* generic Unicode text
* generic ANSI text
* HTML formatted text (UTF-8 format)
* RTF text (UTF-16 format)
* CSV (comma separated values) but with customizable separators
@@TVTDataObject.RenderInternalOLEData@TFormatEtc@TStgMedium@HResult
Summary
Helper method to return data previously stored by SetData.
Description
For some operations (e.g. shell transfers with IDropTargetHelper interface) data is stored in the class.
RenderInternalOLEData returns this data when queried later.
@@TVTDataObject.SetData@TFormatEtc@TStgMedium@BOOL
Summary
Implementation of the IDataObject.SetData method.
Description
This method is used to add or replace data in the data object.
@@TVTDataObject.StgMediumIncRef@TStgMedium@TStgMedium@Boolean@IDataObject
Summary
Central managing method to copy OLE data.
Description
This method is called when data must be copied from or to the data object. For each supported storage medium a different
(and appropriate) action is taken.
@@AlphaBlend@HDC@HDC@TRect@TPoint@TBlendMode@Integer@Integer
Summary
General purpose procedure to blend one bitmap to another.
Description
This is an optimized alpha blend procedure using MMX instructions to perform as quick as possible. For this procedure to
work properly it is important that both source and target bitmap use the 32 bit color format (pf32Bit for TBitmap). <B>R</B>
describes the source rectangle to work on, while <B>Target</B> is the place (upper left corner) in the target bitmap
where to blend to. Note that source width + X offset must be less or equal to the target width. Similar for the height.
If <B>Mode</B> is bmConstantAlpha then the blend operation uses the given ConstantAlpha value for all pixels.
If <B>Mode</B> is bmPerPixelAlpha then each pixel is blended using its individual alpha value (the alpha value of the
source).
If <B>Mode</B> is bmMasterAlpha then each pixel is blended using its individual alpha value multiplied by ConstantAlpha.
If <B>Mode</B> is bmConstantAlphaAndColor then each destination pixel is blended using ConstantAlpha but also a constant
color which will be obtained from Bias. In this case no offset value is added, otherwise Bias is used as offset.
Blending of a color into target only (bmConstantAlphaAndColor) ignores <B>Source</B> (the DC) and <B>Target</B> (the
position).
Note
This procedure does not check whether MMX instructions are actually available! Call it only if MMX is really usable,
\otherwise a process exception for unknown op codes is thrown.
@@DrawTextW@HDC@PWideChar@Integer@TRect@Cardinal@Boolean
Summary
Paint support procedure.
Description
This procedure implements a subset of Window's DrawText API for Unicode which is not available for Windows 95, 98 and ME.
For a description of the parameters see DrawText in the online help.
Supported flags are currently:
* DT_LEFT
* DT_TOP
* DT_CALCRECT
* DT_NOCLIP
* DT_RTLREADING
* DT_SINGLELINE
* DT_VCENTER
Differences to the DrawTextW Windows API:
The additional parameter <B>AdjustRight</B> determines whether to adjust the right border of the given rectangle to
accomodate the largest line in the text. It has only a meaning if also DT_CALCRECT is specified.
Note
When running on any NT windows version (Windows NT 4.0, Windows 2000., Windows XP and up) the native windows API is used
instead of this method as it also supports word wrapping properly.
@@TreeFromNode@PVirtualNode
Summary
General purpose routine to get the tree to which a node belongs.
Description
For obvious reasons it makes no sense to store the reference to a tree in each node record, but sometimes there might
arise the need to know to which tree a node belongs. This is not often the case but is necessary e.g. for optimized moves
in drag'n drop or cut'n paste operations.
Each node contains a reference to its parent to allow fast traversal. The hidden root node, however, does not need this
reference because it does not have a node parent. Instead it contains the reference of the tree to which it belongs. To
determine which node is the root node (when you don't know its tree) a special case of sibling reference is used. Since
the root node does neither have a previous nor a next sibling the corresponding pointers are set to the root node, making
the root so pointing to itself. This case will never happen in "normal" nodes, so it is a reliable way to detect the root
node.
@@TVTButtonFillMode
Summary
Determines how the interior of nodes buttons should be drawn.
Description
Usually the little plus and minus buttons have just the color of the treeview but sometimes it looks better to use
another kind of painting. This is particularly important when simulating Windows XP buttons on non-XP systems. The image
below shows how the various modes look like:
<TABLE noborder>
========================
<IMAGE ButtonFillModes>
</TABLE>
@@CFSTR_CSV
Summary
Contains the registration string for certain clipboard formats.
Description
Some of the clipboard formats in the system, like CF_HDROP, are registered by Windows itself. For rich text, html, csv
and other data first the formats must be registered with the clipboard. The identifier returned by the registration code
is used to unregister the format later and to identify the format when transferring data or enumerating the clipboard
formats. The following formats are registered by Virtual Treeview:
* CVS: comma separated values, a tabular data format.
* HTML: text data with text formatting and structured like a big table. Unicode is supported as well (UTF-8).
* RTF: rich text format, similar to HTML, but more complex and also a bit older.
* RTFNOOBJS: like RTF but without embedded objects (not used by Virtual Treeview).
* VIRTUALTREEVIEW: serialized treeview data. This is the native tree format and the only one directly accepted by the
control.
* VTREFERENCE: a special format to pass on a reference of the sender treeview. If both, sender and receiver, live in
the same process this reference can be used to directly access the sender treeview, without COM interecption.
@@CFSTR_HTML
<COMBINE CFSTR_CSV>
@@TVTDragImage.DragTo@TPoint@Boolean
Summary
Moves the drag image to a new position, which is determined from the passed point <B>P</B> and the previous mouse
position.
Description
<B>ForceRepaint</B> is true if something on the screen changed and the back image must be refreshed.
@@TVTDragImage.GetDragImageRect
Summary
\Returns the current size and position of the drag image (screen coordinates).
Description
\Returns the current size and position of the drag image (screen coordinates).
@@TVTDragImage.InternalShowDragImage@HDC
Summary
Frequently called helper routine to actually do the blend and put it onto
Description
Frequently called helper routine to actually do the blend and put it onto the screen. Only used if the system does not
support drag images.
@@TVTDragImage.PrepareDrag@TBitmap@TPoint@TPoint@IDataObject
Summary
Creates all necessary structures to do alpha blended dragging using the given image.
Description
<B>ImagePostion</B> and <B>Hotspot</B> are given in screen coordinates. The first determines where to place the drag
image while the second is the initial mouse position. This method also determines whether the system supports drag images
natively. If so then only minimal structures are created.
@@TVTDragImage.WillMove@TPoint
Summary
Add a summary here...
Description
This method determines whether the drag image would "physically" move when DragTo would be called with the same target
point. Always returns false if the system drag image support is available.
@@TVTDragManager.ForceDragLeave
Summary
This method calls the drop target helper's DragLeave method to ensure it removes the drag image from screen.
Description
This method calls the drop target helper's DragLeave method to ensure it removes the drag image from screen.
@@TVTHeader.DragTo@TPoint
Summary
Moves the drag image to a new position, which is determined from the passed point <B>P</B> and the previous mouse
position.
Description
Moves the drag image to a new position, which is determined from the passed point <B>P</B> and the previous mouse
position.
@@TVTHeader.GetColumnsClass
Summary
\Returns the class to be used for the actual column implementation.
Description
Descentants may optionally override this and return their own class.
@@TVTHeader.HandleMessage@TMessage
Summary
General message handler for the header.
Description
The header gets here the opportunity to handle certain messages before they reach the tree. This is important because the
tree needs to handle various non-client area messages for the header as well as some dragging/tracking events. By
returning True the message will not be handled further, otherwise the message is then dispatched to the proper message
handlers.
@@TVTHeader.InHeader@TPoint
Summary
Determines whether the given point (client coordinates!) is within the header rectangle (non-client coordinates).
Description
Determines whether the given point (client coordinates!) is within the header rectangle (non-client coordinates).
@@TVTHeader.Invalidate@TVirtualTreeColumn@Boolean
Summary
Invalidates the entire header or parts of it so they are repainted.
Description
Because the header is in the non-client area of the tree it needs some special handling in order to initiate its
repainting. If <B>ExpandToRight</B> is true then not only the given column but everything to its right will be
invalidated (useful for resizing). This makes only sense when a column is given.
@@TVTHeader.LoadFromStream@TStream
Summary
Restores the state of the header from the given stream.
Description
Restores the state of the header from the given stream.
@@TVTHeader.PrepareDrag@TPoint@TPoint
Summary
Initializes dragging of the header, <B>P</B> is the current mouse postion and <B>Start</B> the initial mouse position.
Description
Initializes dragging of the header, <B>P</B> is the current mouse postion and <B>Start</B> the initial mouse position.
@@TVTHeader.RecalculateHeader
Summary
Initiate a recalculation of the non-client area of the owner tree.
Description
Initiate a recalculation of the non-client area of the owner tree.
@@TVTHeader.RestoreColumns
Summary
Restores all columns to their width which they had before they have been auto fitted.
Description
Restores all columns to their width which they had before they have been auto fitted.
@@TVTHeader.SaveToStream@TStream
Summary
Saves the complete state of the header into the provided stream.
Description
Saves the complete state of the header into the provided stream.
@@TVTHeader.UpdateMainColumn
Summary
Called once the load process of the owner tree is done.
Description
Called once the load process of the owner tree is done.
@@RegisterVTClipboardFormat@Word@TVirtualTreeClass@Cardinal
<COMBINE RegisterVTClipboardFormat@string@TVirtualTreeClass@Cardinal@Integer@PDVTargetDevice@Integer@Integer>
@@RegisterVTClipboardFormat@string@TVirtualTreeClass@Cardinal@Integer@PDVTargetDevice@Integer@Integer
Summary
Methods to register a certain clipboard format for a given tree class.
Description
Registration with the clipboard is done here too and the assigned ID returned by the function. tymed may contain or'ed
TYMED constants which allows to register several storage formats for one clipboard format.
@@CacheThreshold
Summary
Number of nodes a tree must at least have to start caching and at the same time the maximum number of nodes between two
cache entries.
Description
Number of nodes a tree must at least have to start caching and at the same time the maximum number of nodes between two
cache entries.
@@CFSTR_RTF
<COMBINE CFSTR_CSV>
@@CFSTR_RTFNOOBJS
<COMBINE CFSTR_CSV>
@@CFSTR_VIRTUALTREE
<COMBINE CFSTR_CSV>
@@CFSTR_VTREFERENCE
<COMBINE CFSTR_CSV>
@@ShadowSize
Summary
Size in pixels of the hint shadow.
Description
This value has no influence on Win2K and XP systems as those OSes have native shadow support. Set it to 0 if you don't
want shadows on the other systems.
@@IVTEditLink
Summary
Interface which is used for communication between the treeview and a node editor.
Description
Due to the virtual nature of the tree it is necessary to supply a kind of plug in interface for application defined node
editors. TCustomVirtualStringTree is the first class which implements a node editor. This is just a generic editor to
edit a node's caption just like TTreeview does it. Because of the lack of support under Win9x system this editor only can
edit ANSI text. You have to create an own editor to make also Unicode string editing available for node captions.
All node editors must implement this interface to allow the treeview to communicate with the node editor. Node editors
are small components or forms. If a node shall be edited (for instance when the user presses F2) the treeview will fire
the event OnCreateEditor. The application must determine which node editor must be used for the data in the given node
and column. Then it creates and returns an instance of the appropriate node editor.
The life cycle of the node editor object is handled via reference counting. This means that the application must not
destroy the node editor explicitly - this will happen automatically when the node editor is not used anymore.
@@IVTEditLink.BeginEdit
Summary
This function will be called by the virtual tree when the editing starts.
Description
Write code to actually display the node editor here. This might be something like Visible := True or Show. The return
value should be true if editing can start or false otherwise. Before this function is called PrepareEdit and SetBounds
are executed.
@@IVTEditLink.CancelEdit
Summary
This function will be called by the virtual tree when the current editing is about to be cancelled.
Description
Hide the node editor here. This might be something like Visible := False or Hide. The return value should be True if the
editing can be cancelled. Return false if the node editor is in an internal state which does not allow to cancel the
editing right now.
Do not destroy the node editor instance because this will be done implicitly via reference counting.
Note
If the edited tree is changed during this function, i.e. focus change, node deletion and so on, CancelEdit might be
called again by the tree which can lead to access violations. It is therefore advisable to block reentrancy with a
boolean variable. Example:
<CODE>
<B>function</B> TStringEditLink.CancelEdit: Boolean;
<B>begin</B>
\Result := <B>not</B> FStopping;
<B>if</B> Result <B>then</B>
<B>begin</B>
FStopping := True;
FEdit.Hide;
FTree.CancelEditNode;
<B>end</B>;
<B>end</B>;
</CODE>
@@IVTEditLink.EndEdit
Summary
This function will be called by the virtual tree when the current editing is being finished.
Description
Hide the node editor here. This might be something like Visible := False or Hide. The return value should be true if the
editing can be finished. Return false if the node editor is in an internal state which does not allow to finish the
editing right now - possibly because there is no valid value available at the moment. If the editing can be finished
transmit the edited value to the tree or to the data structure which is displayed in the tree.
Do not destroy the node editor instance because this will be done implicitly via reference counting.
Note
If the edited tree is changed during this function, i.e. focus change, node deletion and so on, EndEdit might be called
again by the tree which can lead to access violations. It is therefore advisable to block reentrancy with a boolean
variable. Example:
<CODE>
<B>function</B> TStringEditLink.EndEdit: Boolean;
<B>begin</B>
\Result := <B>not</B> FStopping;
<B>if</B> Result <B>then</B>
<B>try</B>
FStopping := True;
<B>if</B> FEdit.Modified <B>then</B>
FTree.DoNewText(FNode, FColumn, FEdit.Caption);
FEdit.Hide;
<B>except</B>
FStopping := False;
<B>raise</B>;
<B>end</B>;
<B>end</B>;
</CODE>
@@IVTEditLink.GetBounds
Summary
The virtual tree can use this function to get the current bounding rect of the node editor.
Description
The bounding rect of the node editor may change during the editing to reflect the changed edit contents. The tree uses
this function to query the current bounding rect of the editor. VCL components derived from TControl have a BoundsRect
property which can be used as a return value here.
@@IVTEditLink.PrepareEdit@TBaseVirtualTree@PVirtualNode@TColumnIndex
Summary
This function is called by a virtual tree to initialize the node editor.
Description
Use PrepareEdit to initialize the node editor. This includes getting the node content in the specified column which will
be needed later when the editor is shown. BeginEdit may be called anytime after this function returns. If the
initialization fails simply return false (exceptions should be trapped).
@@IVTEditLink.ProcessMessage@TMessage
Summary
This function is used to forward messages being directed to the virtual tree.
Description
Some node editors might need to trap some messages which are directed to the treeview window. This function remedies the
need to subclass the virtual tree via its WindowProc property. If these messages are not needed leave the function body
empty.
@@IVTEditLink.SetBounds@TRect
Summary
The virtual tree calls this function to initialize the bounding rectangle of the node editor.
Description
This function is usually called after PrepareEdit and before BeginEdit in order to place the node editor exactly over the
node which is about to be edited. Use the R parameter to set the bounding rect of the editor. If the treeview is in grid
mode R will be equal to the cell rectangle of the to be edited cell. Otherwise R is the bounding rectangle of the actual
node text.
Note
SetBounds is also a method of TControl. Hence if your node editor is implemented by a descendant of TControl you must use
a method resolution clause to avoid a name clash. The clause can look similar to this:
<CODE>
<B>procedure</B> EditLinkSetBounds(R: TRect); <B>stdcall</B>;
<B>procedure</B> IVTEditLink.SetBounds = EditLinkSetBounds;
</CODE>
@@TCheckImageKind.ckSystemDefault
System defined check images.
@@THeaderState.hsResizing
multi column resizing in progress
@@THeaderState.hsColumnWidthTrackPending
left button is down, user might want to start resize a column
@@THeaderState.hsColumnWidthTracking
column resizing is in progress