{"id":13731969,"url":"https://github.com/scottmudge/imgui_tabs","last_synced_at":"2025-05-08T06:30:52.250Z","repository":{"id":65563397,"uuid":"86872050","full_name":"scottmudge/imgui_tabs","owner":"scottmudge","description":"Tab module for imgui. Should be relatively forwardly compatible. ","archived":false,"fork":false,"pushed_at":"2018-10-12T20:11:42.000Z","size":14,"stargazers_count":138,"open_issues_count":6,"forks_count":23,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-04T02:10:38.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottmudge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-01T01:07:36.000Z","updated_at":"2024-08-02T02:51:44.000Z","dependencies_parsed_at":"2023-01-29T19:25:09.909Z","dependency_job_id":null,"html_url":"https://github.com/scottmudge/imgui_tabs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottmudge%2Fimgui_tabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottmudge%2Fimgui_tabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottmudge%2Fimgui_tabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottmudge%2Fimgui_tabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottmudge","download_url":"https://codeload.github.com/scottmudge/imgui_tabs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224707570,"owners_count":17356357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:42.819Z","updated_at":"2024-11-14T23:30:39.772Z","avatar_url":"https://github.com/scottmudge.png","language":"C++","readme":"# imgui_tabs\nTab module for imgui. Should be relatively forwardly compatible. \n\nCode like this: \n```\nImGui::BeginTabBar(\"Settings#left_tabs_bar\");\n\n// ericb 2017_07_21 : draw the tabs background BEFORE to fill it, to avoid a \"colored overlay\"\nImGui::DrawTabsBackground();\n\nif (ImGui::AddTab(\"General\")){\n    bool fullscreen = mGUICfg-\u003efullScreen.value;\n    if(ImGui::Checkbox(\"Fullscreen Mode\",\u0026fullscreen)){\n        mGUICfg-\u003etoggleFullscreenMode = true;\n    }\n    if(ImGui::Checkbox(\"Enable Multisampling\",\u0026mGUICfg-\u003eenableMultisampling.value)){\n        mGUICfg-\u003esettingsChanged = true;\n    }\n\n    if(ImGui::SliderInt(\"MSAA Count\",(int*)\u0026mGUICfg-\u003emultisampleCount.value,mGUICfg-\u003emultisampleCount.lowerLimit,mGUICfg-\u003emultisampleCount.upperLimit))\n        mGUICfg-\u003esettingsChanged = true;\n}\nif (ImGui::AddTab(\"GUI\")){\n    ImGui::Text(\"Tab 2\");\n}\nif (ImGui::AddTab(\"Tab Name\")){\n    ImGui::Text(\"Tab 3\");\n}\nif (ImGui::AddTab(\"Tab Name\")){\n    ImGui::Text(\"Tab 4\");\n}\nImGui::EndTabBar();\n\nImGui::Dummy(ImVec2(0,20));\n\nImGui::BeginTabBar(\"#Additional Parameters\");\nfloat value = 0.0f;\n\n// ericb 2017_07_21 : draw the tabs background BEFORE to fill it, to avoid a \"colored overlay\"\nImGui::DrawTabsBackground();\n\nif (ImGui::AddTab(\"Tab Name2\")){\n    ImGui::SliderFloat(\"Slider\",\u0026value,0,1.0f);\n}\nif (ImGui::AddTab(\"Tab Name3\")){\n    ImGui::Text(\"Tab 2\");\n}\nif (ImGui::AddTab(\"Tab Name4\")){\n    ImGui::Text(\"Tab 3\");\n}\nif (ImGui::AddTab(\"Tab Name5\")){\n    ImGui::Text(\"Tab 4\");\n}\nImGui::EndTabBar();\n```\nYields results like this:\n\n![alt text](http://i.imgur.com/6PSK9NL.gif \"Animated Tabs\")\n\n  Usage:\n     \n     To start a tab bar, use: ImGui::BeginTabBar(const char* label)\n          -\u003e The label can be blank if you want, but you MUST!! pass a string of some length. Use the '#' character to\n              give it an ID without a label.\n \n      Add tabs by using:\n          if (ImGui::AddTab(\"Tab Name\")){\n                 \u003c Insert other draw commands here \u003e\n          }\n          -\u003e This is much like collapsing header. If the tab is active, then AddTab will return true, allowing drawing\n              to occur.\n \n      End the tab bar by using ImGui::EndTabBar()\n \n      And that's it! You can dynamically add or remove tabs, the bar will reset the ID and tab label vectors appropriately,\n      but it DOESN'T continuously allocate/deallocate them in memory every time (unless the CRC32 hashes of the tab or tab bar change,\n      computed from their respective labels).\n \n      Notes:\n          * You can change the rounding by altering:\n                  \"static constexpr const float rounding = 6.0f;\"\n             in the _drawTabBarTop function. Alternatively, you can add it as a parameter, but to save on memory being passed\n             around, and since I will be using 6 as a constant, I didn't include this.\n \n          * The constexpr:\n                  \"static constexpr const float shrink = 1.0f;\"\n             in the _drawTabBarTop function needs to be set to the width of your borders.\n \n          * I added custom colors and a new prototype for GetColorU32() to acquire these colors. You can change them here.\n \n          * I added extra operator functions for ImVec2 and ImVec4, _YOU MUST_ define IMGUI_DEFINE_MATH_OPERATORS in\n             imgui_internal.h for this to work.\n \n          * Please attribute my work if used or added, along with the original ImGui license/attribution.\n \n \n","funding_links":[],"categories":["Graphics"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottmudge%2Fimgui_tabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottmudge%2Fimgui_tabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottmudge%2Fimgui_tabs/lists"}