Loading...
 

Expand,Collapse,ExpandAll,CollapseAll

Expand,Collapse,ExpandAll,CollapseAll

Expand(windowID, oboxID), Expand(, oboxID), Expand
ExpandAll(windowID, oboxID), ExpandAll(, oboxID), ExpandAll
Collapse(windowID, oboxID), Collapse(, oboxID), Collapse
CollapseAll(windowID, oboxID), CollapseAll(, oboxID), CollapseAll

parameters: Widget identifier that refers to an Object Box.

Stack
Stack Position Description
Stack(In) Top one object
Stack(Out) Top -

In the case of structured data, the object is searched for by the stack and is expanded in Expand and collapsed in Collapse.
The variants ExpandAll and CollapseAll not only expand and collapse the object itself, but also recursively expand and collapse all subordinate objects up to those that do not have any further subordinate objects (Leaves).

If NULL is passed as an object on the stack, the actions are performed with respect to the top (virtual) node (root), i.e. they affect the entire structure.

To refer to the current selection for the action rather than to an object, use the corresponding commands OboxExpand,OboxCollapse,OboxExpandAll,OboxCollapseAll.

As an interactive variant, the user can press the displayed + button to the left of the objects. The keys "+", "-", "*", "/" are assigned to Expand,Collapse,ExpandAll,CollapseAll by default. If you do not define the system events of these keys: PLUS,MINUS,MULTIPLY,DIVIDE the default actions will be executed automatically, i.e. obsolete ones e.g. "PLUS: GetObjectsSelected Expand" will be defined.

The Expand / ExpandAll functions only work "down". If you want to display an object that sits deeper in the tree and expand the tree up to this element, these functions are not helpful.

The following macro can be used as a work around instead:


Define(ExpandObjectInTree)
Var(tmpVector) [] -> tmpVector
do
Dup ifnot { Drop break }
Dup tmpVector Insert
Get(transaction)
loop
tmpVector iterate { Expand(, this) }
;

In this example allocationTxn is the object which should be displayed in the tree for selection. To expand the tree up to this point, all higher positions must be expanded. So in the do-loop loop, the higher positions found are recursively expanded and the higher positions found are expanded in reverse order (to the order in which they were collected).


// expand all upto the object should be selected
allocationTXN ExpandObjectInTree
allocationTXN Select(, this)