Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A variant of SetupMenuSelect that stores the codes along with the labels, allowing arranging the menu as desired, the codes can be non-consecutive and out-of-order.
First implemented within the SetupMenuSelect class, but that (temporarily?) adds a bit of memory use to every select menu, so re-implemented as a derived class, thus no impact at all on use of the original class (for most menus). That was more work than that was worth, but I learned some things.
Example use:
SetupMenuSelectCodes * btm = new SetupMenuSelectCodes( "Wireless", RST_ON_EXIT, 0, true, &wireless_type );
btm->addEntryCode( "Disable", WL_DISABLE ); // 0
btm->addEntryCode( "Bluetooth", WL_BLUETOOTH ); // 1
btm->addEntryCode( "Bluetooth LE", WL_BLUETOOTH_LE ); // 5
btm->addEntryCode( "WiFi (Standalone)", WL_WLAN_STANDALONE ); // 4
btm->addEntryCode( "WiFi (Master)", WL_WLAN_MASTER ); // 2
btm->addEntryCode( "WiFi (Client)", WL_WLAN_CLIENT ); // 3