Programmer Guide/Macro Library/BUTIL: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
[[./#MSGBOX|MSGBOX and MSGBOXEX]]
{|class="keinrahmen"
==MSGBOX==
|[[#MsgBox|MSGBOX and MSGBOXEX]] || --
===<code>BUTIL MSGBOX <var>type</var> [<var>buttonlist</var>] [ ; <var>text</var> ; <var>title</var> ; <var>maxtime</var> [<var>timestep</var> ; <var>xpos</var> ; <var>ypos</var> ; <var>monitor</var> ; <var>defaultbutton</var> ]</code>===
|[[#FileDialog]] || --
===<code>BUTIL MSGBOXEX '<var>type</var> [<var>buttonlist</var>]' '<var>text</var>' [ '<var>title</var>' '<var>maxtime</var> [<var>timestep</var>]' '<var>xpos</var>' '<var>ypos</var>' '<var>monitor</var>' '<var>defaultbutton</var>' ]</code>===
|}
 
==MsgBox==
;<code>BUTIL MSGBOX <var>type</var> [<var>buttonlist</var>] [ ; <var>text</var> ; <var>title</var> ; <var>maxtime</var> [<var>timestep</var> ; <var>xpos</var> ; <var>ypos</var> ; <var>monitor</var> ; <var>defaultbutton</var> ]</code>:
;<code>BUTIL MSGBOXEX '<var>type</var> [<var>buttonlist</var>]' '<var>text</var>' [ '<var>title</var>' '<var>maxtime</var> [<var>timestep</var>]' '<var>xpos</var>' '<var>ypos</var>' '<var>monitor</var>' '<var>defaultbutton</var>' ]</code>: Display a message box dialog.
 
 
{|class="einrahmen"
{|class="einrahmen"
!argument !!description !!default
!argument !!description !!default
Line 68: Line 74:




==FILEDIALOG==
==FileDialog==
;<code>BUTIL FILEDIALOG <var>type</var> [ ; <var>title</var> ; <var>path</var> ]</code>:  
;<code>BUTIL FILEDIALOG <var>type</var> [ ; <var>title</var> ; <var>path</var> ]</code>: General file dialog.
;<code>DLGFILEOPEN [ '<var>title</var>' '<var>path</var>' ]</code>
;<code>FILEOPENDIALOG [ '<var>title</var>' '<var>path</var>' ]</code>: Dialog to open an existing file
;<code>DLGFILENEW [ '<var>title</var>' '<var>path</var>' ]</code>
;<code>FILENEWDIALOG [ '<var>title</var>' '<var>path</var>' ]</code>: Dialog to create a new file.
{|class="einrahmen"
{|class="einrahmen"
!argument !!description !!default
!argument !!description !!default
|-
|-
|<var>type</var> [<var>buttonlist</var>]
|<var>type</var> [<var>buttonlist</var>]
|Defines the type of the message box and the displayed buttons (see table below).<BR>The <var>buttonlist</var> is the blank seperated list of buttons, if <var>type</var> is set to <code>USERDEFINED</code>.
|<code>LOAD</code> or <code>OPEN</code> &rarr; open existing file<BR>
|
|<code>LOAD</code> or <code>OPEN</code> &rarr; open existing file<BR>
|-
|<var>text</var>
|The text to be displayed in the message box.
|
|-
|-
|<var>title</var>
|<var>title</var>
|Caption of the message box.
|The caption of the dialog window.
|name of the {{STX}} application
|<code>Select File</code>
|-
|-
|<var>maxtime</var> [<var>timestep</var>]
|<var>file</var>
|If this argument is a number, it is used as timeout value in seconds.<BR>If a timeout is set, a progress bar is displayed and the message box is closed automatically after <var>timeout</var> seconds. The <var>timestep</var> is the time for the progress bar update in seconds (if &lt;1) or milli-seconds (if &ge;1). The default <var>timestep</var> is set to 50ms.
|The default file or directory.
|no timeout
|current directory
|-
|<var>xpos</var>
|Horizontal position in pixels or keyword <code>LEFT, RIGHT, CENTER</code>.<BR>If <var>xpos</var> is a number it specifies, the offset to the left (&ge;0) or the right (&lt;0) side of the desktop.
|depends on parent window
|-
|<var>ypos</var>
|Vertical position in pixels or keyword <code>TOP, BOTTOM, CENTER</code>.<BR>If <var>ypos</var> is a number it specifies, the offset to the top (&ge;0) or the bottom (&lt;0) of the desktop.
|depends on parent window
|-
|<var>monitor</var>
|The index (1, 2, ..) of the monitor to display the message box on.
|monitor the mouse is on
|-
|<var>defaultbutton</var>
|The index (1, 2, ..) of the default button, which will initially be receiving the focus. Buttons are numbered from left to right, starting with index 1.
|1
|-
|-
!RESULT !!description
!RESULT !!description
|-
|-
|<code>CANCEL</code> ||If the message box was closed using the close button or the <code>[Escape]</code>-key.
|<code>path</code> ||The full pathname of the file to be opened or created.
|-
|<code>TIMEOUT</code> ||If a timeout was set and the maximum timout value was reached before a user input.
|-
|-
|<var>button</var> ||The name of the pressed button.<BR>Note that <code>USERDEFINED</code> buttons using the ampersand &amp; to underline a letter (e.g. &amp;Segment) return the keyword including the ampersand.
|''empty string'' ||If the dialog was canceled.
|}
|}

Revision as of 13:02, 11 May 2011

MSGBOX and MSGBOXEX -- #FileDialog --

MsgBox

BUTIL MSGBOX type [buttonlist] [ ; text ; title ; maxtime [timestep ; xpos ; ypos ; monitor ; defaultbutton ]
BUTIL MSGBOXEX 'type [buttonlist]' 'text' [ 'title' 'maxtime [timestep]' 'xpos' 'ypos' 'monitor' 'defaultbutton' ]
Display a message box dialog.


argument description default
type [buttonlist] Defines the type of the message box and the displayed buttons (see table below).
The buttonlist is the blank seperated list of buttons, if type is set to USERDEFINED.
text The text to be displayed in the message box.
title Caption of the message box. name of the STx application
maxtime [timestep] If this argument is a number, it is used as timeout value in seconds.
If a timeout is set, a progress bar is displayed and the message box is closed automatically after timeout seconds. The timestep is the time for the progress bar update in seconds (if <1) or milli-seconds (if ≥1). The default timestep is set to 50ms.
no timeout
xpos Horizontal position in pixels or keyword LEFT, RIGHT, CENTER.
If xpos is a number it specifies, the offset to the left (≥0) or the right (<0) side of the desktop.
depends on parent window
ypos Vertical position in pixels or keyword TOP, BOTTOM, CENTER.
If ypos is a number it specifies, the offset to the top (≥0) or the bottom (<0) of the desktop.
depends on parent window
monitor The index (1, 2, ..) of the monitor to display the message box on. monitor the mouse is on
defaultbutton The index (1, 2, ..) of the default button, which will initially be receiving the focus. Buttons are numbered from left to right, starting with index 1. 1
RESULT description
CANCEL If the message box was closed using the close button or the [Escape]-key.
TIMEOUT If a timeout was set and the maximum timout value was reached before a user input.
button The name of the pressed button.
Note that USERDEFINED buttons using the ampersand & to underline a letter (e.g. &Segment) return the keyword including the ampersand.


type buttons (return values are specified in brackets)
NONE no buttons, message box must be closed with the [Escape]-key or by using a timeout
Msg or Message OK (okay)
OkayCancel OK (okay), Cancel (cancel)
OkayRetryCancel OK (okay), Retry (retry) Cancel (cancel)
YesNo Yes (yes), No (no)
YesNoCancel Yes (yes), No (no) Cancel (cancel)
UserDefined buttons are defined by the argument buttonlist


FileDialog

BUTIL FILEDIALOG type [ ; title ; path ]
General file dialog.
FILEOPENDIALOG [ 'title' 'path' ]
Dialog to open an existing file
FILENEWDIALOG [ 'title' 'path' ]
Dialog to create a new file.
argument description default
type [buttonlist] LOAD or OPEN → open existing file
LOAD or OPEN → open existing file
title The caption of the dialog window. Select File
file The default file or directory. current directory
RESULT description
path The full pathname of the file to be opened or created.
empty string If the dialog was canceled.

Navigation menu

Personal tools