SET DISPLAY

From STX Wiki
Jump to navigationJump to search
Display Item
INTRODUCTION NEW SET ATTRIBUTES MESSAGES EXAMPLES

This chapter documents the SET display family of commands applicable to STx DISPLAY items (i.e. shell items of type DISPLAY).

SET display subcommand

Graph Control

The following commands are used to set the height and width of the window in which a graph is displayed, as well as assigning the graph itself.

GRAPH

SET display GRAPH graphitemname

Activate a graph attached to the display. The activated graph gets the keyboard focus. Note that if the user activates the graph via the mouse or keyboard, the graph message RESTORE is sent.

HEIGHT

SET display HEIGHT h1 [ … hNrows]

Set the height of all graph rows relative to one another. The height of the display window and of the dialog is not changed. E.g. SET display HEIGHT 1 1 2 sets the height of row three to the double of the height of rows one and two.

hX The relative height of the row X (1 … number of rows).

See the attributes !HROW and !WCOLS to retrieve the current height/width settings.

WIDTH

Set the width of a display row's columns.

SET display WIDTH row|* left right

Set the width of the columns of the specified row (row ³ 0) or all split rows (row = *). The column splitter position is computed using:

pos = left / (left + right) × display_window_width.
left The relative width of the left column (left ≥ 0).
right The relative width of the right column (right ≥ 0).

Graph Defaults

The following settings are not directly used by the display. They define the default settings for graphs which are created after the display. For a detailed description see the section SET GRAPH. Only the argument title (of SET display TITLE) is actually used by the display as the window caption (the text in the top left corner of the window).

AXIS

SET display AXIS xLabel yLabel labelFont labelColor xTitle yTitle titleFont titleColor xUnit yUnit xBorder yBorder

FRAME

SET display FRAME xscale yscale scalecolor grid gridcolor xsteps ysteps major minor

MARKERS

SET display MARKERS mode auto font color msfont mslincol msfillcol mstextcol

BGCOLOR

SET display BGCOLOR text draw<

TITLE

SET display TITLE mode font color [title]

Popup Menus

ADDPOPUP

SET display ADDPOPUP title item1 item2 …
SET display ADDPOPUP title table /Table

Add a popup menu to the display. The popup menus are displayed in the menu bar of the window in the same order as the ADDPOPUP commands are issued. Here is an example.

5662.gif

When a user selects an entry from one of these popups, a POPUP message is sent to the display item.

title The menu title which is displayed in the menu bar of the display.
itemX The menu items. itemX is used as the menu item capture unless the following applies:
  • The string itemX is an asterisk - a menu separator is added rather than a caption.
  • The string itemX begins with the character '>' (e.g. >text) - A submenu is defined using text as the caption.
  • The string itemX is the character '<' - the last opened submenu is closed.

If you want to display a hotkey in the menu item, add a tab and the hotkey to the item text, e.g. "Open [tab] Ctrl+O".

table A simple table with one item per entry. See itemX for item details.

Separators or items which start or end a submenu are not counted in the menu item index computation!

SETPOPUP

SET display SETPOPUP index1 [...] [/Enable|Disable /Check|Uncheck]

Activate or deactivate and/or set or clear the check status of menu items. The items may be located in different menus.

The index of menu items is used in the message handling and for the SETPOPUP command. It is computed as follows:

index = menuIndex × 100 + itemindex
menuindex index of menu (0, 1, … with leftmost being 0)
itemindex index of item in addressed menu (0, 1, … with topmost being 0); separators and submenu headers are not counted

DELETEPOPUP

SET display DELPOPUP|DELETEPOPUP

Delete all popup menus and hide the menu bar.

Print

SET display PRINT CLIPBOARD<
SET display PRINT filename
SET display PRINT PRINTER

The PRINT commands will print all graphs contained in the display (this does not include the dialog), either to a physical printer (when using the PRINTER argument, or to the Windows clipboard (when using the CLIPBOARD argument), or even to a file (when supplied with a filename as its argument).

The options /Print and /Screen are used to select the color scheme. For file output, the file format is selected by the options /Enhancedmetafile (*.WMF), /Bitmap (*.BMP) or /Gnp (sic!) (*.PNG). Once started, the operation is performed in the background and a STOP message is sent when finished.

Toolbars

A set of toolbars can be added to each display. Each toolbar consists of the buttons specified in the ADDTOOLBAR command and can be identified by an index (> 0). If a button is assigned to more than one toolbar, it has the same meaning and message id in all toolbars in which it is present. Toolbar buttons can be used like buttons (press) or switches (toggle on/off). The set of defined toolbar buttons (see Appendix) is very small at present but will be expanded in the future as needed.

ADDTOOLBAR

SET display ADDTOOLBAR index title/var> button1

Add a toolbar to the display.

index The toolbar index (≥ 0).
title The title of the toolbar window. This is only displayed if the toolbar is floating.
buttonX The id of the toolbar button (see the Appendix for a list).

SETTOOLBAR

SET display SETTOOLBAR index /Visible|Hidden

Show or hide a toolbar index.

SET display SETTOOLBAR button1 … [/Enable|Disable /Check|Uncheck /Button|Switch]

Set state (/E or /D, /C or U) and mode (/B or /S) of all listed toolbar buttons (button1 …). If a button is member of more than one toolbar, its state/mode is changed in all toolbars it is part of.

DELTOOLBAR

SET display DELTOOLBAR|DELETETOOLBAR index

Delete the toolbar index.

Window Visibility and Layout

NOWINDOW|HIDDEN|VISIBLE|ENABLED

SET display mode|* [style xpos ypos width height] [/Centered /Foreground /Dialog /View /Layout /Modal=itemId]

Set the display window mode, style position and size and configure the dialog.

mode window mode. Possible values are NOWINDOW (the window is hidden and disabled), HIDDEN (the window is hidden), VISIBLE (the window is visible but disabled), ENABLED (the window is visible and enabled) or an asterisk if you do not want to change the window mode.
style The window style. Possible values are MINIMIZE (the window is minimized to the taskbar), MAXIMIZE (the window is maximized to take up the whole monitor display) or RESTORE (the window is restored to its normal size).
xpos The left coordinate of the window in pixels. The leftmost pixel on the display is 0.
ypos The top coordinate of the window in pixels. The topmost pixel on the display is 0.
width The width of the window in pixels.
height The height of the window in pixels.
/Centered The window is displayed in the center of the screen; xpos, ypos, width and height are ignored, though they may not be omitted.
/Foreground The window is displayed as the topmost window. Note that a window that is topmost is always visible and enabled, therefore the mode parameter is ignored when this flag is used.
/Dialog=pos Set the dialog position inside display (relative to the graphs); changing the position is only possible if the dialog is non-floating. pos must be one out of ABOVE, BELOW, LEFT and RIGHT.
/View=view Set window view mode to view, being one out of:
  • WINDOW: The window is a normal window
  • FULLSCREEN: The display takes up the whole screen (applicable only for displays of type frame)
  • ALWAYSONTOP The display remains on top, even if and when other windows are activated.

Note that you must use the /Apply option if you want the fullscreen mode to take effect.

/Layout (uppercase "L") or /layout (lowercase "l") Recalculate dialog window size; include (L) or ignore (l) hidden controls (case sensitive!)
/Modal=itemId Assign a modal parent to the display display. The modal parent itemId is inactive whilst the display exists and behind the display in the z-order.

Set the Window Title

TITLE

SET display TITLE mode font color [ title ] [ /Settitleonly ]

Set and configure the display's title. The option /Settitleonly can be used to set a new title without applying the other settings.

mode Turn the display's title on or off. Consequently, the following two values are supported: ON, OFF, with the former turning the title of the display on and the latter turning it off.
font A font argument as specified in Fonts and Font Argument Format.
color A color argument as specified in Colors and Color Arguments.
title The title text.

Navigation menu

Personal tools