guiListCreate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function creates a new list control on the provided form.gui_list_log

List controls can be used to allow the user to select between a number or things, or to provide line based data to the user.

 

Input:

form : SYSHANDLE

A handle to the form that the list control is created on.

 

x : SINT default 1

The horizontal location of the list control.gui_list_select

 

y : SINT default 1

The vertical location of the list control.

 

w : SINT default 1

The width of the list control.

 

h : SINT default 1

The height of the list control.

 

tag : DINT

The tag value to store.

 

size : INT (1..100) default 10

The number of items the list will contain.

 

type : INT default 1

The type of list to create:

1

- A read-only list that automatically scrolls as new items are appended. Suited for e.g. showing output from an ongoing process.

2

- A list with selectable items. Suited for providing a list of choices to the user.

 

Output:

list : SYSHANDLE

The handle to the new list control.

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-2

- Not enough memory / resources.

-3

- Invalid argument. Invalid size, type or form handle.

-5

- Unknown error

-10

- Invalid location or dimension.

-11

- The GUI API is not supported.

-12

- The location is already used.

 

Declaration:

FUNCTION guiListCreate : INT;
VAR_INPUT
  form     : SYSHANDLE;
  x        : SINT := 1;
  y        : SINT := 1;
  w        : SINT := 1;
  h        : SINT := 1;
  tag      : DINT;
  size     : INT := 10;
  type     : INT := 1;
  list     : ACCESS SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  list   : SYSHANDLE;
  form   : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create a scrolling list with space for 10 items
  rc := guiListCreate(list := list, form:=form, x:=1, y:=1, w:=5, h:=6, size := 10, type:=1);
  ...
END;
END_PROGRAM;