|
muteki
|
Functions related to the message box view. More...
#include <muteki/common.h>Go to the source code of this file.
Enumerations | |
| enum | message_box_type_e { MB_DEFAULT = 0 , MB_ICON_ERROR , MB_ICON_INFO , MB_ICON_WARNING , MB_ICON_QUESTION , MB_BUTTON_YES = 1 << 8 , MB_BUTTON_NO = 2 << 8 , MB_BUTTON_OK = 4 << 8 , MB_BUTTON_CANCEL = 8 << 8 , MB_BUTTON_NONE = 16 << 8 } |
| Message box types. More... | |
| enum | message_box_result_e { MB_RESULT_OK = 3 , MB_RESULT_CANCEL = 4 , MB_RESULT_YES = 5 , MB_RESULT_NO = 6 } |
| Results returned by the MessageBox() function after the user dismisses the message box. More... | |
Functions | |
| int | MessageBox (const UTF16 *text, unsigned short type) |
| High level message box function. | |
Functions related to the message box view.
| enum message_box_result_e |
Results returned by the MessageBox() function after the user dismisses the message box.
| Enumerator | |
|---|---|
| MB_RESULT_OK | The OK button was pressed by the user. Pressing |
| MB_RESULT_CANCEL | The Cancel button was pressed by the user. Pressing |
| MB_RESULT_YES | The Yes button was pressed by the user. Pressing |
| MB_RESULT_NO | The No button was pressed by the user. Pressing |
| enum message_box_type_e |
Message box types.
A valid message box type is either MB_DEFAULT or a MB_ICON_ enum joined by one or more MB_BUTTON_ enums with the bitwise-or operator (|). For example,
will cause a message box with the message "hello world", the exclamation-point icon, and both the Yes and No buttons to be shown.
|
extern |
High level message box function.
Create and show a message box view with the specified text, an icon and one or more buttons, and return which button on the message box is pressed when the user dismisses it. The type argument controls the icon and buttons shown on the message box view.
Message boxes can be dismissed by 3 ways: Pressing the button on the message box (including selecting them and pressing Enter), using the key bind (Y for OK/Yes, N for No and C for cancel) or pressing the ESC key when Cancel-like operations are defined (i.e. Cancel or No, with Cancel taking precedence when both are shown).
When OK and Yes are both available, what the user has selected takes precedence. That is, if the user selects Yes button instead of the OK button with TAB or arrow keys, pressing the Y key on the keyboard will make the function return MB_RESULT_YES instead of MB_RESULT_OK.
0x1013d| text | UTF-16 encoded text to be displayed on the message box. |
| type | The message box type. |