mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Tables: Browse settings list in Metrics (outside of Table entry).
This commit is contained in:
		@@ -10689,8 +10689,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
 | 
			
		||||
#ifdef IMGUI_HAS_TABLE
 | 
			
		||||
        if (TreeNode("SettingsTables", "Settings packed data: Tables: %d bytes", g.SettingsTables.size()))
 | 
			
		||||
        {
 | 
			
		||||
            //for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
 | 
			
		||||
            //    DebugNodeTableSettings(settings);
 | 
			
		||||
            for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
 | 
			
		||||
                DebugNodeTableSettings(settings);
 | 
			
		||||
            TreePop();
 | 
			
		||||
        }
 | 
			
		||||
#endif // #ifdef IMGUI_HAS_TABLE
 | 
			
		||||
@@ -11071,6 +11071,7 @@ void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImGuiWindow*, const ImDrawLis
 | 
			
		||||
void ImGui::DebugNodeStorage(ImGuiStorage*, const char*) {}
 | 
			
		||||
void ImGui::DebugNodeTabBar(ImGuiTabBar*, const char*) {}
 | 
			
		||||
void ImGui::DebugNodeTable(ImGuiTable*) {}
 | 
			
		||||
void ImGui::DebugNodeTableSettings(ImGuiTableSettings*) {}
 | 
			
		||||
void ImGui::DebugNodeWindow(ImGuiWindow*, const char*) {}
 | 
			
		||||
void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings*) {}
 | 
			
		||||
void ImGui::DebugNodeWindowsList(ImVector<ImGuiWindow*>*, const char*) {}
 | 
			
		||||
 
 | 
			
		||||
@@ -2394,6 +2394,7 @@ namespace ImGui
 | 
			
		||||
    IMGUI_API void          DebugNodeStorage(ImGuiStorage* storage, const char* label);
 | 
			
		||||
    IMGUI_API void          DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label);
 | 
			
		||||
    IMGUI_API void          DebugNodeTable(ImGuiTable* table);
 | 
			
		||||
    IMGUI_API void          DebugNodeTableSettings(ImGuiTableSettings* settings);
 | 
			
		||||
    IMGUI_API void          DebugNodeWindow(ImGuiWindow* window, const char* label);
 | 
			
		||||
    IMGUI_API void          DebugNodeWindowSettings(ImGuiWindowSettings* settings);
 | 
			
		||||
    IMGUI_API void          DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);
 | 
			
		||||
 
 | 
			
		||||
@@ -2505,25 +2505,30 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
 | 
			
		||||
                (column->Flags & ImGuiTableColumnFlags_WidthAlwaysAutoResize) ? "WidthAlwaysAutoResize " : "",
 | 
			
		||||
                (column->Flags & ImGuiTableColumnFlags_NoResize) ? "NoResize " : "");
 | 
			
		||||
        }
 | 
			
		||||
        ImGuiTableSettings* settings = TableFindSettings(table);
 | 
			
		||||
        if (settings && TreeNode("Settings"))
 | 
			
		||||
        {
 | 
			
		||||
            BulletText("SaveFlags: 0x%08X", settings->SaveFlags);
 | 
			
		||||
            BulletText("ColumnsCount: %d (max %d)", settings->ColumnsCount, settings->ColumnsCountMax);
 | 
			
		||||
            for (int n = 0; n < settings->ColumnsCount; n++)
 | 
			
		||||
            {
 | 
			
		||||
                ImGuiTableColumnSettings* column_settings = &settings->GetColumnSettings()[n];
 | 
			
		||||
                ImGuiSortDirection sort_dir = (column_settings->SortOrder != -1) ? (ImGuiSortDirection)column_settings->SortDirection : ImGuiSortDirection_None;
 | 
			
		||||
                BulletText("Column %d Order %d SortOrder %d %s Visible %d UserID 0x%08X WidthOrWeight %.3f",
 | 
			
		||||
                    n, column_settings->DisplayOrder, column_settings->SortOrder,
 | 
			
		||||
                    (sort_dir == ImGuiSortDirection_Ascending) ? "Asc" : (sort_dir == ImGuiSortDirection_Descending) ? "Des" : "---",
 | 
			
		||||
                    column_settings->Visible, column_settings->UserID, column_settings->WidthOrWeight);
 | 
			
		||||
            }
 | 
			
		||||
            TreePop();
 | 
			
		||||
        }
 | 
			
		||||
        if (ImGuiTableSettings* settings = TableFindSettings(table))
 | 
			
		||||
            DebugNodeTableSettings(settings);
 | 
			
		||||
        TreePop();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGui::DebugNodeTableSettings(ImGuiTableSettings* settings)
 | 
			
		||||
{
 | 
			
		||||
    if (!TreeNode((void*)(intptr_t)settings->ID, "Settings 0x%08X (%d columns)", settings->ID, settings->ColumnsCount))
 | 
			
		||||
        return;
 | 
			
		||||
    BulletText("SaveFlags: 0x%08X", settings->SaveFlags);
 | 
			
		||||
    BulletText("ColumnsCount: %d (max %d)", settings->ColumnsCount, settings->ColumnsCountMax);
 | 
			
		||||
    for (int n = 0; n < settings->ColumnsCount; n++)
 | 
			
		||||
    {
 | 
			
		||||
        ImGuiTableColumnSettings* column_settings = &settings->GetColumnSettings()[n];
 | 
			
		||||
        ImGuiSortDirection sort_dir = (column_settings->SortOrder != -1) ? (ImGuiSortDirection)column_settings->SortDirection : ImGuiSortDirection_None;
 | 
			
		||||
        BulletText("Column %d Order %d SortOrder %d %s Visible %d UserID 0x%08X WidthOrWeight %.3f",
 | 
			
		||||
            n, column_settings->DisplayOrder, column_settings->SortOrder,
 | 
			
		||||
            (sort_dir == ImGuiSortDirection_Ascending) ? "Asc" : (sort_dir == ImGuiSortDirection_Descending) ? "Des" : "---",
 | 
			
		||||
            column_settings->Visible, column_settings->UserID, column_settings->WidthOrWeight);
 | 
			
		||||
    }
 | 
			
		||||
    TreePop();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif // #ifndef IMGUI_DISABLE_METRICS_WINDOW
 | 
			
		||||
 | 
			
		||||
//-------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user