MCPcopy Create free account
hub / github.com/Raais/ImStudio / ShowExampleAppPropertyEditor

Function ShowExampleAppPropertyEditor

src/third-party/imgui/imgui_demo.cpp:7090–7119  ·  view source on GitHub ↗

Demonstrate create a simple property editor.

Source from the content-addressed store, hash-verified

7088
7089// Demonstrate create a simple property editor.
7090static void ShowExampleAppPropertyEditor(bool* p_open)
7091{
7092 ImGui::SetNextWindowSize(ImVec2(430, 450), ImGuiCond_FirstUseEver);
7093 if (!ImGui::Begin("Example: Property editor", p_open))
7094 {
7095 ImGui::End();
7096 return;
7097 }
7098 IMGUI_DEMO_MARKER("Examples/Property Editor");
7099
7100 HelpMarker(
7101 "This example shows how you may implement a property editor using two columns.\n"
7102 "All objects/fields data are dummies here.\n"
7103 "Remember that in many simple cases, you can use ImGui::SameLine(xxx) to position\n"
7104 "your cursor horizontally instead of using the Columns() API.");
7105
7106 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2));
7107 if (ImGui::BeginTable("split", 2, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_Resizable))
7108 {
7109 // Iterate placeholder objects (all the same data)
7110 for (int obj_i = 0; obj_i < 4; obj_i++)
7111 {
7112 ShowPlaceholderObject("Object", obj_i);
7113 //ImGui::Separator();
7114 }
7115 ImGui::EndTable();
7116 }
7117 ImGui::PopStyleVar();
7118 ImGui::End();
7119}
7120
7121//-----------------------------------------------------------------------------
7122// [SECTION] Example App: Long Text / ShowExampleAppLongText()

Callers 1

ShowDemoWindowMethod · 0.85

Calls 3

ImVec2Function · 0.85
HelpMarkerFunction · 0.85
ShowPlaceholderObjectFunction · 0.85

Tested by

no test coverage detected