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

Finish TextFilter #649

Closed
tetenpapier opened this issue Jun 13, 2022 · 5 comments
Closed

Finish TextFilter #649

tetenpapier opened this issue Jun 13, 2022 · 5 comments
Milestone

Comments

@tetenpapier
Copy link
Contributor

I would like to use the TextFilter on a list but I don't find anything about it in the documentation.

The binding is already written (#313 & in code), but not the API.

@dbr
Copy link
Contributor

dbr commented Jun 14, 2022

Are you referring to this https://github.com/ocornut/imgui/blob/v1.86/imgui_demo.cpp#L1357-L1376 ?

If so I think they are available in API:

  1. The flags like ImGuiInputTextFlags_CharsUppercase are available as InputText::chars_uppercase https://docs.rs/imgui/0.8.0/imgui/struct.InputText.html#method.chars_uppercase etc
  2. From Input Widget Callback Draft #516, the callback based filters are usable via https://docs.rs/imgui/0.8.0/imgui/struct.InputText.html#method.callback and the trait mentioned there. I suspect it might be quite tricky to implement purely based on the docs, so there is an example which is probably clearer here: https://github.com/imgui-rs/imgui-rs/blob/v0.8.2/imgui-examples/examples/text_callbacks.rs

@tetenpapier
Copy link
Contributor Author

No, I'm referring to https://github.com/ocornut/imgui/blob/v1.86/imgui_demo.cpp#L5642-L5660.

I've searched Filter in the Rust documentation but only found the filters for InputText. I can make my own filter but I prefer to use the native features of ImGUI.

@dbr
Copy link
Contributor

dbr commented Jun 17, 2022

Ahh, I see! That is indeed not yet exposed in the API yet. I don't have time to look into this currently, but a PR would be welcomed - it should be relatively simple to make the bindings (although anything dealing with strings can be a bit tricky because of the Rust String vs C++'s null-terminated strings)

@tetenpapier
Copy link
Contributor Author

If I've time, it'll be a pleasure to contribute !

@dbr dbr added this to the v0.9 milestone Nov 22, 2022
@dbr
Copy link
Contributor

dbr commented Nov 22, 2022

Closing - was done in #658 and will be released with v0.9 🥳

@dbr dbr closed this as completed Nov 22, 2022
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