Adding a "Combo Box" Object to a Screen

Navigation:  How to Work with Screens > Adding Menu/Selection Objects to a Screen >

Adding a "Combo Box" Object to a Screen

Previous pageReturn to chapter overviewNext page

 

Object Purpose

 

This object is used to allow the operator to define data by selecting it from a fixed list. The data to be displayed by this object can be entered or come from a variable ("Text/Variables") or from values stored in a data file field ("Data File") or a local database table field ("Local Database"). The selected data is stored in user variables and can, then, be further processed or stored. See Variable Definition.

This fixed list of values is presented as a drop-down list on the screen of the device.

 

Add this input object to a screen by dragging a "Combo" object from the top section of the "Control" tab OR  the "Preview" section onto the screen.

 

Step-by-Step

 

1. Drag the object onto the screen:

 

If dragged from the "Control" tab, the object will assume the default style.

 

If dragged from the "Style Preview Section", it will assume that particular style.

 

2. Now, double-click the selected object on the screen OR  the tree view to open the "Properties" window.

 

 

The "General" tab is open by default.

 

3. In the "Source Type" option, select the source of the values to be displayed in the "Combo Box" object ("Text/Variables", "Data File" or "Local Database").

 

4. Fill in the options according to the selected "Source Type".

 

When selecting the Text/Variables” option, follow these instructions:

 

a. Value to Display column

Define the name of each list item. Either enter the name of each item/button in the corresponding box or click and select a variable with the intended value. See Variable Definition.

 

b. Value to Return column

Fill in this column to provide an alternative text for each list item. Enter the alternative value or click to select a variable with the intended value.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

c. In the "Store Selected Item (Value or Line Number) into Variable" option:

 

I. Var. (Value) - Click to select the variable that will receive the selected item value. See To Select/Create a Variable.

 

II. Var. (Line No) - Click to select the variable that will receive the selected item line number.

 

d. Continue to Step 5.

 

When selecting "Data File", the corresponding options become available. Proceed as follows:

 

 

a. Select a data file from the "File Name" drop-down list. If required, click to edit the selected data file. See Editing a Data File

 

b. In the "Field to Display" box, select the data file field to be displayed from the drop-down list.

 

c. In the "Field to Return" option, define the field that contains the value to return.

 

d. In the "Store Selected Item (Value or Line Number) into Variable" option:

 

I. Var. (Value) - Click to select the variable that will receive the selected item value. See To Select/Create a Variable.

 

II. Var. (Line No) - Click to select the variable that will receive the selected item line number.

 

e. Proceed to Step 5.

 

When selecting "Local Database", the corresponding options become available. Proceed as follows:

 

 

a. In the "Table" box, select a table from the drop-down list. See How to Work with a Local Database.

If required, click to open the "Join Tables" window. See To Join Tables.

 

b. In the "Field to Return" option, define the field that contains the value to return.

 

c. In the "Field to Display" drop-down, select the data file field to be displayed.

 

d. In the "Store Selected Item (Value or Line Number) into Variable" section:

 

I. Var. (Value) - Click to select the variable that will receive the selected item value. See To Select/Create a Variable.

 

e.Continue to Step 5.

 

5. Go to the "Query" tab.

 

 

6. If the object's data source is a data file or a local database table, you can define a query using "where conditions" in the "Where Clause" table. The Query Assistant will help you define the criteria for the necessary "Where" clause(s) (fields, operand, value type).

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

If the query is not available or needed, continue to step 8.

 

 

Double-click the required row or click the corresponding .

The content of the resulting window (Query Assistant)depends on the row selected in the "Where Clause" table (the first row (A) or any of the other rows (B)).

 

If the Query Assistant is called from A

If the Query Assistant is called from B

 

 

 

 

(... ...)

If needed,check the most adequate parenthesis for your Where clause.

And  Or

(...   ...)

Check “And” or “Or” and, if needed, the most adequate parenthesis according to your Where clause.

Table Field

Select the data file/table field (depending on the selected data source) from the drop-down list or click to select a variable with that value.

Table Field

Select the data file/table field (depending on the selected data source) from the drop-down list or click to select a variable with that value.

Operand

Select a comparison operand from the drop-down list.

Operand

Select a comparison operand from the drop-down list.

Num.

Check this option if the Where clause requires numeric values.

Num.

Check this option if the Where clause requires numeric values.

Text

Check this option if the Where clause requires text values.

Text

Check this option if the Where clause requires text values.

Value/Field

Click to select a variable with the required value or select a table field from the drop-down list.

Value/ Field

Click to select a variable with the required value or select a table field from the drop-down list.

Value/Field ...

Click to select a variable with the required value or select a table field from the drop-down list.

Its activation depends on the defined “Operand”.

Value/Field ...

Click to select a variable with the required value or select a table field from the drop-down list.

Its activation depends on the defined “Operand”.

Click to apply these options and return to the "Query" tab.

 

7.This option only applies if the data source for the "Combo Box" is a local database table. As an option, use the "Order By" table to sort the order of the table fields.

 

8. Go to the "Layout" tab.

 

 

9. Define the object's style by selecting an option from the drop-down list or by clicking . See Editing and Creating Styles and Editing and Creating the "Combo Box" Style.

 

10. Position the values, within each button, with the alignment buttons.

 

11. Maintain the given values or specify the object's position/size within the screen, by providing the "X" and "Y" coordinates as well as "Width" and "Height".

 

Detail of Position/Size values

 

 

12. In the "Control Settings", attribute a name to the object. This name is displayed in the tree view.

 

13. Consider whether or not to check the following options:

"Enable"

Activates the object's input feature.

"Tab Stop"

Must be checked to enable a "Change Tab Order". This provides the possibility to change the order (between data input objects) in which the information is keyed in by the device operator.

"Visible"

Controls the object's visibility in the device's screen.

 

14. Define the "PullDown Layout":

"Lines to Display "

Select the amount of lines/rows that will appear on the device's screen when the "Combo" object is expanded.

"Default Position"

Select the row that will appear when the "Combo" object is collapsed.

 

Use the right click in MCL-Designer's input boxes to access certain features regarding the input box's option as well as general actions such as "Copy"; "Paste"; "Search".

Ex: If you right-click the "Text Data" input box (included in a "Display Text" properties window), you are provided with the "Paste", "Search..." and "Variable Select" options.

If you right-click any other input box, it will provide other possibilities.

 

 

15. Go to the "Actions" tab.

 

Keep in mind that there is always a default event (ex: "On Change"; "On Timer"; "On Hotkey"; etc.) attached to the object (in this case, an "On Change" event). If you want the event to trigger an action, you must add processes to it (ex: "Go To"; "Check File"; "Set Focus"; etc.).

 

 

16. To edit the event, double-click the event row ("On Change") OR  right-click the event row and select "Edit..." in the resulting menu. Either of these choices opens an "Edit Event" window.

 

 

17. Select from the drop-down (B) or (C) list:

 

A

This event, performed by the device operator, is the "trigger" that enables an action to advance the application. It cannot be modified.

Default event: "On Change" - Is triggered when the operator enters data via the "Combo Box" object.

B

Provides targets for a "Go to" action (see Working with the Branch Processes Group). After the device operator has fulfilled the "On Change" event, the workflow will proceed to the selected destination. If you want to add processes other than a "Go to", select the <Action> option.

C

Provides quick links for a "Go to" action ("Next Screen"; "Exit"; etc.) to be executed when the event is fulfilled.

See Detail of a window below.

 

Detail of a window

 

This window is an alternative to the drop-down list of destinations. Select a destination screen or routine within the same program as this object, in the left table. Specify the target even more by selecting from the table to the right. The available options are a consequence of your choice in the left table.

If you want to add more processes, select the <Action> option.

Finish this operation by clicking .

 

18. If required, add processes to the event. See Adding and Editing Processes.

 

This object has predefined local variables (only available in event context). See Combo Box's Predefined Local Variables.

 

 

 

Before concluding the addition operation, check the following:

 

Remember that the "Enable" option (located in the "Layout" tab) must be checked so that the added actions/processes run.

 

 

If required, use the icons located on the upper right corner of the "properties" window:

 

Click this icon to create a new data file. Go to Creating a Data File to see how to fill in the several options available.

 

Click this icon to open a "Localization" window where you can edit the text element within that object or add translations to it. See Localization.

 

Click this icon to attach any relevant notes to this object. Enter your text in the resulting window. This information is displayed in the "Developer report". See Report.

 

 

 

19. Click in the "Actions" tab to apply the choices made.

 

The "Combo" object has been successfully added to the screen.

 

 

 

If any subsequent edition of the object's properties is required, double-click the "Combo Box" OR  select " 'Combo Box' Properties" (in its right-click menu) to open the properties window.

 

 

 

If you want to view this object applied within an application, see Sample Applications.

 

 

Combo Box's Predefined Local Variables

 

This object has predefined local variables (only available in event context).

 

Event

On Change

Variable Name

L_Control_Name

L_Field_Value

L_Line_Number

Variable ID

&0a

&1a

&2a

Description

Stores the object's name (*)

Stores selected field value (**)

Stores selected field number

 

* Defined in the object's "properties" window ("Layout" tab).

** Defined in the object's "properties" window ("General" tab).