guiCheckBoxChangeEvent (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function retrieves a check box changed event from the event queue, which is triggered when the user clicks on the check box.

This function must be called to clear event 2 from guiWaitEvent.

 

Input:

None.

 

Output:

check_box : SYSHANDLE

The handle to the check box.

 

checked : BOOL

The new state of the check box

 

Returns: INT

0

- Data is ready.

-1

- Interface is not open (see guiOpen).

-6

- Data is not ready

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiCheckBoxChangeEvent : INT;
VAR_INPUT
  check_box : ACCESS SYSHANDLE;
  checked   : ACCESS BOOL;
END_VAR;

 

 

Example:

...
FUNCTION CheckBoxHandler
VAR
  rc      : INT;
  handle  : SYSHANDLE;
  tag     : DINT := 0;
  checked : BOOL;
END_VAR;
  rc := guiCheckBoxChangeEvent(check_box := handle, checked := checked);
  IF rc = 0 THEN
    guiGetTag(handle := handle, tag := tag);
    IF checked THEN
        DebugFmt(message:="Check box with tag \4 was checked", v4 := tag);
    ELSE
        DebugFmt(message:="Check box with tag \4 was unchecked", v4 := tag);
    END_IF;
  END_IF;
END_FUNCTION;
...