TREEVIEW
|
Syntax: |
TREEVIEW([<WAIT|NOWAIT>,
<Exit Macro>, <Split-Windowcall Handle>], <Array>, <Default Value>, <Count>,
<Separator>, <Header>, <Height in Rows>, <Width in
Columns>, <Element Height in Pixel>, <Expand Level> [,<Edit> [,<Red>,
<Green>, <Blue>]])
|
||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||
|
Meaning: |
Creates a Treeview which is displayed in a
window. WINDOWPOS defines the position of the TREEVIEW window. TREEVIEW is inserted on the mask like a mask
field if the following 2 conditions are fulfilled: 1. The parameter NOWAIT is specified. 2. The variable EBUS_CHILDWINDOW is not 0. In this case the TREEVIEW can be called like
the other fields by the keys <→|>, <↓>, etc. In the <Exit Macro> the variable EBUS_DATA contains the return code of the TREEVIEW. With NOWAIT the TREEVIEW is started and the
function is terminated immediately and returns the handle of the TREEVIEW.
With the instruction CLOSE_TREEVIEW(<Handle>) a
TREEVIEW opened by NOWAIT can be closed. With WAIT the TREEVIEW is started
hierarchically: The function is only terminated when the TREEVIEW is
terminated. The Macro <Exit Macro> is executed
after the TREEVIEW has been terminated. If WAIT or NOWAIT is specified, an <Exit
Macro> must also be specified. With NOWAIT the variable EBUS_DATA contains in the <Exit Macro> the returncode of the TREEVIEW. If the TREEVIEW is to be displayed in the
split window, <Split-Windowcall Handle> must contain the handle of the
split window. If
the TREEVIEW is to be inserted on a WINDOWCALL
mask like a mask field, EBUS_CHILDWINDOW
must be <> 0 and <Split-Windowcall Handle> must contain the handle
of a WINDOWCALL mask. If the parameters [WAIT | NOWAIT,<Exit
Macro>,<Split-Windowcall Handle>] ar missing, this is equivalent to
WAIT. With NOWAIT all ON <Event> Macros are saved when the TREEVIEW is started and left. When the
TREEVIEW is activated again the last state of the switches and ON
<Event> Macros is restored. After each ON <Event> Macro that is executed in the TREEVIEW, the ON <Event> Macros
are saved again. <Array> is the name of the variable of
a one-dimensional String Array. It is enough to define only the name of the
variable without indices. The elements of <array> define the structure of
the tree from top (the root) to bottom and must have the following structure:
<Level><Separator><Image
Name><Separator><Text> <Level> is a number that specifies the
nesting depth of the tree. The 1st element of <Array> (that is element
No. 1, element No. 0 is not considered) designates the root and therefore has
the value 0 as <Level>. All following elements must have a
<Level> > 0. <Image Name> defines the image to be
displayed in the tree. In addition, the images used in the tree should be
made familiar to the program with #ADD_IMAGE
so that they can be entered into the jar file. <Text> is the text to be displayed next
to the image in the tree. <Default Value> defines which element of the tree
is selected at the start of TREEVIEW. The tree is expanded automatically so
that the requested element becomes visible. The <Text> of the element
or the full path of the element can be specified as <Default Value>.
The path consists of the texts separated by <Separator> from level 0 up
to the level of the element to be selected (see example=. If only the
<Text> specified and if this <Text> appears several times in the
tree, the first found element is selected. If <Default Value> is the
empty string "", the root element is selected. <Count> is the number of elements used
by SELECTA. The 1st element in the table is the element No. 1.
Element No. 0 is not used by TREEVIEW. It must be secured that a correct
value is transferred. It is not checked whether <Count> is bigger than
the dimension of the variable. If this is the case, runtime errors are
reported. <Separator> defines the character by
which <Level>, <Image Name> and <Text> are separated. If
<Separator> is the empty string, the semi-colon ";" is the
Separator. <Header> defines the window header. <Height in Rows> and <Width in
Columns> define the size of the TREEVIEW in rows and columns. <Element Height in Pixel> defines the
height of the TREEVIEW elements. If <Element Height in Pixel> <= 0
the optimal height is computed by the size of the images and the size of the
font. <Expand
Level> defines up to which level the tree is expanded at the start. If <Edit> <> 0, the elements of
the tree can be edited after clicking twice (Note: no double-click!).
By the function TREEVIEW_EDIT_TEXT elements can be edited even if <Edit> = 0. The background color of the TREEVIEW is
defined by <Red>, <Green> and <Blue>. If one of these
parameters < 0, the standard background color is used. All ON SELECT(<Key>)
Macros work in the TREEVIEW. When these Macros are executed EBUS_TREEVIEW$ contains the path and EBUS_TREEVIEW the number of the currently selected element. TREEVIEW returns the following values:
|
||||||||||||||||||||||||||||||||
|
Parameter: |
|
||||||||||||||||||||||||||||||||
|
Sample: |
DIM T$(20) T$(1) =
"0;contact.png;Contact person" T$(2) = "1;company.png;Fritsch GmbH" T$(3) = "2;person.png;Huber Franz" T$(4) = "2;person.png;Meier Josef" T$(5) = "1;company.png;Karo Verlag" T$(6) = "2;person.png;Hübner Jutta" T$(7) = "2;person.png;Bauer Sigrid" T$(8) = "2;person.png;Talhammer Bernd" T$(9) = "2;person.png;Arndt Erich" /* DAFAULT$ contains
the full path DEFAULT$ = "Contact person;Karo Verlag;Arndt
Erich" WINDOWPOS(0,0) H% = TREEVIEW(T$,DEFAULT$,9,";","Contact
persons",15,50,16,0) IF H% = -1 THEN … Error … ENDIF |
||||||||||||||||||||||||||||||||
|
See also: |
|
–