-
Notifications
You must be signed in to change notification settings - Fork 15
/
imgui_tabs.h
28 lines (22 loc) · 1.01 KB
/
imgui_tabs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef IMGUI_TABS_H
#define IMGUI_TABS_H
#include <imgui.h>
#include <string>
#include <vector>
namespace ImGui {
/*
tabLabels: name of all tabs involved
tabSize: number of elements
tabIndex: holds the current active tab
tabOrder: optional array of integers from 0 to tabSize-1 that maps the tab label order. If one of the numbers is replaced by -1 the tab label is not visible (closed). It can be read/modified at runtime.
// USAGE EXAMPLE
static const char* tabNames[] = {"First tab","Second tab","Third tab"};
static int tabOrder[] = {0,1,2};
static int tabSelected = 0;
const bool tabChanged = ImGui::TabLabels(tabNames,sizeof(tabNames)/sizeof(tabNames[0]),tabSelected,tabOrder);
ImGui::Text("\nTab Page For Tab: \"%s\" here.\n",tabNames[tabSelected]);
*/
IMGUI_API bool TabLabels(const std::vector<std::string> &tabNames, size_t tabSize, size_t &tabIndex, int *tabOrder = NULL);
IMGUI_API bool ColorPicker(const char *label, float col[3]);
} // namespace ImGui
#endif // IMGUI_TABS_H