Sfairadora

  • Reference Guide

message_box

message_box(title, text, buttons)
message_box(icon, title, text, buttons)
message_box(err)
message_box(title, text, err, buttons)
message_box(icon, title, text, err, buttons)
Displays a message box with specified text and buttons. The function returns information about which button was pressed to close the message box.

Parameters

icon
If this parameter is specified, it determines the icon to be displayed left to the message text. The parameter is of the type Icon. Typically, one of the icon constants is used.
title
A String specifying the message box title.
text
A Rich_string specifying the text of the message.
err
A value of the type Error, whose content is displayed in the message box.
buttons
A list of buttons represented as a sequence of the type Seq(Msg_box_button). For standard button combinations, predefined constants listed below can be used. However, the user can create a different button combination.

Standard Buttons Constants

Name
Description
MBB_OK
OK button.
MBB_CANCEL
Cancel button.
MBB_OK_CANCEL
OK and Cancel buttons.
MBB_YES_NO
Yes and No buttons.
MBB_YES_NO_CANCEL
Yes, No, and Cancel buttons.
The constants are of the type Seq(Msg_box_button).

Msg_box_button Type

Component Type
Component Name
Description
Rtf
title
The title text in the RTF format.
Int
value
The value returned by the message_box, if the button is pressed.
Bool
active
If this member is set to TRUE, the button is active after the message box is displayed. Thus, it suffices to hit Enter to press the button.
Bool
ok
If this member is set to TRUE, the button is equivalent to the OK button. This means that its value is returned when the keys Ctrl+Enter are pressed.
Bool
cancel
If this member is set to TRUE, the button is equivalent to the Cancel button. This means that its value is returned when the Esc key is pressed or the message box window is closed with the cross button located in the right top corner of the window.
If none of the buttons defined has this member set, the message box can only be closed by pressing one of the buttons.

Return Value

The value component of the button used to close the message box is returned. If one of the standard button combination constants is used, the following return value constants are applicable:
Name
Description
MB_OK (0)
OK button.
MB_CANCEL (1)
Cancel button.
MB_YES (2)
Yes button.
MB_NO (3)
No button.
The constants are of the type Int.

See Also