TreeCombo

Inheritance Hierarchy

          IComponent

          IControl

          ITreeControl

          ITreeCombo

          TreeCombo

Description

The TreeCombo component is used to display tree-like hierarchical structures, such as an object inheritance tree, in the form of drop-down lists.

Working with the Component

Select the component elements by clicking on the element icon or on the element itself, or pressing the space key.

Double-clicking the column border automatically fits the left column. The width is adjusted based on all elements that the node contains (including expander, flag, icon, status icon or node text).

NOTE. You can resize the drop-down list of elements by dragging its right, left or bottom border with your mouse. The minimum width of the drop-down list equals to the component width.

By default information on the element selection is displayed in the component editor. To update this information automatically, the  AutoUpdateInfo property is used. To display user data in the component editor, the basic property  Text must be changed.

Element Search

The following types of search are available from the expanded drop-down list:

If search has been successful, the cursor will focus on the found element. Selection state depends on value of the  FindMode property. Depending on selected multiple selection mode, you can add an element to selection either by selecting it using the Space key or selecting it with the mouse cursor while holding down the CTRL key.

You can also search for elements with the component drop-down list collapsed. When the component is focused, entering a set of characters creates a list of elements whose names contain this set of characters:

Elements are selected using the previously noted method, depending on the value defined in the  SelectionMode property. Closing this dialog box applies the selection to the component.

You can search for one or several words based on segments in any mode. To do this, separate the search combinations with whitespace character. The word order in the names of search elements is ignored.

Sorting Data

Data sorting is available if the  ShowColumnHeaders, Sorted  and the  ColumnClick  properties have the True value, and the  SortType  property has a value other than None.

When you are in the form executing mode, click the caption of the appropriate column to sort data by it. The data are sorted ascending. Double-clicking changes the sorting direction. To sort data by multiple columns, click the headings of the required columns while holding down CTRL key. The sorting order is as follows: the column whose caption is clicked last is sorted last.

Sorting parameters can also be defined in the Sorting specialized dialog box:

This dialog box opens when selecting the appropriate item from the context menu called from the column heading area.

NOTE. The context menu option is available if the  ShowColumnHeaders  and  Sorted  properties are set to True, and the  SortType  property should have a value other than None.

Move the columns used to sort by to the selection list. The and the buttons are used to change sorting direction by the selected column. The and the buttons are used to change the sorting order. Columns at the top of the list are sorted first.

In Fore language, to apply sorting, you need to set the  Sorted  property to True, and the  SortType  property should have a value other than None. The column data of which is sorted is defined in the  SortColumn property. Sorting direction is defined in the  SortAscending  property of the corresponding column.

The  Sort  and  SortDefault methods can also be used to manage sorting.

Example

Properties of the TreeCombo Component

  Property name Brief description
The Align property determines the behavior of the component, when the size of its parent component is changed.
The AllowDrag property determines whether an object can be dragged from the component.
The AllowDrop property determines whether the component can accept a dragged object.
Outdated. Use SelectionMode.
The Anchors property returns settings that determine the percentage of the size change for the current component when the parent component is resized.
The AnimationType property determines type of animation to be used when component's combo box is expanded.
The AutoCheckParent property determines, whether the parent nodes of the component should automatically receive an indefinite state, if not all of the child elements are selected.
The AutoUpdateInfo property determines indicator of automatic update of information on selection in the component editor.
The BorderStyle property determines the style of the border of the component.
The Brush property specifies the brush used to fill the component area.
The CancelOnEscape property determines, whether selection should be cancelled, and the list is closed, when the Escape key is pressed.
The Checkboxes property determines whether check boxes of the component elements should be present.
The ClientHeight property is used to receive or specify the height of the component’s client space.
The ClientWidth property is used to receive or specify the width of the component’s client space.
The CloseOnClick property determines, whether the list should be automatically closed, when one of the elements is selected with a mouse click.
The CloseOnEnter property determines, whether the list should be closed, and the selection - saved - when the ENTER key is pressed.
The Color property determines the background color of a component.
The ColumnClick property determines whether it is possible to display the component column headings.
The Columns property returns the component columns collection.
The ComponentCount property returns the number of child components.
The Components property returns the child component.
The Cursor property determines the look of the cursor over the component.
The CustomMultiselectText property determines whether a custom template is used to form component text on multiple selection.
The CustomMultiselectTextTemplate property determine the template, according to which component text willbe formed on multiple selection.
The Data property is used to store any custom data.
The Dropped property returns the status of the drop-down menu.
The DroppedListHeight property determines height of the component's drop-down menu.
The DroppedListWidth property determines width of the component's drop-down menu.
The DroppedPopupMenu property determines context menu which can be opened in the area of the components's drop-down menu.
The DropTargetNode property determines the component node, over which a user is currently dragging another node.
The Enabled property determines whether the component is available for the user.
The EnableFindDialog property determines, whether the standard element search dialog should be open when the CTRL+F key combination or F3 key is pressed.
The FilterStyle property determines mode of creating a tree of filtered elements.
The FindEditVisible property determines whether a search string is displayed when the component drop-down list is expanded.
The FindMode property determines mode of marking found elements.
The Focused property returns True, if the focus is set on the component.
The FocusedNode property determines the node, which is currently focused.
The Font property determines the set of characteristics, describing the font, used to display text.
The GridLines property determines, whether grid should be displayed.
The HeaderMenu property determines the context menu, which is called by clicking the caption of the component column using the additional mouse button.
The Height property determines the component height.
The HelpContext property determines a unique index for the context help section for this component.
The HideSelection property determines, whether the selected component element should stay selected, when the focus moves to another component.
The HighlightTrack property determines whether to highlight element on mouse over.
The Hint property determines the hint text for the component.
The HotTrack property determines whether the elements should be underscored on mouse over.
The HotTrackAutoExpand property determines whether the state of children tree is changed on clicking a selected element.
The Images property contains the list of images, used for tree nodes display.
The InnerRoot property returns parameters of inner root node of the tree.
The Left property determines the coordinate of the left border of the component.
The Locked property determines, whether it is possible to change selection and edit elements.
Outdated. Use SelectionMode.
The Name property determines the component name.
The Nodes property returns the component items collection.
The Parent property determines the parent component.
The ParentColor property determines whether the component inherits the color of the parent component.
The ParentFont property determines whether the component should use the font of the parent component.
The ParentShowHint property determines when a tooltip is displayed.
The PopupMenu property determines the context menu to be displayed on right-click.
The ReadOnly property determines whether the elements are available for editing.
The RowSelect property determines, whether the whole row should be highlighted, when an element is selected.
The Scrolls property returns parameters of component's scrollbars.
The Selected property determines the last selected tree element.
The Selection property returns the tree element selection.
The SelectionMode property determines the mode of selecting component elements.
The ShowButtons property determines, whether hide/show child elements buttons should be displayed.
The ShowColumnHeaders property determines, whether column headers should be displayed.
The ShowEditImage property determines whether the icon element should be displayed in the component editor.
The ShowHint property enables and disables showing a hint for the component.
The ShowHints property determines, whether hints should be displayed when the mouse hovers over elements.
The ShowLines property determines, whether the line, connecting a node with its children, should be displayed.
The ShowSystemHints property determines whether system tooltips should be displayed for various component elements.
The SortColumn property determines the index of the column, by which sorting should be performed.
The Sorted property determines whether it is possible to perform sorting by the column specified in the property  SortColumn.
The SortType property determines the component sorting type.
The StateImages property determines the source of icons for the selected elements.
The TabOrder property determines the component position in the tab order.
The TabStop property determines whether the focus is set to a component when the TAB button is pressed.
The Tag property is not used by the compiler. The user can change the value of the Tag property and use it as required.
The Text property determines the row identifying a component for user.
The Top property determines the coordinate of the top border of the component.
The Visible property determines the visibility of the component during execution.
The Width property determines the component width.

Methods of the TreeCombo Component

  Method name Brief description
The AdjustDroppedListWidth property adjusts width of the component's drop-down menu.
The AdjustWidth method is used to automatically fit a column based on its contents.
The BringToFront method brings a component to front.
The ClientToScreen method converts point coordinates relative to component coordinates into display coordinates.
The DoDragDrop method allows to start drag-and-drop operation.
The DropDown method expands the drop-down menu.
The GetImage method returns a graphic presentation of a component together with all child components.
The GetItemAt method checks if the node is in the specified point of component client area.
The HitTest method checks if element is in the specified point of component client area.
The RollUp method collapses the drop-down menu.
The ScreenToClient method converts screen coordinates of a point to coordinates specified relative to the component coordinate system.
The SendToBack method sends a component to back.
The SetFocus method sets focus to this component.
The Sort method sorts by the values of the specified column.
The SortDefault method performs sorting by the contents of the column, which index is specified in the SortColumn property.
The UpdateInfo method updates data.

Events of the TreeCombo Component

  Event name Brief description
The OnAdded event occurs when a new element is added.
The OnBeginDrag event occurs for a component, when a user starts to drag an object from the component.
The OnBeginFilter event occurs at the start of filtering of component elements list.
The OnBeginSearch event occurs when elements are started to be searched in the component.
The OnChecked event occurs when the element check box is selected.
The OnChecking event occurs, when the element check box is selected.
The OnClick event occurs if a user clicks a component area using the main mouse button.
The OnCollapsed event occurs after collapsing the hierarchy of the tree node children.
The OnCollapsing event occurs before collapsing the hierarchy of tree node children.
The OnColumnClick event occurs on mouse click on the component column header.
The OnCompareItems event occurs during comparing two elements during the user element sorting.
The OnDblClick event occurs if a user double-clicks a component area using the mouse button.
The OnDeleting event occurs, when the element is deleted.
The OnDragDrop event occurs for a component if a user drops a dragged object over it.
The OnDragEnter event occurs when a dragged object crosses the borders of this component.
The OnDragLeave event occurs when a dragged object leaves the borders of this component.
The OnDragOver event occurs for this component when a user drags a dragged object over it.
The OnDropDown event occurs on expanding the component list.
The OnEdited event occurs on exiting the mode of editing the contents of the component current record field.
The OnEditing event occurs when changing to the mode for editing the field contents of the current component entry.
The OnEnter event occurs when a component receives focus.
The OnExit event occurs when a component loses focus.
The OnExpanded event occurs after expanding the hierarchy of tree node children.
The OnExpanding event occurs directly before expanding the tree node children hierarchy.
The OnFilter event occurs after the list of components is filtered.
The OnFocusedChanged event occurs, when the focus is moved to another component element.
The OnFocusedChanged event occurs, when the focus is moved to another component element.
The OnGetHint event occurs when a hint appears over the element, over which the mouse cursor is located.
The OnGetNodeImage event occurs on determining an image near the tree element.
The OnGetNodeStateImage event occurs on determining the state images near the tree element.
The OnHover event occurs when you hover over the element with your mouse and underline it.
The OnHScroll event occurs when the horizontal scrollbar slider changes its position.
The OnKeyDown event occurs if a component is focused and a keyboard key is pressed.
The OnKeyPress event occurs if a component is focused when a user presses a character key.
The OnKeyPreview event occurs prior to each event requiring clicking.
The OnKeyUp event occurs if a component is focused and a user releases any button previously pressed.
The OnMouseDown event occurs when the pointer is in component area and a mouse button is pressed.
The OnMouseEnter event occurs when mouse cursor enters the component area.
The OnMouseHover event occurs when mouse cursor is held in the component area.
The OnMouseLeave event occurs when mouse cursor leaves the component area.
The OnMouseMove event occurs on moving the cursor over component.
The OnMouseUp event occurs on releasing mouse button when the cursor is in component area.
The OnMouseWheel event occurs if the component has focus when the mouse wheel is rotated.
The OnRollUp event occurs when the component list is collapsed.
The OnSearch event occurs after the element search in the component is finished.
The OnSelected event occurs after selecting a node.
The OnSelecting event occurs before selecting a node.
The OnSelectionChanged event occurs when the componen element selection is changed.
The OnUnselected event occurs after deselecting a node.
The OnUnselecting event occurs before deselecting an element.
The OnVScroll event occurs when the vertical scrollbar slider changes its position.

See also:

Additional Components