elseif(rect_type==TRT_ColumnsContentHeadersUsed){ImGuiTableColumn*c=&table->Columns[n];returnImRect(c->ContentMinX,table->InnerClipRect.Min.y,c->ContentMaxXHeadersUsed,table->InnerClipRect.Min.y+table->LastFirstRowHeight);}// Note: y1/y2 not always accurate
elseif(rect_type==TRT_ColumnsContentHeadersUsed){ImGuiTableColumn*c=&table->Columns[n];returnImRect(c->WorkMinX,table->InnerClipRect.Min.y,c->ContentMaxXHeadersUsed,table->InnerClipRect.Min.y+table->LastFirstRowHeight);}// Note: y1/y2 not always accurate
IMGUI_APIvoidEndTable();// only call EndTable() if BeginTable() returns true!
IMGUI_APIvoidTableNextRow(ImGuiTableRowFlagsrow_flags=0,floatmin_row_height=0.0f);// append into the first cell of a new row.
IMGUI_APIboolTableNextColumn();// append into the next column (or first column of next row if currently in last column). Return true if column is visible.
IMGUI_APIboolTableSetColumnIndex(intcolumn_n);// append into the specified column. Return true if column is visible.
IMGUI_APIboolTableNextColumn();// append into the next column (or first column of next row if currently in last column). Return false when column is not visible.
IMGUI_APIboolTableSetColumnIndex(intcolumn_n);// append into the specified column. Return false when column is not visible.
IMGUI_APIintTableGetColumnIndex();// return current column index.
// Tables: Headers & Columns declaration
// - Use TableSetupColumn() to specify label, resizing policy, default width/weight, id, various other flags etc.
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody",(unsignedint*)&flags,ImGuiTableFlags_NoBordersInBody);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body (borders will always appears in Headers");
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize",(unsignedint*)&flags,ImGuiTableFlags_NoBordersInBodyUntilResize);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers)");
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody",&flags,ImGuiTableFlags_NoBordersInBody);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body (borders will always appears in Headers");
//ImGui::CheckboxFlags("ImGuiTableFlags_ScrollX", (unsigned int*)&flags, ImGuiTableFlags_ScrollX); // FIXME-TABLE: Explain or fix the effect of enable Scroll on outer_size
//ImGui::CheckboxFlags("ImGuiTableFlags_ScrollX", &flags, ImGuiTableFlags_ScrollX); // FIXME-TABLE: Explain or fix the effect of enable Scroll on outer_size
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize",&flags,ImGuiTableFlags_NoBordersInBodyUntilResize);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers)");
ImGui::SameLine();HelpMarker("Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off)");
ImGui::CheckboxFlags("_IndentEnable",(unsignedint*)&column_flags[column],ImGuiTableColumnFlags_IndentEnable);ImGui::SameLine();HelpMarker("Default for column 0");
ImGui::CheckboxFlags("_IndentDisable",(unsignedint*)&column_flags[column],ImGuiTableColumnFlags_IndentDisable);ImGui::SameLine();HelpMarker("Default for column >0");
ImGui::CheckboxFlags("_IndentEnable",&column_flags[column],ImGuiTableColumnFlags_IndentEnable);ImGui::SameLine();HelpMarker("Default for column 0");
ImGui::CheckboxFlags("_IndentDisable",&column_flags[column],ImGuiTableColumnFlags_IndentDisable);ImGui::SameLine();HelpMarker("Default for column >0");
flags&=~(ImGuiTableFlags_SizingPolicyMaskX_^ImGuiTableFlags_SizingPolicyFixedX);// Can't specify both sizing polices so we clear the other
ImGui::SameLine();HelpMarker("Default if _ScrollX if enabled. Makes columns use _WidthFixed by default, or _WidthAlwaysAutoResize if _Resizable is not set.");
ImGui::Combo("row bg target",(int*)&row_bg_target,"RowBg0\0RowBg1\0");ImGui::SameLine();HelpMarker("Target RowBg0 to override the alternating odd/even colors,\nTarget RowBg1 to blend with them.");
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody",(unsignedint*)&flags,ImGuiTableFlags_NoBordersInBody);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body (borders will always appears in Headers");
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize",(unsignedint*)&flags,ImGuiTableFlags_NoBordersInBodyUntilResize);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers)");
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody",&flags,ImGuiTableFlags_NoBordersInBody);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body (borders will always appears in Headers");
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize",&flags,ImGuiTableFlags_NoBordersInBodyUntilResize);ImGui::SameLine();HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers)");
flags&=~(ImGuiTableFlags_SizingPolicyMaskX_^ImGuiTableFlags_SizingPolicyStretchX);// Can't specify both sizing polices so we clear the other
ImGui::SameLine();HelpMarker("[Default if ScrollX is off]\nFit all columns within available width (or specified inner_width). Fixed and Stretch columns allowed.");
flags&=~(ImGuiTableFlags_SizingPolicyMaskX_^ImGuiTableFlags_SizingPolicyFixedX);// Can't specify both sizing polices so we clear the other
ImGui::SameLine();HelpMarker("[Default if ScrollX is on]\nEnlarge as needed: enable scrollbar if ScrollX is enabled, otherwise extend parent window's contents rectangle. Only Fixed columns allowed. Stretched columns will calculate their width assuming no scrolling.");
ImGui::SameLine();HelpMarker("Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with ScrollFreeze options.");
// We use the terminology "Visible" to refer to a column that is not Hidden by user or settings. However it may still be out of view and clipped (see IsClipped).
structImGuiTableColumn
{
@ -1907,23 +1907,23 @@ struct ImGuiTableColumn
floatWidthAuto;// Automatic width
floatWidthRequest;// Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
floatWidthGiven;// Final/actual width visible == (MaxX - MinX), locked in TableUpdateLayout(). May be > WidthRequest to honor minimum width, may be < WidthRequest to honor shrinking columns down in tight space.
floatContentMinX;// Start position for the frame, currently ~(MinX + CellPaddingX)
floatWorkMinX;// Start position for the frame, currently ~(MinX + CellPaddingX)
floatContentMaxXFrozen;// Contents maximum position for frozen rows (apart from headers), from which we can infer content width.
floatContentMaxXUnfrozen;
floatContentMaxXHeadersUsed;// Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls
floatContentMaxXHeadersIdeal;
ImS16NameOffset;// Offset into parent ColumnsNames[]
boolIsVisible;// Is the column not marked Hidden by the user? (could be clipped by scrolling, etc).
boolIsVisible;// Is the column not marked Hidden by the user? (even if off view, e.g. clipped by scrolling).
boolIsVisibleNextFrame;
boolIsClipped;// Set when not overlapping the host window clipping rectangle.
boolIsSkipItems;
boolIsClipped;// Is not actually in view (e.g. not overlapping the host window clipping rectangle).
boolIsSkipItems;// Do we want item submissions to this column to be ignored early on.
ImS8NavLayerCurrent;// ImGuiNavLayer in 1 byte
ImS8DisplayOrder;// Index within Table's IndexToDisplayOrder[] (column may be reordered by users)
ImS8IndexWithinVisibleSet;// Index within visible set (<= IndexToDisplayOrder)
ImS8PrevVisibleColumn;// Index of prev visible column within Columns[], -1 if first visible column
ImS8NextVisibleColumn;// Index of next visible column within Columns[], -1 if last visible column
ImS8SortOrder;// -1: Not sorting on this column
ImS8SortDirection;// enum ImGuiSortDirection_
ImS8SortOrder;// Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
ImS8SortDirection;// ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImU8AutoFitQueue;// Queue of 8 values for the next 8 frames to request auto-fit
ImU8CannotSkipItemsQueue;// Queue of 8 values for the next 8 frames to disable Clipped/SkipItem
ImU8DrawChannelCurrent;// Index within DrawSplitter.Channels[]
@ -1957,7 +1957,7 @@ struct ImGuiTable
{
ImGuiIDID;
ImGuiTableFlagsFlags;
ImVector<char>RawData;
void*RawData;// Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
ImSpan<ImGuiTableColumn>Columns;// Point within RawData[]
ImSpan<ImS8>DisplayOrderToIndex;// Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
ImSpan<ImGuiTableCellData>RowCellData;// Point within RawData[]. Store cells background requests for current row.
@ -1969,8 +1969,8 @@ struct ImGuiTable
intLastFrameActive;
intColumnsCount;// Number of columns declared in BeginTable()
intColumnsVisibleCount;// Number of non-hidden columns (<= ColumnsCount)
intCurrentColumn;
intCurrentRow;
intCurrentColumn;
ImS16InstanceCurrent;// Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple table with same ID look are multiple tables, they are just synched.
ImS16InstanceInteracted;// Mark which instance (generally 0) of the same ID is being interacted with
floatRowPosY1;
@ -1980,7 +1980,7 @@ struct ImGuiTable
floatRowIndentOffsetX;
ImGuiTableRowFlagsRowFlags:16;// Current row flags, see ImGuiTableRowFlags_
ImGuiTableRowFlagsLastRowFlags:16;
intRowBgColorCounter;// Counter for alternating background colors (can be fast-forwarded by e.g clipper)
intRowBgColorCounter;// Counter for alternating background colors (can be fast-forwarded by e.g clipper), not same as CurrentRow because header rows typically don't increase this.
ImU32RowBgColor[2];// Background color override for current row.
ImU32BorderColorStrong;
ImU32BorderColorLight;
@ -2008,7 +2008,7 @@ struct ImGuiTable
ImRectHostBackupWorkRect;// Backup of InnerWindow->WorkRect at the end of BeginTable()
ImRectHostBackupParentWorkRect;// Backup of InnerWindow->ParentWorkRect at the end of BeginTable()
ImRectHostBackupClipRect;// Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground()
ImVec2HostCursorMaxPos;// Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable()
ImVec2HostBackupCursorMaxPos;// Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable()
ImVec1HostBackupColumnsOffset;// Backup of OuterWindow->ColumnsOffset at the end of BeginTable()
ImGuiWindow*OuterWindow;// Parent window for the table
ImGuiWindow*InnerWindow;// Window holding the table data (== OuterWindow or a child window)
@ -2049,18 +2049,8 @@ struct ImGuiTable
boolMemoryCompacted;
boolHostSkipItems;// Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis