InsertItem Method (TREEVIEW)


PLBCMP GUI Only

 

The InsertItem method adds a new item into a TREEVIEW object. The method uses the following format:

 

[label]

{object}.InsertItem

[GIVING {return}] USING [*Text=]{text}:

 

 

[*Parent=]{parent}:

 

 

[*After=]{after}[:

 

 

[*Image=]{image}][:

 

 

[*SelImage=]{selimage}][:

 

 

[*Param=]{param}]

 

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:

  1. {parent} is a variable, literal or a constant as defined in PLBMETH.INC indicating one of the following actions:

  2.  

    Value

    Constant

    Insert the item ...

    nnn

     

    subordinate to item nnn.

    0xFFFF0000

    TVI_ROOT

    as the root item.

 

  1. {after} is a variable, literal or a constant as defined in PLBMETH.INC indicating one of the following actions:

  2.  

    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.

 

  1. {param} is a user-defined value and must be a four byte INTEGER.

  2. Upon completion, {return} will contain the new item handle or zero if the method fails.

  3. If the value returned is zero, the ZERO Condition Flag is set.

  4. 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.

  5. The EOS Condition Flag is always cleared.

  6. 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

 



PL/B Language Reference GetXMLDataSize Method (TREEVIEW) ItemHitTest Method (TREEVIEW)