guiFormCreate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function creates a new custom form and provides a handle for it.

 

Any controls on the form are placed on a grid with an equal number of tiles in each direction, with tile 1,1 in the upper-left corner.

 

This table shows an example of the layout of a form with controls:

Form(grid := 6)

Control

Text/Value

Location(x,y)

Size(w x h)

gui_form_grid

Label

"Label"

1,1

2 x 1

Label

"Check Box"

1,2

2 x 1

Check box

Checked

3,2

1 x 1

Label

"Spinner"

1,3

2 x 1

Spinner

0

3,3

3 x 1

Label

"Text"

1,4

2 x 1

Text box

"Text"

3,4

2 x 1

Button

"Menu"

1,6

2 x 1

Button

"Click Me"

5,6

2 x 1

 

 

Input:

grid : SINT (1..10)

The size of the grid.

 

Output:

form : SYSHANDLE

A handle to the new form.

 

Returns: INT

0

- The form has been created.

-1

- Interface is not open (see guiOpen).

-2

- Not enough memory / resources.

-3

- The grid size is invalid.

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiFormCreate : INT;
VAR_INPUT
  grid : SINT;
  form : ACCESS SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc   : INT;
  form : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create a form with 5x5 tiles
  rc := guiFormCreate(form := form, grid := 5);
  ...
END;
END_PROGRAM;