guiMenuClickEvent (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.00.00


This function retrieves a menu click event from the event queue, which is triggered when the user clicks a menu item.

This function must be called to clear event 3 from guiWaitEvent.

 

Input:

None.

 

Output:

menu : SYSHANDLE

The handle to the menu.

 

index : INT

The index of the clicked item.

 

Returns: INT

0

- Data is ready.

-1

- Interface is not open (see guiOpen).

-6

- Data is not ready

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiMenuClickEvent INT;
VAR_INPUT
   menu   : ACCESS SYSHANDLE;
   index  : ACCESS INT;
END_VAR;

 

 

Example:

...
FUNCTION MenuHandler
VAR
   rc     : INT;
   handle : SYSHANDLE;
   tag    : DINT := 0;
   index  : INT;
END_VAR;
   rc := guiMenuClickEvent(menu := handle, index := index);
   IF rc = 0 THEN
      IF BOOL(handleTHEN
         guiGetTag(handle := handletag := tag);
         DebugFmt(message:="Menu with tag \4, index \1 was clicked", v1 := indexv4 := tag);
      ELSE
         DebugMsg(message:="No menu was clicked");
      END_IF;
   END_IF;
END_FUNCTION;
...