Prusa MINI Firmware overview
screen_test_msgbox.c File Reference
#include "gui.h"
#include "config.h"

Classes

struct  screen_test_msgbox_data_t
 

Macros

#define pd   ((screen_test_msgbox_data_t *)screen->pdata)
 

Functions

void screen_test_msgbox_init (screen_t *screen)
 
void screen_test_msgbox_done (screen_t *screen)
 
void screen_test_msgbox_draw (screen_t *screen)
 
int screen_test_msgbox_event (screen_t *screen, window_t *window, uint8_t event, void *param)
 

Variables

const char * test_text = "Welcome to the Original Prusa MINI setup wizard. Would you like to continue?"
 
screen_t screen_test_msgbox
 
const screen_tpscreen_test_msgbox = &screen_test_msgbox
 

Macro Definition Documentation

◆ pd

#define pd   ((screen_test_msgbox_data_t *)screen->pdata)

Function Documentation

◆ screen_test_msgbox_init()

void screen_test_msgbox_init ( screen_t screen)
33  {
34  int16_t id;
35 
36  int16_t id0 = window_create_ptr(WINDOW_CLS_FRAME, -1, rect_ui16(0, 0, 0, 0), &(pd->frame));
37 
38  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 32, 220, 22), &(pd->tst));
39  window_set_text(id, (const char *)"TEST MSGBOX");
40 
41  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 54, 220, 22), &(pd->back));
42  window_set_text(id, (const char *)"back");
43  window_enable(id);
45 
46  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 76, 220, 22), &(pd->tst_ok));
47  window_set_text(id, (const char *)"OK");
48  window_enable(id);
50 
51  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 98, 220, 22), &(pd->tst_okcancel));
52  window_set_text(id, (const char *)"OK-CANCEL");
53  window_enable(id);
55 
56  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 120, 220, 22), &(pd->tst_abortretryignore));
57  window_set_text(id, (const char *)"ABORT-RETRY-IGNORE");
58  window_enable(id);
60 
61  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 142, 220, 22), &(pd->tst_yesnocancel));
62  window_set_text(id, (const char *)"YES-NO-CANCEL");
63  window_enable(id);
65 
66  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 164, 220, 22), &(pd->tst_yesno));
67  window_set_text(id, (const char *)"YES-NO");
68  window_enable(id);
70 
71  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(10, 186, 220, 22), &(pd->tst_retrycancel));
72  window_set_text(id, (const char *)"RETRY-CANCEL");
73  window_enable(id);
75 
76  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(20, 208, 90, 22), &(pd->tst_ico_custom));
77  window_set_text(id, (const char *)"CUSTOM");
78  window_enable(id);
80 
81  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(20, 230, 90, 22), &(pd->tst_ico_error));
82  window_set_text(id, (const char *)"ERROR");
83  window_enable(id);
85 
86  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(110, 208, 90, 22), &(pd->tst_ico_question));
87  window_set_text(id, (const char *)"QUESTION");
88  window_enable(id);
90 
91  id = window_create_ptr(WINDOW_CLS_TEXT, id0, rect_ui16(110, 230, 90, 22), &(pd->tst_ico_warning));
92  window_set_text(id, (const char *)"WARNING");
93  window_enable(id);
95 }
Here is the call graph for this function:

◆ screen_test_msgbox_done()

void screen_test_msgbox_done ( screen_t screen)
97  {
98  window_destroy(pd->frame.win.id);
99 }
Here is the call graph for this function:

◆ screen_test_msgbox_draw()

void screen_test_msgbox_draw ( screen_t screen)
101  {
102 }

◆ screen_test_msgbox_event()

int screen_test_msgbox_event ( screen_t screen,
window_t window,
uint8_t  event,
void param 
)
104  {
105  if (event == WINDOW_EVENT_CLICK)
106  switch ((int)param) {
107  case MSGBOX_BTN_MAX + 2:
108  screen_close();
109  return 1;
110  case MSGBOX_BTN_OK + 1:
111  case MSGBOX_BTN_OKCANCEL + 1:
113  case MSGBOX_BTN_YESNOCANCEL + 1:
114  case MSGBOX_BTN_YESNO + 1:
115  case MSGBOX_BTN_RETRYCANCEL + 1: {
116  uint16_t btn = ((int)param - 1) & MSGBOX_MSK_BTN;
117  gui_msgbox(test_text, btn | MSGBOX_ICO_INFO);
118  } break;
119  case MSGBOX_BTN_MAX + 3:
120  case MSGBOX_BTN_MAX + 4:
121  case MSGBOX_BTN_MAX + 5:
122  case MSGBOX_BTN_MAX + 6: {
123  uint16_t ico = (((int)param - (MSGBOX_BTN_MAX + 3)) << MSGBOX_SHI_ICO) & MSGBOX_MSK_ICO;
124  gui_msgbox(test_text, MSGBOX_BTN_OK | ico);
125  } break;
126  }
127  /* else if (event == WINDOW_EVENT_LOOP)
128  {
129  float temp = window_get_value(screen->pd->spin0.window.win.id);
130  int val = sim_heater_temp2val(temp);
131  window_set_value(screen->pd->numb0.win.id, val);
132  }*/
133  return 0;
134 }
Here is the call graph for this function:

Variable Documentation

◆ test_text

const char* test_text = "Welcome to the Original Prusa MINI setup wizard. Would you like to continue?"

◆ screen_test_msgbox

◆ pscreen_test_msgbox

const screen_t* pscreen_test_msgbox = &screen_test_msgbox
pd
#define pd
Definition: screen_test_msgbox.c:29
MSGBOX_BTN_OKCANCEL
#define MSGBOX_BTN_OKCANCEL
Definition: window_msgbox.h:21
MSGBOX_MSK_BTN
#define MSGBOX_MSK_BTN
Definition: window_msgbox.h:9
MSGBOX_SHI_ICO
#define MSGBOX_SHI_ICO
Definition: window_msgbox.h:14
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
window_destroy
void window_destroy(int16_t id)
Definition: window.c:132
MSGBOX_BTN_MAX
#define MSGBOX_BTN_MAX
Definition: window_msgbox.h:29
screen_test_msgbox_done
void screen_test_msgbox_done(screen_t *screen)
Definition: screen_test_msgbox.c:97
screen_test_msgbox_event
int screen_test_msgbox_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_test_msgbox.c:104
MSGBOX_ICO_INFO
#define MSGBOX_ICO_INFO
Definition: window_msgbox.h:36
MSGBOX_BTN_OK
#define MSGBOX_BTN_OK
Definition: window_msgbox.h:20
screen_close
void screen_close(void)
Definition: screen.c:80
screen_test_msgbox_init
void screen_test_msgbox_init(screen_t *screen)
Definition: screen_test_msgbox.c:33
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
screen_test_msgbox_data_t
Definition: screen_test_msgbox.c:9
MSGBOX_BTN_RETRYCANCEL
#define MSGBOX_BTN_RETRYCANCEL
Definition: window_msgbox.h:25
WINDOW_CLS_FRAME
#define WINDOW_CLS_FRAME
Definition: window.h:9
MSGBOX_BTN_YESNOCANCEL
#define MSGBOX_BTN_YESNOCANCEL
Definition: window_msgbox.h:23
screen_test_msgbox_draw
void screen_test_msgbox_draw(screen_t *screen)
Definition: screen_test_msgbox.c:101
window_set_tag
void window_set_tag(int16_t id, uint8_t tag)
Definition: window.c:329
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
MSGBOX_BTN_YESNO
#define MSGBOX_BTN_YESNO
Definition: window_msgbox.h:24
window_create_ptr
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
window_enable
void window_enable(int16_t id)
Definition: window.c:517
createSpeedLookupTable.int
int
Definition: createSpeedLookupTable.py:15
MSGBOX_MSK_ICO
#define MSGBOX_MSK_ICO
Definition: window_msgbox.h:8
MSGBOX_BTN_ABORTRETRYIGNORE
#define MSGBOX_BTN_ABORTRETRYIGNORE
Definition: window_msgbox.h:22
test_text
const char * test_text
Definition: screen_test_msgbox.c:31