Prusa MINI Firmware overview
window_msgbox.h
Go to the documentation of this file.
1 // window_msgbox.h
2 #ifndef _WINDOW_MSGBOX_H
3 #define _WINDOW_MSGBOX_H
4 
5 #include "window.h"
6 
7 //messagebox flags bitmasks
8 #define MSGBOX_MSK_ICO 0x0070 // icon mask
9 #define MSGBOX_MSK_BTN 0x000f // button config mask
10 #define MSGBOX_MSK_IDX 0x0300 // selected button index mask
11 #define MSGBOX_MSK_CHG 0x7000 // changed buttons mask
12 
13 //messagebox flags bitshift
14 #define MSGBOX_SHI_ICO 4 // icon shift
15 #define MSGBOX_SHI_BTN 0 // button config shift
16 #define MSGBOX_SHI_IDX 8 // selected button index shift
17 #define MSGBOX_SHI_CHG 12 // changed buttons shift
18 
19 //messagebox button config
20 #define MSGBOX_BTN_OK 0x0000 // 1 button "OK"
21 #define MSGBOX_BTN_OKCANCEL 0x0001 // 2 buttons "OK" - "Cancel"
22 #define MSGBOX_BTN_ABORTRETRYIGNORE 0x0002 // 3 buttons "Abort" - "Retry" - "Ignore"
23 #define MSGBOX_BTN_YESNOCANCEL 0x0003 // 3 buttons "Yes" - "No" - "Cancel"
24 #define MSGBOX_BTN_YESNO 0x0004 // 2 buttons "Yes" - "No"
25 #define MSGBOX_BTN_RETRYCANCEL 0x0005 // 2 buttons "Retry" - "Cancel"
26 #define MSGBOX_BTN_CUSTOM1 0x0006 // 1 custom button
27 #define MSGBOX_BTN_CUSTOM2 0x0007 // 2 custom buttons
28 #define MSGBOX_BTN_CUSTOM3 0x0008 // 3 custom buttons
29 #define MSGBOX_BTN_MAX MSGBOX_BTN_CUSTOM3
30 
31 //messagebox icons
32 #define MSGBOX_ICO_CUSTOM 0x0000
33 #define MSGBOX_ICO_ERROR 0x0010
34 #define MSGBOX_ICO_QUESTION 0x0020
35 #define MSGBOX_ICO_WARNING 0x0030
36 #define MSGBOX_ICO_INFO 0x0040
37 #define MSGBOX_ICO_MAX (MSGBOX_BTN_RETRYCANCEL >> MSGBOX_SHI_ICO)
38 
39 //messagebox results (selected button)
40 #define MSGBOX_RES_CANCEL 2 // the Cancel button was selected
41 #define MSGBOX_RES_ABORT 3 // the Abort button was selected
42 #define MSGBOX_RES_RETRY 4 // the Retry button was selected
43 #define MSGBOX_RES_IGNORE 5 // the Ignore button was selected
44 #define MSGBOX_RES_YES 6 // the Yes button was selected
45 #define MSGBOX_RES_NO 7 // the No button was selected
46 #define MSGBOX_RES_OK 8 // the OK button was selected
47 #define MSGBOX_RES_TRYAGAIN 10 // the Try Again button was selected
48 #define MSGBOX_RES_CONTINUE 11 // the Continue button was selected
49 #define MSGBOX_RES_CUSTOM0 12 // custom button0 was selected
50 #define MSGBOX_RES_CUSTOM1 13 // custom button1 was selected
51 #define MSGBOX_RES_CUSTOM2 14 // custom button2 was selected
52 
53 //messagebox default selected buttons
54 #define MSGBOX_DEF_BUTTON0 0x0000 // selected button 0
55 #define MSGBOX_DEF_BUTTON1 0x0100 // selected button 1
56 #define MSGBOX_DEF_BUTTON2 0x0200 // selected button 2
57 
58 #define MSGBOX_GREY_FRAME 0x8000 // draw grey frame
59 
60 #pragma pack(push)
61 #pragma pack(1)
62 
63 typedef struct _window_class_msgbox_t {
66 
67 typedef struct _window_msgbox_t {
75  const char *title;
76  uint16_t id_icon;
77  const char *text;
78  const char *buttons[3];
79  uint16_t flags;
80  int res;
82 
83 #pragma pack(pop)
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif //__cplusplus
88 
89 extern uint16_t window_msgbox_id_icon[5];
90 
92 
93 #ifdef __cplusplus
94 }
95 #endif //__cplusplus
96 
97 #endif //_WINDOW_MSGBOX_H
window_msgbox_id_icon
uint16_t window_msgbox_id_icon[5]
Definition: window_msgbox.c:62
_font_t
Definition: guitypes.h:76
window_class_msgbox_t
struct _window_class_msgbox_t window_class_msgbox_t
window_class_msgbox
const window_class_msgbox_t window_class_msgbox
Definition: window_msgbox.c:249
_window_msgbox_t::padding
padding_ui8_t padding
Definition: window_msgbox.h:73
_window_msgbox_t::font_title
font_t * font_title
Definition: window_msgbox.h:72
_window_msgbox_t::title
const char * title
Definition: window_msgbox.h:75
_window_msgbox_t::color_text
color_t color_text
Definition: window_msgbox.h:70
_window_msgbox_t::win
window_t win
Definition: window_msgbox.h:68
_window_msgbox_t::color_back
color_t color_back
Definition: window_msgbox.h:69
_window_class_msgbox_t
Definition: window_msgbox.h:63
_window_msgbox_t
Definition: window_msgbox.h:67
_window_t
Definition: window.h:76
_window_msgbox_t::alignment
uint8_t alignment
Definition: window_msgbox.h:74
window_msgbox_t
struct _window_msgbox_t window_msgbox_t
_window_msgbox_t::font
font_t * font
Definition: window_msgbox.h:71
_padding_ui8_t
Definition: guitypes.h:86
uint8_t
const uint8_t[]
Definition: 404_html.c:3
_window_class_t
Definition: window.h:67
_window_msgbox_t::id_icon
uint16_t id_icon
Definition: window_msgbox.h:76
_window_msgbox_t::text
const char * text
Definition: window_msgbox.h:77
window.h
_window_msgbox_t::res
int res
Definition: window_msgbox.h:80
_window_msgbox_t::buttons
const char * buttons[3]
Definition: window_msgbox.h:78
color_t
uint32_t color_t
Definition: guitypes.h:62
_window_msgbox_t::flags
uint16_t flags
Definition: window_msgbox.h:79
_window_class_msgbox_t::cls
window_class_t cls
Definition: window_msgbox.h:64