playground/ExampleApps/ExampleAppPropertyEditor.cpp
// The code below was copy-pasted verbatim from imgui_demo.cpp
// Do not edit!!!
//-----------------------------------------------------------------------------
// [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor()
//-----------------------------------------------------------------------------
The code below was copy-pasted verbatim from imgui_demo.cpp
Do not edit

[SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor()
The code below was copy - pasted verbatim from imgui_demo . cpp Do not edit [ SECTION ] Example App : Property Editor / ShowExampleAppPropertyEditor ()
static void ShowPlaceholderObject(const char* prefix, int uid)
{
    ImGui::PushID(uid);
    ImGui::TableNextRow();
    ImGui::TableSetColumnIndex(0);
    ImGui::AlignTextToFramePadding();
    bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid);
    ImGui::TableSetColumnIndex(1);
    ImGui::Text("my sailor is rich");
    if (node_open)
    {
        static float placeholder_members[8] = { 0.0f, 0.0f, 1.0f, 3.1416f, 100.0f, 999.0f };
        for (int i = 0; i < 8; i++)
        {
            ImGui::PushID(i); 
            if (i < 2)
            {
                ShowPlaceholderObject("Child", 424242);
            }
            else
            {
                ImGui::TableNextRow();
                ImGui::TableSetColumnIndex(0);
                ImGui::AlignTextToFramePadding();
                ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet;
                ImGui::TreeNodeEx("Field", flags, "Field_%d", i);
                ImGui::TableSetColumnIndex(1);
                ImGui::SetNextItemWidth(-FLT_MIN);
                if (i >= 5)
                    ImGui::InputFloat("##value", &placeholder_members[i], 1.0f);
                else
                    ImGui::DragFloat("##value", &placeholder_members[i], 0.01f);
                ImGui::NextColumn();
            }
            ImGui::PopID();
        }
        ImGui::TreePop();
    }
    ImGui::PopID();
}
static void ShowPlaceholderObject ( const char * prefix , int uid ) { ImGui :: PushID ( uid ) ; ImGui :: TableNextRow ( ) ; ImGui :: TableSetColumnIndex ( 0 ) ; ImGui :: AlignTextToFramePadding ( ) ; bool node_open = ImGui :: TreeNode ( " " , " " , prefix , uid ) ; ImGui :: TableSetColumnIndex ( 1 ) ; ImGui :: Text ( " " ) ; if ( node_open ) { static float placeholder_members [ 8 ] = { 0.0f , 0.0f , 1.0f , 3.1416f , 100.0f , 999.0f } ; for ( int i = 0 ; i < 8 ; i ++ ) { ImGui :: PushID ( i ) ; if ( i < 2 ) { ShowPlaceholderObject ( " " , 424242 ) ; } else { ImGui :: TableNextRow ( ) ; ImGui :: TableSetColumnIndex ( 0 ) ; ImGui :: AlignTextToFramePadding ( ) ; ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet ; ImGui :: TreeNodeEx ( " " , flags , " " , i ) ; ImGui :: TableSetColumnIndex ( 1 ) ; ImGui :: SetNextItemWidth ( - FLT_MIN ) ; if ( i >= 5 ) ImGui :: InputFloat ( " " , & placeholder_members [ i ] , 1.0f ) ; else ImGui :: DragFloat ( " " , & placeholder_members [ i ] , 0.01f ) ; ImGui :: NextColumn ( ) ; } ImGui :: PopID ( ) ; } ImGui :: TreePop ( ) ; } ImGui :: PopID ( ) ; }
The code below was copy-pasted verbatim from imgui_demo.cpp
Do not edit!!
The code below was copy - pasted verbatim from imgui_demo . cpp Do not edit!!
// Use object uid as identifier. Most commonly you could also use the object pointer as a base ID. // Text and Tree nodes are less high than framed widgets, using AlignTextToFramePadding() we add vertical spacing to make the tree lines equal high. // Use field index as identifier. // Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well)