| Directives |
|
| Format | MSGBOX
text$ [ ,title$ [
,options$ [ ,selection$
] ] ] Where:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Use the MSGBOX directive to display a window with a message in the middle of the screen. The text will be split into segments (lines) based on the system settings for screen width and centering characteristics. You can define multiple lines of text by using a SEP character between lines. Use the options string to identify the buttons and/or icons you want to include in the message box. The user's message box button selection is returned in a string variable. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Customizing the Message Box | If
the 'MX' system parameter is set, the
system calls subprograms *ext/msgbox.gui (user-defined) or
*ext/system/msgbox.gui (ProvideX-supplied) to process the
request instead of the standard Windows message box. By
default, ProvideX sets the 'MX' parameter to On
when *ext/msgbox.gui is found to exist. The msgbox.gui subprogram creates and displays a message box that is virtually identical to the standard Windows system message box but will use XP-style buttons if the '4D' mnemonic is enabled. In addition, it will use the currently-selected windows graphic font. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *Note* | When 'MX' is set, MSGBOX commands entered in console mode or executed within an EXECUTE command cannot be followed by any other command (as MSGBOX will be executing a CALL without a return address). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Several
internal bitmap names for standard Windows bitmaps are
available for displaying the embedded OS icons used by
the normal message box API call:
The button text OK, YES, NO, CANCEL, ABORT, RETRY, CONTINUE, and IGNORE are included in the system message library file (i.e., *mlfile.en) to provide support for multi-lingual systems. The message numbers are defined as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Use
the DEF MSG directive to temporarily
override the message text associated with the MSG(
) number. This directive allows messages to be
changed on the fly. For example, MSG(164) "&Yes,&No"can
be changed to another language:
Using Customized Messages with WindX Use of this facility under WindX requires some additional effort by the developer; i.e., will the subprogram be running on the host or on the workstation. If the program runs on the host, it will transmit the screen drawing information to the workstation just like any other ProvideX program. If the program is to run on the workstation, the host will simply send the MSGBOX parameters to WindX, which in turn runs the program locally (assuming it is present). The setup for WindX is described as follows:
This takes advantage of the fact that ProvideX automatically sets 'MX' based on the existence of a (user-defined) *ext/msgbox.gui. Simply copy the msgbox.gui from *ext/system to the *ext directory on the host, the system will use it and send screen drawing directives to the workstation. If it is copied (or installed) to *ext on the WindX workstation, the system will automatically use it, assuming it is not overridden by the host. This customizable MSGBOX also takes advantage of the 'BEEP' mnemonic. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| See Also | 'MX' System Parameter DEF MSG Define Temporary Message |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example | 1000
MSGBOX "Remove the customer record", 1000: "Confirmation Please","?,YESNO",X$ 1010 IF X$<>"YES" THEN RETURN 1020 REMOVE (1,KEY=K$) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||