MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / DebugNodeTable

Method DebugNodeTable

TheForceEngine/TFE_Ui/imGUI/imgui_tables.cpp:3902–3974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3900}
3901
3902void ImGui::DebugNodeTable(ImGuiTable* table)
3903{
3904 ImGuiContext& g = *GImGui;
3905 const bool is_active = (table->LastFrameActive >= g.FrameCount - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
3906 if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
3907 bool open = TreeNode(table, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
3908 if (!is_active) { PopStyleColor(); }
3909 if (IsItemHovered())
3910 GetForegroundDrawList()->AddRect(table->OuterRect.Min, table->OuterRect.Max, IM_COL32(255, 255, 0, 255));
3911 if (IsItemVisible() && table->HoveredColumnBody != -1)
3912 GetForegroundDrawList()->AddRect(GetItemRectMin(), GetItemRectMax(), IM_COL32(255, 255, 0, 255));
3913 if (!open)
3914 return;
3915 if (table->InstanceCurrent > 0)
3916 Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
3917 if (g.IO.ConfigDebugIsDebuggerPresent)
3918 {
3919 if (DebugBreakButton("**DebugBreak**", "in BeginTable()"))
3920 g.DebugBreakInTable = table->ID;
3921 SameLine();
3922 }
3923
3924 bool clear_settings = SmallButton("Clear settings");
3925 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));
3926 BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
3927 BulletText("CellPaddingX: %.1f, CellSpacingX: %.1f/%.1f, OuterPaddingX: %.1f", table->CellPaddingX, table->CellSpacingX1, table->CellSpacingX2, table->OuterPaddingX);
3928 BulletText("HoveredColumnBody: %d, HoveredColumnBorder: %d", table->HoveredColumnBody, table->HoveredColumnBorder);
3929 BulletText("ResizedColumn: %d, ReorderColumn: %d, HeldHeaderColumn: %d", table->ResizedColumn, table->ReorderColumn, table->HeldHeaderColumn);
3930 for (int n = 0; n < table->InstanceCurrent + 1; n++)
3931 {
3932 ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, n);
3933 BulletText("Instance %d: HoveredRow: %d, LastOuterHeight: %.2f", n, table_instance->HoveredRowLast, table_instance->LastOuterHeight);
3934 }
3935 //BulletText("BgDrawChannels: %d/%d", 0, table->BgDrawChannelUnfrozen);
3936 float sum_weights = 0.0f;
3937 for (int n = 0; n < table->ColumnsCount; n++)
3938 if (table->Columns[n].Flags & ImGuiTableColumnFlags_WidthStretch)
3939 sum_weights += table->Columns[n].StretchWeight;
3940 for (int n = 0; n < table->ColumnsCount; n++)
3941 {
3942 ImGuiTableColumn* column = &table->Columns[n];
3943 const char* name = TableGetColumnName(table, n);
3944 char buf[512];
3945 ImFormatString(buf, IM_ARRAYSIZE(buf),
3946 "Column %d order %d '%s': offset %+.2f to %+.2f%s\n"
3947 "Enabled: %d, VisibleX/Y: %d/%d, RequestOutput: %d, SkipItems: %d, DrawChannels: %d,%d\n"
3948 "WidthGiven: %.1f, Request/Auto: %.1f/%.1f, StretchWeight: %.3f (%.1f%%)\n"
3949 "MinX: %.1f, MaxX: %.1f (%+.1f), ClipRect: %.1f to %.1f (+%.1f)\n"
3950 "ContentWidth: %.1f,%.1f, HeadersUsed/Ideal %.1f/%.1f\n"
3951 "Sort: %d%s, UserID: 0x%08X, Flags: 0x%04X: %s%s%s..",
3952 n, column->DisplayOrder, name, column->MinX - table->WorkRect.Min.x, column->MaxX - table->WorkRect.Min.x, (n < table->FreezeColumnsRequest) ? " (Frozen)" : "",
3953 column->IsEnabled, column->IsVisibleX, column->IsVisibleY, column->IsRequestOutput, column->IsSkipItems, column->DrawChannelFrozen, column->DrawChannelUnfrozen,
3954 column->WidthGiven, column->WidthRequest, column->WidthAuto, column->StretchWeight, column->StretchWeight > 0.0f ? (column->StretchWeight / sum_weights) * 100.0f : 0.0f,
3955 column->MinX, column->MaxX, column->MaxX - column->MinX, column->ClipRect.Min.x, column->ClipRect.Max.x, column->ClipRect.Max.x - column->ClipRect.Min.x,
3956 column->ContentMaxXFrozen - column->WorkMinX, column->ContentMaxXUnfrozen - column->WorkMinX, column->ContentMaxXHeadersUsed - column->WorkMinX, column->ContentMaxXHeadersIdeal - column->WorkMinX,
3957 column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? " (Asc)" : (column->SortDirection == ImGuiSortDirection_Descending) ? " (Des)" : "", column->UserID, column->Flags,
3958 (column->Flags & ImGuiTableColumnFlags_WidthStretch) ? "WidthStretch " : "",
3959 (column->Flags & ImGuiTableColumnFlags_WidthFixed) ? "WidthFixed " : "",

Callers

nothing calls this directly

Calls 5

GetForegroundDrawListFunction · 0.85
TableGetInstanceDataFunction · 0.85
ImFormatStringFunction · 0.85
AddRectMethod · 0.80

Tested by

no test coverage detected