@ -132,7 +132,7 @@ Also see [Wiki](https://github.com/ocornut/imgui/wiki) for more links and ideas.
### Upcoming Changes
### Upcoming Changes
Some of the goals for 2020 are:
Some of the goals for 2020 are:
- Work on new Tables API (to replace Columns). (see [#2957](https://github.com/ocornut/imgui/issues/2957), in public [tables](https://github.com/ocornut/imgui/tree/tables) branch looking for feedback)
- Work on Tables (see [#2957](https://github.com/ocornut/imgui/issues/2957), now merged in master.
- Work on Docking (see [#2109](https://github.com/ocornut/imgui/issues/2109), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch)
- Work on Docking (see [#2109](https://github.com/ocornut/imgui/issues/2109), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch)
- Work on Multi-Viewport / Multiple OS windows. (see [#1542](https://github.com/ocornut/imgui/issues/1542), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch looking for feedback)
- Work on Multi-Viewport / Multiple OS windows. (see [#1542](https://github.com/ocornut/imgui/issues/1542), in public [docking](https://github.com/ocornut/imgui/tree/docking) branch looking for feedback)
- Work on gamepad/keyboard controls. (see [#787](https://github.com/ocornut/imgui/issues/787))
- Work on gamepad/keyboard controls. (see [#787](https://github.com/ocornut/imgui/issues/787))
// Draw List API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData)
// Draw List API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawListFlags, ImDrawList, ImDrawData)
// Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
// Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
// Platform interface for multi-viewport support (ImGuiPlatformIO, ImGuiPlatformMonitor, ImGuiViewportFlags, ImGuiViewport)
// Platform interface for multi-viewport support (ImGuiPlatformIO, ImGuiPlatformMonitor, ImGuiViewportFlags, ImGuiViewport)
// FIXME-TABLE: Add ImGuiTableSortSpecs and ImGuiTableColumnSortSpecs in "Misc data structures" section above (we don't do it right now to facilitate merging various branches)
IMGUI_APIvoidEndTable();// only call EndTable() if BeginTable() returns true!
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_APIvoidTableNextRow(ImGuiTableRowFlagsrow_flags=0,floatmin_row_height=0.0f);// append into the first cell of a new row.
@ -1101,38 +1099,40 @@ enum ImGuiTableFlags_
ImGuiTableFlags_Reorderable=1<<1,// Allow reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
ImGuiTableFlags_Reorderable=1<<1,// Allow reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
ImGuiTableFlags_Hideable=1<<2,// Allow hiding/disabling columns in context menu.
ImGuiTableFlags_Hideable=1<<2,// Allow hiding/disabling columns in context menu.
ImGuiTableFlags_Sortable=1<<3,// Allow sorting on one column (sort_specs_count will always be == 1). Call TableGetSortSpecs() to obtain sort specs.
ImGuiTableFlags_Sortable=1<<3,// Allow sorting on one column (sort_specs_count will always be == 1). Call TableGetSortSpecs() to obtain sort specs.
ImGuiTableFlags_MultiSortable=1<<4,// Allow sorting on multiple columns by holding Shift (sort_specs_count may be > 1). Call TableGetSortSpecs() to obtain sort specs.
ImGuiTableFlags_NoSavedSettings=1<<4,// Disable persisting columns order, width and sort settings in the .ini file.
ImGuiTableFlags_NoSavedSettings=1<<5,// Disable persisting columns order, width and sort settings in the .ini file.
ImGuiTableFlags_ContextMenuInBody=1<<5,// Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
ImGuiTableFlags_ContextMenuInBody=1<<6,// Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
// Decorations
// Decorations
ImGuiTableFlags_RowBg=1<<7,// Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
ImGuiTableFlags_RowBg=1<<6,// Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
ImGuiTableFlags_BordersInnerH=1<<8,// Draw horizontal borders between rows.
ImGuiTableFlags_BordersInnerH=1<<7,// Draw horizontal borders between rows.
ImGuiTableFlags_BordersOuterH=1<<9,// Draw horizontal borders at the top and bottom.
ImGuiTableFlags_BordersOuterH=1<<8,// Draw horizontal borders at the top and bottom.
ImGuiTableFlags_BordersInnerV=1<<10,// Draw vertical borders between columns.
ImGuiTableFlags_BordersInnerV=1<<9,// Draw vertical borders between columns.
ImGuiTableFlags_BordersOuterV=1<<11,// Draw vertical borders on the left and right sides.
ImGuiTableFlags_BordersOuterV=1<<10,// Draw vertical borders on the left and right sides.
ImGuiTableFlags_Borders=ImGuiTableFlags_BordersInner|ImGuiTableFlags_BordersOuter,// Draw all borders.
ImGuiTableFlags_Borders=ImGuiTableFlags_BordersInner|ImGuiTableFlags_BordersOuter,// Draw all borders.
ImGuiTableFlags_NoBordersInBody=1<<12,// Disable vertical borders in columns Body (borders will always appears in Headers).
ImGuiTableFlags_NoBordersInBody=1<<11,// Disable vertical borders in columns Body (borders will always appears in Headers).
ImGuiTableFlags_NoBordersInBodyUntilResize=1<<13,// Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers).
ImGuiTableFlags_NoBordersInBodyUntilResize=1<<12,// Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers).
// Sizing
// Sizing
ImGuiTableFlags_ColumnsWidthStretch=1<<14,// Default if ScrollX is off. Columns will default to use _WidthStretch. Read description above for more details.
ImGuiTableFlags_ColumnsWidthStretch=1<<13,// Default if ScrollX is off. Columns will default to use _WidthStretch. Read description above for more details.
ImGuiTableFlags_ColumnsWidthFixed=1<<15,// Default if ScrollX is on. Columns will default to use _WidthFixed or _WidthAutoResize policy (if Resizable is off). Read description above for more details.
ImGuiTableFlags_ColumnsWidthFixed=1<<14,// Default if ScrollX is on. Columns will default to use _WidthFixed or _WidthAutoResize policy (if Resizable is off). Read description above for more details.
ImGuiTableFlags_SameWidths=1<<16,// Make all columns the same widths which is useful with Fixed columns policy (but granted by default with Stretch policy + no resize). Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible and disable ImGuiTableFlags_Resizable.
ImGuiTableFlags_SameWidths=1<<15,// Make all columns the same widths which is useful with Fixed columns policy (but granted by default with Stretch policy + no resize). Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible and disable ImGuiTableFlags_Resizable.
ImGuiTableFlags_NoHeadersWidth=1<<17,// Disable headers' contribution to automatic width calculation.
ImGuiTableFlags_NoHeadersWidth=1<<16,// Disable headers' contribution to automatic width calculation.
ImGuiTableFlags_NoHostExtendY=1<<18,// Disable extending past the limit set by outer_size.y, only meaningful when neither of ScrollX|ScrollY are set (data below the limit will be clipped and not visible)
ImGuiTableFlags_NoHostExtendY=1<<17,// Disable extending past the limit set by outer_size.y, only meaningful when neither of ScrollX|ScrollY are set (data below the limit will be clipped and not visible)
ImGuiTableFlags_NoKeepColumnsVisible=1<<19,// Disable keeping column always minimally visible when ScrollX is off and table gets too small.
ImGuiTableFlags_NoKeepColumnsVisible=1<<18,// Disable keeping column always minimally visible when ScrollX is off and table gets too small.
ImGuiTableFlags_PreciseWidths=1<<20,// Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
ImGuiTableFlags_PreciseWidths=1<<19,// Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
ImGuiTableFlags_NoClip=1<<21,// Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
ImGuiTableFlags_NoClip=1<<20,// Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
// Padding
// Padding
ImGuiTableFlags_PadOuterX=1<<22,// Default if BordersOuterV is on. Enable outer-most padding.
ImGuiTableFlags_PadOuterX=1<<21,// Default if BordersOuterV is on. Enable outer-most padding.
ImGuiTableFlags_NoPadOuterX=1<<23,// Default if BordersOuterV is off. Disable outer-most padding.
ImGuiTableFlags_NoPadOuterX=1<<22,// Default if BordersOuterV is off. Disable outer-most padding.
ImGuiTableFlags_NoPadInnerX=1<<24,// Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
ImGuiTableFlags_NoPadInnerX=1<<23,// Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
// Scrolling
// Scrolling
ImGuiTableFlags_ScrollX=1<<25,// Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollX=1<<24,// Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollY=1<<26// Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
ImGuiTableFlags_ScrollY=1<<25,// Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
// Sorting
ImGuiTableFlags_SortMulti=1<<26,// Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
ImGuiTableFlags_SortTristate=1<<27// Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
};
};
// Flags for ImGui::TableSetupColumn()
// Flags for ImGui::TableSetupColumn()
@ -1152,7 +1152,7 @@ enum ImGuiTableColumnFlags_
ImGuiTableColumnFlags_NoSort=1<<9,// Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
ImGuiTableColumnFlags_NoSort=1<<9,// Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
ImGuiTableColumnFlags_NoSortAscending=1<<10,// Disable ability to sort in the ascending direction.
ImGuiTableColumnFlags_NoSortAscending=1<<10,// Disable ability to sort in the ascending direction.
ImGuiTableColumnFlags_NoSortDescending=1<<11,// Disable ability to sort in the descending direction.
ImGuiTableColumnFlags_NoSortDescending=1<<11,// Disable ability to sort in the descending direction.
ImGuiTableColumnFlags_NoHeaderWidth=1<<12,// Header width don't contribute to automatic column width.
ImGuiTableColumnFlags_NoHeaderWidth=1<<12,// Disable header text width contribution to automatic column width.
ImGuiTableColumnFlags_PreferSortAscending=1<<13,// Make the initial sort direction Ascending when first sorting on this column (default).
ImGuiTableColumnFlags_PreferSortAscending=1<<13,// Make the initial sort direction Ascending when first sorting on this column (default).
ImGuiTableColumnFlags_PreferSortDescending=1<<14,// Make the initial sort direction Descending when first sorting on this column.
ImGuiTableColumnFlags_PreferSortDescending=1<<14,// Make the initial sort direction Descending when first sorting on this column.
ImGuiTableColumnFlags_IndentEnable=1<<15,// Use current Indent value when entering cell (default for column 0).
ImGuiTableColumnFlags_IndentEnable=1<<15,// Use current Indent value when entering cell (default for column 0).
@ -1190,11 +1190,9 @@ enum ImGuiTableRowFlags_
enumImGuiTableBgTarget_
enumImGuiTableBgTarget_
{
{
ImGuiTableBgTarget_None=0,
ImGuiTableBgTarget_None=0,
//ImGuiTableBgTarget_ColumnBg0 = 1, // FIXME-TABLE: Todo. Set column background color 0 (generally used for background
ImGuiTableBgTarget_RowBg0=1,// Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
//ImGuiTableBgTarget_ColumnBg1 = 2, // FIXME-TABLE: Todo. Set column background color 1 (generally used for selection marking)
ImGuiTableBgTarget_RowBg1=2,// Set row background color 1 (generally used for selection marking)
ImGuiTableBgTarget_RowBg0=3,// Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
ImGuiTableBgTarget_CellBg=3// Set cell background color (top-most color)
ImGuiTableBgTarget_RowBg1=4,// Set row background color 1 (generally used for selection marking)
ImGuiTableBgTarget_CellBg=5// Set cell background color (top-most color)
constImGuiTableColumnSortSpecs*Specs;// Pointer to sort spec array.
constImGuiTableColumnSortSpecs*Specs;// Pointer to sort spec array.
intSpecsCount;// Sort spec count. Most often 1 unless e.g. ImGuiTableFlags_MultiSortable is enabled.
intSpecsCount;// Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled.
boolSpecsDirty;// Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
boolSpecsDirty;// Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
HelpMarker("This section allows you to interact and see the effect of StretchX vs FixedX sizing policies depending on whether Scroll is enabled and the contents of your columns.");
HelpMarker("This section allows you to interact and see the effect of StretchX vs FixedX sizing policies depending on whether Scroll is enabled and the contents of your columns.");
ImGui::SameLine();HelpMarker("When sorting is enabled: hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).");
ImGui::SameLine();HelpMarker("When sorting is enabled: allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).");
ImGui::SameLine();HelpMarker("When sorting is enabled: hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).");
ImGui::SameLine();HelpMarker("When sorting is enabled: allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).");
intHiddenFramesCanSkipItems;// Hide the window for N frames
ImS8HiddenFramesCanSkipItems;// Hide the window for N frames
intHiddenFramesCannotSkipItems;// Hide the window for N frames while allowing items to be submitted so we can measure their size
ImS8HiddenFramesCannotSkipItems;// Hide the window for N frames while allowing items to be submitted so we can measure their size
ImGuiCondSetWindowPosAllowFlags;// store acceptable condition flags for SetNextWindowPos() use.
ImS8HiddenFramesForRenderOnly;// Hide the window until frame N at Render() time only
ImGuiCondSetWindowSizeAllowFlags;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowPosAllowFlags:8;// store acceptable condition flags for SetNextWindowPos() use.
ImGuiCondSetWindowCollapsedAllowFlags;// store acceptable condition flags for SetNextWindowCollapsed() use.
ImGuiCondSetWindowSizeAllowFlags:8;// store acceptable condition flags for SetNextWindowSize() use.
ImGuiCondSetWindowDockAllowFlags;// store acceptable condition flags for SetNextWindowDock() use.
ImGuiCondSetWindowCollapsedAllowFlags:8;// store acceptable condition flags for SetNextWindowCollapsed() use.
ImGuiCondSetWindowDockAllowFlags:8;// store acceptable condition flags for SetNextWindowDock() use.
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2SetWindowPosPivot;// store window pivot for positioning. ImVec2(0, 0) when positioning from top-left corner; ImVec2(0.5f, 0.5f) for centering; ImVec2(1, 1) for bottom right.
ImVec2SetWindowPosPivot;// store window pivot for positioning. ImVec2(0, 0) when positioning from top-left corner; ImVec2(0.5f, 0.5f) for centering; ImVec2(1, 1) for bottom right.
@ -2115,8 +2116,7 @@ struct ImGuiTableColumn
{
{
ImRectClipRect;// Clipping rectangle for the column
ImRectClipRect;// Clipping rectangle for the column
ImGuiIDUserID;// Optional, value passed to TableSetupColumn()
ImGuiIDUserID;// Optional, value passed to TableSetupColumn()
ImGuiTableColumnFlagsFlagsIn;// Flags as they were provided by user. See ImGuiTableColumnFlags_
ImGuiTableColumnFlagsFlags;// Flags after some patching (not directly same as provided by user). See ImGuiTableColumnFlags_
ImGuiTableColumnFlagsFlags;// Effective flags. See ImGuiTableColumnFlags_
floatMinX;// Absolute positions
floatMinX;// Absolute positions
floatMaxX;
floatMaxX;
floatInitStretchWeightOrWidth;// Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
floatInitStretchWeightOrWidth;// Value passed to TableSetupColumn(). For Width it is a content width (_without padding_).
@ -2148,9 +2148,12 @@ struct ImGuiTableColumn
boolIsSkipItems;// Do we want item submissions to this column to be completely ignored (no layout will happen).
boolIsSkipItems;// Do we want item submissions to this column to be completely ignored (no layout will happen).
boolIsPreserveWidthAuto;
boolIsPreserveWidthAuto;
ImS8NavLayerCurrent;// ImGuiNavLayer in 1 byte
ImS8NavLayerCurrent;// ImGuiNavLayer in 1 byte
ImS8SortDirection;// ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImU8AutoFitQueue;// Queue of 8 values for the next 8 frames to request auto-fit
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
ImU8CannotSkipItemsQueue;// Queue of 8 values for the next 8 frames to disable Clipped/SkipItem
ImU8SortDirection:2;// ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
ImU8SortDirectionsAvailCount:2;// Number of available sort directions (0 to 3)
ImU8SortDirectionsAvailMask:4;// Mask of available sort directions (1-bit each)
ImU8SortDirectionsAvailList;// Ordered of available sort directions (2-bits each)
ImGuiTableColumn()
ImGuiTableColumn()
{
{
@ -2173,7 +2176,7 @@ struct ImGuiTableCellData
ImGuiTableColumnIdxColumn;// Column number
ImGuiTableColumnIdxColumn;// Column number
};
};
// FIXME-TABLES: transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
// FIXME-TABLE: transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
structImGuiTable
structImGuiTable
{
{
ImGuiIDID;
ImGuiIDID;
@ -2280,8 +2283,8 @@ struct ImGuiTable
boolMemoryCompacted;
boolMemoryCompacted;
boolHostSkipItems;// Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
boolHostSkipItems;// Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
IMGUI_APIintTableGetHoveredColumn();// May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
IMGUI_APIintTableGetHoveredColumn();// May use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead. Return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.