Radio buttons are groups of buttons that can have only one button selected at a time.
This control is somewhat similar to the non-editable combo box. We recommend you to use radio buttons if the number of options you offer a user to choose from is not great and if it is necessary to display all of the options simultaneously on the presentation to simplify the user's decision making procedure. If the number of options is significant, we recommend you to use the combo box control. If you want to allow a user to choose more than one option, you should use the list box control.
You can link this control to a variable or a parameter of type int. In this case on choosing other option from the group of buttons, the linked variable/parameter will immediately get the index of this option as its value. The index is zero-based, i.e. the button defined first in the Radio buttons table has index 0, the second one has index 1, etc.
Name – The name of the buttons group. It is used to identify and access the control from code.
Ignore – If selected, the radio buttons will be excluded from the model.
Visible on upper agent – If selected, the control will be also visible on the upper agent where this agent lives.
Orientation – The orientation of the control: either Vertical or Horizontal. Determines how the radio buttons are arranged.
Radio buttons
– Here you define buttons composing the group. In table rows you
specify the labels that will be displayed for options of the buttons
group.
To remove an entry, select the row in the table and click the "cross"
button. Since the order of entries is important, you can rearrange them
using arrow keys, located to the right of the table.
Link to – If you want to bind the radio buttons with a variable or a parameter of type int (on choosing other option from the group of buttons, the linked variable/parameter immediately gets an index of this option as its value), select this checkbox and enter the name of the variable/parameter you want to link to the radio buttons.
Default value – [Visible if the Link to checkbox is not selected] The expression that returns integer index of the option that will be selected by default. Indexes are zero-based, i.e. to make the first button selected, type here 0; to select the second button, type 1, and so on.
Enabled – Here you can specify Boolean expression determining whether radio buttons are enabled or disabled.
Here you can type the code to execute when any of radio buttons is clicked. The index of currently selected radio button is available here as value (local variable of type int) The index is zero-based, i.e. the first option of buttons group has index 0, the second 1, and so on.
Text color
–
The control specifies the color of the text labels displaying button
names. Click inside the control and choose a color from the set of the
most used ones, or choose a custom color using the Colors dialog box.
Font – Specifies the font family for the labels text. You can adjust the size of the text in the field to the right (pt.).
Italic – If selected, the labels will be italicized.
Bold – If selected, the labels will be emphasized in bold.
Level – Level to which this control belongs.
X – X-coordinate of the control's upper left corner.
Y – Y-coordinate of the control's upper left corner.
Width – The width of the control (in pixels).
Height
– The height of the control (in pixels).
Visible – The control's visibility. The control is visible when the specified expression evaluates to true, Otherwise it is and not visible.
Replication – Here you specify the number copies of this control you want to be created. If you leave this field empty, only one such control will be created.
Show name – If selected, the name of the control will be displayed on a presentation diagram.
Icon – If selected, the radio buttons will be considered as a part of the agent's icon.
Function |
Description |
int getValue() |
Returns the currently selected radio button, -1 if none. |
void setValue(int index) |
Sets selected the radio button with the given index, sets others deselected. |
void setValue |
Sets selected the radio button with the given index, sets others deselected. |
void setValueToDefault() |
Sets the value of the radio buttons to what has been provided as the default one. Doesn't execute user action code. |
Function |
Description |
boolean isEnabled() |
Tests if the control is enabled or disabled. Returns true if enabled, otherwise false. |
void setEnabled |
Sets the control enabled or disabled.
Parameter: |
Function |
Description |
void action() |
Executes the action associated with the control. |
Function |
Description |
double getX() |
Returns the X coordinate of the control (namely, the X coordinate of its upper left corner). |
double getY() |
Returns the Y coordinate of the control (namely, the Y coordinate of its upper left corner). |
void setX(double x) |
Sets the X coordinate of the control.
|
void setY(double y) |
Sets the Y coordinate of the control.
|
void setPos(double x,
|
Sets new coordinates for the control.
Parameters: |
Function |
Description |
boolean isVisible() |
Returns the visibility of the control. |
void setVisible(boolean v) |
Sets the visibility of the control. Parameter: |