Fix UI compile issues (#20092)
This commit is contained in:
parent
f15fef90a9
commit
f8ee6f8b31
@ -55,7 +55,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
#if HAS_MARLINUI_U8GLIB && DISABLED(TFT_CLASSIC_UI)
|
||||
|
||||
#include "HAL_LCD_com_defines.h"
|
||||
|
||||
|
@ -181,7 +181,7 @@ static void disp_language(uint8_t language, uint8_t state) {
|
||||
|
||||
strcat_P(public_buf_l, PSTR(".bin"));
|
||||
|
||||
lv_obj_set_event_cb_mks(obj, event_handler, id, nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(obj, event_handler, id, "", 0);
|
||||
lv_imgbtn_set_src_both(obj, public_buf_l);
|
||||
|
||||
if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj);
|
||||
|
@ -279,7 +279,7 @@ void disp_gcode_icon(uint8_t file_num) {
|
||||
cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m);
|
||||
|
||||
if (list_file.IsFolder[i]) {
|
||||
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0);
|
||||
lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_dir.bin");
|
||||
if (i < 3)
|
||||
lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight);
|
||||
@ -298,7 +298,7 @@ void disp_gcode_icon(uint8_t file_num) {
|
||||
strcat(test_public_buf_l, list_file.file_name[i]);
|
||||
char *temp = strstr(test_public_buf_l, ".GCO");
|
||||
if (temp) strcpy(temp, ".bin");
|
||||
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0);
|
||||
lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l);
|
||||
if (i < 3) {
|
||||
lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET);
|
||||
@ -308,7 +308,7 @@ void disp_gcode_icon(uint8_t file_num) {
|
||||
lv_btn_use_label_style(buttonText[i]);
|
||||
lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW);
|
||||
lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF);
|
||||
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0);
|
||||
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0);
|
||||
lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100);
|
||||
lv_obj_set_size(buttonText[i], 100, 40);
|
||||
}
|
||||
@ -320,7 +320,7 @@ void disp_gcode_icon(uint8_t file_num) {
|
||||
lv_btn_use_label_style(buttonText[i]);
|
||||
lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW);
|
||||
lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF);
|
||||
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0);
|
||||
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0);
|
||||
lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100);
|
||||
lv_obj_set_size(buttonText[i], 100, 40);
|
||||
}
|
||||
@ -328,7 +328,7 @@ void disp_gcode_icon(uint8_t file_num) {
|
||||
lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
}
|
||||
else {
|
||||
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0);
|
||||
lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_file.bin");
|
||||
if (i < 3)
|
||||
lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight);
|
||||
|
@ -1680,7 +1680,7 @@ lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char
|
||||
lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/, lv_style_t *style/*=&style_para_value*/) {
|
||||
lv_obj_t *btn = lv_btn_create(par, nullptr);
|
||||
if (id)
|
||||
lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(btn, cb, id, "", 0);
|
||||
else
|
||||
lv_obj_set_event_cb(btn, cb);
|
||||
lv_btn_set_style_both(btn, style);
|
||||
@ -1748,7 +1748,7 @@ lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, con
|
||||
lv_obj_t *btn = lv_imgbtn_create(par, nullptr);
|
||||
if (img) lv_imgbtn_set_src_both(btn, img);
|
||||
if (id)
|
||||
lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(btn, cb, id, "", 0);
|
||||
else
|
||||
lv_obj_set_event_cb(btn, cb);
|
||||
lv_imgbtn_use_label_style(btn);
|
||||
@ -1785,7 +1785,7 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_
|
||||
lv_obj_t *btn = lv_btn_create(par, nullptr); /*Add a button the current screen*/
|
||||
lv_obj_set_pos(btn, x, y); /*Set its position*/
|
||||
lv_obj_set_size(btn, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/
|
||||
if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0);
|
||||
if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, "", 0);
|
||||
lv_btn_use_label_style(btn);
|
||||
lv_btn_set_layout(btn, LV_LAYOUT_OFF);
|
||||
lv_obj_t *label = lv_label_create_empty(btn); /*Add a label to the button*/
|
||||
|
@ -73,7 +73,7 @@ void lv_draw_wifi(void) {
|
||||
|
||||
buttonReconnect = lv_imgbtn_create(scr, nullptr);
|
||||
|
||||
lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, nullptr, 0);
|
||||
lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, "", 0);
|
||||
lv_imgbtn_set_src_both(buttonReconnect, "F:/bmp_wifi.bin");
|
||||
lv_imgbtn_use_label_style(buttonReconnect);
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_TFT_LVGL_UI
|
||||
#if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION)
|
||||
|
||||
#include "draw_ui.h"
|
||||
#include "wifi_module.h"
|
||||
@ -822,4 +822,4 @@ int32_t wifi_upload(int type) {
|
||||
return esp_upload.uploadResult == success ? 0 : -1;
|
||||
}
|
||||
|
||||
#endif // HAS_TFT_LVGL_UI
|
||||
#endif // HAS_TFT_LVGL_UI && USE_WIFI_FUNCTION
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
#if HAS_WIRED_LCD && !HAS_GRAPHICAL_TFT
|
||||
|
||||
#include "lcdprint.h"
|
||||
|
||||
|
@ -262,6 +262,8 @@ millis_t MarlinUI::next_button_update_ms; // = 0
|
||||
|
||||
#endif
|
||||
|
||||
#if !HAS_GRAPHICAL_TFT
|
||||
|
||||
void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, bool wordwrap/*=false*/) {
|
||||
SETCURSOR(col, row);
|
||||
if (!string) return;
|
||||
@ -324,6 +326,8 @@ millis_t MarlinUI::next_button_update_ms; // = 0
|
||||
if (suff) wrap_string_P(col, row, suff);
|
||||
}
|
||||
|
||||
#endif // !HAS_GRAPHICAL_TFT
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
|
||||
void MarlinUI::init() {
|
||||
|
@ -80,12 +80,10 @@
|
||||
|
||||
#include "lcdprint.h"
|
||||
|
||||
#if !HAS_GRAPHICAL_TFT
|
||||
void _wrap_string(uint8_t &col, uint8_t &row, const char * const string, read_byte_cb_t cb_read_byte, const bool wordwrap=false);
|
||||
inline void wrap_string_P(uint8_t &col, uint8_t &row, PGM_P const pstr, const bool wordwrap=false) { _wrap_string(col, row, pstr, read_byte_rom, wordwrap); }
|
||||
inline void wrap_string(uint8_t &col, uint8_t &row, const char * const string, const bool wordwrap=false) { _wrap_string(col, row, string, read_byte_ram, wordwrap); }
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#include "../sd/cardreader.h"
|
||||
#endif
|
||||
|
||||
typedef void (*screenFunc_t)();
|
||||
|
Loading…
Reference in New Issue
Block a user