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

String picker search field #701

Open
NQNStudios opened this issue Mar 20, 2025 · 5 comments
Open

String picker search field #701

NQNStudios opened this issue Mar 20, 2025 · 5 comments
Assignees
Labels
dialogxml Affects the dialog system enhancement

Comments

@NQNStudios
Copy link
Collaborator

It will fit at the top of the dialog, there's some blank space by the dialog picture. You'll type into it and click a Search button. It'll do a case-insensitive search of the strings starting from the current page. It'll set a highlight color on matching strings. If there are none on the current page or you hit the button twice, it'll proceed to the next page with a match. It can have a little label that might tell you 'No matches' or 'Reached end, looping'

@NQNStudios NQNStudios added enhancement dialogxml Affects the dialog system labels Mar 20, 2025
@NQNStudios NQNStudios self-assigned this Mar 20, 2025
@NQNStudios
Copy link
Collaborator Author

NQNStudios commented Mar 20, 2025

@CelticMinstrel Here's how it looks:

Image

One thing that's troublesome is you expect 'Enter' to run the search you've typed in, but it clicks OK instead. But I'm not so sure making the search button the default would be good to do in every string picker. And whether it (the search feature) should be made optional per dialog type. Maybe it could automatically appear for multipage pickers?

For the 'give item' debug action picker shown here what I'd like is for the search to be Enter and the "OK" button to say "Give", with g as its key.

NQNStudios added a commit to NQNStudios/cboe that referenced this issue Mar 20, 2025
@CelticMinstrel
Copy link
Member

CelticMinstrel commented Mar 21, 2025

One thing that's troublesome is you expect 'Enter' to run the search you've typed in, but it clicks OK instead. But I'm not so sure making the search button the default would be good to do in every string picker.

Hmm, yeah, this design is a bit troublesome. From what I recall, the notion of "focus" in dialogxml is very basic, and there is no concept of having no field focused. If that concept existed, my expectation would be to hit search if the field has focus and hit OK if it does not.

But, there are other options that come to mind.

  1. Remove the text field and "reverse" toggle - just have a search button. That brings up a separate search dialog where you enter in your query, possibly select reverse, and click OK. The query could still be shown as static text in the dialog. There are still a few issues, but that's similar to how RPGMaker handles search.

  2. The input field is invisible until you press Search. Once it's visible, enter hits Search instead of OK. Perhaps Ctrl+Enter hits OK.

Also, the button should have a keyboard shortcut of Ctrl+F. I also think the status text just below the field should be in a slightly smaller font size.

And whether it (the search feature) should be made optional per dialog type. Maybe it could automatically appear for multipage pickers?

It seems like it would be really hard to generalize it down to something that can be used in any dialog. The specific logic of the search in particular depends on the dialog.

For the 'give item' debug action picker shown here what I'd like is for the search to be Enter and the "OK" button to say "Give", with g as its key.

Changing the label on the button is as easy as choiceDlog->getControl("done").setText("whatever"). Not sure if changing the key is equally easy.

@NQNStudios
Copy link
Collaborator Author

NQNStudios commented Mar 21, 2025

Hmm, yeah, this design is a bit troublesome. From what I recall, the notion of "focus" in dialogxml is very basic, and there is no concept of having no field focused. If that concept existed, my expectation would be to hit search if the field has focus and hit OK if it does not.

I was thinking that a kludgy concept of 'focus' could be added to this specific dialog, by manually toggling the dialog's default button in response to:

  • Selecting an LED -> make the OK button default
  • Typing in the search field -> search button becomes default
  • clicking on the search field -> search button
  • clicking the search button -> search button
  • toggling the reverse led -> search button

@NQNStudios
Copy link
Collaborator Author

It seems like it would be really hard to generalize it down to something that can be used in any dialog. The specific logic of the search in particular depends on the dialog.

I meant multipage string pickers.

NQNStudios added a commit to NQNStudios/cboe that referenced this issue Mar 21, 2025
@NQNStudios
Copy link
Collaborator Author

The input field is invisible until you press Search. Once it's visible, enter hits Search instead of OK. Perhaps Ctrl+Enter hits OK.

I went with this solution.

NQNStudios added a commit to NQNStudios/cboe that referenced this issue Mar 29, 2025
NQNStudios added a commit to NQNStudios/cboe that referenced this issue Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialogxml Affects the dialog system enhancement
Projects
None yet
Development

No branches or pull requests

2 participants