UIradioBoxLabel
Synopsis
macro to create a list of radio buttons (UIradioBox) with labels in a panel
macro UIradioBoxLabel {
ilink parent;
imlink labels;
int+IPort2 selectedItem;
string+nres+IPort2 selectedString=>labels[selectedItem];
string title => name_of(<-,1);
int visible = 1;
int active=1
int x = 0; // input
int y = 0; // input
int width = 200;
int height => .UIradioBox.y + .UIradioBox.height;
label_cmd label_cmd {
labels => <-.labels;
cmd.active => <-.<-.active;
};
UIpanel UIpanel {
parent = <-.parent;
x => <-.x;
y => <-.y;
width => <-.width;
height => <-.height;
};
UIlabel UIlabel {
parent => <-.UIpanel;
label => <-.title;
alignment = 1;
y = 0;
width => <-.UIpanel.width;
active => <-.active;
};
UIradioBox UIradioBox {
parent => <-.UIpanel;
cmdList => <-.label_cmd.cmd;
&selectedItem => <-.label_cmd.outItem;
&visible => <-.visible;
y => <-.UIlabel.y + <-.UIlabel.height + 4;
width => <-.UIpanel.width;
};
/***
UIstr_choice UIstr_choice {
choices => <-.labels;
selected_index => <-.selectedItem; selected_string => <-.selectedString;
};
***/
};Description
UIradioBoxLabel creates a UIradioList of toggles in a window. You can choose one option at one time. This macro differs from UIradioBox in that it already includes an enclosing UIpanel, a UIlabel, and a reference to a list of per-toggle labels.
Input Ports
Imlink. This input should connect to an array of strings. The strings are the labels on the buttons in the UIradioBox.
Subobjects
Integer. IPort2. Defines which item in the UIradioBox has been selected. This usually contains a reference to the selected object.
Integer. Sets the widget's visibility. This is usually a reference to the visibility of the parent panel.
height => .UIradioBox.y + .UIradioBox.height
Example
Main.Filters.extract_cell_component (and many others in Main)
v/modules.vFile
See Also Related Modules