Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Have a way to disable a menu entry by default #425

Open
ScruffR opened this issue Sep 5, 2023 · 0 comments
Open

Feature Request: Have a way to disable a menu entry by default #425

ScruffR opened this issue Sep 5, 2023 · 0 comments

Comments

@ScruffR
Copy link

ScruffR commented Sep 5, 2023

I know I can call menu[1].disable(), however it would be nice if there was a way to have a way to mark a menu entry as disabled at "design time" via a style
e.g.

MENU(settings, " Motor/Encoder Settings >", doNothing, noEvent, noStyle
, OP(                 " Motor        ", doNothing, anyEvent) // this should not be selectable, the curser should skip the line
, FIELD(speed       , "  Speed       ", " rpm", 1, 200, 10, 1, doNothing, noEvent, noStyle)
, FIELD(accelTime   , "  Accel.Time  ", " ms", 10, 500, 100, 0, doNothing, noEvent, noStyle)
, OP(                 " Encoder      ", doNothing, anyEvent) // this should not be selectable, the curser should skip the line
, FIELD(pulsesPerRev, "  Pulses/Rev  ", "", 100, 1200, 100, 10, doNothing, noEvent, noStyle)
, FIELD(mmPerRev    , "  mm/Rev      ", " mm", 50, 2500, 10, 1, doNothing, noEvent, noStyle)
, OP(                 "> RESTORE     ", restoreData, enterEvent)
, OP(                 "< SAVE        ", storeData, enterEvent)
);

alternatively or additionally it would be nice to have a macro (e.g. "LABEL") to add such "separators" that have not other purpose than to structure a menu.
This would also allow for "virtual" footer options, where e.g. the EXIT entry was always on the bottom row of the display.

Which brings me to another suggestion: Definition of a footer sub-menu.
Like in the example above it would be nice to have the RESTORE and SAVE entries pinned to the bottom row of the display left and right. As cherry on top it would be great if this footer stayed in place even when the menu "above" had more rows than the display can hold. So scrolling would only happen for the top but one rows of the display.
With a bigger display it might even be nice to have a header, which stays in place to display the title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant