-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
ComboBox with TextInput #2057
Comments
Hello @HaSa1002 Thanks for posting this! Some feedback:
|
Thanks for the feedback. First of all I posted a gif (It was a bit late yesterday). Second, that could be possible, but the selection is saved using the buffer of the textinput and it depends on the sizing possiblities of the combo. Third is on the way. Fourth, I use now strncmp since it checkes the equality of the first n characters. Fifth, the custom delete is ncessary, because the user deletes the selection, but still want's to the delete on more char. If this isn't working you can't delete chars because only the proposal is selected to gurantee textinput. Six, yes, I forgot that. |
@ocornut I'm trying to implement something similar. Regarding your suggestion to use InputText + BeginCombo/EndCombo: how can I align the drop-down selectables with the left of my InputText? |
May not have time to look at it, but linking this thread to #718 |
Thanks @ocornut. That ought to work. |
Version/Branch of Dear ImGui:
1.64
Back-end file/Renderer/OS:
Back-ends: SFML, imgui-SFML
OS: Win10
Suggestion:
I needed a ComboBox, where you can simply enter Text and the combobox provides you with one proposal. If it doesn't fit, you simply enter the next character and get the next best fitting proposal. Besides you can click on the ComboBox Key or use the right mouse button to open the ComboBox and select an entry. The textinputcombobox.cpp.txt provides the full implementation of this widget, as well as an minimal example, which is also visible below. The solution is by far not perfect eceptionally the "backspace" (the action, if you want to delete text) support, since it uses SFML Keys, because I couldn't get this correctly done using imgui functions. Also deleting isn't always exxecuted, which could be related to my backend, since it worked when it was not in the function... I tried to use no stl container, but didn't came around one pair to pass the actual array as well as the size of this array.
Screenshots/Video
Standalone, minimal, complete and verifiable example:
Sourcecode:
textinputcombobox.cpp.txt
The text was updated successfully, but these errors were encountered: