Programmer Guide/Shell Items/Display/SET DISPLAY: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
 
(40 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
 
{{Display Item}}
This chapter documents the <code>SET display</code> family of commands applicable to {{STX}} [[Programmer_Guide/Shell_Items/Display|<code>DISPLAY</code> items]] (i.e. shell items of type <code>DISPLAY</code>).
This chapter documents the <code>SET display</code> family of commands applicable to {{STX}} [[Programmer_Guide/Shell_Items/Display|<code>DISPLAY</code> items]] (i.e. shell items of type <code>DISPLAY</code>).


  SET <var>display</var> <var>subcommand</var> &hellip;
  SET <var>display</var> <var>subcommand</var> &hellip;
For a list of <code>DISPLAY</code> item attributes, see [[Programmer Guide/Shell Items/Display/DISPLAY Item Attributes|DISPLAY Item Attributes]]. For a short first introduction into the matter of <code>DISPLAY</code> items, see [[Programmer_Guide/Shell_Items/Display/Introducing_Display_Items|Introducing Display Items]].


== Graph Control ==
== Graph Control ==
Line 15: Line 13:
  SET <var>display</var> GRAPH <var>graphitemname</var>
  SET <var>display</var> GRAPH <var>graphitemname</var>


Activate a graph attached to the display. The activated graph gets the keyboard focus.
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 [[Programmer Guide/Shell Items/Graph/GRAPH Messages#RESTORE|RESTORE]] is sent.


===HEIGHT===
===HEIGHT===


  SET <var>display</var> HEIGHT <var>h1</var> [.. <var>hNrows</var>]
  SET <var>display</var> HEIGHT <var>h<sub>1</sub></var> [ &hellip; <var>h<sub>Nrows</sub></var>]


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. <code>SET display HEIGHT 1 1 2</code> sets the height of row three to the double of the height of rows one and two.
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. <code>SET display HEIGHT 1 1 2</code> sets the height of row three to the double of the height of rows one and two.
{|
|-
| <var>h<sub>X</sub></var>
| The relative height of the row <var>X</var> (1 &hellip; number of rows).
|}
See the [[../DISPLAY Item Attributes/|attributes]] <code>!HROW</code> and <code>!WCOLS</code> to retrieve the current height/width settings.
===WIDTH===
{{/WIDTH}}
== Graph Defaults ==
The following settings are not directly used by the [[Programmer_Guide/Shell_Items/Display|display]]. They define the default settings for graphs which are created after the display. For a detailed description see the section [[Programmer_Guide/Shell_Items/Graph/SET_GRAPH|<code>SET GRAPH</code>]]. Only the argument <var>title</var> (of <code>SET display TITLE</code>) is actually used by the display as the window caption (the text in the top left corner of the window).
===AXIS===
SET <var>display</var> AXIS <var>xLabel</var> <var>yLabel</var> <var>labelFont</var> <var>labelColor</var> <var>xTitle</var> <var>yTitle</var> <var>titleFont</var> <var>titleColor</var> <var>xUnit</var> <var>yUnit</var> <var>xBorder</var> <var>yBorder</var>
===FRAME===
SET <var>display</var> FRAME <var>xscale</var> <var>yscale</var> <var>scalecolor</var> <var>grid</var> <var>gridcolor</var> <var>xsteps</var> <var>ysteps</var> <var>major</var> <var>minor</var>
===MARKERS===
SET <var>display</var> MARKERS <var>mode</var> <var>auto</var> <var>font</var> <var>color</var> <var>msfont</var> <var>mslincol</var> <var>msfillcol</var> <var>mstextcol</var>
===BGCOLOR===
SET <var>display</var> BGCOLOR <var>text</var> <var>draw</var><
===TITLE===
SET <var>display</var> TITLE <var>mode</var> <var>font</var> <var>color</var> [<var>title</var>]


;<var>hX</var>
==Popup Menus==


:The relative height of the row <var>X</var> (1 .. number of rows).
===ADDPOPUP===


===WIDTH===
SET <var>display</var> ADDPOPUP <var>title</var> <var>item<sub>1</sub></var> <var>item<sub>2</sub></var> &hellip;
SET <var>display</var> ADDPOPUP <var>title</var> <var>table</var> /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 <code>ADDPOPUP</code> commands are issued. Here is an example.
 
[[File:5662.gif]]
 
When a user selects an entry from one of these popups, a <code>[[Programmer Guide/Shell Items/Dialog/DISPLAY and DIALOG Messages|POPUP]]</code> message is sent to the display item.
{|
|-
| <var>title</var>
| The menu title which is displayed in the menu bar of the display.
|-
| <var>item<sub>X</sub></var>
| The menu items. <var>item<sub>X</sub></var> is used as the menu item capture unless the following applies:
* The string <var>item<sub>X</sub></var> is an asterisk - a menu separator is added rather than a caption.
* The string <var>item<sub>X</sub></var> begins with the character '<code>&gt;</code>' (e.g. <code>&gt;text</code>) - A submenu is defined using <code>text</code> as the caption.
* The string <var>item<sub>X</sub></var> is the character '<code>&lt;</code>' - 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".
|-
| <var>table</var>
| A simple table with one item per entry. See <var>item<sub>X</sub></var> for item details.
 
Separators or items which start or end a submenu are not counted in the menu item index  computation!
|}
 
===SETPOPUP===
 
SET <var>display</var> SETPOPUP <var>index<sub>1</sub></var> [...] [/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 <code>SETPOPUP</code> command. It is computed as follows:
 
<var>index</var> = menuIndex &times; 100 + itemindex
{|
|-
|<code>menuindex</code>
|index of menu (0, 1, &hellip; with leftmost being 0)
|-
|<code>itemindex</code>
|index of item in addressed menu (0, 1, &hellip; 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 <var>display</var> PRINT CLIPBOARD<
SET <var>display</var> PRINT <var>filename</var>
SET <var>display</var> PRINT PRINTER
 
The <code>PRINT</code> commands will print all graphs contained in the display (this does not include the dialog), either to a physical printer (when using the <code>PRINTER</code> argument, or to the Windows clipboard (when using the <code>CLIPBOARD</code> argument), or even to a file (when supplied with a filename as its argument).
 
The options <code>/Print</code> and </code>/Screen</code> are used to select the color scheme. For file output, the file format is selected by the options <code>/Enhancedmetafile</code> (*.WMF), <code>/Bitmap</code> (*.BMP) or <code>/Gnp</code> (sic!) (*.PNG). Once started, the operation is performed in the background and a <code>STOP</code> 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 <code>ADDTOOLBAR</code> command and can be identified by an index (&gt;&nbsp;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 <var>display</var> ADDTOOLBAR <var>index</var> <var>title/var> <var>button<sub>1</sub></var> &hellip;
 
Add a toolbar to the display.
 
{|
|-
| <var>index</var>
| The toolbar index (&ge;&nbsp;0).
|-
| <var>title</var>
| The title of the toolbar window. This is only displayed if the toolbar is floating.
|-
| <var>button<sub>X</sub></var>
| The id of the toolbar button (see the [[???|Appendix]] for a list).
|}
 
===SETTOOLBAR===
SET <var>display</var> SETTOOLBAR <var>index</var> /Visible|Hidden
 
Show or hide a toolbar <var>index</var>.
 
SET <var>display</var> SETTOOLBAR <var>button<sub>1</sub></var> &hellip; [/Enable|Disable /Check|Uncheck /Button|Switch]
 
Set state (<code>/E</code> or <code>/D</code>, <code>/C</code> or <code>U</code>) and mode (<code>/B</code> or <code>/S</code>) of all listed toolbar buttons (<var>button<sub>1</sub></var> &hellip;). If a button is member of more than one toolbar, its state/mode is changed in all toolbars it is part of.
 
===DELTOOLBAR===
SET <var>display</var> DELTOOLBAR|DELETETOOLBAR <var>index</var>


SET <var>display</var> WIDTH <var>row</var>|<var>* left right</var>
Delete the toolbar <var>index</var>.


Set the width of the columns of the specified row (<var>row</var> ³ <code>0</code>) or all split rows (<var>row</var> = <code>*</code>). The column splitter position is computed using:
==Window Visibility and Layout==
===NOWINDOW|HIDDEN|VISIBLE|ENABLED===


pos = left / (left + right) . display_window_width.
SET <var>display</var> <var>mode</var>|* [<var>style</var> <var>xpos</var> <var>ypos</var> <var>width</var> <var>height</var>] [/Centered /Foreground /Dialog /View /Layout /Modal=<var>itemId</var>]


;<var>left</var>
Set the display window mode, style position and size and configure the dialog.


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


;<var>right</var>
Note that you must use the <code>/Apply</code> option if you want the fullscreen mode to take effect.
|-
| <code>/Layout</code> (uppercase "L") or <code>/layout</code> (lowercase "l")
| Recalculate dialog window size; include (<code>L</code>) or ignore (<code>l</code>) hidden controls (case sensitive!)
|-
| <code>/Modal=<var>itemId</var></code>
| Assign a modal parent to the display <var>display</var>. The modal parent <var>itemId</var> is inactive whilst the <var>display</var> exists and behind the <var>display</var> in the z-order.
|}


:The relative width of the right column (<var>right</var> >= 0).
==Set the Window Title==
===TITLE===


== Graph defaults ==
SET <var>display</var> TITLE <var>mode</var> <var>font</var> <var>color</var> [ <var>title</var> ] [ /Settitleonly ]
The following settings are not directly used by the [[Programmer_Guide/Shell_Items/Display|display]]. They define the default settings for graphs which are created after the display. For a detailed description see the section [[Programmer_Guide/Shell_Items/Graph/SET_GRAPH|<code>SET GRAPH</code>]]. Only the argument <var>title</var> (of <code>SET display TITLE</code>) is actually used by the display as the window caption (the text in the top left corner of the window).


SET <var>display</var> AXIS <var>xLabel yLabel labelFont labelColor xTitle yTitle titleFont titleColor xUnit yUnit xBorder yBorder</var>
Set and configure the display's title. The option <code>/Settitleonly</code> can be used to set a new title without applying the other settings.
SET <var>display</var> FRAME <var>xscale</var> <var>yscale</var> <var>scalecolor</var> <var>grid</var> <var>gridcolor</var> <var>xsteps</var> <var>ysteps</var> <var>major</var> <var>minor</var>
{|
SET <var>display</var> MARKERS <var>mode</var> <var>auto</var> <var>font</var> <var>color</var> <var>msfont</var> <var>mslincol</var> <var>msfillcol</var> <var>mstextcol</var>
|-
SET <var>display</var> BGCOLOR <var>text</var> <var>draw</var><
| <var>mode</var>
SET <var>display</var> TITLE <var>mode</var> <var>font</var> <var>color</var> [<var>title</var>]
| Turn the display's title on or off. Consequently, the following two values are supported: <code>ON</code>, <code>OFF</code>, with the former turning the title of the display ''on'' and the latter turning it ''off''.
|-
| <var>font</var>
| A font argument as specified in [[???|Fonts and Font Argument Format]].
|-
| <var>color</var>
| A color argument as specified in [[???|Colors and Color Arguments]].
|-
| <var>title</var>
| The title text.
|}

Latest revision as of 16:00, 22 January 2019

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