guiRadioButtonSetSelected (Function)

Top  Previous  Next

Architecture:

NX32L

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 := radio1form:=formx:=2y:=3w:=1h:=1,
         group := 0tag:=43);
   rc := guiRadioButtonCreate(radio_button := radio2form:=formx:=2y:=4w:=1h:=1
         group := 0selected := TRUEtag:=44);
   ...
   // Set radio1 as selected, deselects radio 2
   rc := guiRadioButtonSetSelected(radio_button := radio1);
   ...
END;
END_PROGRAM;