27class ContextMenu :
public UI {
29 ContextMenu() { oledShowsUIUnderneath =
true; };
31 virtual ~ContextMenu() =
default;
33 void focusRegained()
override;
34 void selectEncoderAction(int8_t offset)
override;
35 ActionResult buttonAction(deluge::hid::Button b,
bool on,
bool inCardRoutine)
override;
36 void drawCurrentOption();
37 virtual bool isCurrentOptionAvailable() {
return true; }
38 virtual bool acceptCurrentOption() {
return false; }
40 virtual std::span<char const*> getOptions() = 0;
42 bool getGreyoutColsAndRows(uint32_t* cols, uint32_t* rows)
override;
43 ActionResult padAction(int32_t x, int32_t y, int32_t velocity)
override;
44 virtual bool setupAndCheckAvailability();
46 virtual deluge::hid::Button getAcceptButton() {
return deluge::hid::button::SELECT_ENC; }
48 int32_t currentOption = 0;
51 int32_t scrollPos = 0;
52 virtual char const* getTitle() = 0;
57 UIType getUIType()
override {
return UIType::CONTEXT_MENU; }