Programmer Guide/Shell Items/Dialog/Dialog Controls/Edit

From STX Wiki
< Programmer Guide‎ | Shell Items‎ | Dialog‎ | Dialog Controls
Revision as of 10:56, 15 May 2018 by Jw (talk | contribs) (Created page with "File:dialog_control_edit.png SET <var>dialog</var> <var>index</var> EDIT <var>row</var> <var>col</var> <var>caption</var> <var>var<sub>1</sub></var> [ <var>width</var> <...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Dialog control edit.png

SET dialog index EDIT row col caption var1 [ width height var2|* fg bg font ] [ /A|L|R ] [ /F[=PCAFS] ] 
var1 The name of the variable or table (for multiline edit; /Multiline) to store the edit string in.
var2 This is an optional table setting advanced properties of the edit control (see below). If you don't need to set advanced properties, you may indicate so by supplying the asterisk, "*", instead of a table.

Advanced properties of the EDIT control

A large number of advanced properties (i.e., settings) for an edit control may be set using a parameter table supplied as the var2 argument (see above). If you don't need these advanced features, you may indicate so by supplying an asterisk, "*", instead of a table.

The parameter table used for setting the advanced properties of an edit control must be an extended table containing exactly two string columns that, in turn, must be named "parameter" and "string". You may create such a table using the following STx statement:

#tab := new table * * /E string:parameter string:string

For each advanced property to set, you need to store a respective entry (i.e., row) in the table, and tag the entry (see Tagging table entries). Each such entry has to contain the name of the respective property in the name column, and its desired value in the string column.

The following advanced parameters are supported:

Parameter Value(s)
name field string field
append on or off
breakpoints on or off
caret on or off
clear If specified, clears the contents of the edit control. There is no argument to this parameter.

Example: $#tSettings parameter clear /T

colorOutput sets the color for the shell output (only for edit controls with a type property set to cli)
colorInput sets the color for the input (only for edit controls with a type property set to cli)
colorPrompt sets the color for the prompt (only for edit controls with a type property set to cli)
colorBackground Sets the color for the background (only for edit controls with a type property set to cli)
colorCaret Sets the color (only for edit controls with a type property set to cli)

Example: $#tSettings * parameter colorBackground string hlgray /tExample: $#tSettings * parameter colorPrompt string 0:250:128 /t

currentLine lineNumber
lineNumbers on or off
outputMode The following values are supported:
  • overwrite - overwrites old content with new content
  • append - appends new content to old content
  • overwriteLastLine - overwrites the last line
  • newLine - which appends new data on a new line

Example: $#tSettings * parameter outputMode string overwriteLastLine /T

outputLineLimit If set to a number higher than zero, the control will limit the number of lines displayed. This is particularly useful when using a "log" type edit box.
prompt the CLI prompt, e.g. "> " or "# "
readonly on or off
showLine lineNumber
type The following values are supported:
  • edit - a normal edit box
  • log - read-only, append mode, caret off
  • code - read-only, breakpoints on, linenumbers on, caret off and uses STx syntax highlighting
  • cli - the command line interface
waitforinput If set to "on", key messages will be passed on to the shell without the CLI processing them in any other way. This can, e.g., be used by the console getc command to wait for the user to input a character. When the key processing should continue, this parameter should be set to "off".

Note again that parameters you supply in the control table are ignored unless tagged.

Important: Once a setting has been applied, the tag will be removed. So, if you want to change the setting at a later time, you need to tag it again.

Additional options for the EDIT control

Option Meaning
/Integer or /Number Input field must contain a valid floating-point number (/Number) or an integer (/Integer), or a numeric expression of the respective type; expressions are evaluated before assigned to var1 (not applicable/available if var1 is a table).
/Password Input is hidden; an asterisk, "*" is displayed for each entered character
/Multiline Allow multiline input.
/Keystroke Send UPDATE message to shell for each entered character; otherwise the update message is only sent if the input is completed (another control is selected).The enter key is a special case; for /Multiline edit boxes, the enter key is used for line breaks, whilst for single line edit boxes, the enter key sends a COMMAND message (since STx version 3.6.0). Note that the enter key for a single line edit box also sends the same command as the default button (if one is defined - see BUTTON).
/F[=PCAFS] If no modifier is specified, all keys are forwarded. Otherwise, the listed modifiers will come into effect. Any combination of the modifiers is allowed. The modifiers have the following meaning:
  • P - printable keys
  • C - control keys (ctrl, shift, alt, alt-gr)
  • A - action keys (left, right, esc, return etc.
  • F - function keys (F1-F24)
  • S - sticky keys (caps lock, num lock, scroll lock)

See Common arguments for a description of the parameters not described here.

Navigation menu

Personal tools