MCPcopy Create free account
hub / github.com/Nelarius/imnodes / ColorNodeEditor

Class ColorNodeEditor

example/color_node_editor.cpp:123–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123class ColorNodeEditor
124{
125public:
126 ColorNodeEditor() : graph_(), nodes_(), root_node_id_(-1),
127 minimap_location_(ImNodesMiniMapLocation_BottomRight) {}
128
129 void show()
130 {
131 // Update timer context
132 current_time_seconds = 0.001f * SDL_GetTicks();
133
134 auto flags = ImGuiWindowFlags_MenuBar;
135
136 // The node editor window
137 ImGui::Begin("color node editor", NULL, flags);
138
139 if (ImGui::BeginMenuBar())
140 {
141 if (ImGui::BeginMenu("Mini-map"))
142 {
143 const char* names[] = {
144 "Top Left",
145 "Top Right",
146 "Bottom Left",
147 "Bottom Right",
148 };
149 int locations[] = {
150 ImNodesMiniMapLocation_TopLeft,
151 ImNodesMiniMapLocation_TopRight,
152 ImNodesMiniMapLocation_BottomLeft,
153 ImNodesMiniMapLocation_BottomRight,
154 };
155
156 for (int i = 0; i < 4; i++)
157 {
158 bool selected = minimap_location_ == locations[i];
159 if (ImGui::MenuItem(names[i], NULL, &selected))
160 minimap_location_ = locations[i];
161 }
162 ImGui::EndMenu();
163 }
164
165 if (ImGui::BeginMenu("Style"))
166 {
167 if (ImGui::MenuItem("Classic"))
168 {
169 ImGui::StyleColorsClassic();
170 ImNodes::StyleColorsClassic();
171 }
172 if (ImGui::MenuItem("Dark"))
173 {
174 ImGui::StyleColorsDark();
175 ImNodes::StyleColorsDark();
176 }
177 if (ImGui::MenuItem("Light"))
178 {
179 ImGui::StyleColorsLight();
180 ImNodes::StyleColorsLight();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected