InsertItem Method (TREEVIEW)
PLBCMP GUI Only
The InsertItem method adds a new item into a TREEVIEW object. The method uses the following format:
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
Where:
label
Optional. A Program Execution Label.
object
Required. A TREEVIEW object into which an item is inserted.
return
Optional. A Numeric Variable that contains the new item's handle or zero if the method fails.
text
Required. A Character String Variable or literal that specifies the text associated with the new item.
parent
Required. A decimal number or Numeric Variable that specifies the parent item handle.
after
Required. A decimal number or Numeric Variable that specifies the item handle after which the new item should be inserted.
image
Optional. A decimal number or Numeric Variable that specifies an IMAGELIST index to associate with the item.
selimage
Optional. A decimal number or Numeric Variable that specifies an IMAGELIST index to display when selected.
param
Optional. A decimal number or Numeric Variable that specifies a user-defined value.
Flags Affected: EOS, OVER, ZERO
Note the following:
{parent} is a variable, literal or a constant as defined in PLBMETH.INC indicating one of the following actions:
|
Value |
Constant |
Insert the item ... |
|
nnn |
|
subordinate to item nnn. |
|
0xFFFF0000 |
TVI_ROOT |
as the root item. |
{after} is a variable, literal or a constant as defined in PLBMETH.INC indicating one of the following actions:
|
Value |
Constant |
Insert the item after ... |
|
nnn |
|
item handle nnn. |
|
0xFFFF0001 |
TVI_FIRST |
the first sibling item. |
|
0xFFFF0002 |
TVI_LAST |
the last sibling item. |
|
0xFFFF0003 |
TVI_SORT |
in sorted order. |
{param} is a user-defined value and must be a four byte INTEGER.
Upon completion, {return} will contain the new item handle or zero if the method fails.
If the value returned is zero, the ZERO Condition Flag is set.
If {return} is too small to contain the new item handle, the OVER Condition Flag is set. To ensure correct results, {return} should be defined as a four byte INTEGER or a ten byte FORM.
The EOS Condition Flag is always cleared.
For improved performance in the Application Server environment, do not specify the optional return value and parameters unless needed.
See Also: Example Code, Method Syntax, TREEVIEW Methods
![]() |