eBook Maestro  

Dialogs object

The object with functions for opening color, file, directory, font selection and message dialog boxes.
Addressing the Dialogs object:

window.external.Dialogs

Functions

ShowColorDialog()

Open the color selection dialog box.

Call: window.external.Dialogs.GetColor();

Return value: no.

ShowDirectoryDialog()

Open the directory selection dialog box.

Call: window.external.Dialogs.ShowDirectoryDialog();

Return value: no.

ShowFileOpenDialog()

Open the open file dialog box.

Call: window.external.Dialogs.ShowFileOpenDialog();

Return value: no.

ShowFileSaveDialog()

Open the save file dialog box.

Call: window.external.Dialogs.ShowFileSaveDialog();

Return value: no.

ShowFontDialog()

Open the font selection dialog box.

Call: window.external.Dialogs.ShowFontDialog();

Return value: no.

ShowDialogBox(Caption, Text, Flags)

Display a dialog box, a message and one or more buttons, where Caption is the text that appears in the title bar of the dialog box, Text is the message and Flags specifies what buttons appear on the message box.

Call: window.external.Dialogs.ShowDialogBox(Caption, Text, Flags);

Return value: the return value is one of the following menu-item values returned by the dialog box:
1 - OK button was selected
2 - CANCEL button was selected
3 - ABORT button was selected
4 - RETRY button was selected
5 - IGNORE button was selected
6 - YES button was selected
7 - NO button was selected

Note: Flags can be a combination of flags from the following groups of flags.
Button Flags:
0 - The message box contains one push button: OK
1 - The message box contains two push buttons: OK and CANCEL
2 - The message box contains three push buttons: ABORT, RETRY and IGNORE
3 - The message box contains three push buttons: YES, NO and CANCEL
4 - The message box contains two push buttons: YES and NO
5 - The message box contains two push buttons: RETRY and CANCEL

Icon Flags:
16 - A stop-sign icon appears in the message box
32 - A question-mark icon appears in the message box
48 - An exclamation-point icon appears in the message box
64 - An icon consisting of a lowercase letter i in a circle appears in the message box

Default Button:
0 - The first button is the default button.
256 - The second button is the default button.
512 - The third button is the default button.
1024 - The fourth button is the default button.

Example: the flags value for the message box with OK/CANCEL button and a question-mark icon will be: 1 + 32 = 33

Properties

FileName

Call: window.external.Dialogs.FileName;

Sets/Returns the FileName value. This value is used by ShowFileOpenDialog() and ShowFileSaveDialog() functions. FileName indicates the path of the last file selected. When the user selects a file in the dialog box and clicks OK, the selected file becomes the value of the FileName property.

Filter

Call: window.external.Dialogs.Filter;

Sets/Returns the Filter value. This value is used by ShowFileOpenDialog() and ShowFileSaveDialog() functions. Filter determines the file masks (filters) available in the dialog. Assign a value to the Filter property that consists of a description and a mask separated by a vertical bar (pipe) character. Do not include spaces around the vertical bar. For example,
'HTML files (*.html;*.htm)|*.HTML;*.HTM'

Multiple filters should be separated by vertical bars. For example,
'HTML files (*.html)|*.HTML|Images (*.gif;*.jpg)|*.GIF;*.JPG'

FilterIndex

Call: window.external.Dialogs.FilterIndex;

Sets/Returns the Filter Index value. This value is used by ShowFileOpenDialog() and ShowFileSaveDialog() functions. FilterIndex determines which filter is selected by default when the dialog opens.

Title

Call: window.external.Dialogs.Title;

Sets/Returns the Title value. This value is used by ShowDirectoryDialog(), ShowFileOpenDialog(), ShowFileSaveDialog() and ShowFontDialog() functions. Title specifies the caption of the Dialog windows.

RootDir

Call: window.external.Dialogs.RootDir;

Sets/Returns the Root Directory value. This value is used by ShowDirectoryDialog() function. RootDir is the full path to the root directory in the directory tree for which it is impossible to select a parent directory or an empty string if any directory can be selected.

Color

Call: window.external.Dialogs.Color;

Sets/Returns the Color value. This value is used by ShowColorDialog() function. The Color is the 6-character string of the selected color (in the "RRGGBB" format). When the user selects a color in the dialog box and clicks OK, the selected color becomes the value of the Color property.

MaxFontSize

Call: window.external.Dialogs.MaxFontSize;

Sets/Returns the Maximum Font Size value for the ShowFontDialog() function.

MinFontSize

Call: window.external.Dialogs.MinFontSize;

Sets/Returns the Minimum Font Size value for the ShowFontDialog() function.

FontColor

Call: window.external.Dialogs.FontColor;

Sets/Returns the Font Color value. This value is used by ShowFontDialog() function. The FontColor is the 6-character string of the selected font color (in the "RRGGBB" format). When the user selects a font in the dialog box and clicks OK, the selected color becomes the value of the FontColor property.

FontName

Call: window.external.Dialogs.FontName;

Sets/Returns the Font Name value. This value is used by ShowFontDialog() function. When the user selects a font in the dialog box and clicks OK, the selected font name becomes the value of the FontName property.

FontSize

Call: window.external.Dialogs.FontSize;

Sets/Returns the Font Size value. This value is used by ShowFontDialog() function. When the user selects a font in the dialog box and clicks OK, the selected font size becomes the value of the FontSize property.

FontStyle

Call: window.external.Dialogs.FontStyle;

Sets/Returns the FontStyle value. This value is used by ShowFontDialog() function. When the user selects a font in the dialog box and clicks OK, the selected font style becomes the value of the FontStyle property. The FontStyle is a string that may contain the following letters describing the font style:
B - Bold
I - Italic
S - StrikeOut
U - Underline

DefaultExt

Call: window.external.Dialogs.DefaultExt;

Sets/Returns the DefaultExt value. This value is used by ShowFileOpenDialog() and ShowFileSaveDialog() functions. DefaultExt specifies a default file extension.

Directory

Call: window.external.Dialogs.Directory;

Sets/Returns the FileName value. This value is used by ShowDirectoryDialog(), ShowFileOpenDialog() and ShowFileSaveDialog() functions. When the user selects a directory in the directory dialog box and clicks OK, the selected directory becomes the value of the Directory property.