|
Muteki
EABI code execution on Besta® RTOS devices.
|
Functions related to the message box modal. More...
#include "../../common.h"Go to the source code of this file.
Enumerations | |
| enum | ui_messagebox_type_e { UI_MB_DEFAULT = 0 , UI_MB_ICON_ERROR , UI_MB_ICON_INFO , UI_MB_ICON_WARNING , UI_MB_ICON_QUESTION , UI_MB_BUTTON_YES = 1 << 8 , UI_MB_BUTTON_NO = 2 << 8 , UI_MB_BUTTON_OK = 4 << 8 , UI_MB_BUTTON_CANCEL = 8 << 8 , UI_MB_BUTTON_NONE = 16 << 8 } |
| Message box types. More... | |
| enum | ui_messagebox_result_e { UI_MB_RESULT_OK = 3 , UI_MB_RESULT_CANCEL = 4 , UI_MB_RESULT_YES = 5 , UI_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 modal.
Results returned by the MessageBox() function after the user dismisses the message box.
| Enumerator | |
|---|---|
| UI_MB_RESULT_OK | The OK button was pressed by the user. Pressing Y key on the keyboard could also trigger this (specifically when OK button is enabled via UI_MB_BUTTON_OK). |
| UI_MB_RESULT_CANCEL | The Cancel button was pressed by the user. Pressing C key or ESC key on the keyboard could also trigger this. |
| UI_MB_RESULT_YES | The Yes button was pressed by the user. Pressing Y key on the keyboard could also trigger this (specifically when Yes button is enabled via UI_MB_BUTTON_YES). |
| UI_MB_RESULT_NO | The No button was pressed by the user. Pressing N key or ESC key on the keyboard could also trigger this. |
| enum ui_messagebox_type_e |
Message box types.
A valid message box type is either UI_MB_DEFAULT or a UI_MB_ICON_ enum joined by one or more UI_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.
| Enumerator | |
|---|---|
| UI_MB_DEFAULT | The default type. This is usually equivalent to (UI_MB_ICON_WARNING | UI_MB_BUTTON_OK). |
| UI_MB_ICON_ERROR | Display an error (stop-sign) icon on the message box. |
| UI_MB_ICON_INFO | Display an info icon (lower case i) on the message box. |
| UI_MB_ICON_WARNING | Display a warning (exclamation-point) icon on the message box. |
| UI_MB_ICON_QUESTION | Display a question-mark icon on the message box. |
| UI_MB_BUTTON_YES | Provide Yes button on the message box. |
| UI_MB_BUTTON_NO | Provide No button on the message box. |
| UI_MB_BUTTON_OK | Provide OK button on the message box. |
| UI_MB_BUTTON_CANCEL | Provide Cancel button on the message box. |
| UI_MB_BUTTON_NONE | Do not show any button. This will hide all buttons on the message box. Any key press will dismiss the message box and the return value will always be set to message_box_result_t::UI_MB_RESULT_OK. |
|
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 UI_MB_RESULT_YES instead of UI_MB_RESULT_OK.
| text | UTF-16 encoded text to be displayed on the message box. |
| type | The message box type. |