guiProgressBarCreate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function creates a new progress bar on the provided form.gui_progress_bar

Progress bars are used to show how far a process is from being completed.

 

Input:

form : SYSHANDLE

A handle to the form that the progress bar is created on.

 

x : SINT default 1

The horizontal location of the progress bar.

 

y : SINT default 1

The vertical location of the progress bar.

 

w : SINT default 1

The width of the progress bar.

 

h : SINT default 1

The height of the progress bar.

 

tag : DINT

The tag value to store.

 

value : DINT default 0

The value of the progress bar.

 

min_value : DINT default 0

The minimum value of the progress bar.

 

max_value : DINT default 100

The maximum value of the progress bar.

 

Output:

progress_bar : SYSHANDLE

The handle to the new progress bar.

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-2

- Not enough memory / resources.

-3

- Invalid argument. Make sure that the values are all valid: min_value <= value <= max_value, min_value <> max_value.

-5

- Unknown error

-10

- Invalid location or dimension.

-11

- The GUI API is not supported.

-12

- The location is already used.

 

Declaration:

FUNCTION guiProgressBarCreate : INT;
VAR_INPUT
  form         : SYSHANDLE;
  x            : SINT := 1;
  y            : SINT := 1;
  w            : SINT := 1;
  h            : SINT := 1;
  tag          : DINT;
  value        : DINT := 0;
  min_value    : DINT := 0;
  max_value    : DINT := 100;
  progress_bar : ACCESS SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  prgbar : SYSHANDLE;
  form   : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create a progress bar with a position of 50%
  rc := guiProgressBarCreate(progress_bar := prgbar, form:=form, x:=2, y:=3, w:=3, h:=1, value := 50, tag:=43);
  ...
END;
END_PROGRAM;