FileChooser

(System Library)

Description: Provides an edit box for specifying a file name, along with a label and a browse button.
Returns: Text
Usage: Steady State only.
Function Groups: File I/O, String and Buffer
Related to: Edit |
Format: System.FileChooser(X1, Y1, X2, Y2, Title, ButtonLabel, OutVar, ID, Trigger, View, Save, FilterPattern, FilterDesc, DialogTitle, ExtensionToUse, [DrawBevel, VertAlign, AlignTitle, BGColor, FGColor, FontParm, TitleBGColor, TitleFGColor, BevelColor, PlaceholderText])
Parameters:  
X1
Left or right side of area
Y1
Top or bottom of area
X2
Opposite side to X1
Y2
Opposite side to Y1
Title
Text. Any text expression to be used as a title for the field. Defaults to "" if invalid.
ButtonLabel
Required text. The label to use on the browse button. Defaults to "..." if invalid.
OutVar
Required text. A variable whose value is set by the edit field.
ID
Optional. Any numeric expression from 0 to 32767 for the focus number of this graphic. If this value is 0, the edit field will display its current setting, but its value will not be able to be changed and it will appear grayed out. The default value is 1.
Trigger
Numeric. Trigger provides feedback. While editing, the value will be 0. When editing is complete (tab, enter or loss of focus) the value will change to non-zero: 1 if enter is pressed, 2 otherwise.

View

Numeric. Indicates how to display the edit field, as follows

View

Display Mode

0

Invisible

1

Normal (color scheme - no graying)

2

Grayed-out (only if FocusID is 0)

3Non-grayed text on a shaded background

This parameter may be used to force an edit field with a FocusID of 0 to display normally, rather than allowing it to default to its grayed color. Note that if the FocusID is not 0, setting this value as 2 will not force the field to gray out.

The default value is 2 if FocusID is 0 and 1 otherwise.

Save

Save

Save Mode

0

Open dialog

1

Save dialog

-1

Browse for folder

-2 Browser for folder + add trailing "\"
FilterPattern
Required text. An array or a semicolon-separated list of wildcard file patterns for the types that will appear. Defaults to "" if invalid.
FilterDesc
Required text. An array or a semicolon-separated list of text values describing the corresponding FilterPatterns. Defaults to "" if invalid.
DialogTitle
Required text. The title to apply to the file dialog. Defaults to "" if invalid.
ExtensionToUse
Required text. For save dialogs (Save parameter == 1) the file extension to use if not specified by the user. Defaults to "" if invalid.
DrawBevel
OptionalBoolean. If TRUE, the bevel is drawn. The Default value is FALSE.
VertAlign
Optional. Any numeric expression that sets the vertical alignment of the edit field according to one of the following options

VertAlign

Vertical Alignment

0

Top

1

Center

2

Bottom

Whether the title is included when the vertical alignment is calculated is determined by the value of AlignTitle. The default value is 0.

AlignTitle
Optional Boolean. TRUE if title affects alignment
BGColor
Optional. Background color of the edit box
FGColor
Optional. Foreground color of the edit box
FontParm
Optional. Font value
TitleBGColor
Optional. Background color under title
TitleFGColor
Optional. Foreground (text) color for the title
BevelColor
Optional. Color of the bevel line
PlaceholderText
Optional. Text to display in place of invalid entry
Comments:

This module is a member of the System Library, and must therefore be prefaced by System. as shown in the "Format" section.

The height of the edit field is constant, with X1 and X2 defining its width, and Y1 and Y2 defining the boundaries in which it is to be confined vertically, which may or may not include the added height of a title and bevel, depending on the alignment used and if they exist.

Example:

  System.FileChooser(LHS, TOP, RHS, TOP,
                     GetPhrase("PathLabel"), GetPhrase("BrowseLabel"), FoundPath,
                     1 {ID}, EditTrig, 2, -1 {folder}, "", "", GetPhrase("SelectExistingAppsLabel"),
                     Invalid, FALSE, 0, TRUE);