MCPcopy Create free account
hub / github.com/clementgallet/libTAS / ShowExampleAppPropertyEditor

Function ShowExampleAppPropertyEditor

src/external/imgui/imgui_demo.cpp:7550–7580  ·  view source on GitHub ↗

Demonstrate create a simple property editor. This demo is a bit lackluster nowadays, would be nice to improve.

Source from the content-addressed store, hash-verified

7548// Demonstrate create a simple property editor.
7549// This demo is a bit lackluster nowadays, would be nice to improve.
7550static void ShowExampleAppPropertyEditor(bool* p_open)
7551{
7552 ImGui::SetNextWindowSize(ImVec2(430, 450), ImGuiCond_FirstUseEver);
7553 if (!ImGui::Begin("Example: Property editor", p_open))
7554 {
7555 ImGui::End();
7556 return;
7557 }
7558
7559 IMGUI_DEMO_MARKER("Examples/Property Editor");
7560 HelpMarker(
7561 "This example shows how you may implement a property editor using two columns.\n"
7562 "All objects/fields data are dummies here.\n");
7563
7564 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2));
7565 if (ImGui::BeginTable("##split", 2, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY))
7566 {
7567 ImGui::TableSetupScrollFreeze(0, 1);
7568 ImGui::TableSetupColumn("Object");
7569 ImGui::TableSetupColumn("Contents");
7570 ImGui::TableHeadersRow();
7571
7572 // Iterate placeholder objects (all the same data)
7573 for (int obj_i = 0; obj_i < 4; obj_i++)
7574 ShowPlaceholderObject("Object", obj_i);
7575
7576 ImGui::EndTable();
7577 }
7578 ImGui::PopStyleVar();
7579 ImGui::End();
7580}
7581
7582//-----------------------------------------------------------------------------
7583// [SECTION] Example App: Long Text / ShowExampleAppLongText()

Callers 1

ShowDemoWindowMethod · 0.85

Calls 5

ImVec2Function · 0.85
PushStyleVarFunction · 0.85
ShowPlaceholderObjectFunction · 0.85
PopStyleVarFunction · 0.85
HelpMarkerFunction · 0.70

Tested by

no test coverage detected