41 lines
944 B
C++
41 lines
944 B
C++
#ifndef __BaseMenuScreen
|
|
#define __BaseMenuScreen
|
|
|
|
#include <stdbool.h>
|
|
#include "ScreenManager.h"
|
|
|
|
/*
|
|
* Base menu screen
|
|
* Provides the base for a menu screen, allows scrolling to
|
|
* the previous or next menu screen or performs an action.
|
|
*/
|
|
class BaseMenuScreen : public BaseScreen
|
|
{
|
|
private:
|
|
bool mEnableMenuScroll = true;
|
|
|
|
protected:
|
|
bool getEnableMenuScroll() { return mEnableMenuScroll; }
|
|
void setEnableMenuScroll(bool value);
|
|
|
|
virtual bool hasPrevious() = 0;
|
|
virtual bool hasNext() = 0;
|
|
|
|
virtual const char* getTitle() = 0;
|
|
virtual void gotoPrevious() {}
|
|
virtual void gotoNext() {}
|
|
|
|
void printTitle();
|
|
void printScrollIndicators();
|
|
virtual void printValue();
|
|
|
|
public:
|
|
BaseMenuScreen(ScreenManager* screenManager) : BaseScreen(screenManager) { }
|
|
|
|
virtual void onShow();
|
|
virtual void onHide();
|
|
|
|
virtual void onEncoder(long lastPosition, long newPosition);
|
|
};
|
|
|
|
#endif |