Default handler for g.DockNodeWindowMenuHandler(): display the list of windows for a given dock-node. This is exceptionally stored in a function pointer to also user applications to tweak this menu (undocumented) Custom overrides may want to decorate, group, sort entries. Please note those are internal structures: if you copy this expect occasional breakage. (if you don't need to modify the "Tabs.
| 19330 | // Please note those are internal structures: if you copy this expect occasional breakage. |
| 19331 | // (if you don't need to modify the "Tabs.Size == 1" behavior/path it is recommend you call this function in your handler) |
| 19332 | void ImGui::DockNodeWindowMenuHandler_Default(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar) |
| 19333 | { |
| 19334 | IM_UNUSED(ctx); |
| 19335 | if (tab_bar->Tabs.Size == 1) |
| 19336 | { |
| 19337 | // "Hide tab bar" option. Being one of our rare user-facing string we pull it from a table. |
| 19338 | if (MenuItem(LocalizeGetMsg(ImGuiLocKey_DockingHideTabBar), NULL, node->IsHiddenTabBar())) |
| 19339 | node->WantHiddenTabBarToggle = true; |
| 19340 | } |
| 19341 | else |
| 19342 | { |
| 19343 | // Display a selectable list of windows in this docking node |
| 19344 | for (int tab_n = 0; tab_n < tab_bar->Tabs.Size; tab_n++) |
| 19345 | { |
| 19346 | ImGuiTabItem* tab = &tab_bar->Tabs[tab_n]; |
| 19347 | if (tab->Flags & ImGuiTabItemFlags_Button) |
| 19348 | continue; |
| 19349 | if (Selectable(TabBarGetTabName(tab_bar, tab), tab->ID == tab_bar->SelectedTabId)) |
| 19350 | TabBarQueueFocus(tab_bar, tab); |
| 19351 | SameLine(); |
| 19352 | Text(" "); |
| 19353 | } |
| 19354 | } |
| 19355 | } |
| 19356 | |
| 19357 | static void ImGui::DockNodeWindowMenuUpdate(ImGuiDockNode* node, ImGuiTabBar* tab_bar) |
| 19358 | { |
nothing calls this directly
no test coverage detected