Windows control - List box
Windows control - List box is used to display a set of text information. User can select one particular data from displayed set. There are supported three basic types of list boxes - standard list box (right one in the sample below), drop-down list box (left one) and editable list box.
The list may be filled from a script or defined by a contents according to a
status text, which is connected to the object.
These conditions are applied for the second option:
- The connected object must be of Integer type.
- The value of status text in the object must be of REAL or INTEGER type. A usage must be defined for the values, a base value must be integer and a stem must be 1.
Notice:
- The empty string, defined for some of the values in the status text, cannot be inserted to the List box.
- The function %HI_GetSelectedItem returns an index (from 1 ...) of the current (selected) row in the list box. The index need not correspond with the consecutive number of status text (the order corresponds providing that the extended status text is not used - it increases the number by 1 and the status text does not contains any empty items).
List box may be conditioned that it must be filled in HI. If any item is not selected, or editable list box is empty, the background of list box matches with the color defined in application parameters. In D2000 GrEditor, the entry field is always colored according to this parameter. Drop-down list in rolled-up state has appearance that corresponds with Windows appearance.
Conditions for using background:
- Optional item - no change of color (default),
- Conditioned mandatory item – color set according to application parameters ColorConditionalItems
- Mandatory item – color set according to application parameters ColorMandatoryItems
Example
To create list box
- In the Drawing toolbar click the button List box .
- Point the mouse cursor to the position of the first displayer corner and click.
- Point the mouse cursor to the position of the diametric displayer corner and click.
List box parameters are being configured in the palette Connect object through the following tabs:
Connect
Connected object
Selection of an object to connect. The object allows to set the number of selected list box line and vice versa - the value of the connected object is being changed when the user select any of the list box lines. Lines are numbered from above and numbering begins from 1. The object must be of integer type.
When you connect an object of Structured variable you must define whose
item will be connected to the list box. Unique item position in structured
variable is defined by the column name (the parameter Column) and the row
number (the parameter Row). For object of Value array you
must define which array item will be connected to the list box.
Note relating to D2000 Thin Client
Parameter is not implemented in Thin Client.
For more rules see the page Drawing rules and object properties for D2000 Thin Client.
Script
Reference variable
Specifies the name of the list box in the form of reference variable for use in the picture script.
Metadata
Assignment of application data (metadata) to a graphic object. If the object contains some metadata, the name of the first record will be displayed in the button. Multiple records are indicated by ",...".
Event
The list box allows user to select an active picture event for the list box. The list contains the following active picture events:
Event Handler
The button opens the active picture script to define the active picture event specified by the parameter Event.
Info text/URL
Info text
Text to display as a tooltip when user points the mouse
cursor to the list box in the picture opened in process D2000 HI.
Possibility to use the
Dictionary
(to open press CTRL+L).
URL
Definition of URL address to open a web page from a picture. The address may be set also in the picture script by the function %HI_SetOBJURL.
Properties
Text entry field may be conditioned that it must be filled in HI. If any text is not entered, the background of field matches with the color defined in application parameters. In D2000 GrEditor, the entry field is always colored according to this parameter.
Conditions for using background:
- Optional item - no change of color (default),
- Conditioned mandatory item – color set according to application parameters ColorConditionalItems
- Mandatory item – color set according to application parameters ColorMandatoryItems
Text
The parameter is useless for this type of Windows control.
Visible
If the parameter is checked, the list box will be visible after first opening the picture in process D2000 HI. The parameter can be controlled from the script using the function %HI_SetVisible.
Disabled
If the parameter is checked, the list box will be disabled after first opening the picture in process D2000 HI. The parameter can be controlled from the picture script using the function %HI_SetEnable.
Group
The parameter allows you to set the list box as the first control of a group of Windows controls.
Type
The parameter Type allows to define the type of the list box. There are three values: List, Drop down list and Drop down combo.
List defines a standard list box (displayed in the right part of the sample above). Drop down list defines a list that displays just currently selected line and it is opened after clicking the button. Drop down combo is a modification of drop down list and allows to enter a text.
Note relating to D2000 Thin Client
List type - Drop down combo is not
implemented in Thin Client.
For more rules see the page Drawing rules and object properties for D2000 Thin Client.
Expand status text
If the parameter is checked, and there is defined a status text with the step of 1 for the connected object, the empty row will be inserted for a content of the status text. When selecting, it causes that the value of variable becomes invalid (it assigns the Invalid value).
Font
Clicking on the button placed right opens a list of text fonts. A font selected from the list will be used for the radio list box. For more information on text fonts see the topic Text fonts.
Dynamic searching
Parameter Dynamic searching is used for defining a type of dynamic searching in the windows control List box. It can be:
- No searching - keeps the previous behaviour of windows control.
- Searching - enables a dynamic searching that causes a selection of item, which is the most identical to a searched expression.
- Searching with restriction - the same as Searching option and it also temporarily removes the items that do not match the searched expression.
In the following table, there is shown a support for the dynamic searching in the different types of list box:
Searching | Restriction | |
---|---|---|
List | implicitly | NO |
Drop-down list | YES | YES |
Drop-down combo | implicitly | YES |
The use of implicit searching in a drop-down combo: After entering the searched string to the combo box and pressing the cursor control key up/down, the most identical item is selected.
The use of searching with restriction in the drop-down list: According to the entered string, the contents of the list are restricted to the identical items. If some of the items is selected, or the list is closed, the content reverts to initial state.
0 komentárov