Skip to content

added the GEMSpinner::produceStringForValue() feature - #139

Open
clarencelocke wants to merge 1 commit into
Spirik:masterfrom
clarencelocke:master
Open

added the GEMSpinner::produceStringForValue() feature#139
clarencelocke wants to merge 1 commit into
Spirik:masterfrom
clarencelocke:master

Conversation

@clarencelocke

Copy link
Copy Markdown

From #138:

Currently the printMenuItems() method will always explicitly generate a string representation of a GEMSpinnerValue via itoa() or dtostrf().

I have a situation where the underlying spinner value happens to be a byte (the underlying source is an enum value), but there exists a human-readable string representation of those values (e.g., 1 = "Apple", 2 = "Bear", 3 = "Cat", etc.). When the menu item is printed (and also when it is being edited), it would be much more useful to display the human readable string instead of the string representation of the byte value.

I had proposed an API in the above open issue — this PR is my attempt at implementing that enhancement. I believe that I have address the changes in all of the correct locations (but my actual use case is targeting the U8G2 code base so I did not test the Adafruit case).

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

Successfully merging this pull request may close these issues.

1 participant