mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-30 18:34:34 +01:00
This commit is contained in:
parent
ea39841fcd
commit
d6ea56dfd9
@ -7514,6 +7514,15 @@ ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGuiID ImGui::GetIDWithSeed(int n, ImGuiID seed)
|
||||||
|
{
|
||||||
|
ImGuiID id = ImHashData(&n, sizeof(n), seed);
|
||||||
|
ImGuiContext& g = *GImGui;
|
||||||
|
if (g.DebugHookIdInfo == id)
|
||||||
|
DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
void ImGui::PopID()
|
void ImGui::PopID()
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||||
|
@ -2802,6 +2802,7 @@ namespace ImGui
|
|||||||
IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function.
|
IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function.
|
||||||
IMGUI_API void PushOverrideID(ImGuiID id); // Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
|
IMGUI_API void PushOverrideID(ImGuiID id); // Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
|
||||||
IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
|
IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
|
||||||
|
IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed);
|
||||||
|
|
||||||
// Basic Helpers for widget code
|
// Basic Helpers for widget code
|
||||||
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
|
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
|
||||||
|
@ -366,9 +366,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
|
IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
|
||||||
if (table->InstanceDataExtra.Size < instance_no)
|
if (table->InstanceDataExtra.Size < instance_no)
|
||||||
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
||||||
char instance_desc[12];
|
instance_id = GetIDWithSeed(instance_no, GetIDWithSeed("##Instances", NULL, id)); // Push "##Instance" followed by (int)instance_no in ID stack.
|
||||||
int instance_desc_len = ImFormatString(instance_desc, IM_ARRAYSIZE(instance_desc), "##Instance%d", instance_no);
|
|
||||||
instance_id = GetIDWithSeed(instance_desc, instance_desc + instance_desc_len, id);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user