kotlin-graphics / imgui

Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
MIT License
604 stars 36 forks source link

combo box filtering #145

Open gurachan opened 4 years ago

gurachan commented 4 years ago

https://github.com/ocornut/imgui/issues/1658

like this :( kinda nice to have

elect86 commented 4 years ago

We may implement the suggested option of kovewnikov..

gurachan commented 4 years ago

yes please, that will be awesome. I will use it to search, display, and filter near online players' names entities in the game hehe. just kinda making like mtasa admin panel xD

elect86 commented 4 years ago

So, I finished 1.77, merged it back into master and ported the named comboFilter

To test it, simply uncomment this and this

To simplify I opted for a much simpler and quicker startWith filter, ie only the first contiguous match will be selected, if any.

If we want to expand this, kind of like the completition on Idea where, for example, the capital letters matter, we can continue working on it together

Otherwise, if satisfied, just close it :)

gurachan commented 4 years ago

thats available too in jdk8-snapshot one?

elect86 commented 4 years ago

Now

elect86 commented 4 years ago

Regarding the filtering function: we may implement some pre-defined options, such as "plain" (first which starts with the same input), "advanced" (search for the one maximizing the number of matching chars), "onCapitals" (same but priority to the capitals letters), etc etc

Just an idea