guiTextBoxCreate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function creates a new text box on the provided form.gui_text_box

Text boxes are used to allow the user to enter a text string, which triggers the text box changed event.

Clicking the text box shows a dialog to change the text string, using the same keyboard as guiShowTextInput.

 

 

Input:

form : SYSHANDLE

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

 

x : SINT default 1

The horizontal location of the text box.

 

y : SINT default 1

The vertical location of the text box.

 

w : SINT default 1

The width of the text box.

 

h : SINT default 1

The height of the text box.

 

tag : DINT

The tag value to store.

 

text : STRING

The initial value of the text box.

 

max_len : INT (1..254) default 20

The maximum length of the string.

 

Output:

text_box : SYSHANDLE

The handle to the new text box.

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-2

- Not enough memory / resources.

-3

- Invalid argument.

-5

- Unknown error

-8

- The text contains invalid characters.

-10

- Invalid location or dimension.

-11

- The GUI API is not supported.

-12

- The location is already used.

 

Declaration:

FUNCTION guiTextBoxCreate : INT;
VAR_INPUT
  form     : SYSHANDLE;
  x        : SINT := 1;
  y        : SINT := 1;
  w        : SINT := 1;
  h        : SINT := 1;
  tag      : DINT;
  text     : STRING;
  max_len  : INT := 20;
  text_box : ACCESS SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc      : INT;
  textbox : SYSHANDLE;
  form    : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create a text box
  rc := guiTextBoxCreate(text_box := textbox, form:=form, x:=2, y:=3, w:=3, h:=1, tag:=43, text := "Text", max_len := 10);
  ...
END;
END_PROGRAM;