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

Request: Element visibility #24

Closed
ImpulseAdventure opened this issue Jan 7, 2018 · 5 comments
Closed

Request: Element visibility #24

ImpulseAdventure opened this issue Jan 7, 2018 · 5 comments
Assignees
Milestone

Comments

@ImpulseAdventure
Copy link
Owner

It would be useful to support dynamic displays that show / hide GUI elements on the basis of the current state (e.g. A button that is only visible when a radio button / checkbox is set). This may just involve adding a ElemSetVisibleEn() and then integrating this with the existing redraw functionality. The visibility status could potentially be stored by expanding tsElem:bValid into a multi-bit state field.

@rrroonn
Copy link

rrroonn commented Jan 9, 2019

Definitely something that should be added. The ability to Hide() or Show() is needed, along with cascading redraws of affected regions.
Thank you.

@ImpulseAdventure ImpulseAdventure self-assigned this Jan 11, 2019
@ImpulseAdventure
Copy link
Owner Author

Agreed. I will move this feature into the shortlist for implementation as it should be relatively straightforward and potentially quite useful. Note that I may initially implement this with a full-display invalidation (I don’t expect show/hide to be done frequently), but clearly it would be desirable to support an optimized invalidated region. There are other features that could benefit from this optimized invalidation, so it would be worthwhile.

@rrroonn
Copy link

rrroonn commented Jan 12, 2019 via email

ImpulseAdventure added a commit that referenced this issue Jan 16, 2019
- New API: ElemSetShow()
- NOTE: This implementation triggers full-page redraw when an element is hidden. Future implementations will perform selective redraw of revealed regions.
- ElemRefFlags updated to add GSLC_ELEMREF_SHOW
- Create default ElemRefFlags GSLC_ELEMREF_DEFAULT
@ImpulseAdventure
Copy link
Owner Author

@rrroonn -- I have now integrated a preliminary implementation of the element visibility feature into the WIP24-Visibility branch

  • Users can call ElemSetShow() to hide or show an element dynamically
  • Example ex04 has been modified to demonstrate the callbacks from the checkbox (via Add checkbox/radio toggle callback #74 ) used in order to hide/show the progress bar
  • Note that this initial implementation triggers a page redraw upon hiding an element (typically slow on Arduino, not very noticeable on RPi). Upcoming enhancements to this feature will incorporate a selective / optimized redraw during element hiding (ie. determining which elements need to be redrawn with selective clipping once they are revealed).

@ImpulseAdventure ImpulseAdventure changed the title Support for element visibility Request: Element visibility Feb 12, 2019
ImpulseAdventure added a commit that referenced this issue Feb 22, 2019
- Note: hiding an element triggers full page redraw in the current implementation (not yet optimized for partial redraw)
@ImpulseAdventure
Copy link
Owner Author

ImpulseAdventure commented Feb 22, 2019

Visibility feature has now been integrated into master via #117

  • Partial redraw was implemented using clipping regions. A more advanced redraw by determining element coverage within the clipping region could be be implemented that would reduce some overdraw.
  • Note that final API naming is ElemSetVisible()
  • Thanks again, @rrroonn for the input.

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

No branches or pull requests

2 participants