Dialog Boxes

AlertBox

Purpose:

Display a Windows style dialog box containing a title, message and an OK button.

Category:

Messages/Interaction

Syntax:

AlertBox "title" "message"

title

The dialog box title.

message

The dialog box message. Line breaks can be entered using the pipe character “|”.

Example:

AlertBox "Hello World" "This is my first AlertBox."



Hint: You can change the font and icon used by the AlertBox, MessageBox, InputBox and Exit dialogs in the Interface section of App Properties.


MessageBox

Purpose:

Display a Windows style dialog box containing a message and a custom set of buttons.

Category:

Messages/Interaction

Syntax:

MessageBox "title" "message" "buttons" "variable"

title

The dialog box title.

message

The dialog box message. Line breaks can be entered using the pipe character “|”.

buttons

The captions of the custom buttons separated by the pipe “|” character.

variable

The name of the variable to store the number of the selected button. The first button = 1, the second = 2, and so on. The variable will contain a 0 (zero) if the reader closes the dialog box without making a selection.

Example:

The following example displays a MessageBox asking readers to rate their mood. An AlertBox with an appropriate message based on their response is displayed.


MessageBox "Hello" "How do you feel?" "Good|Fair|Poor" "[Mood]"
If "[Mood]" "=" "1"
  AlertBox "Hello" "That’s wonderful!"
EndIf
If "[Mood]" "=" "2"
  AlertBox "Hello" "I hope your mood improves."
EndIf
If "[Mood]" "=" "3"
  AlertBox "Hello" "That’s too bad."
EndIf
If "[Mood]" "=" "0"
  AlertBox "Hello" "Wow, you must really be in a bad mood!"
EndIf


InputBox

Purpose:

Display a simple input dialog box and request that the reader enter a single line of text.

Category:

Messages/Interaction

Syntax:

InputBox "title" "message" "variable"

title

The dialog box title.

message

The dialog box message. Line breaks can be entered using the pipe character “|”.

variable

The name of the variable to store text entered by the reader.

Example:

InputBox "Welcome" "Enter your access code" "[Code]"
If "[Code]" "=" "JB5276H"
  GotoPage "Start"
Else
  AlertBox "Sorry" "That’s not a valid access code."
  Exit "" ""
EndIf



FileOpenBox

Purpose:

Allow the reader to select a file name using a standard Windows File Open dialog box.

Category:

Messages/Interaction

Syntax:

FileOpenBox "title" "file mask" "initial path" "variable" "options"

title

The dialog box title.

file mask

A file mask indicating the types of files that may be selected. A mask consists of two portions: the text that the reader will see and the code that tells Windows which types of files to display. The two portions must be separated by the pipe character "|". Typically the code portion contains an asterisk, a period and a three letter file extension matching the file type you want the reader to select. For example, to display only files ending in txt, your mask would look like this:


Text Files|*.txt


You can also use an asterisk instead of a file extension to display all types of files. For example:


Any File|*.*


initial path

The folder that will be displayed when the File Open dialog box first opens.

variable

The name of the variable to store the name of the selected file(s).

options

Leave this parameter empty to select a single file or enter “Multiple” here to allow readers to select more than one file.

Example:

FileOpenBox "Open" "Any File|*.*" "c:\" "[File]" ""


If you include the Multiple option, readers will be allowed to select more than one file. When multiple files are selected, each file name will be placed into the specified variable separated by semicolons. To extract the file names, you will need to use the StrParse Action. For example:


FileOpenBox "Open" "Any File|*.*" "c:\" "[Files]" "Multiple"
StrParse "[Files]" ";" "[Names]" "[Count]"


When executed, StrParse will create an array based on the [Names] variable ([Names1], [Names2], etc.). The number of elements in the array will be equal to the number of files selected.


FileSaveBox

Purpose:

Allow the reader to specify a file name using a standard Windows File Save dialog box.

Category:

Messages/Interaction

Syntax:

FileSaveBox "title" "file mask" "initial directory" "variable"


See FileOpenBox for a description of these parameters.

Example:

FileSaveBox "Save" "Any File|*.*" "c:\" "[File]"

If "[File]" ">" ""

  FileWrite "[File]" "1" "[CustomerInfo]"

EndIf


FolderBox

Purpose:

Display a Windows Folder Selector and allow the reader to make a selection.

Category:

Messages/Interaction

Syntax:

FolderBox "title" "variable"

title

The dialog box title.

variable

The name of the variable to store the selected folder.

Example:

FolderBox "Select a Folder" "[Folder]"


Popups

Balloon

Purpose:

Display a comic book-style speech balloon containing a short message.

Category:

Messages/Interaction

Syntax:

Balloon "message" "left" "top" "delay"

message

The message you want to appear in the balloon.

left, top

The coordinates of the balloon’s left, top corner relative to the publication window. To position the balloon at the location of the mouse pointer, use “-1” for both.

delay

The number of milliseconds to display the balloon or 0 (zero) to leave the balloon on screen until the reader presses an key or clicks the mouse.

Example:

Balloon "Here is a balloon message!" "-1" "-1" "0"


StickyNote

Purpose:

Display a yellow sticky note with a custom message.

Category:

Messages/Interaction

Syntax:

StickyNote "left" "top" "message" "delay"

left, top

The coordinates of the sticky note’s left, top corner relative to the publication window. To center the sticky note on the screen, enter “-1” for both.

message

The message that will appear in the sticky note. Line breaks can be entered using the pipe character “|”.

delay

The number of milliseconds to display the sticky note or 0 (zero) to leave the sticky note on screen until the reader presses an key or clicks the mouse.

Example:

StickyNote "-1" "-1" "Thank you for viewing my program." "2000"



PopUpImage

Purpose:

Display an image file with an optional special effect.

Category:

Messages/Interaction

Syntax:

PopUpImage "left" "top" "file name" "delay" "effect" "speed"

left, top

The coordinates of the image’s left, top corner relative to the publication window. To center the image on the screen, enter “-1” for both.

file name

The name of the image file to display.

delay

The number of milliseconds to display the image or 0 (zero) to leave the image on screen until the reader presses an key or clicks the mouse.

effect

One of the following:


None, Dissolve, Slide Left, Slide Right, Slide Up, Slide Down, Explode, Implode, Weave Horizontal, Weave Vertical, Split Horizontal, Split Vertical, Wipe Left, Wipe Right, Wipe Up, Wipe Down, Circle, Grow, Blocks, Checkerboard, Block Dissolve, Fade, Page Turn or Transparent. (Plug-ins are also available to add additional effects.)

speed

The effect’s speed (0 = fastest, 10 = slowest).

Example:

The following example displays an image using the dissolve effect. The image will remain on screen until the mouse is clicked or a key is pressed.

PopUpImage "-1" "-1" "c:\samples\arrow.bmp" "0" "Dissolve" "3"


Menus

Menu

Purpose:

Display a popup menu allowing the reader to make a selection from a list of items. A single Action for each menu choice must appear immediately following the Menu statement. For example, if the menu contains three items, then three Actions must follow the Menu Action. Only the Action corresponding to the menu choice will be executed. If nothing is selected from the menu, the all of the corresponding menu Actions will be skipped.

Category:

Messages/Interaction

Syntax:

Menu "left" "top" "items" "width" "lines"

left, top

The coordinates of the menu’s left, top corner relative to the publication window. To center the menu on the screen, enter "-1" for both.

items

A list of menu choices separated by the pipe “|” character.

width

The desired with (in pixels) for the menu. To let VisualNEO for Windows pick the optimal width , enter "-1".

lines

The number of items to display before adding a vertical scroll bar to the menu. This can be useful with very large menus. To display as many items as will fit on-screen, enter "-1".

Example:

The example below displays a menu containing three choices, then displays an AlertBox corresponding to the item selected:


Menu "-1" "-1" "Apples|Oranges|Grapes" "-1" "-1"
AlertBox "" "You have selected Apples"
AlertBox "" "You have selected Oranges"
AlertBox "" "You have selected Grapes"


MenuEx

Purpose:

Display a popup menu, and stores the number of the selected item in a variable.

Category:

Messages/Interaction

Syntax:

MenuEx "left" "top" "items" "variable" "width" "lines"

left, top

The coordinates of the menu’s left, top corner relative to the publication window. To center the menu on the screen, enter "-1" for both.

items

A list of menu choices separated by the pipe “|” character.

variable

The name of the variable to store the selected item. The first item = 1, the second = 2, and so on. The variable will contain a 0 (zero) if no selection is made.

width

The desired with (in pixels) for the menu. To let VisualNEO for Windows pick the optimal width , enter "-1".

lines

The number of items to display before adding a vertical scroll bar to the menu. This can be useful with very large menus. To display as many items as will fit on-screen, enter "-1".

Example:

MenuEx "-1" "-1" "Apples|Oranges|Grapes" "[Result]" "-1" "-1"
If "[Result]" "=" "1"
  AlertBox "" "You have selected Apples"
EndIf
If "[Result]" "=" "2"

AlertBox "" "You have selected Oranges"

EndIf

If "[Result]" "=" "3"

AlertBox "" "You have selected Grapes"

EndIf



Search Functions

Find

Purpose:

Display a Find dialog box and allow the reader to search for words or phrases. The search may be limited to a group of pages, the current page, or the entire publication.

Category:

Messages/Interaction

Syntax:

Find "page title"

page title

A page title or group of titles separated with the pipe character “|”. Pages will be searched in the order listed. Use “All” instead of a page title to search the entire publication, or “Current” to search only the current page.

Example:

Find "Contents|Introduction|index"


FindFirst

Purpose:

Search for the first occurrence of a word or phrase without displaying the Find dialog box. Use FindNext to repeat the search more than once.

Category:

Messages/Interaction

Syntax:

FindFirst "search text" "page title"

search text

The word or phrase you want to find.

page title

A page title or group of titles separated with the pipe character “|”. Pages will be searched in the order listed. Use “All” instead of a page title to search the entire publication, or use “Current” to search only the current page.

Example:

FindFirst "apple" "Contents|Introduction|Index"


FindNext

Purpose:

Continue a search started with FindFirst.

Category:

Messages/Interaction

Syntax:

FindNext

Example:

FindNext



Help Functions

HelpTopic

Purpose:

Display a topic in the publication’s help file. You must specify a help file in App Properties before using this command.

Category:

Messages/Interaction

Syntax:

HelpTopic "topic title"

topic title

The title of the help topic to display.

Example:

HelpTopic "Index"



Shut Down

Exit

Purpose:

Exit the publication with an optional confirming dialog box.

Category:

Messages/Interaction

Syntax:

Exit "title" "message"

title

The dialog box title.

message

The dialog box message. Line breaks can be entered using the pipe character “|”. Leave the title and message fields blank to exit immediately without requesting confirmation.

Example:

Exit "Good-Bye" "Do you really want to quit?"



Note: You can change the font and icon used by the Exit box in the Interface section of the App Properties screen.