guiRadioButtonSetSelected (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function makes a radio button selected, and deselects any currently selected radio button in the group.

Calling this function does not trigger the radio button selected event.

 

Input:

radio_button : SYSHANDLE

A handle to the radio button to select.

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-3

- Invalid handle.

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiRadioButtonSetSelected : INT;
VAR_INPUT
  radio_button : SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  form   : SYSHANDLE;
  radio1 : SYSHANDLE;
  radio2 : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create two radio buttons, radio2 is selected
  rc := guiRadioButtonCreate(radio_button := radio1, form:=form, x:=2, y:=3, w:=1, h:=1,
        group := 0, tag:=43);
  rc := guiRadioButtonCreate(radio_button := radio2, form:=form, x:=2, y:=4, w:=1, h:=1,
        group := 0, selected := TRUE, tag:=44);
  ...
  // Set radio1 as selected, deselects radio 2
  rc := guiRadioButtonSetSelected(radio_button := radio1);
  ...
END;
END_PROGRAM;