|
|
@ -33,41 +33,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "../../feature/cancel_object.h"
|
|
|
|
#include "../../feature/cancel_object.h"
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
static void lcd_cancel_object_confirm() {
|
|
|
|
// TODO: Select the active object
|
|
|
|
const int8_t v = editable.int8;
|
|
|
|
// upon entry to the menu and present
|
|
|
|
const char item_num[] = {
|
|
|
|
// a confirmation screen.
|
|
|
|
' ',
|
|
|
|
//
|
|
|
|
char((v > 9) ? '0' + (v / 10) : ' '),
|
|
|
|
|
|
|
|
char('0' + (v % 10)),
|
|
|
|
|
|
|
|
'\0'
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
do_select_screen_yn(
|
|
|
|
|
|
|
|
[]{
|
|
|
|
|
|
|
|
cancelable.cancel_object(editable.int8 - 1);
|
|
|
|
|
|
|
|
#if HAS_BUZZER
|
|
|
|
|
|
|
|
ui.completion_feedback();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
ui.goto_previous_screen,
|
|
|
|
|
|
|
|
GET_TEXT(MSG_CANCEL_OBJECT), item_num, PSTR("?")
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void menu_cancelobject() {
|
|
|
|
void menu_cancelobject() {
|
|
|
|
START_MENU();
|
|
|
|
START_MENU();
|
|
|
|
BACK_ITEM(MSG_MAIN);
|
|
|
|
BACK_ITEM(MSG_MAIN);
|
|
|
|
|
|
|
|
|
|
|
|
GCODES_ITEM(MSG_CANCEL_OBJECT, PSTR("M486 C"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Draw cancelable items in a loop
|
|
|
|
// Draw cancelable items in a loop
|
|
|
|
for (int8_t i = 0; i < cancelable.object_count; i++) {
|
|
|
|
int8_t a = cancelable.active_object;
|
|
|
|
if (!TEST(cancelable.canceled, i)) {
|
|
|
|
for (int8_t i = -1; i < cancelable.object_count; i++) {
|
|
|
|
editable.int8 = i;
|
|
|
|
if (i == a) continue;
|
|
|
|
ACTION_ITEM(MSG_CANCEL_OBJECT, [](){
|
|
|
|
int8_t j = i < 0 ? a : i;
|
|
|
|
cancelable.cancel_object(editable.int8);
|
|
|
|
if (!cancelable.is_canceled(j)) {
|
|
|
|
ui.quick_feedback();
|
|
|
|
editable.int8 = j + 1;
|
|
|
|
});
|
|
|
|
SUBMENU(MSG_CANCEL_OBJECT, lcd_cancel_object_confirm);
|
|
|
|
MENU_ITEM_ADDON_START(LCD_WIDTH - 2 - (i >= 10));
|
|
|
|
MENU_ITEM_ADDON_START(LCD_WIDTH - 2 - (j >= 9));
|
|
|
|
lcd_put_int(i);
|
|
|
|
lcd_put_int(editable.int8);
|
|
|
|
MENU_ITEM_ADDON_END();
|
|
|
|
MENU_ITEM_ADDON_END();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i < 0) SKIP_ITEM();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_CANCEL_OBJECT, &editable.int8, -1, 32, [](){
|
|
|
|
|
|
|
|
if (editable.int8 > -1) {
|
|
|
|
|
|
|
|
cancelable.cancel_object(editable.int8);
|
|
|
|
|
|
|
|
ui.quick_feedback();
|
|
|
|
|
|
|
|
editable.int8 = -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
END_MENU();
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|