GUI ScreenIO for Windows |
Every panel copybook includes fields that make it easy to display program messages.
Like most other things in GUI ScreenIO, you use 88 level items to instruct GUI ScreenIO how to display your message. The portion of your panel copybook that controls how messages are displayed looks like this.
01 panel-1.
|
To display a message, simply move your message text to the text field, set the destination of your message by setting the appropriate 88 level item TRUE, and the next time you call GUI ScreenIO, your message will be displayed.
So, to display a message in a standard Windows messagebox, do this:
MOVE 'My message text' TO panel-MESSAGE-TEXT
|
If you want to display a messagebox with your own title and a few more buttons, you enable Customized Message Boxes using the Panel Properties.
Checking this option creates a slightly expanded copybook definition that looks like this:
*
: Use this to display a message:
|
To display your customized messagebox, you move in the text as before, but you also set the type of icon to be displayed, and which buttons should be on the messagebox.
For example, to display the customized messagebox with a STOP sign icon, and three buttons; Abort, Retry, and Ignore:
MOVE 'My message text' TO panel-MESSAGE-TEXT
|
You can can figure out which button was pressed when GUI ScreenIO returns to your program because the customized messagebox option adds these 88 level items beneath the event ID field:
88 panel-EVENT-MB-ABORT VALUE 8050.
|
You display a messagebox and test which button was pressed just as you would any of the other events that are defined for your panel, e.g., like this:
MOVE 'My message text' TO panel-MESSAGE-TEXT
EVALUATE TRUE
WHEN panel-EVENT-MB-CANCEL
WHEN panel-EVENT-MB-CONTINUE
WHEN panel-EVENT-MB-IGNORE
WHEN panel-EVENT-MB-NO
WHEN panel-EVENT-MB-OK
WHEN panel-EVENT-MB-RETRY
WHEN panel-EVENT-MB-TRYAGAIN
WHEN panel-EVENT-MB-YES
END-EVALUATE |
© 2000-2019 Norcom, all rights reserved |