TREEVIEW
PLBCMP GUI Only
The TREEVIEW instruction defines a hierarchical list of items consisting of a label and an optional bitmap. A TREEVIEW is typically used to display the files and directories on a disk or any information that might usefully be displayed as a hierarchy. To define a TREEVIEW, use one of the following statement formats:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Data Label.
%
Optional. Denotes the item as being GLOBAL.
arraysize
Required. An integer decimal constant, CONST variable, or EQUATEd value indicating the number of array items.
^
Optional. Denotes the item as being a POINTER.
target
Required. The name of a previously defined data item of the same type.
Flags Affected: NONE
Note the following:
A TREEVIEW object is a collection of items.
Each item has a label and can optionally have an icon or bitmap associated with it.
Each item can also have a four (4) byte user-defined value associated with it.
The top item in the hierarchy is called the root item and has no parent item.
An item that is below the root item in the hierarchy is called a child item.
An item that has child items is called a parent item.
Child items are displayed indented and below the parent item. The items can be visually connected by lines if the TREELNSTYLE property is set to $LINES or $LINESATROOT.
Multi-dimension arrays are supported up to a maximum of fourteen dimensions.
The ^ denotes Pointer Variable.
Although a TREEVIEW may be defined as Global, it is DESTROYed during a CHAIN instruction.
Support for the PWS TREEVIEW object was added in release 9.8C. The PWS TREEVIEW is limited to a total of 1,000 nodes as currently implemented. To optimize the TREEVIEW operations for the PL/B Web Server, the TREEVIEW data is maintained on the server side as virtual data. The TREEVIEW data is rendered to the client browser as needed to give the best possible performance. While the PWS TREEVIEW object is implemented to simulate the PLB Windows TREEVIEW object behaviors, it should be noted that there are differences for appearances and events that cannot be simulated.
Supported properties
|
Property |
Note |
|
ANCHOR |
|
|
APPEARANCE |
|
|
BORDER |
|
|
BUTTONS |
The BUTTONS property visual presentation is controlled by the '.treevp' and '.treevm' CSS classes found in the 'plbwebbasic.css' style class definitions. |
|
CAUSEVALID |
|
|
CHECKBOX |
|
|
DOCK |
|
|
ENABLED FONT |
|
|
IMAGELIST |
|
|
LEFT |
|
|
OBJECTID |
|
|
RUNNAME |
|
|
TABID |
|
|
TOOLTIP |
|
|
TOP |
|
|
TREELNSTYLE |
|
|
USERDATA |
|
|
VISIBLE |
|
|
WIDTH |
|
|
ZORDER |
|
Unsupported properties
Any settings for unsupported properties are processed and maintained by the PWS virtual TREEVIEW. However, there settings are ignored and do not affect the operations of the PWS TREEVIEW.
|
Property |
|
AUTOREDRAW |
|
DROPID |
|
FLOATMENU |
|
FULLROW |
|
HELPFILE |
|
HELPID |
|
HELPTOPIC |
|
HIDESEL |
|
HOTTRACK |
|
HWND |
|
IDENT |
|
THEME |
|
TOOLTIPHWND |
Supported events
The events for the PWS TREEVIEW are generated and rendered by the PWS client browser JavaScript operations. The following events are supported by the PWS TREEVIEW.
|
Event |
Note |
|
Change |
|
|
Click |
|
|
DoubleClick |
Not when using mobile device |
|
GotFocus |
|
|
LostFocus |
|
|
Validate |
|
Unsupported events
|
Event |
|
DragDrop |
|
DragOver |
|
KeyPress |
|
MouseDown |
|
MouseMove |
|
MouseUp |
Supported methods
|
Method |
Note |
|
DeleteAll |
|
|
DeleteItem |
|
|
Expand |
The CODE parameter TVE_COLLAPSERESET is not supported. |
|
GetCount |
|
|
GetItemCheck |
|
|
GetItemImage |
|
|
GetItemParam |
|
|
GetItemSelImage |
|
|
GetItemState |
|
|
GetItemText |
|
|
GetNextItem |
|
|
GetVisibleCount |
Different from the Windows Control. See behavior note (b.) below. |
|
GetWebId |
|
|
GetWebStyle |
|
|
GetXmlDataSize |
|
|
InsertItem |
The string can be specified as simple text or a well formed HTML data string. |
|
LoadXmlFile |
|
|
SaveXmlFile |
|
|
SaveXmlToDim |
|
|
SelectItem |
|
|
SetImageList |
|
|
SetItem |
The string can be specified as simple text or a well formed HTML data string. |
|
SetItemCheck |
|
|
SetItemState |
|
|
SetWebStyle |
|
|
SortChildren |
|
Unsupported Methods:
|
Method |
|
GetLastDropXY |
|
ItemHitTest |
PWS TREEVIEW operational behaviors:
A single end-user click action on a PWS TREEVIEW parent node causes the expand or collapse action of the children nodes. A double click action is ONLY possible when using a client browser that does not exist on a mobile device.
The PWS TREEVIEW GetVisibleCount returns the total number of nodes that are available to become visible in the TREEVIEW view. The PWS TREEVIEW GetVisibleCount can be greater than the number of current nodes showing in the TREEVIEW view. The value identifies all nodes which are currently expanded and can be scrolled into the PWS TREEVIEW view. The PWS TREEVIEW GetVisibleCount return value is different than the Windows TREEVIEW GetVisibleCount value which is calculated using the TREEVIEW height and the node height.
The SETPROP CHECKBOX property operation only takes affect for the PWS TREEVIEW. This same operation does not have a visual affect for the Windows TREEVIEW control.
The PWS TREEVIEW object utilizes the '.treevp' and '.treevm' classes as described in the 'plbwebbasic.css' file. These classes allow end-users to control the visual presentation of the TREEVIEW background being applied for an item's button when the 'BUTTONS' property is turned on. The 'background-position' css style in the '.treevp' and '.treevm' classes can be changed to a setting as shown in the 'plbwebcss.info' file that is located in the 'http_root' directory. The descriptions as shown in the 'plbwebcss.info' file correspond to the 'jQuery Framework Icon' images shown at the URL ' http://jqueryui.com/themeroller/' link. In addition, a HTML web page named 'plbwebtvcssinfo.html' located and provided in the 'http_root' directory. This web page can be executed\used to show all of the available JQuery ui-con images along with the corresponding 'background-position' settings.
See Also: Example Code, Object Definitions, Object Output Instructions
![]() |