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;
};
***/
};
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.
height => .UIradioBox.y + .UIradioBox.height
Main.Filters.extract_cell_component (and many others in Main)
v/modules.v