Working message

Command group Flag affected Reversible Execute on client Platform(s)
Message boxes NO NO NO All

Syntax

Working message title ([Cancel button] [,Repeat count] [,Do not auto close]) {message}

Options

Cancel button If specified, the message has a cancel button
Repeat count If specified, the message displays a numeric repeat count (an internal value that increments during method execution)
Do not auto close If specified, open a modal working message that does not automatically close when the method ends. While the message is open, subsequent working message calls with this option increment the message and ignore the other parameters

Description

This command displays a window, usually to indicate that Omnis is working or waiting for input. The window displays a sequence of changing icons to indicate that Omnis is actively working. A working message automatically closes when the method quits, and control returns to the user.

The title parameter contains a title for the working message window, together with parameters that configure the behavior and appearance of the window. The method editor has a Configure Working Message Helper button below the code entry field that you can use to easily set these parameters. The title parameter has the following syntax:

<*Title
text*> / <*size*(16|32|48)> : <*color*> : *id1,id2,...,idN* ; <*speed*> ; <*progress
bar range*>;<*display delay*>

The size specifies the width and height of the icons, and can be either 16, 32 or 48.

The color specifies the color to be applied to each icon, when the icon is a themed SVG icon. To specify a color, use either the name of an Omnis color constant e.g. kRed, or a 7 character hex encoding of the color, in the form #RRGGBB e.g. #0000FF is blue.

id1,id2,...,idN is a comma separated list of icon ids, that specifies the sequence of icons to be displayed in the working message window. These icons can come from an icon set accessible to the library containing themed SVG icons (or for legacy apps #ICONS for the library, or an icon data file such as OmnisPic).

speed indicates the time, in 1/60th second units, for which an icon in the sequence is displayed.

progress bar range specifies the range of a progress bar. If you specify a non-zero value, then the working message window displays a progress bar, and each call to the Working message command increases the length of the bar until it reaches the range.

display delay specifies the time in 1/60th second units, that must elapse before the working message window becomes visible. This allows you to use the Working message command in situations where the processing is sometimes very rapid, and in that case avoid the message displaying and disappearing almost immediately.

If a working message is placed in a loop with a Cancel button, pressing Ctrl-break/Ctrl-C/Cmnd-period or clicking on Cancel quits all methods. However, if you first execute Disable cancel test at loops, you can implement an orderly exit. If Disable cancel test at loops is executed before the loop, the cancel is detected only on executing the Working message.

Repeat count option is available with Working message, and displays the value of an internal counter which indicates the number of times a particular Working message has been encountered. If the command is in a Repeat loop, the counter increments at each pass of the loop.

Example

# Working message with orderly exit
Begin reversible block
  Disable cancel test at loops
End reversible block
Working message (Cancel button) {Processing Record [lCount]}
For lCount from 1 to 20000 step 1
  Redraw working message
  If canceled
    Break to end of loop
  End If
End For
OK message {All done}