SELECTA
|
Syntax: |
SELECTA([<WAIT|NOWAIT>,
<Exit Macro>, <Split-Windowcall Handle>], <Array>,<Default Value>, <Count>,
<Header>, <Column Headers>, <Color Column Headers> [,<@Image Separator>, <Image
Display>] [,<Separator> [,<Minimum Rows> [,<Color Separator>[,<Helptext
Separator>[,<Invisible
Separator>]]]]])
|
||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||
|
Meaning: |
SELECTA opens a window that shows the data
from a one-dimensional String Array. WINDOWPOS specifies the position of the SELECTA Window. SELECTA works in the same way as the function
SELECT. SELECTA is inserted on the mask like a mask
field if the following 3 conditions are fulfilled: 1. The parameter NOWAIT is specified. 2. The title is the empty string "". 3. DISABLE
WINDOW_BORDER is set. Or 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 SELECT 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 SELECT. With NOWAIT the SELECT is started and the
function is terminated immediately and returns the handle of the SELECT. With
the instruction CLOSE_SELECT(<Handle>) a SELECT opened with NOWAIT can be closed. With WAIT the SELECT is started
hierarchically: The function is only terminated when the SELECT has been
terminated. The Macro <Exit Macro> is executed
after the SELECT has been terminated, either by closing the window, by ESC or
by the instructions ENDSELECT or QUITSELECT. If WAIT or NOWAIT is specified, an <Exit
Macro> must be specified as well. With NOWAIT the variable EBUS_DATA contains in the <Exit Macro> the return code of the
SELECT. If the SELECT is to be displayed in a split
window, NOWAIT has to be specified and <Split-Windowcall Handle> must
contain the handle of the split window. If
the SELECTA 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-Handle>] are missing, then this is equivalent to WAIT. With NOWAIT all ON <Event> Macros are saved every time the SELECTA is started and left. When
the SELECT is activated again the last state of the switch and ON
<Event> Macros are restored. After every ON SELECT(<Key>) Macro that is executed in SELECTA, the ON <Event>
Macros are saved again. <Array> is the name of the variable of
a one-dimensional String Array. Only the name of the variable without indices
is to be specified. Each element of <Array> is shown as a line in
SELECTA. The content of a line can be divided into any number of fields by
the 1st character of <Separator>, which are then displayed in columns. Multi-line texts can be displayed in SELECTA.
A line wrap is created by EBUS_LINEFEED$ or by <html>
… <br> … </html>. Sample: DIM ARRAY$(10) ARRAY$(1) =
"This is a text" + EBUS_LINEFEED$
+ "with 2 lines." ARRAY$(2) =
"<html>This is also a text<br>with 2
lines.</html>" With <Default Value> any string
expression can be specified. When the function SELECTA is called all entries
in <Array> are compared to <Default Value>. If they are
identical, the found table element is displayed selected. If <Default
Value> is the empty string "" or if no element is found in the
table which equals <Default Value>, the first element of the table is
displayed selected. Several lines can be displayed selected as <Default
Value>. The entries in <Default Value> must therefore be separated
by CHR$(9) (TAB). <Count> is the number of elements that are used
by SELECTA. The first element in the table is element No.1.Element No. 0 is
not used by SELECTA. A correct value must be transferred. It is not checked
whether <Count> is bigger than the dimension of the variable. If this
is the case, runtime errors are reported. <Header> defines the Window title. <Column Headers> defines the headers of the
columns. If <Column Headers> contains the empty string "", no
column header is displayed. <Color Column Headers> defines the color of the column title line.
The number of an RGB color must be specified. If <Color
Column Headers>
< 0 or > 255, RGB(0) is used. The SELECT can also display images. For this
purpose an @<Image Separator> must be specified. The character @ marks
the image separator. If a field begins with this character, the text after
this character is interpreted as image and the image is displayed instead of
the text. <Image Display> defines how the image
is to be shown:
The
display type left / middle has no effect if the field has an individual
attribute left/right/centered. It is possible to load images from WEB. The name
of the image has to start with one of the following prefixes: http: https: ftp: ftps: <Separator> can contain up to 4
separators: The 1st
character in <Separator> divides the fields in the elements of
<Array> and in the <Column Headers>. An appropriate number of
columns is the displayed. If <Separator> contains the empty string
"", only one column is displayed in SELECTA. The 2nd character in <Separator>
specifies which field contents are to be shown right-bound. The character
must be specified as first character in the elements of <Array> with
the respective field value. By default, the field content is shown
left-bound. The 3rd character in <Separator>
specifies which field contents are to be shown centered. The character must
be specified as first character in the elements of <Array> with the
respective field value. The 4th character in <Separator> marks checkboxes.
It can only be specified in the <Column Headers> and applies to the whole
column. All elements of the column are then displayed as checkbox. A checkbox
is shown as set if the 1st character of the column element is the
character CHR$(EBUS_CHECKBOX_Y). If the column
element of a checkbox is the empty string "", no checkbox but an
empty field is displayed. The 5th character in <Separator> marks comboboxes.
If it is specified in the <Column Headers> it applies to the whole
column. If a field of the column is edited with SELAEDIT a combobox appears where an item can be selected. The elements of the
combobox have to be added behind the column header (separated by the combobox
separator). Sample:
The combobox separator is § COLUMN_HEADER$ =
"No;§DayOfWeek§Monday§Wednesday§Friday§Sunday;Date;..." The 2nd column has the header
"DayOfWeek". If a field of the 2nd column is edited by SELAEDIT, a
combobox with the following items appears: Monday Wednesday Friday Sunday It is possible to edit a single field with a
combobox. The combobox separator must not occur in the column header. The
combobox items have to be added behind the field value separated by the
combobox separator. Sample:
The combobox separator is § COLUMN_HEADER$ = "No;DayOfWeek;Date" T$(1)
= "1;Feast day;12-25-2011" T$(2)
= "1;Wednesday §Monday§Wednesday§Friday§Sunday;12-14-2011" The
2nd column of T$(1) is edited like an
alphanumeric field. If
the 2nd column of T$(2) is edited a combobox with
the following items appears: Monday Wednesday Friday Sunday The items, which are shown when the combobox
is opened, can have individual colors. The colors have to be added at the end of the item
in the following format: #<F-Red,F-Green,F-Blue,B-Red,B-Green,B-Blue> In
this case the character # cannot be used as combobox separator. F_Red,
F-Green and F-Blue specify the foreground color and B_Red, B-Green and B-Blue
specify the background color Sample: The
combobox separator is § T$(2)
= "1;Wednesday §Monday§Wednesday§Friday§Sunday#<255,255,255,255,0,0>;14.12.2011" Sunday is displayed with red background color and white
foreground color. Note: Combobox fields have to
be edited by SELAEDIT with Field Type = A (alphanumeric). The Separators for right-bound and centered
can also be specified in the <Column Headers>. They then apply to all
elements of the column except of those elements that have their own
Separator. If for a column element a <Color
Separator> is specified, the separator must stand behind the
<Color Separator> for a right-bound or centered display. <Minimum Rows> defines the minimum of
rows to be displayed in the SELECTA window. Colors can be assigned to rows, columns or
single column elements by inserting a color code. The color code is composed
of the first character of <Color Separator> and a <Color>. <Color> contains in pointed brackets
<Foreground Color , Background Color>.
As fore- and background color the number of an RGB color or a negative number must be specified. With a negative number
the respective color is not set; the standard fore- or background color
applies instead. Sample:
The color character is @ RGB(1) = 255,0,0 /* red RGB(2) = 0,0,255 /* blue @<1,2>
specifies red on blue @<1,-1> sets
the foreground to red, the background remains unchanged @<-1,1> sets
the background to red, the foreground remains unchanged Colors can also be defined in the <Column
Headers>. They then apply to all elements of the column except of those
elements that have their own color. The color for one single column element
(field) is defined by inserting a color code. The color for a whole row is defined by
inserting a color code before the row. This
color code then applies to all fields of this row. A color code must thus be
inserted before every field of the row that is to be displayed in the normal
mode or in a different color. With <Color Separator><-1,-1> the
field is displayed in the normal mode (no color). Note:
The color of the first field of a row always applies to the whole row. If
the other fields of a row are to have no color, <Color
Separator><-1,-1> must be specified for every field. Since different color codes can be assigned
to rows and columns and fields, the following priority rules apply: The highes priority for the color of a field
has the color code of the field. If no color is defined for a field, the color
of the row applies. If no row color is specified wither, the
color of the column applies. If
a <Helptext Separator> is specified, the text after the <Helptext
Separator> in the elements of
<Array> which are separated by Separator is displayed when the
mouse is over the corresponding element. If
a <Invisible Separator> is specified, the text after the <Invisible
Separator> is not displayed on the screen. Invisible text has to be placed
at the end of the column elements. The ON SELECT(MOUSE) Macro is executed in SELECTA if the left mouse button has been pressed
and one or more of the keys SHIFT, Alt or Ctrl are being pressed at the same
time. In the ON SELECT(...)
Macros the variables EBUS_SELECT_POS and EBUS_SELECTA can be set. After the Macro has been executed
the respective line is selected. The variable EBUS_SELECT_FIXCOLUMNS defines which columns of SELECTA are fixed. Fixed columns always
remain visible even if the horizontal scroll bar of the SELECT is shifted to
the right. SELECTA returns the following values: -1: runtime error -2:
SELECT can be called into a split window only with NOWAIT. -3: error: <number> <= 0 > 0: SELECTA returns the number of the
Array element that has been selected. 0: No element has been selected, SELECTA has
been left with <Esc> or QUITSELECT. When SELECTA has finished the variable EBUS_SELECTA_SELECTED_ROWS$
contains the numbers of the selected rows. The numbers in EBUS_SELECTA_SELECTED_ROWS$
are separated by ";". |
||||||||||||||||||||||||||||||||
|
Parameter: |
|
||||||||||||||||||||||||||||||||
|
Sample: |
DIM T$(10) /* specifiy colors RGB(0) = 0,0,0 /* black RGB(2) = 0,128,0 /* green RGB(4) = 128,0,0 /* red RGB(5) = 255,0,0 /* light red RGB(6) = 255,255,0 /* yellow RGB(15)
= 255,255,255 /* white WHITE_RED$
= "\<15,4>" BLACK_YELLOW$
= "\<0,6>" WHITE_GREEN$
= "\<15,2>" WHITE_LIGHTRED$ = "\<15,5>" T$(1) = WHITE_RED$ + "dark red;" +
BLACK_YELLOW$ + "yellow|yellow text;" +
WHITE_GREEN$ + "green in red column" T$(2) = BLACK_YELLOW$ + "yellow|yellow
text;" + WHITE_LIGHTRED$ + "light red;" + WHITE_RED$ +
"red column line 2" T$(3) = WHITE_GREEN$ +
"green;\<-1,-1>normal; " +
WHITE_RED$ + "red column line 3" T$(4) = "normal;" + WHITE_LIGHTRED$ +
"ligth red; " +
WHITE_RED$ + "red column line 4" T$(5) = WHITE_LIGHTRED$ + "This line is light
red;;" + WHITE_RED$ T$(6) = "\<2,-1>Only text is green.;;"
+ WHITE_RED$ SELECTFONT
= 0 WINDOWPOS(0,0) H% = SELECTA(T$,"",10,"Color
in SELECTA",
"Column 1;Column 2;" + WHITE_RED$ +
"@dark red column right aligned", 0,";@",0,"\","|") /* If the mouse is over
one of the fields "yellow" the tooltip text /* "yellow
text" is displayed.
/* Color in SELECTA without columns DIM T$(10) /* specify colors RGB(0)
= 0,0,0 /* black RGB(2)
= 0,128,0 /* green RGB(4)
= 128,0,0 /* red RGB(5)
= 255,0,0 /* light red RGB(6)
= 255,255,0 /* yellow RGB(15) = 255,255,255 /* white WHITE_RED$ = "\<15,4>" BLACK_YELLOW$ = "\<0,6>" WHITE_GREEN$ = "\<15,2>" WHITE_LIGHTRED$ =
"\<15,5>" T$(1) = "This line is normal" T$(2) = WHITE_RED$ + " This line is red." T$(3) = BLACK_YELLOW$ + " This line is yellow." T$(4) = WHITE_GREEN$ + " This line is green." T$(5) = WHITE_LIGHTRED$ + " This line is light
red. " T$(6) = "\<2,-1>Only text is green." SELECTFONT = 0 WINDOWPOS(0,0) H% = SELECTA(T$,"",10,"Color in
SELECTA","",0,"",0,"\")
|
||||||||||||||||||||||||||||||||
|
See also: |
EBUS_SELECT_LINEWIDTH_HORIZONTAL EBUS_SELECT_LINEWIDTH_VERTICAL |