psydack / uimgui

UImGui (Unity ImGui) is an UPM package for the immediate mode GUI library using ImGui.NET. This project is based on RG.ImGui project.
MIT License
349 stars 55 forks source link

[REQUEST] Missing function ImGui::ActivateItemByID(ImGuiID id) #59

Open flarsson87 opened 8 months ago

flarsson87 commented 8 months ago

Hi!

It seems that the mentioned function is not exposed in the glue bridge provided by this package.

https://github.com/search?q=repo%3Aocornut/imgui%20ActivateItemByID&type=code

Is this something that could be considered? What is the best way to go about requesting non exposed functions?

Best,

psydack commented 8 months ago

Yo!

That's a nice question. I need to check how it works to understand how I can apply it in the current version. As that is in internal file, I believe it requires more changes than I'm expected to do in this repo.

What do you need to do? Maybe there is something else we can work

flarsson87 commented 8 months ago

Thanks for the response!

I'm looking into custom navigation behavior and I'd like to 'activate' focused elements by e.g. pressing 'right arrow' to fold out dropdowns and 'left arrow' to collapse them.

I implemented this for a c++ version by doing (pseudo):

void activate_widget(label)
{
    auto id = Imgui.get_id(label)
    Imgui.activate_item(id)
}

I'd also probably be looking to get my hands on e.g. NavMoveRequestCancel , FocusItem and some other internal imgui functions that are not exposed yet.