More menu header fu

This commit is contained in:
Scott Lahteine 2020-08-21 21:59:59 -05:00
parent 46744e8433
commit 744f74506f
2 changed files with 10 additions and 10 deletions

View File

@ -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 {

View File

@ -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: