UIoptionBoxLabel

Synopsis

macro to create a list of options ( UIoptionBox) with labels in a panel

macro UIoptionBoxLabel {
       ilink parent;
       imlink labels;
       string title => name_of(<-);
       int visible= 1;
       int selectedItems[];
       int max;

       label_cmd label_cmd {
labels => <-.labels;
int+read+nonotify+opt inItem[] => <-.selectedItems;
int+write+nonotify+opt outItem[];
       };

       int x = 0; // input
       int y = 0; // input
       int width = 200;
       int height => .UIoptionBox.y + .UIoptionBox.height;
       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;
       };


       UIoptionBox UIoptionBox {
            parent => <-.UIpanel;
            max => <-.max;
            cmdList => <-.label_cmd.cmd;
            selectedItems => <-.label_cmd.outItem;
            visible => <-.visible;
            y => <-.UIlabel.y + UIlabel.height + 4;
            width => <-.UIpanel.width;
       };
  };

Description

UIoptionBoxLabel creates a UIoptionList of toggles in a window. You can choose more than one option at one time. This macro differs from UIoptionBox in that it already includes an enclosing UIpanel, a UIlabel, and a reference to a list of per-toggle labels.

Input Ports

parent

This input should connect to the UIpanel that contains the UIoptionBox widget.

labels

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

Subobjects

title

String. The title that appears, naming the widget.

String. The title that appears, naming the widget.

selectedItems[]

Integer. An array that defines which items in the UIoptionBox have been selected. The array is as long as the number of items selected. The array elements contain references to the selected objects.

max

Integer. Sets the maximum number of items that can be selected at one time. If undefined, all options can be set. Once the max options are set, all other options are deactivated until fewer than max options are set.

visible =1

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

Example

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

File

v/UI.v

See Also Related Modules

UIoptionBox
UIradioBoxLabel