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

parent

Ilink. This input should connect to the UIpanel that contains the UIradioBoxLabel widget.

labels[]

Imlink. This input should connect to an array of strings. The strings are the labels on the buttons in the UIradioBox.

Subobjects

selectedItem

Integer. IPort2. Defines which item in the UIradioBox has been selected. This usually contains a reference to the selected object.
.

selectedString

String. IPort2. Defines which string in the UIradioBox has been selected.

ltitle

String. The title that appears, naming the widget.

visible =1

Integer. Sets the widget's visibility. This is usually a reference to the visibility of the parent panel.

active =1

Integer.

x =0

Integer. Input.

y =0

Integer. Input.

width = 200

Integer.

height => .UIradioBox.y + .UIradioBox.height

Integer.

Example

Main.Filters.extract_cell_component (and many others in Main)
v/modules.v

File

v/UI.v

See Also Related Modules

UIradioBox
UIoptionBoxLabel