@@ -295,6 +295,7 @@ struct ExampleMemberInfo
295
295
// Metadata description of ExampleTreeNode struct.
296
296
static const ExampleMemberInfo ExampleTreeNodeMemberInfos[]
297
297
{
298
+ { "MyName", ImGuiDataType_String, 1, offsetof(ExampleTreeNode, Name) },
298
299
{ "MyBool", ImGuiDataType_Bool, 1, offsetof(ExampleTreeNode, DataMyBool) },
299
300
{ "MyInt", ImGuiDataType_S32, 1, offsetof(ExampleTreeNode, DataMyInt) },
300
301
{ "MyVec2", ImGuiDataType_Float, 2, offsetof(ExampleTreeNode, DataMyVec2) },
@@ -8957,6 +8958,8 @@ struct ExampleAppPropertyEditor
8957
8958
ImGui::Separator();
8958
8959
if (ImGui::BeginTable("##properties", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY))
8959
8960
{
8961
+ // Push object ID after we entered the table, so table is shared for all objects
8962
+ ImGui::PushID((int)node->UID);
8960
8963
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed);
8961
8964
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch, 2.0f); // Default twice larger
8962
8965
if (node->HasData)
@@ -8995,10 +8998,16 @@ struct ExampleAppPropertyEditor
8995
8998
ImGui::SliderScalarN("##Editor", field_desc.DataType, field_ptr, field_desc.DataCount, &v_min, &v_max);
8996
8999
break;
8997
9000
}
9001
+ case ImGuiDataType_String:
9002
+ {
9003
+ ImGui::InputText("##Editor", reinterpret_cast<char*>(field_ptr), 28);
9004
+ break;
9005
+ }
8998
9006
}
8999
9007
ImGui::PopID();
9000
9008
}
9001
9009
}
9010
+ ImGui::PopID();
9002
9011
ImGui::EndTable();
9003
9012
}
9004
9013
}
0 commit comments