DISPLAY and DIALOG Messages

From STX Wiki
Jump to navigationJump to search

The dialog and display messages are described together because all messages sent by a display can also be sent by a dialog. The display only generates messages if there are both graphs and dialogs in the display. If the display only contains a dialog, all display messages are redirected to the dialog item! In the following description, dialogitemname is used if a message is always generated by a dialog and windowitemname if a dialog or a display can send the message.

Keyboard events

MENU|DISPLAY windowitemname KEY keycode keyname

This message is generated if a key is pressed inside the dialog area or inside a display without an active graph. The information about the key is stored in the variables keycode and keyname. The value of keycode is a unique identification of the key including some status flags (shift, control, …). The keyname is a translation of keycode into a string representation, or an asterisk (*) if translation is not possible (see keyname values).

Popup menu events

MENU|DISPLAY windowitemname POPUP menuitem

This message indicates that the user has selected a popup menu item. The parameter menuitem identifies the menu and item: menuitem = 100.menuindex + itemindex. The menus and menu items are numbered in the same order as the ADDPOPUP commands were executed.

Toolbar events

MENU|DISPLAY windowitem TBCOMMAND buttonid buttonname
MENU|DISPLAY windowitem TBCHECK buttonid buttonname
MENU|DISPLAY windowitem TBUNCHECK buttonid buttonname

These messages are generated if a toolbar button is pressed (TBCOMMAND), checked (TBCHECK) or unchecked (TBUNCHECK). There are two styles of toolbar button: the 'button' sends a command, whilst the 'switch' sends its checked/unchecked state. Both parameters buttonid and buttonname can be used to identify the button. For a list of available buttons see the command SET DISPLAY.

Mouse wheel events

MENU|DISPLAY windowitemname WHEEL code delta ctrl shift left right

A special message is used for the mouse wheel. If its position is changed and no graph is active, the display or dialog item sends a WHEEL message. The code is the original window-message code. It is decoded into delta (positive/negative position increment) and flags (0=not pressed, 1=pressed) for simultaneously pressed keys and/or mouse buttons. The value of delta depends on the change-speed and the type of mouse.

Print events

MENU|DISPLAY windowitemname STOP par

If a copy/print process (initiated via a command or the copy/print dialog) is finished, the display sends a STOP message to the shell. The parameter par is meaningless (and normally set to 0).

Only the graphs contained in a display are printed - not the dialog!

Joystick events

MENU|DISPLAY windowitemname JOYSTICKBUTTONS buttons
MENU|DISPLAY windowitemname JOYSTICKPOV pov

If a joystick is attached to the system and the option /Joystick was used on display creation (see NEW DISPLAY), these messages are send on button/point of view activation by the user. The buttons parameter is 32 bits long. Theoretically 32 buttons are supported. Each bit indicates the status (pressed=1, not pressed=0) of a button. For a joystick with 8 buttons, only the first 8 bits are relevant. E.g. to check if the 4th button was pressed use the following if 'buttons & bit(3)' != 0 then. Note: the value of buttons if only the 4th button is pressed is 8 (2^3). The value of buttons if the 2nd and 4th buttons are pressed is 10 ((2^1)+( 2^3)). The pov parameter has the values 0-7 if pressed, where 0 is North, 1 is North-east, 2 is East etc. If the point of view button is not pressed (centered), pov has the value –1.

Navigation menu

Personal tools