-DefaultTreeViewSort - returns result of string comparison between -names of Node1 and Node2. +DefaultTreeViewSort is the default routine used to compare tree +nodes to determine their sort order. DefaultTreeViewSort is used in the +CustomSort method when a another comparison routine has not been specified in +the argument for the method. It is passed as an argument to the Sort routine +in the implementation section for the unit.
-DefaultTreeViewSort compares the text of two TreeNodes and returns -the following result: +DefaultTreeViewSort checks for an assigned OnCompare event handler in the +TreeView control for the nodes. When assigned, it is signalled to compare the +specified nodes to determine the return value for the method. If TreeView or +its OnCompare handler have not been assigned, the text for the nodes in Node1 +and Node2 are compared to get the return value. The return values contains +the following:
-The comparison takes into account ANSI characters, i.e. it takes care of -strange accented characters. Contrary to AnsiCompareText, the comparison is -case sensitive. +On UNIX-like platforms, the CompareStr routine is called to compare the values +for the Text in the nodes. The comparison is case-sensitive. All other +platforms call the AnsiCompareStr routine to compare the Text values. +AnsiCompareStr handles ANSI characters which include accented characters. The +comparison is case-sensitive.
+The return value accounts for the state icon displayed when StateImages have +been assigned in the TreeView control and StateImageIndex is a valid position +in the image list. The return value is adjusted for the scaled width for the +state image and the default item spacing used on the TreeView control. +
++DisplayRect returns the coordinates for rectangle containing +the content for the tree node. The Left, Top, Right, and Bottom members in the +return value are adjusted for the BorderWidth used on the TreeView control for +the node. +
++When TextOnly is set to True, the return value contains the +coordinates where the text for the node is located on the TreeView control. +The Left and Right members in the rectangle are set to the values returned +from the DisplayTextLeft and DisplayTextRight methods. +
++The return value contains an empty rectangle (with all members set to 0) if +TreeView has not been assigned for the node. +
++DisplayRect is called from methods that include: +
++The return value is set to the return value from the DisplayExpandSignRight +method. +
++DisplayTextLeft is a method used to determine the horizontal +coordinate where the Text for the tree node is displayed. If a TCustomTreeview +instance has not been assigned in the tree node, the return value contains the +result from the DisplayIconLeft method. +
++Values from the Images and GetImageSize in the TreeView control are used (when +assigned) to adjust the left edge for the Text display area. If an image +position has been assigned in ImageIndex or SelectedIndex, the left edge is +increased by the image size and the default item spacing on the TreeView +control. +
++DisplayTextLeft is used in TTreeNode methods like DisplayRect and +DisplayTextRight. It is also used in TCustomTreeView methods including +BeginEditing, GetHitTestInfoAt, and MouseDown. +
++DisplayTextRight is a method used to determine the horizontal +coordinate for the right-hand edge of the Text displayed for the tree node. If +a TCustomTreeview instance has not been assigned in the tree node, the return +value contains the result from the DisplayTextLeft method. Otherwise, the +position is calculated using the left-hand edge for the Text, the width +returned from the TextWidth method in the control Canvas, and padding derived +from the Indent used on the TreeView control. +
++DisplayTextRight is used in the DisplayRect method in TTreeNode. It is also +used in TCustomTreeView methods including GetNodeAt, GetNodeWithExpandSignAt, +GetHitTestInfoAt, and MouseDown. +
+When a Parent node has been assigned, its GetFirstChild method is used to get the return value. Otherwise, the internal linked list -for the sub-tree is used to get the previous tree node as the return value. +for the subtree is used to get the previous tree node as the return value.
GetHandle is a THandle function used to get the value for the Handle -property. It is the Handle allocated for the associated TreeView control. +property. It is the Handle allocated for the associated TreeView control, or +zero (0) if the TreeView property has not been assigned for the node.
+If Parent has been assigned, the return value is set to the last child node in +the Items for the Parent node. If the node is a top-level node (where Parent +is unassigned), the value from GetNextSibling is used. The return value is +Nil if a sibling node is not found for the current tree node. +
++This provides access to the tree node at the deepest level for the node +subtree. +
++Calls GetFirstChild to begin the search for the next tree node in the +hierarchy. If a child node is not found, the GetNextSkipChildren method is +called to locate the next sibling node in the tree. +
++Calls GetNextSibling to get the return value for the method. Returns +Nil if AValue has not been assigned. +
++Calls GetFirstVisibleChild to start the search for the next expanded tree +node. If the node is assigned and its Expanded property is set to True, +it is used as the return value for the method. If a child node is not found, +the Parent node is searched for a visible sibling node. The return value is +Nil if neither condition is satisfied. +
++The internal members with the values for GetPrevMultiSelected and +GetNextMultiSelected are updated when the value in the MultiSelected property +is changed for the node. +
++The internal member with the return value for the method is updated when the +MoveTo method is called for the tree node. This occurs when the value in Index +is modified. It is also updated when methods in TTreeNode are called to add or +insert a tree node into the node list. +
+@@ -28661,7 +28917,7 @@ preceding logic, or when none of the ancestor nodes are visible and expanded.
+GetNextVisibleSibling is a TTreeNode function used to +locate the next sibling node that has its Visible property enabled. A sibling +node is one which exists at the same Level as the current node in the node +hierarchy; in other words, it is one of the child nodes in the Parent for the +current node. +
++GetNextVisibleSibling calls GetNextSibling to start the search for a visible +sibling node. The node is used in the return value when its Visible property +is set to True. The return value is Nil if there are no sibling +nodes after the current node, or a visible sibling node was not found. +
++GetNextVisibleSibling is used in TTreeNode methods like BottomExpanded, +GetNextVisible, GetNextExpanded, and GetFirstVisibleChild. It is also called +from methods like TTreeNodes.MultiSelect and TCustomTreeview.DoPaintNode when +a tree node is selected or drawn on the TreeView control. +
+HasAsParent is Boolean function which indicates whether +the tree node specified in AValue is an ancestor of the current +tree node. +
++The return value is True if AValue is the Parent node for the current +class instance. Preceding Parent nodes in the hierarchy are also searched if +needed by calling their HasAsParent method, and the return value is set to +True if any one of them is the node in AValue. +
++The return value is set to False when a node is encountered and its +Parent node has not been assigned. +
++Strangely enough, the method also returns True if AValue is unassigned +(Nil). +
++HasAsParent is called from the MoveTo method and used to enable or disable +change event handlers in the TreeView control when a node is relocated in the +node hierarchy. +
++IndexOfText searches the child nodes in Items to locate a node with +the text specified in the NodeText argument. A case-sensitive comparison is +performed using the equality operator (=). The child nodes are searched in +reverse order, and the return value represent the last node in Items with the +specified value. The return value is -1 if a node is not found in Items with +the specified value. +
++IndexOfText is a convenience method; it is not used in the implementation of +TTreeNode, TTreeNodes, or TCustomTreeView. +
++Assign is an overridden method in TTreeNode used to +implement object persistence for the type. Assign ensures that property values +in Source are copied to the current class instance when it is derived from +TTreeNode. Properties copied from Source include: +
++The node cache in the TTreeNodes owner is cleared prior to copying values from +Source (when assigned). +
++If Source is not a TTreeNode instance, the inherited method is called to +complete the assignment or raise an EConvertError exception if Source is +unassigned. +
++Collapse calls the BeginUpdate and EndUpdate methods in the +TreeView control (when assigned) to reduce the number of updates performed +while one or more of the tree nodes are displayed in the collapsed state. +
++Recurse indicates whether child and all descendent nodes are also +collapsed in the method. The default value is False, and causes only +the current node instance to be displayed in the collapsed state. When set to +True, child nodes are visited and recursively collapsed. +
++After completion of the method, the affected nodes will have their Expanded +properties set to False and their States flags are updated accordingly. +
++Use Expand to reverse the collapse process. Use ExpandParents to expand all +ancestor tree nodes for the current node. +
++ConsistencyCheck validates properties in the tree node to ensure +that the node is in a valid state for its TTreeNodes container and the +TreeView control where the node is displayed. +
++ConsistencyCheck can raise a catchable debugger exception if any of the values +are not consistent or valid. For instance: +
++The ConsistencyCheck method is called recursively for child nodes as well. +
++These exception represent an extraordinary condition. +
++ConsistencyCheck is called from the implementation of the ConsistencyCheck +method in TTreeNodes, and occurs when the TreeView instance calls its +ConsistencyCheck method. +
+
-Delete is a method used to remove the tree node from the TTreeNodes
+Delete is a method used to remove the tree node from its TTreeNodes
container. Delete calls Free to destroy the object instance if the Deleting
property is not set to True. No actions are performed when Deleting is
True.
@@ -28980,21 +29460,52 @@ property is not set to True. No actions are performed when Deleting is
+DeleteChildren clears the node cache in the TTreeNodes owner prior
+to removing any child nodes in Items. It calls the Collapse method with
+recursion to set the child nodes and their descendent nodes to the collapsed
+state. The HasChildren property is set to False to update the States
+flag values in the node and cause the TreeView control to be redrawn.
+
+EndEdit calls the EndEditing method in TreeView control to apply
+the new value in the control Editor to the Text for the node. Cancel indicates
+whether the modified text value for the node should be discarded. When set to
+False, the modified value is stored in the Text property for the node.
+The OnEdited event handler in TreeView is signalled (when assigned) and
+Invalidate is called to cause the control to be redrawn.
+
+No actions are performed in the method if TreeView has not been assigned for
+the node.
+
+ExpandParents visits each tree node which is used as the
+Parent for a node, and sets its Expanded property to True.
+
+ExpandParents is called from methods like MakeVisible and EnsureNodeIsVisible in TCustomTreeView.
+
-Calls the EnsureNodeIsVisible method in the associated TreeView (when
-assigned). Otherwise, calls the ExpandParents method.
+It calls the EnsureNodeIsVisible method in the associated TreeView (when
+assigned). Otherwise, it calls the ExpandParents method.
@@ -29091,15 +29617,20 @@ Definition of the modes of attachment:
+Update calls the Invalidate method in the TreeView control for the
+node and causes the tree view control (and the node) to be redrawn. No actions
+are performed in the method if TreeView has not been assigned, or if the
+TTreeNodes container is already performing an update.
+
+Update is called is called when a new value has been assigned to the Text,
+Height, or NodeEffect properties in the node.
+
+AbsoluteIndex is a read-only Integer property which
+contains the absolute ordinal position for the tree node, regardless of its
+parent or level, in the hierarchy of tree nodes. For example:
+
Contains the same value as the Count property in Items.
Data is a Pointer property with a pointer to the custom data for the node.
Data can contain any arbitrary data type, and must be cast to the correct
-types when used in an application.
+type when used in an application.
Setting a new value for the property causes the associated TreeView (when
@@ -29521,11 +30103,22 @@ starting at the current node.
+
+