VR-Vantage
Loading...
Searching...
No Matches
imgui_user.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2020 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
9
10#pragma once
11
12namespace ImGui
13{
14
16 const char* label,
17 int num_datas,
18 const char** names,
19 const ImColor* colors,
20 float(*getter)(const void* data, int idx),
21 const void * const * datas,
22 int values_count,
23 int values_offset,
24 float scale_min,
25 float scale_max,
26 ImVec2 graph_size,
27 const bool* labels = NULL);
28
30 const char* label,
31 int num_hists,
32 const char** names,
33 const ImColor* colors,
34 float(*getter)(const void* data, int idx),
35 const void * const * datas,
36 int values_count,
37 float scale_min,
38 float scale_max,
39 ImVec2 graph_size);
40
41// doesn't actually work yet
42 IMGUI_API void ItemRowsBackground(float lineHeight = -1.0f, const ImColor& color = ImColor(20, 20, 20, 64));
43
44//TDG: I know this is ugly but it avoids the need to put a pop tree in the right spot at the bottom of the if statement
45// open to suggestions on how to improve this but this was the best I could come up with.
46// this macro creates a DtScopedTreeNode and runs through the for loop once. The only reason it is a for loop is
47// so it can base the destructor on the result of the treeNode function return variable.
48#define IF_IMGUI_SCOPED_TREE_NODE(label) for (ImGui::DtScopedTreeNode scopedNode(label); scopedNode.nodeActive(); scopedNode.setNodeActive(false))
49#define IF_IMGUI_SCOPED_TREE_NODE_EX(label, flags) for (ImGui::DtScopedTreeNodeEx scopedNode(label, flags); scopedNode.nodeActive(); scopedNode.setNodeActive(false))
50
54 {
55 public:
57 DtScopedTreeNode(const char* label);
58
61
63 bool nodeActive();
64
66 void setNodeActive(bool flag);
67
68 protected:
69
72 };
73
77 {
78 public:
80 DtScopedTreeNodeEx(const char* label, ImGuiTreeNodeFlags flags);
81
84
86 bool nodeActive();
87
89 void setNodeActive(bool flag);
90
91 protected:
92
95
96 };
97
98} // namespace ImGui
~DtScopedTreeNodeEx()
destructor
void setNodeActive(bool flag)
set the node active value
DtScopedTreeNodeEx(const char *label, ImGuiTreeNodeFlags flags)
constructor
bool myNodeActiveOriginal
Definition imgui_user.h:94
bool nodeActive()
current node active value
bool myNodeActive
Definition imgui_user.h:93
~DtScopedTreeNode()
destructor
bool nodeActive()
current node active value
bool myNodeActive
Definition imgui_user.h:70
bool myNodeActiveOriginal
Definition imgui_user.h:71
void setNodeActive(bool flag)
set the node active value
DtScopedTreeNode(const char *label)
constructor
int ImGuiTreeNodeFlags
Definition imgui.h:205
#define IMGUI_API
Definition imgui.h:78
Definition imgui.h:292
IMGUI_API void PlotMultiLines(const char *label, int num_datas, const char **names, const ImColor *colors, float(*getter)(const void *data, int idx), const void *const *datas, int values_count, int values_offset, float scale_min, float scale_max, ImVec2 graph_size, const bool *labels=NULL)
IMGUI_API void PlotMultiHistograms(const char *label, int num_hists, const char **names, const ImColor *colors, float(*getter)(const void *data, int idx), const void *const *datas, int values_count, float scale_min, float scale_max, ImVec2 graph_size)
IMGUI_API void ItemRowsBackground(float lineHeight=-1.0f, const ImColor &color=ImColor(20, 20, 20, 64))
Definition imgui.h:2244
Definition imgui.h:263