You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inline iterator erase(const_iterator it) { IM_ASSERT(it >= begin() && it < end()); constptrdiff_t off = it - begin(); memmove(Data + off, Data + off + 1, (Size - (size_t)off - 1) * sizeof(value_type)); Size--; return Data + off; }
120
-
inlinevoidinsert(const_iterator it, const value_type& v) { IM_ASSERT(it >= begin() && it <= end()); constptrdiff_t off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; }
120
+
inlineiteratorinsert(const_iterator it, const value_type& v) { IM_ASSERT(it >= begin() && it <= end()); constptrdiff_t off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; return Data + off; }
121
121
};
122
122
#endif// #ifndef ImVector
123
123
@@ -204,10 +204,13 @@ namespace ImGui
204
204
IMGUI_API floatGetTextLineHeight();
205
205
206
206
// ID scopes
207
-
IMGUI_API voidPushID(constchar* str_id);
207
+
// If you are creating repeated widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
208
+
IMGUI_API voidPushID(constchar* str_id); // push identifier into the ID stack. IDs are hash of the *entire* stack!
208
209
IMGUI_API voidPushID(constvoid* ptr_id);
209
210
IMGUI_API voidPushID(constint int_id);
210
211
IMGUI_API voidPopID();
212
+
IMGUI_API ImGuiID GetID(constchar* str_id); // calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed.
213
+
IMGUI_API ImGuiID GetID(constvoid* ptr_id);
211
214
212
215
// Widgets
213
216
IMGUI_API voidText(constchar* fmt, ...);
@@ -587,22 +590,38 @@ struct ImGuiTextBuffer
587
590
};
588
591
589
592
// Helper: Key->value storage
590
-
// - Store collapse state for a tree
591
-
// - Store color edit options, etc.
593
+
// - Store collapse state for a tree (Int 0/1)
594
+
// - Store color edit options (Int using values in ImGuiColorEditMode enum).
595
+
// - Custom user storage for temporary values.
592
596
// Typically you don't have to worry about this since a storage is held within each Window.
593
-
// Declare your own storage if you want to manipulate the open/close state of a particular sub-tree in your interface.
597
+
// Declare your own storage if:
598
+
// - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state).
599
+
// - You want to store custom debug data easily without adding or editing structures in your code.
0 commit comments