User:Jcreer/SMS:DMI Widgets and Dialogs Elements
Element <check_box>
Info | Widget that displays text that is checked/unchecked. |
Versions | 1, 2 |
Attributes | none |
Children | text, default, unique_name, dependency, export_text_checked, export_text_unchecked, text_style |
Used by | item |
Example |
<check_box> <text>Calculate Sediment Transport</text> <default>checked</default> <unique_name>togCalcSedimentTransport</unique_name> <export_text_checked>ON</export_text_checked> <export_text_unchecked>OFF</export_text_unchecked> <dependency>…</dependency>… </ check_box > |
Element <combo_box>
Info |
Widget that displays list of options. Only 1 can be selected. If no default is specified and the optional tag is present, then an empty option will be added to the combo box. If there is no default tag, and no optional tag, then the first item will be default. In version 2, if a combo box has display_options_arc, and is part of a dialog that is used as an arc attribute, then a limited set of display options will appear for the options of the combo box. The display option for each option of the combo box will only be line thickness and color. The display option is NOT saved at any point and will be reset every time SMS is opened. |
Versions | 1, 2 |
Attributes | none |
Children | option, unique_name, optional, dependency, text_style, display_options_arc |
Used by | item, row, column |
Example | Creates a combo box with hours, minutes and seconds. Hours is the default item.
<combo_box> <unique_name>cbxTransportUnits</unique_name> <option> <text>hours</text> <default></default> </option> <option> <text>minutes</text> </option> <option> <text>seconds</text> </option> <dependency>…</dependency>… </ combo_box > |
Element <contains>
Info | Holds all the groups and items of a group. |
Versions | 2 |
Attributes | none |
Children | group, item |
Used by | group |
Example |
Element <control_curve>
Info | Displays an curve push button. When pushed the xy curve values can be updated and a curve is displayed. |
Versions | 2 |
Attributes | none |
Children | max_rows, flags, x_column, y_column, unique_name, dependency |
Used by | item, row, column |
Example | This example creates a curve limited to 10 rows.
<item> <control_curve> <unique_name>myCurve1</unique_name> <max_rows>10</max_rows> <flags>XY_USEDATE</flags> <x_column> <text>Time </x_column> <y_column> <text>Velocity</text> </y_column> </control_curve> … |
Element <control_dataset>
Info |
Displays an edit box, and push buttons for select, delete and create. Once selected, the dataset string is placed into the edit box. <dataset_type> can be scalar or vector. Possible keyword outputs are file_name (which is the name of the dataset without path), geom_name, and file_path (full path c:\somewhere) and sms_path. |
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | push_button, dataset_type, unique_name, dependency, default, dataset_name, text_style, use_parameter |
Used by | item, row, column |
Example | This example creates the custom control with only the select and delete buttons.
<item> <control_dataset> <push_button>select<push_button> <push_button>delete</push_button> <dataset_type>scalar</dataset_type> </control_dataset> |
Element <control_date>
Info | Displays date and time selector, where a date can be selected. Possible output is value, which will be the date formatted as specified in SMS preferences. Possible outputs are year, month, day, hour, minute, second.
Keywords:
|
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | unique_name, dependency, default, text_style |
Used by | item, row, column |
Example |
<item> <text>Start date</text> <control_date> <unique_name>edtDate</unique_name> </control_date> <card> <card_name>DATE</card_name> <export_format>"%s Day:%s Month:%s Year:%s Hour:%s Minute%s Second:%s\n", #card_name, edtDate#DAY_DIGIT, edtDate#MONTH_LONG_NAME, edtDate#YEAR_4, edtDate#HOUR_24, edtDate#MINUTE_ZERO, edtDate#SECOND_ZERO</export_format> </card> </item> |
Element <control_density>
Info | Displays an edit box and combo box. Combo box can contain kg/m^3, gr/cm^3, lb/ft^3. Possible outputs are value and units.
Keywords:
|
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | option, unique_name, dependency, range, default, text_style |
Used by | item, row, column |
Example |
Displays kg/m^3 and lb/ft^3 in combo box. If kg/m^3 selected and exported, returns the text “kg m”. <item> <text>Density </text> <control_density> <option> <text>kg/m^3</text> <export_text>kg m</export_text> <unit_keyword>#MPV_KG_PER_CU_M</unit_keyword> </option> <option> <text>lb_ft^3</text> <export_text>lbs ft</export_text> <unit_keyword>#MPV_LB_PER_CU_FT</unit_keyword> </option> </control_density> … |
Element <control_duration>
Info | Displays an edit box and combo box. Combo box contains days, hours, minutes, seconds. Possible outputs are value and units.
Keywords:
|
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | option, unique_name, dependency, range, default, text_style |
Used by | item, row, column |
Example | Displays only minutes and hours in combo box. If hours selected and exported, returns the text “hrs”.
<item> <text>Transport Time Step</text> <control_duration> <option> <text>minutes</text> <export_text>min</export_text> <unit_keyword>#TIME_MINUTES</unit_keyword> </option> <option> <text>hours</text> <export_text>hrs</export_text> <unit_keyword>#TIME_HOURS</unit_keyword> <default></default> </option> </control_duration> … |
Element <control_file_opener>
Info |
Push button that opens a file open dialog to select files. Possible outputs are file_path. |
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | filter, create_file, unique_name, dependency, default, text_style |
Used by | item, row, column |
Example | Opens a file dialog, filtering on files with *.h5 and *.cmcards extensions
<item> <text>File:</text> <control_file_opener> <filter>Cmcards file (.cmcards)</filter> </control_file_opener> … |
Element <control_length>
Info | Displays an edit box and combo box. Combo box can contain meters, cm, mm, um, ft, in. Possible outputs are value and units.
Keywords:
|
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | option, unique_name, dependency, range, default, text_style |
Used by | item, row, column |
Example | Displays only cm, and mm in combo box. If cm selected and exported, returns the text “centimeter”.
<item> <text>Length</text> <control_length> <option> <text>cm</text> <export_text>centimeter</export_text> <unit_keyword>#LEN_CM</unit_keyword> </option> <option> <text>mm</text> <export_text>mm</export_text> <unit_keyword>#LEN_MM</unit_keyword> <default></default> </option> </control_length> |
Element <control_velocity>
Info | Displays an edit box and combo box. Combo box can contain m/sec, m/min, m/hours, etc.... Also could be m/sec, cm/sec, ft/sec, etc... The option tag specifies which options are displayed. The edit box will display doubles, within the given range, if provided. Possible outputs are value and units.
Keywords:
|
Versions | 1 (<custom_control_XXXX>), 2 |
Attributes | none |
Children | option, unique_name, dependency, range, default, text_style |
Used by | item, row, column |
Example | Displays m/sec and cm/sec in combo box. If m/sec selected and exported, returns the text “m sec”.
<item> <text>Velocity </text> <control_velocity> <unique_name>ccVelocity</unique_name> <range>0-100</range> <option> <text>m/sec</text> <export_text>m sec</export_text> <unit_keyword>#VEL_M_PER_S</unit_keyword> </option> <option> <text>cm/sec</text> <export_text>cm sec</export_text> <unit_keyword>#VEL_CM_PER_S</unit_keyword> </option> </control_velocity> … |
Element <control_volume_flow>
Info | Displays an edit box and combo box. Combo box can contain m^3/sec, m^3/min, m^3/hours, etc.... Also could be m^3/sec, cm^3/sec, ft^3/sec, etc... The option tag specifies which options are displayed. The edit box will display doubles, within the given range, if provided. Possible outputs are value and units. |
Versions | 2 |
Attributes | none |
Children | option, unique_name, dependency, range, default, text_style |
Used by | item, row, column |
Example | Displays m^3/sec and cm^3/sec in combo box. If m^3/sec selected and exported, returns the text “m^3 sec”.
<item> <text>Volume flow</text> <control_volume_flow> <unique_name>ccVolumeFlow</unique_name> <range>0-100</range> <option> <text>m^3/sec</text> <export_text>m^3 sec</export_text> <unit_keyword>#VFLOW_CU_M_PER_SEC</unit_keyword> </option> <option> <text>cm^3/sec</text> <export_text>cm^3 sec</export_text> <unit_keyword>#VFLOW_CU_CM_PER_SEC</unit_keyword> </option> </control_volume_flow> … |
Element <dataset_name>
Info | Determines the name of the dataset to be created. Uses the standard printf and sprintf format (www.cplusplus.com/reference/clibrary/cstdio/printf/). The keywords #row_number, #column_number, #row_name, and #column_name are used when the dataset is in a table. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | control_dataset |
Example |
<control_dataset> <dataset_name>”Five percent Layer %d”, #row_number</dataset_name> … </control_dataset> |
Element <dataset_type>
Info | Determines if the dataset is scalar or vector. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | control_dataset |
Example |
<control_dataset> <dataset_type>scalar</dataset_type> … </control_dataset> |
Element <default>
Info | Sets the initial default value of a widget. Can also be used to state the default combo-box option. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | edit_box, check_box, option, any element that begins with “custom_control” |
Example 1 |
<edit_box> <default>1.5</default> </edit_box > |
Example 2 | Check box is checked
<check_box> <default>checked</default> </check_box > |
Example 3 | Check box isn’t checked
<check_box> <default>unchecked</default> </check_box > |
Example 4 | Combo box hours is default
<combo_box> <option> <text>minutes</text> </option> <option> <text>hours</text> <default></default> </option> |
Example 5 | Custom control date always has a date formatted as “day-month-year hour:minute:second”.
<control_date> <default>16-7-2010 14:45:32</default> </control_date> |
Element <dialog>
Info | Used to define a dialog. |
Versions | 2 |
Attributes | none |
Children | dialog_name, page |
Used by | dialogs |
Example |
Element <dialog_name>
Info | Specifies the name of a dialog. This is required. This name is used by link_to. |
Versions | 2 |
Attributes | none |
Children | none |
Used by | dialog |
Example |
Element <dialogs>
Info | Contains all the dialogs used in a model. |
Versions | 2 |
Attributes | none |
Children | dialog |
Used by | model |
Example |
Element <display_options_arc>
Info | Specifies that the options in the combo box are to be used as arc/nodestring boundary condition display options. This element should only be used once in the schema. |
Versions | 2 |
Attributes | none |
Children | none |
Used by | combo_box |
Example |
Element <flags>
Info | Flags are optional, and are used to modify the behavior/appearance of the control_curve. Only 1 flag is currently defined: XY_USEDATE. When this flag is set, the x column becomes a date/time calendar. |
Versions | 2 |
Attributes | none |
Children | none |
Used by | control_curve |
Example | This example creates a curve button with the date/time flag.
<item> <control_curve> <unique_name>myCurve1</unique_name> <flags>XY_USEDATE</flags> <x_column> <text>Time </x_column> <y_column> <text>Velocity</text> </y_column> </control_curve> … |
Element <group>
Info | Tree group item that contains one or more items or groups. |
Versions | 1, 2 |
Attributes | none |
Children | text, dependency, text_style, contains |
Used by | page_def, contains |
Example |
<group> <text> Timing </text> <item> … tree item stuff </item> </group> |
Element <item>
Info | Tree item contains one or more widgets (combo_box, text_box, edit_box, etc). A tree item can contain multiple cards (version 1), but those cards must be mutually exclusive. |
Versions | 1, 2 |
Attributes | none |
Children | text, card, dependency, text_box, edit_box, check_box, combo_box, table, any element starting with “custom_control”, text_style |
Used by | group |
Example |
<item> <text>Transport Time Step</text> <edit_box>…. </edit_box> <card>…</card> |
Element <max_rows>
Info | Optional element used to limit the number of rows the user can specify in a SMS:Dynamic Model Interface Schema#Element <control_curve>control_curve. If this element is not used, the max_rows is unlimited. |
Versions | 2 |
Attributes | none |
Children | none |
Used by | control_curve |
Example | This example creates a curve button with the date/time flag.
<item> <control_curve> <unique_name>myCurve1</unique_name> <max_rows>10</max_rows> <x_column> <text>Time </x_column> <y_column> <text>Velocity</text> </y_column> </control_curve> … |
Element <minimum_height>
Info | Used to set the minimum height of a widget in pixels. Added in SMS 11.2. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | table |
Example |
< table > <minimum_height>500</minimum_height> </ table > |
Element <new_line>
Info | Creates a new line before adding the next widget in a tree item. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | item |
Example | In the dialog there would be:
Breaking Efficency: [edit box] (new_line called) Friction Efficency:
<item> <text>Non-cohesive bedload entrainment</text> <text_box> <text>Breaking Efficency:</text> </text_box> <edit_box> <unique_name>edtBreakingEff</unique_name> </edit_box> <new_line></new_line> <text_box> <text>Friction Efficency:</text> </text_box> |
Element <optional>
Info | Placed inside widgets to suppress a warning message from being displayed if the widgets data is empty. By default, data associated with a widget is required. If the <optional> tag is included and the widget’s data is empty, a warning message won’t be displayed. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | text_box, combo_box, edit_box, table, any element that starts with “custom_control”, check_box |
Example |
<optional></optional> |
Element <range>
Info | Determines the range of acceptable values in an edit_box. Can use the keywords GREATER_THAN, GREATER_THAN_EQUALS, LESS_THAN and LESS_THAN_EQUALS. Numbers assumed inclusive unless otherwise specified. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | edit_box, any element that starts with “control” except control_file_opener, control_dataset and control_date |
Example 1 |
<edit_box> <range>0-1</range> </ edit_box > |
Example 2 |
<range>0 – 5.6546</range> |
Example 3 |
<range>GREATER_THAN 0</range> |
Example 4 |
<range>GREATER_THAN 0.0 - LESS_THAN 5.0</range> |
Example 5 | Both examples are equivalent
<range>0.0 - LESS_THAN 5.0</range> <range>GREATER_THAN_EQUALS 0.0 - LESS_THAN 5.0</range> |
Element <row>
Info | Typically a user would only use row if there is a fixed table and wanting to display row text or to specify specific rows as read only. Row tags are placed inside a < table >. |
Versions | 1, 2 |
Attributes | none |
Children | text, read_only, optional, dependency, text_box, combo_box, edit_box, all elements starting with “custom_control”, check_box, text_style |
Used by | table |
Example | Row 1 is read only, row 2 isn’t
< table > … <row> <text>Row1</text> <read_only></read_only> </row> <row> <text>Row2</text> </row> </ table > |
Element < table >
Info | Table widget with columns and rows. Will most likely have multiple column and row tags. |
Versions | 1, 2 |
Attributes | none |
Children | read_only, column, row, dependency, unique_name, text_style |
Used by | item |
Example | Read only table with 2 columns and 3 rows. The number of rows are fixed.
< table > <unique_name>myTable </unique_name> <read_only></read_only> <fixed_row_count>3</fixed_row_count> <column> <text>hours</text> </column> <column> <text>minutes</text> </column> </ table > |
Element <text_size>
Info | Sets the point size of the text. Ranges from 8 to 20. Added in SMS 11.2. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | text_style |
Example | This would set the size of the text to 20pt. when the value in the edit_box is less than 0.0.
<edit_box> <unique_name>edtA</unique_name> <default>1.0</default> <text_style> <text_size>20</text_size> <condition>edtA LESS_THAN 0.0</condition> <text_style> </edit_box> |
Element <text_style>
Info | Holds the style options for the text. Added in SMS 11.2. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | group, item, text_box, combo_box, edit_box, all elements starting with “custom_control”, check_box, options |
Example | This would bold the text when the value in the edit_box is less than 0.0.
<edit_box> <unique_name>edtA</unique_name> <default>1.0</default> <text_style> <bold></bold> <condition>edtA LESS_THAN 0.0</condition> <text_style> </edit_box> |
Element <type>
Info | Determines if the edit_box is displaying text, an integer or a double. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | edit_box |
Example 1 |
<edit_box> <type>double</type> … </ edit_box > |
Example 2 |
<type>integer</type> |
Example 3 |
<type>text</type> |
Element <underline>
Info | Sets the text to be underlined. Added in SMS 11.2. |
Versions | 1, 2 |
Attributes | none |
Children | none |
Used by | text_style |
Example | This would underline the text when the value in the edit_box is less than 0.0.
<edit_box> <unique_name>edtA</unique_name> <default>1.0</default> <text_style> <underline></underline> <condition>edtA LESS_THAN 0.0</condition> <text_style> </edit_box> |
Element <x_column>
Info | Used to define the attributes in the column such as text (heading). |
Versions | 2 |
Attributes | none |
Children | text |
Used by | control_curve |
Example | This example creates a curve button with the date/time flag.
<item> <control_curve> <unique_name>myCurve1</unique_name> <flags>XY_USEDATE</flags> <x_column> <text>Time </x_column> <y_column> <text>Velocity</text> </y_column> </control_curve> … |
Element <y_column>
Info | Used to define the attributes in the column such as text (heading). |
Versions | 2 |
Attributes | none |
Children | text |
Used by | control_curve |
Example | This example creates a curve button with the date/time flag.
<item> <control_curve> <unique_name>myCurve1</unique_name> <flags>XY_USEDATE</flags> <x_column> <text>Time </x_column> <y_column> <text>Velocity</text> </y_column> </control_curve> … |