Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 7 Pages and Components > 7.18 The Components > 7.18.9 Selection

7.18.9.1 Combo Box, List Box and Radio Buttons Components

Scroll Prev Top Next More

These three controls allow the user to select from a list of options.  The difference is how they are presented.  The ComboBox is a standard Windows control that displays the selection with a down arrow next to it.  If the user clicks the down arrow, a box appears with the possible selections.  The radio buttons displays a radio button with prompt for each option, with the selection having a filled in button.  The list box is similar as it presents a list of selectable items.  The selected item is highlighted.  The big difference between a list box and radio buttons is that the list can be bigger than the component and if so, a scroll bar will appear.

Common Properties:

Main:

Choices: all three component types display a selection of choices.  Adding choices is similar to adding any multi- property except there is no threshold.  Please see sections 7.4.2 for details on Multi- properties.  Each choice has a label (choice) and a value.  When a choice is selected, the OutputTarget is set to the choice's value.

OutputTarget: the channel or variable set to the value of the choice that was selected.

Format:

TextFormat, TextFormatPreset: the format (font, etc) of the displayed choices.

TextBrush, TextBrushPreset:  the brush (color) of the displayed choices.

Common Variables:

Contents: accessible from script.  Provides direct access to the currently displayed choice.  This is a read / write variable so you can change the contents of the component directly from script.

ContentsData: accessible from script.  Provides direct access to the currently displayed choice's data.  This is a read / write variable though writing to it likely has limited use.

Common Functions:

AddChoice(choice, value): allows you to add a new choice to the list from script.

ClearChoices(): removes all choices from the component.

Common Events:

OnSelect: called when the operator has selected a choice.  The variables Choice and ChoiceValue are passed to the event.  If you return() a non-zero value, the OutputTarget will not be updated with the new choice value.

ComboBox Specific Properties:

Format:

ArrowBrush, ArrowBrushPreset: the brush (color) used to draw the down arrow on the button on the right side of the combo box.

ButtonBackBrush, ButtonBackBrushPreset: the brush (color) used to draw the backgrouind of the button on the right side of the combo box.

ListBox:

With the exception of the LBWidth and LBHeight properties, all the properties in this section are identical to the ones for the listbox component, except with a "LB" prefix.  They determine the look for the listbox that appears when the down button is clicked.  Please see the section below on List Box specific properties for more detail.  Note that some of those properties are common properties like BackBrush.  You can make it so that the combo box and it's list box have different backgrounds and borders.

LBWidth, LBHeight: the width and height of the popup list box display that appears when the down arrow button on the right side of the component is clicked.

ListBox Specific Properties:

Format:

SelectionTextBrush, SelectionTextBrushPreset: the brush (color) used to draw the text of the currently selected choice.

SelectionBackBrush, SelectionBackBrushPreset: the brush (color) used to draw the background of the currently selected choice.

LinePadding: the amount of space, in pixels, between each choice.

Radio Buttons Specific Properties:

Format:

LinePadding: the amount of space, in pixels, between each choice.

Button Size: the size of the button as a fraction of the row size, from 0 to 1.

ButtonBackBrush, ButtonBackBrushPreset: the brush (color) used to draw the radio button.

ButtonLineWidth: the line width in pixels of the radio button.

ButtonPadding: the amount of space between the button and its text label.

ButtonRight: if enabled, the button is displayed to the right of the text.  Otherwise it displays to the left.

EyePadding: the amount of space between the outer radio and the inner eye displayed when the choice is selected.

Common Properties:

These components include all the common properties of components plus the background properties described in section 7.4.4.