Skip to content

Commit

Permalink
🎨 Fix up MKS UI defines
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 25, 2021
1 parent f80bcdc commit 01a0f3a
Show file tree
Hide file tree
Showing 26 changed files with 126 additions and 132 deletions.
47 changes: 31 additions & 16 deletions Marlin/src/lcd/extui/mks_ui/draw_acceleration_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,38 +110,53 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {

void lv_draw_acceleration_settings() {
scr = lv_screen_create(ACCELERATION_UI, machine_menu.AccelerationConfTitle);
lv_coord_t y = PARA_UI_POS_Y;
if (!uiCfg.para_ui_page) {
dtostrf(planner.settings.acceleration, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_PRINT, 0, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_PRINT, 0, public_buf_l);

y += PARA_UI_POS_Y;
dtostrf(planner.settings.retract_acceleration, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_RETRA, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_RETRA, 1, public_buf_l);

y += PARA_UI_POS_Y;
dtostrf(planner.settings.travel_acceleration, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l);

y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[X_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.X_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_ACCE_X, 3, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.X_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_X, 3, public_buf_l);

lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_ACCE_DOWN, true);
}
else {
itoa(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_Y, 0, public_buf_l);

itoa(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_Z, 1, public_buf_l);

itoa(planner.settings.max_acceleration_mm_per_s2[E_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.E0_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_E0, 2, public_buf_l);

itoa(planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.E1_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_ACCE_E1, 3, public_buf_l);
#if HAS_Y_AXIS
itoa(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_Y, 0, public_buf_l);
#endif

#if HAS_Z_AXIS
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_Z, 1, public_buf_l);
#endif

#if HAS_HOTEND
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[E_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.E0_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_E0, 2, public_buf_l);
#endif

#if ENABLED(DISTINCT_E_FACTORS)
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.E1_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_E1, 3, public_buf_l);
#endif

lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_ACCE_UP, true);
}

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ACCE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_ACCE_RETURN, true);
}

void lv_clear_acceleration_settings() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_advance_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void lv_draw_advance_settings() {
index++;
#endif

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_ADVANCE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_ADVANCE_RETURN, true);
}

void lv_clear_advance_settings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void lv_draw_auto_level_offset_settings() {
dtostrf(TERN0(HAS_PROBE_XY_OFFSET, probe.offset.z), 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Zoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_OFFSET_Z, 2, public_buf_l);

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_OFFSET_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_OFFSET_RETURN, true);
}

void lv_clear_auto_level_offset_settings() {
Expand Down
50 changes: 25 additions & 25 deletions Marlin/src/lcd/extui/mks_ui/draw_baby_stepping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ static lv_obj_t *scr;
static lv_obj_t *labelV, *buttonV, *zOffsetText;

enum {
ID_BABY_STEP_X_P = 1,
ID_BABY_STEP_X_N,
ID_BABY_STEP_Y_P,
ID_BABY_STEP_Y_N,
ID_BABY_STEP_Z_P,
ID_BABY_STEP_Z_N,
ID_BABY_STEP_DIST,
ID_BABY_STEP_RETURN
ID_BABYSTEP_X_P = 1,
ID_BABYSTEP_X_N,
ID_BABYSTEP_Y_P,
ID_BABYSTEP_Y_N,
ID_BABYSTEP_Z_P,
ID_BABYSTEP_Z_N,
ID_BABYSTEP_DIST,
ID_BABYSTEP_RETURN
};

static float babystep_dist = 0.01;
Expand All @@ -63,37 +63,37 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
char baby_buf[30] = { 0 };
char str_1[16];
switch (obj->mks_obj_id) {
case ID_BABY_STEP_X_P:
case ID_BABYSTEP_X_P:
sprintf_P(baby_buf, PSTR("M290 X%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_X_N:
case ID_BABYSTEP_X_N:
sprintf_P(baby_buf, PSTR("M290 X%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Y_P:
case ID_BABYSTEP_Y_P:
sprintf_P(baby_buf, PSTR("M290 Y%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Y_N:
case ID_BABYSTEP_Y_N:
sprintf_P(baby_buf, PSTR("M290 Y%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Z_P:
case ID_BABYSTEP_Z_P:
sprintf_P(baby_buf, PSTR("M290 Z%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Z_N:
case ID_BABYSTEP_Z_N:
sprintf_P(baby_buf, PSTR("M290 Z%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_DIST:
case ID_BABYSTEP_DIST:
if (ABS((int)(100 * babystep_dist)) == 1)
babystep_dist = 0.05;
else if (ABS((int)(100 * babystep_dist)) == 5)
Expand All @@ -102,7 +102,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
babystep_dist = 0.01;
disp_baby_step_dist();
break;
case ID_BABY_STEP_RETURN:
case ID_BABYSTEP_RETURN:
if (has_adjust_z == 1) {
TERN_(EEPROM_SETTINGS, (void)settings.save());
has_adjust_z = 0;
Expand All @@ -114,21 +114,21 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
}

void lv_draw_baby_stepping() {
scr = lv_screen_create(BABY_STEP_UI);
lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_BABY_STEP_X_P);
lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_X_N);
lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABY_STEP_Y_P);
lv_big_button_create(scr, "F:/bmp_yDec.bin", move_menu.y_dec, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Y_N);
lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABY_STEP_Z_P);
lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Z_N);
buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABY_STEP_DIST);
scr = lv_screen_create(BABYSTEP_UI);
lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_BABYSTEP_X_P);
lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_X_N);
lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABYSTEP_Y_P);
lv_big_button_create(scr, "F:/bmp_yDec.bin", move_menu.y_dec, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_Y_N);
lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABYSTEP_Z_P);
lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_Z_N);
buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABYSTEP_DIST);
labelV = lv_label_create_empty(buttonV);
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable)
lv_group_add_obj(g, buttonV);
#endif

lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_RETURN);
lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_RETURN);

disp_baby_step_dist();

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_eeprom_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void lv_draw_eeprom_settings() {
scr = lv_screen_create(EEPROM_SETTINGS_UI);
lv_screen_menu_item(scr, eeprom_menu.revert, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_EEPROM_REVERT, 0);
lv_screen_menu_item(scr, eeprom_menu.store, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_EEPROM_STORE, 1);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_EEPROM_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_EEPROM_RETURN, true);
}

void lv_clear_eeprom_settings() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_encoder_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_encoder_settings() {
scr = lv_screen_create(ENCODER_SETTINGS_UI, machine_menu.EncoderConfTitle);
buttonEncoderState = lv_screen_menu_item_onoff(scr, machine_menu.EncoderConfText, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ENCODER_STATE, 0, gCfgItems.encoder_enable);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ENCODER_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_ENCODER_RETURN, true);
}

void lv_clear_encoder_settings() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_filament_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void lv_draw_filament_settings() {
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FILAMENT_SET_UP, true);
}

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_FILAMENT_SET_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_FILAMENT_SET_RETURN, true);
}

void lv_clear_filament_settings() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void lv_draw_gcode(bool clear) {
outL = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2, "Result:");
outV = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, (const char*)public_buf);

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_GCODE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_GCODE_RETURN, true);
}

void lv_clear_gcode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void lv_draw_homing_sensitivity_settings() {
lv_screen_menu_item_1_edit(scr, machine_menu.Z2_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_SENSITIVITY_Z2, 3, public_buf_l);
#endif

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_SENSITIVITY_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_SENSITIVITY_RETURN, true);
}

void lv_clear_homing_sensitivity_settings() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_jerk_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void lv_draw_jerk_settings() {
dtostrf(planner.max_jerk[E_AXIS], 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l);

lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_JERK_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_JERK_RETURN, true);
}

void lv_clear_jerk_settings() {
Expand Down
20 changes: 10 additions & 10 deletions Marlin/src/lcd/extui/mks_ui/draw_keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,22 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
if (!txt) return;

// Do the corresponding action according to the text of the button
if (strcmp(txt, "abc") == 0) {
if (strcmp_P(txt, PSTR("abc")) == 0) {
lv_btnm_set_map(kb, kb_map_lc);
lv_btnm_set_ctrl_map(kb, kb_ctrl_lc_map);
return;
}
else if (strcmp(txt, "ABC") == 0) {
else if (strcmp_P(txt, PSTR("ABC")) == 0) {
lv_btnm_set_map(kb, kb_map_uc);
lv_btnm_set_ctrl_map(kb, kb_ctrl_uc_map);
return;
}
else if (strcmp(txt, "1#") == 0) {
else if (strcmp_P(txt, PSTR("1#")) == 0) {
lv_btnm_set_map(kb, kb_map_spec);
lv_btnm_set_ctrl_map(kb, kb_ctrl_spec_map);
return;
}
else if (strcmp(txt, LV_SYMBOL_CLOSE) == 0) {
else if (strcmp_P(txt, PSTR(LV_SYMBOL_CLOSE)) == 0) {
if (kb->event_cb != lv_kb_def_event_cb) {
lv_clear_keyboard();
draw_return_ui();
Expand All @@ -115,7 +115,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
}
return;
}
else if (strcmp(txt, LV_SYMBOL_OK) == 0) {
else if (strcmp_P(txt, PSTR(LV_SYMBOL_OK)) == 0) {
if (kb->event_cb != lv_kb_def_event_cb) {
const char * ret_ta_txt = lv_ta_get_text(ext->ta);
switch (keyboard_value) {
Expand Down Expand Up @@ -183,15 +183,15 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
// Add the characters to the text area if set
if (!ext->ta) return;

if (strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0)
if (strcmp_P(txt, PSTR("Enter")) == 0 || strcmp_P(txt, PSTR(LV_SYMBOL_NEW_LINE)) == 0)
lv_ta_add_char(ext->ta, '\n');
else if (strcmp(txt, LV_SYMBOL_LEFT) == 0)
else if (strcmp_P(txt, PSTR(LV_SYMBOL_LEFT)) == 0)
lv_ta_cursor_left(ext->ta);
else if (strcmp(txt, LV_SYMBOL_RIGHT) == 0)
else if (strcmp_P(txt, PSTR(LV_SYMBOL_RIGHT)) == 0)
lv_ta_cursor_right(ext->ta);
else if (strcmp(txt, LV_SYMBOL_BACKSPACE) == 0)
else if (strcmp_P(txt, PSTR(LV_SYMBOL_BACKSPACE)) == 0)
lv_ta_del_char(ext->ta);
else if (strcmp(txt, "+/-") == 0) {
else if (strcmp_P(txt, PSTR("+/-")) == 0) {
uint16_t cur = lv_ta_get_cursor_pos(ext->ta);
const char * ta_txt = lv_ta_get_text(ext->ta);
if (ta_txt[0] == '-') {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_level_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void lv_draw_level_settings() {
#if HAS_BED_PROBE
lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2);
#endif
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_LEVEL_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_LEVEL_RETURN, true);
}

void lv_clear_level_settings() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/mks_ui/draw_machine_para.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void lv_draw_machine_para() {
lv_screen_menu_item(scr, MachinePara_menu.MotorSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PARA_MOTOR, 1);
lv_screen_menu_item(scr, MachinePara_menu.leveling, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PARA_LEVEL, 2);
lv_screen_menu_item(scr, MachinePara_menu.AdvanceSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_PARA_ADVANCE, 3);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_PARA_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_PARA_RETURN, true);
}

void lv_clear_machine_para() {
Expand Down
Loading

0 comments on commit 01a0f3a

Please sign in to comment.