MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / DebugNodeTable

Method DebugNodeTable

extern/imgui/imgui_tables.cpp:3551–3613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3549}
3550
3551void ImGui::DebugNodeTable(ImGuiTable* table)
3552{
3553 char buf[512];
3554 char* p = buf;
3555 const char* buf_end = buf + IM_ARRAYSIZE(buf);
3556 const bool is_active = (table->LastFrameActive >= ImGui::GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
3557 ImFormatString(p, buf_end - p, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
3558 if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
3559 bool open = TreeNode(table, "%s", buf);
3560 if (!is_active) { PopStyleColor(); }
3561 if (IsItemHovered())
3562 GetForegroundDrawList()->AddRect(table->OuterRect.Min, table->OuterRect.Max, IM_COL32(255, 255, 0, 255));
3563 if (IsItemVisible() && table->HoveredColumnBody != -1)
3564 GetForegroundDrawList()->AddRect(GetItemRectMin(), GetItemRectMax(), IM_COL32(255, 255, 0, 255));
3565 if (!open)
3566 return;
3567 if (table->InstanceCurrent > 0)
3568 ImGui::Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
3569 bool clear_settings = SmallButton("Clear settings");
3570 BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags));
3571 BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
3572 BulletText("CellPaddingX: %.1f, CellSpacingX: %.1f/%.1f, OuterPaddingX: %.1f", table->CellPaddingX, table->CellSpacingX1, table->CellSpacingX2, table->OuterPaddingX);
3573 BulletText("HoveredColumnBody: %d, HoveredColumnBorder: %d", table->HoveredColumnBody, table->HoveredColumnBorder);
3574 BulletText("ResizedColumn: %d, ReorderColumn: %d, HeldHeaderColumn: %d", table->ResizedColumn, table->ReorderColumn, table->HeldHeaderColumn);
3575 //BulletText("BgDrawChannels: %d/%d", 0, table->BgDrawChannelUnfrozen);
3576 float sum_weights = 0.0f;
3577 for (int n = 0; n < table->ColumnsCount; n++)
3578 if (table->Columns[n].Flags & ImGuiTableColumnFlags_WidthStretch)
3579 sum_weights += table->Columns[n].StretchWeight;
3580 for (int n = 0; n < table->ColumnsCount; n++)
3581 {
3582 ImGuiTableColumn* column = &table->Columns[n];
3583 const char* name = TableGetColumnName(table, n);
3584 ImFormatString(buf, IM_ARRAYSIZE(buf),
3585 "Column %d order %d '%s': offset %+.2f to %+.2f%s\n"
3586 "Enabled: %d, VisibleX/Y: %d/%d, RequestOutput: %d, SkipItems: %d, DrawChannels: %d,%d\n"
3587 "WidthGiven: %.1f, Request/Auto: %.1f/%.1f, StretchWeight: %.3f (%.1f%%)\n"
3588 "MinX: %.1f, MaxX: %.1f (%+.1f), ClipRect: %.1f to %.1f (+%.1f)\n"
3589 "ContentWidth: %.1f,%.1f, HeadersUsed/Ideal %.1f/%.1f\n"
3590 "Sort: %d%s, UserID: 0x%08X, Flags: 0x%04X: %s%s%s..",
3591 n, column->DisplayOrder, name, column->MinX - table->WorkRect.Min.x, column->MaxX - table->WorkRect.Min.x, (n < table->FreezeColumnsRequest) ? " (Frozen)" : "",
3592 column->IsEnabled, column->IsVisibleX, column->IsVisibleY, column->IsRequestOutput, column->IsSkipItems, column->DrawChannelFrozen, column->DrawChannelUnfrozen,
3593 column->WidthGiven, column->WidthRequest, column->WidthAuto, column->StretchWeight, column->StretchWeight > 0.0f ? (column->StretchWeight / sum_weights) * 100.0f : 0.0f,
3594 column->MinX, column->MaxX, column->MaxX - column->MinX, column->ClipRect.Min.x, column->ClipRect.Max.x, column->ClipRect.Max.x - column->ClipRect.Min.x,
3595 column->ContentMaxXFrozen - column->WorkMinX, column->ContentMaxXUnfrozen - column->WorkMinX, column->ContentMaxXHeadersUsed - column->WorkMinX, column->ContentMaxXHeadersIdeal - column->WorkMinX,
3596 column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? " (Asc)" : (column->SortDirection == ImGuiSortDirection_Descending) ? " (Des)" : "", column->UserID, column->Flags,
3597 (column->Flags & ImGuiTableColumnFlags_WidthStretch) ? "WidthStretch " : "",
3598 (column->Flags & ImGuiTableColumnFlags_WidthFixed) ? "WidthFixed " : "",
3599 (column->Flags & ImGuiTableColumnFlags_NoResize) ? "NoResize " : "");
3600 Bullet();
3601 Selectable(buf);
3602 if (IsItemHovered())
3603 {
3604 ImRect r(column->MinX, table->OuterRect.Min.y, column->MaxX, table->OuterRect.Max.y);
3605 GetForegroundDrawList()->AddRect(r.Min, r.Max, IM_COL32(255, 255, 0, 255));
3606 }
3607 }
3608 if (ImGuiTableSettings* settings = TableGetBoundSettings(table))

Callers

nothing calls this directly

Calls 4

ImFormatStringFunction · 0.85
GetForegroundDrawListFunction · 0.85
AddRectMethod · 0.80

Tested by

no test coverage detected