Browse Source

More menu header fu

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
ec02aee46c
  1. 10
      Marlin/src/lcd/menu/menu.h
  2. 10
      Marlin/src/lcd/menu/menu_item.h

10
Marlin/src/lcd/menu/menu.h

@ -79,6 +79,16 @@ class MenuItem_static : public MenuItemBase {
static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr); static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr);
}; };
// BACK_ITEM(LABEL)
class MenuItem_back : public MenuItemBase {
public:
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) {
_draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]);
}
// Back Item action goes back one step in history
FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); }
};
// CONFIRM_ITEM(LABEL,Y,N,FY,FN,...), // CONFIRM_ITEM(LABEL,Y,N,FY,FN,...),
// YESNO_ITEM(LABEL,FY,FN,...) // YESNO_ITEM(LABEL,FY,FN,...)
class MenuItem_confirm : public MenuItemBase { class MenuItem_confirm : public MenuItemBase {

10
Marlin/src/lcd/menu/menu_item.h

@ -33,16 +33,6 @@ void lcd_move_z();
///////////// Base Menu Items ////////////// ///////////// Base Menu Items //////////////
//////////////////////////////////////////// ////////////////////////////////////////////
// BACK_ITEM(LABEL)
class MenuItem_back : public MenuItemBase {
public:
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr) {
_draw(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]);
}
// Back Item action goes back one step in history
FORCE_INLINE static void action(PGM_P const=nullptr) { ui.go_back(); }
};
// SUBMENU(LABEL, screen_handler) // SUBMENU(LABEL, screen_handler)
class MenuItem_submenu : public MenuItemBase { class MenuItem_submenu : public MenuItemBase {
public: public:

Loading…
Cancel
Save