Prusa MINI Firmware overview
|
#include "window_msgbox.h"
#include "gui.h"
#include "resource.h"
#include "button_draw.h"
◆ window_msgbox_draw_buttons()
72 rc_btn.
y += (rc_btn.
h - 40);
84 int btn_w = (rc_btn.
w - (count * 2 * spacing2)) / count;
89 for (
i = 0;
i < count;
i++) {
94 chars += strlen(text);
98 for (
i = 0;
i < count;
i++) {
103 rc_btn.
w = btn_w + pf->
w * ((float)strlen(text) - chars);
104 if (chg & (1 <<
i)) {
105 int is_selected = (
i == idx) ? 1 : 0;
108 rc_btn.
x += rc_btn.
w + 2 * spacing2;
◆ window_msgbox_step()
117 int chg = (1 << idx);
◆ window_msgbox_click()
◆ window_msgbox_init()
◆ window_msgbox_done()
◆ window_msgbox_draw()
164 const char *title = window->
title;
168 int title_n = strlen(title);
171 uint16_t id_icon = window->
id_icon;
180 if (title_h < icon_wh.
y)
187 if (title_n && picon)
190 int title_w = rc_tit.
w - icon_w;
210 rc_txt.
h -= (30 + title_h + red_line_offset);
211 rc_txt.
y += title_h + red_line_offset;
217 rc_btn_bg.
y += (rc_btn_bg.
h - 40);
◆ window_msgbox_event()
◆ window_msgbox_title_text
const char* window_msgbox_title_text[] |
Initial value:= {
"",
"Error",
"Question",
"Warning",
"Information",
}
◆ window_msgbox_button_count
Initial value:= {
1,
2,
3,
3,
2,
2,
1,
2,
3,
}
◆ window_msgbox_buttons
◆ window_msgbox_button_text
const char* window_msgbox_button_text[] |
Initial value:= {
"",
"",
"CANCEL",
"ABORT",
"RETRY",
"IGNORE",
"YES",
"NO",
"OK",
"",
"TRY AGAIN",
"CONTINUE",
"CUSTOM0",
"CUSTOM1",
"CUSTOM2",
}
◆ window_msgbox_id_icon
uint16_t window_msgbox_id_icon[5] |
◆ window_class_msgbox
void() window_draw_t(void *window)
Definition: window.h:57
#define MSGBOX_RES_CANCEL
Definition: window_msgbox.h:40
void window_msgbox_done(window_msgbox_t *window)
Definition: window_msgbox.c:155
uint16_t y
Definition: guitypes.h:71
uint8_t h
Definition: guitypes.h:78
uint16_t h
Definition: display.h:26
uint16_t w
Definition: guitypes.h:72
Definition: guitypes.h:76
uint8_t bottom
Definition: guitypes.h:90
#define MSGBOX_GREY_FRAME
Definition: window_msgbox.h:58
#define MSGBOX_SHI_CHG
Definition: window_msgbox.h:17
void window_msgbox_draw_buttons(window_msgbox_t *window)
Definition: window_msgbox.c:70
#define MSGBOX_MSK_BTN
Definition: window_msgbox.h:9
#define MSGBOX_SHI_BTN
Definition: window_msgbox.h:15
padding_ui8_t padding
Definition: window_msgbox.h:73
color_t color_text
Definition: guitypes.h:108
uint8_t top
Definition: guitypes.h:88
uint8_t right
Definition: guitypes.h:89
font_t * font_title
Definition: window_msgbox.h:72
#define MSGBOX_SHI_ICO
Definition: window_msgbox.h:14
#define MSGBOX_RES_CUSTOM1
Definition: window_msgbox.h:50
#define WINDOW_EVENT_ENC_UP
Definition: window.h:41
#define ALIGN_CENTER
Definition: guitypes.h:19
#define MSGBOX_RES_NO
Definition: window_msgbox.h:45
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
uint16_t x
Definition: guitypes.h:65
font_t * font
Definition: guitypes.h:110
const char * window_msgbox_title_text[]
Definition: window_msgbox.c:8
const char * title
Definition: window_msgbox.h:75
void window_destroy(int16_t id)
Definition: window.c:132
#define RENDER_FLG_WORDB
Definition: display_helper.h:9
static padding_ui8_t padding_ui8(uint8_t l, uint8_t t, uint8_t r, uint8_t b)
Definition: guitypes.h:164
uint8_t i
Definition: screen_test_graph.c:72
#define WINDOW_FLG_VISIBLE
Definition: window.h:24
const char * window_msgbox_button_text[]
Definition: window_msgbox.c:43
color_t color_text
Definition: window_msgbox.h:70
#define MSGBOX_BTN_MAX
Definition: window_msgbox.h:29
#define MSGBOX_ICO_INFO
Definition: window_msgbox.h:36
const uint8_t window_msgbox_buttons[][3]
Definition: window_msgbox.c:30
Definition: guitypes.h:64
#define MSGBOX_BTN_OK
Definition: window_msgbox.h:20
display_fill_rect_t * fill_rect
Definition: display.h:33
int16_t id
Definition: window.h:79
uint8_t left
Definition: guitypes.h:87
#define COLOR_GRAY
Definition: guitypes.h:50
window_t win
Definition: window_msgbox.h:68
color_t color_back
Definition: window_msgbox.h:69
#define MSGBOX_SHI_IDX
Definition: window_msgbox.h:16
void() window_done_t(void *window)
Definition: window.h:56
void gui_invalidate(void)
Definition: gui.c:66
#define MSGBOX_RES_ABORT
Definition: window_msgbox.h:41
#define MSGBOX_RES_CUSTOM2
Definition: window_msgbox.h:51
uint16_t y
Definition: guitypes.h:66
static int rect_empty_ui16(rect_ui16_t rc)
Definition: guitypes.h:177
#define MSGBOX_MSK_CHG
Definition: window_msgbox.h:11
#define MSGBOX_RES_YES
Definition: window_msgbox.h:44
void window_msgbox_init(window_msgbox_t *window)
Definition: window_msgbox.c:138
uint8_t alignment
Definition: window_msgbox.h:74
#define MSGBOX_MSK_IDX
Definition: window_msgbox.h:10
struct _window_msgbox_t window_msgbox_t
color_t color_back
Definition: guitypes.h:107
void window_msgbox_step(window_msgbox_t *window, int step)
Definition: window_msgbox.c:113
uint8_t w
Definition: guitypes.h:77
font_t * font
Definition: window_msgbox.h:71
void window_msgbox_event(window_msgbox_t *window, uint8_t event, void *param)
Definition: window_msgbox.c:235
point_ui16_t icon_meas(const uint8_t *pi)
Definition: guitypes.c:155
#define MSGBOX_RES_CUSTOM0
Definition: window_msgbox.h:49
uint8_t btn_spacing
Definition: guitypes.h:115
#define WINDOW_CLS_MSGBOX
Definition: window.h:19
void() window_event_t(void *window, uint8_t event, void *param)
Definition: window.h:58
Definition: guitypes.h:69
void render_text_align(rect_ui16_t rc, const char *text, font_t *font, color_t clr0, color_t clr1, padding_ui8_t padding, uint16_t flags)
Definition: display_helper.c:6
const uint8_t[]
Definition: 404_html.c:3
const uint8_t * resource_ptr(uint16_t id)
Definition: guitypes.c:168
display_t * display
Definition: display.c:6
uint16_t h
Definition: guitypes.h:73
rect_ui16_t rect
Definition: window.h:101
#define MSGBOX_RES_OK
Definition: window_msgbox.h:46
uint16_t id_icon
Definition: window_msgbox.h:76
#define MSGBOX_RES_RETRY
Definition: window_msgbox.h:42
#define COLOR_BLACK
Definition: guitypes.h:40
#define COLOR_RED_ALERT
Definition: guitypes.h:43
const char * text
Definition: window_msgbox.h:77
int res
Definition: window_msgbox.h:80
uint16_t x
Definition: guitypes.h:70
uint16_t w
Definition: display.h:25
const char * buttons[3]
Definition: window_msgbox.h:78
uint16_t window_msgbox_id_icon[5]
Definition: window_msgbox.c:62
#define MSGBOX_RES_IGNORE
Definition: window_msgbox.h:43
font_t * font_big
Definition: guitypes.h:111
void() window_init_t(void *window)
Definition: window.h:55
gui_defaults_t gui_defaults
Definition: gui.c:20
void render_icon_align(rect_ui16_t rc, uint16_t id_res, color_t clr0, uint16_t flags)
Definition: display_helper.c:55
#define WINDOW_EVENT_BTN_DN
Definition: window.h:38
uint16_t flags
Definition: window_msgbox.h:79
void window_msgbox_click(window_msgbox_t *window)
Definition: window_msgbox.c:130
#define MSGBOX_MSK_ICO
Definition: window_msgbox.h:8
uint32_t flg
Definition: window.h:81
list b
Definition: createSpeedLookupTable.py:30
const uint8_t window_msgbox_button_count[]
Definition: window_msgbox.c:17
display_draw_line_t * draw_line
Definition: display.h:31
#define WINDOW_FLG_INVALID
Definition: window.h:26
#define WINDOW_FLG_ENABLED
Definition: window.h:25
#define WINDOW_EVENT_ENC_DN
Definition: window.h:40
static point_ui16_t point_ui16(uint16_t x, uint16_t y)
Definition: guitypes.h:154
void window_msgbox_draw(window_msgbox_t *window)
Definition: window_msgbox.c:158
#define ALIGN_LEFT_CENTER
Definition: guitypes.h:21