Skip to content

Add various input dialogs #13120

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

Semphriss
Copy link
Contributor

I haven't seem much discussion about whether those dialogs should be added to SDL; I open this PR also as a discussion as to whether or not they should be, and which ones are relevant to SDL. I presumed it would be easier to discuss with working code available.

Description

This PR adds the following input dialogs types:

  • Text/password input
    image
  • Progress/loading bar
    image
  • Color picker
    image
  • Date picker
    image

These also seem to be available, but I'm not sure if they're globally useful:

  • List selection dialogs
    image
  • Scale number picker
    image

As of opening the PR, only the Zenity implementation is supported. I chose to open this PR early to get feedback on the current API.

Should I add the two remaining dialog types? More generally, which ones are good to add in SDL?

If some would be good to add:

  • Currently all dialogs take an SDL_PropertiesID argument; should I make a simple version for each, similarly to SDL_ShowSimpleMessageBox?
  • Should I re-use the same property field macros for fields that are similar across dialogs? (such as a single SDL_PROP_DIALOG_TITLE_STRING for all dialogs)
  • For the date picker, I did not re-use the existing SDL_DateTime struct because it seems to be a complete representation of a given timestamp (including the day of the week and the UTC offset), and I wasn't sure how to handle this. I probably should move the code to SDL_DateTime, but I would need guidance on how to design the API.

I should be able to take care of the Windows implementation, but I haven't yet gotten my hands on a new macOS device; help would be welcome.

Existing Issue(s)

Fixes #12792

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.

Support for input dialogs
1 participant