guiCheckBoxCreate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function creates a new check box on the provided form.gui_check_box

Check boxes toggles between two states when clicked, triggering the check box changed event.

 

Input:

form : SYSHANDLE

A handle to the form that the check box is created on.

 

x : SINT default 1

The horizontal location of the check box.

 

y : SINT default 1

The vertical location of the check box.

 

w : SINT default 1

The width of the check box.

 

h : SINT default 1

The height of the check box.

 

tag : DINT

The tag value to store.

 

locked : BOOL default FALSE

If this is TRUE, the state of the check box can not be changed.

 

checked : BOOL default FALSE

The default state of this check box.

 

style : SINT default 0

The type of check box to create.gui_checkboxes

 0        - 3D border

 1        - Simple border

 2        - Toggle button

 

 

Output:

check_box : SYSHANDLE

The handle to the new check box.

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-2

- Not enough memory / resources.

-3

- Invalid argument.

-5

- Unknown error

-10

- Invalid location or dimension.

-11

- The GUI API is not supported.

-12

- The location is already used.

 

Declaration:

FUNCTION guiCheckBoxCreate : INT;
VAR_INPUT
  form      : SYSHANDLE;
  x         : SINT := 1;
  y         : SINT := 1;
  w         : SINT := 1;
  h         : SINT := 1;
  tag       : DINT;
  locked    : BOOL := FALSE;
  checked   : BOOL := FALSE;
  style     : SINT := 0;
  check_box : ACCESS SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  check  : SYSHANDLE;
  form   : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create a check box
  rc := guiCheckBoxCreate(check_box := check, form:=form, x:=2, y:=3, w:=1, h:=1, tag:=42, style := 1);
  ...
END;
END_PROGRAM;