A TreeView control is a hierarchical display of information. Each item in a TreeView control consists of text and pictures, which can be manipulated during program runtime.
TreeView property |
Datatype |
Description |
---|---|---|
Integer |
Specifies the ASCII value of the accelerator key you want to use for the control. |
|
String |
A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users. |
|
String |
A label that briefly describes the control, such as the text in a button or the name of a menu item. |
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the control is. |
|
Long |
Specifies the numeric value of the background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. |
|
Boolean |
Specifies whether the control has a border. Values are: TRUE -- Control has a border. FALSE -- Control does not have a border. |
|
BorderStyle (enumerated) |
Specifies the border style of the control. Values are: StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
Boolean |
Specifies whether PowerBuilder moves the control to the top of the front-to-back order. Values are: TRUE -- Control is on top of other controls. FALSE -- Control is not on top of other controls. |
|
CheckBoxes |
Boolean |
Specifies whether the state images are replaced by check boxes. The check boxes are set to unchecked by default. The TreeView control processes mouse and keyboard input to toggle the checked state. Values are: TRUE -- Check boxes are displayed. FALSE -- Check boxes are not displayed. The state of an item's check box can be determined by checking the state picture index for the item: Unchecked = 1 Checked = 2 |
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
Boolean |
Specifies whether the user can delete a TreeView item from a TreeView control using the Delete key. Values are: TRUE -- The user can delete items from the control. FALSE -- The user cannot delete items from the control. |
|
Boolean |
Disable Drag Drop determines whether events for dragging, such as BeginDrag, are triggered when the user clicks on an item and drags. Values are: TRUE -- Drag events are not triggered. FALSE -- Drag events are triggered. |
|
Boolean |
Specifies whether PowerBuilder puts the control automatically into Drag mode. Values are: TRUE -- When the control is clicked, the control is automatically in Drag mode. FALSE -- When the control is clicked, the control is not automatically in Drag mode. You have to manually put the control into Drag mode by using the Drag function. In either case, DisableDragDrop must be set to false for dragging to occur. |
|
String |
Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control. When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the user can edit the item labels in a control by clicking on a selected item. Values are: TRUE -- The user can edit item labels. FALSE -- The user cannot edit item labels. |
|
Boolean |
Specifies whether the control is enabled (can be clicked). Values are: TRUE -- Control can be clicked. FALSE -- Control cannot be clicked. |
|
String |
Specifies the name of the typeface in which the text of the control displays (for example, arial or courier). |
|
FontCharSet (enumerated) |
Specifies the font character set used for the text in the control. The application must be running on an appropriate version of PowerBuilder under an operating system that supports the selected character set. For a complete list of possible values, see the list of properties for the FontCharSet variable on the Enumerated tab page of the Browser. |
|
FontFamily (enumerated) |
Specifies the font family (type style) used for the text in the control. Values are: AnyFont! Decorative! Modern! Roman! Script! Swiss! |
|
FontPitch (enumerated) |
Specifies the font pitch for the text in the control. Values are: Default! Fixed! Variable! |
|
FullRowSelect |
Boolean |
Specifies whether full row selection is enabled. Values are: TRUE -- Clicking anywhere on a row causes the entire row to be selected, and selecting any item in the row causes the entire row to be highlighted. FALSE -- Selecting one item in a row does not cause the entire row to be highlighted or selected. This property cannot be used in conjunction with HasLines = TRUE. |
Boolean |
Specifies whether TreeView parent items have + and - buttons associated with them to indicate whether they are expanded (-) or collapsed (+). Values are: TRUE -- Parent items have buttons. FALSE -- Parent items do not have buttons. If SingleExpand is set to true to specify that only one item can be expanded, more than one item can be expanded by clicking on the item buttons if HasButtons is also true. |
|
Boolean |
Specifies whether TreeView items are connected by lines. Values are: TRUE -- Items are connected by lines. FALSE -- Items are not connected by lines. |
|
Integer |
Specifies the height of the control, in PowerBuilder units. |
|
Boolean |
Specifies whether selected text stays selected (highlighted) even when the control does not have focus. Values are. TRUE -- Text does not stay highlighted. FALSE -- Text stays highlighted. |
|
ImeMode |
Integer |
Specifies the input method editor mode. This property is relevant only to applications running on a Japanese version of PowerBuilder. |
Integer |
Specifies the size, in PowerBuilder units, that TreeView items are indented. Negative values are accepted but the items are outdented beyond the left edge of the control. Room is always reserved for the regular picture, whether or not it is displayed. An indent of less than 90 has no effect for the standard picture width. Set PictureWidth to 0 to remove extra space. |
|
Boolean |
Specifies whether the text in the control is italic. Values are: TRUE -- Text is italic. FALSE -- Text is not italic. |
|
Boolean |
Specifies that the layout of the control should be a mirror image of the standard layout. Values are: TRUE -- Elements in the control are right justified FALSE -- Elements in the control are left justified (default). |
|
Boolean |
Specifies whether PowerBuilder will connect TreeView root items with lines. Values are: TRUE -- TreeView control connects root items with lines when HasLines is also true. FALSE -- Control does not connect root items with lines. |
|
Integer |
Specifies the size, in pixels, for the height of the TreeView item picture. In a script, this value can be set only before a picture has been added to the picture index list. If the picture height is 0, PowerBuilder uses the height of the first picture added to the picture index list. |
|
Long |
Specifies the color to be transparent when used in a TreeView item picture. Used when the picture is added at initialization or with the function AddPicture, and can be changed between adds. |
|
String |
Specifies the file path or URL address of the files containing the pictures added during initialization. The file extension BMP, ICO, GIF, JPG or JPEG is required. Not updated after initialization. |
|
Integer |
Specifies the size, in pixels, for the width of the TreeView item picture. In a script, this value can be set only before a picture has been added to the picture index list. If the picture width is 0, PowerBuilder uses the width of the first picture added to the picture index list. |
|
String |
Specifies the name of the stock pointer or the file containing the pointer used for the control. |
|
Boolean |
Specifies that characters should be displayed in right-to-left order. The application must be running on an operating system that supports right-to-left display. Values are: TRUE -- Characters display in right-to-left order. FALSE -- Characters display in left-to-right order (default). |
|
SingleExpand |
Boolean |
Specifies whether only the selected TreeView item is allowed to be expanded. A single mouse click selects an item. TRUE -- When an item is selected, it is automatically expanded and the previously selected item is automatically collapsed. FALSE -- More than one item can be expanded at a time. Note that if HasButtons = true, more than one item can be expanded at a time by clicking on the item buttons. |
grSortType |
Selects the sort method. Values are: Ascending! -- Alphabetic by label. Descending! -- Reverse-alphabetic by label. UserDefinedSort! -- According to the script in the Sort event. Unsorted! -- Not sorted. When SortType specifies sorting, sorting happens automatically. For Unsorted!, you can call functions for alphabetic sorting. |
|
Integer |
Specifies the size, in pixels, for the height of the state picture. In a script, this value can be set only before a state picture has been added to the state picture list. If the state picture height is 0, PowerBuilder uses the height of the first picture added to the state picture index list. |
|
Long |
Specifies the color to be transparent when used in a state picture. Used when the picture is added at initialization or with the function AddStatePicture, and can be changed between adds. |
|
String |
Specifies the file path or URL address of the picture used as the state picture. The state picture is displayed to the left of the regular picture. The item is shifted right to make room for it. The picture can be an icon, cursor, or bitmap supplied by the user or a stock picture from the PowerBuilder library. Not updated after initialization. |
|
Integer |
Specifies the size in pixels for the width of the state picture. In a script, this value can be set only before a state picture has been added to the state picture list. If the state picture width is 0, PowerBuilder uses the width of the first picture added to the state picture index list. |
|
Integer |
Specifies the tab value of the control within the window (0 means the user cannot tab to the control). |
|
String |
Specifies the tag value assigned to the control. |
|
Long |
Specifies the numeric value of the color used for text: -2 to 16,777,215. |
|
Integer |
Specifies the size of the text in the control, in points. For backward compatibility, the size is stored as a negative number; for example, 10-point text size is stored as -10. |
|
ToolTips |
Boolean |
Specifies whether an item's label should be displayed in a tooltip if the label is cut off by the right edge of the control. Values are: TRUE -- Tooltips displaying the label text are displayed when the label is cut off on the right side. This is the default. FALSE -- Tooltips are not displayed. |
TrackSelect |
Boolean |
Specifies whether items appear in a different color when the mouse moves over them (hot tracking). Values are: TRUE -- An item changes color when the mouse moves over it. FALSE -- An item does not change color when the mouse moves over or pauses on it. |
Boolean |
Specifies whether the text in the control is underlined. Values are: TRUE -- Text is underlined. FALSE -- Text is not underlined. |
|
Boolean |
Specifies whether the control is visible. Values are: TRUE -- Control is visible. FALSE -- Control is not visible. |
|
Integer |
Specifies the stroke weight of the text in the control; for example, 400 for normal or 700 for bold. |
|
Integer |
Specifies the width of the control, in PowerBuilder units. |
|
Integer |
Specifies the X position (the distance from the left edge of the window), in PowerBuilder units. |
|
Integer |
Specifies the Y position (the distance from the top of the window), in PowerBuilder units. |
TreeView event |
Occurs |
---|---|
When the user begins a drag operation with the left mouse button. If the DragAuto property is set to true, the drag begins automatically. If the DragAuto property is set to false, the drag operation must be done programmatically. |
|
When the user starts to edit a TreeView item label. Return 1 to prevent setting to the new text. Return 0 to accept the new text. |
|
When the user begins a drag operation with the right mouse button. If the DragAuto property is set to true, the drag begins automatically. If the DragAuto property is set to false, the drag operation must be done programmatically. |
|
When the control is clicked. |
|
When the object is created, immediately before the Open event occurs in the window. |
|
When a TreeView item is deleted. |
|
When the object is destroyed, immediately after the Close event occurs in the window. |
|
When the control is double-clicked. |
|
When a dragged control is dropped on the TreeView control. |
|
When a dragged control enters the control, including entering the narrow border around the display area. |
|
When a dragged control leaves the control, including leaving by crossing into the tab page display area. |
|
When a dragged control is within the control, but not on a TreeView item. |
|
When the user finishes editing a TreeView item label. Return 1 to prevent setting to the new text. Return 0 to accept the new text. |
|
Just before the control receives focus (before it is selected and becomes active). |
|
When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control. |
|
When an item has collapsed. |
|
When an item is collapsing. Return 1 to prevent collapsing or 0 to allow it. |
|
When an item has expanded. |
|
When an item is expanding. Return 1 to prevent expansion or 0 to allow it. If you want to populate the children each time an item expands, do it in the ItemExpanding event. If no children are created during the ItemPopulate or Item Expanding events, the item does not expand. |
|
When an item is expanding for the first time. Return 1 to prevent expansion or 0 to allow it. If no children are created during the ItemPopulate or Item Expanding events, the item does not expand. |
|
When the user presses a key. |
|
When the control loses focus (becomes inactive). |
|
When a TreeView control sends a wm_notify message to its parent. |
|
When a Windows message occurs that is not a PowerBuilder event. |
|
When the control is right-clicked. |
|
When the control is right double-clicked. |
|
When the selection has changed. |
|
When the selection is changing. Return 1 to prevent the selection from changing or 0 to allow it. |
|
When sorting occurs and the SortType property is set to UserDefinedSort! The event occurs for each pair of items being sorted. |
TreeView function |
Datatype returned |
Description |
---|---|---|
Integer |
Adds an icon, cursor, or bitmap to the image list. Does not update PictureName. |
|
Integer |
Adds an icon, cursor, or bitmap to the state image list. Does not update StatePictureName. |
|
String |
Returns the name of the control. |
|
Integer |
Collapses the specified TreeView item. |
|
Integer |
Deletes the specified TreeView item and all its children, if any. |
|
Integer |
Deletes the specified icon, cursor, or bitmap from the image list. |
|
Integer |
Deletes all icons, cursors, or bitmaps from the image list. |
|
Integer |
Deletes the specified icon, cursor, or bitmap from the state image list. |
|
Integer |
Deletes all icons, cursors, or bitmaps from the state image list. |
|
Integer |
Starts or ends the dragging of a TreeView item. |
|
Integer |
Starts the editing of a specific TreeView item label. |
|
Integer |
Expands the children and subsequent levels for the specified TreeView item. |
|
Integer |
Expands the specified TreeView item. |
|
Long |
Returns the handle for the specified TreeView item. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
Integer |
Retrieves information for a specified item. |
|
Integer |
Gets the handle or the index of the item under the cursor. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Integer |
Hides the specified TreeView item. |
|
Long |
Inserts a specified item at a specified position and level in a TreeView control. |
|
Long |
Inserts a specified item as the first item at a specified level. |
|
Long |
Inserts a specified item as the last item at a specified level. |
|
Long |
Inserts a specified item at a specified level in the correct alphabetic position, if possible. |
|
Integer |
Moves a control or object to a specified location. |
|
Integer |
Determines the distance from the left edge of an object to the pointer location. |
|
Integer |
Determines the distance from the top edge of an object to the pointer location. |
|
Boolean |
Adds the event to the end of the event queue of an object. |
|
Integer |
Includes an object or lines of text in a print job. |
|
Integer |
Resizes a control to the specified dimensions. |
|
Integer |
Highlights an item in the control, making it the current item. |
|
Integer |
Designates the specified TreeView item as the target of a DragDrop operation. |
|
Integer |
Sets the specified TreeView item as the first item visible in a TreeView control. If there are enough items to allow it, the specified item scrolls to the top of the control. If not, it is selected. |
|
Integer |
Sets the focus for a specified object or control. |
|
Integer |
Sets the information for the specified TreeView item. |
|
Integer |
Specifies a picture index for all TreeView items at a specific level in a TreeView control. |
|
Integer |
Maps a picture index to an overlay picture index. Only four overlay picture indexes are available. |
|
Integer |
Sets the position of the TreeView control in the front-to-back order within a window. |
|
Integer |
Controls the automatic redraw of an object after its properties have changed. |
|
Integer |
Makes an object or control visible, if it is hidden. If the object is already visible, Show brings it to the top. |
|
Integer |
Sorts the children of a specified TreeView item according to the method of the SortType property or alphabetically if SortType is Unsorted!. |
|
Integer |
Sorts the children of an item and all subsequent levels according to the method of the SortType property or alphabetically if SortType is Unsorted!. |
|
Integer |
Triggers a specified event in the control and executes the script for the event. |
|
Object |
Returns the type of the control. |