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<<5,// Disable persisting columns order, width and sort settings in the .ini file.
ImGuiTableFlags_ContextMenuInBody=1<<6,// Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
// Decoration
ImGuiTableFlags_RowBg=1<<6,// Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent to calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
ImGuiTableFlags_BordersInnerH=1<<7,// Draw horizontal borders between rows.
ImGuiTableFlags_BordersOuterH=1<<8,// Draw horizontal borders at the top and bottom.
ImGuiTableFlags_BordersInnerV=1<<9,// Draw vertical borders between columns.
ImGuiTableFlags_BordersOuterV=1<<10,// Draw vertical borders on the left and right sides.
ImGuiTableFlags_RowBg=1<<7,// Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent to calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
ImGuiTableFlags_BordersInnerH=1<<8,// Draw horizontal borders between rows.
ImGuiTableFlags_BordersOuterH=1<<9,// Draw horizontal borders at the top and bottom.
ImGuiTableFlags_BordersInnerV=1<<10,// Draw vertical borders between columns.
ImGuiTableFlags_BordersOuterV=1<<11,// Draw vertical borders on the left and right sides.
ImGuiTableFlags_Borders=ImGuiTableFlags_BordersInner|ImGuiTableFlags_BordersOuter,// Draw all borders.
ImGuiTableFlags_BordersFullHeightV=1<<11,// Borders covers all rows even when Headers are being used. Allow resizing from any rows.
ImGuiTableFlags_BordersFullHeightV=1<<12,// Borders covers all rows even when Headers are being used. Allow resizing from any rows.
// Padding, Sizing
ImGuiTableFlags_SizingPolicyFixedX=1<<12,// Default if ScrollX is on. Columns will default to use _WidthFixed or _WidthAlwaysAutoResize policy. Read description above for more details.
ImGuiTableFlags_SizingPolicyStretchX=1<<13,// Default if ScrollX is off. Columns will default to use _WidthStretch policy. Read description above for more details.
ImGuiTableFlags_NoHeadersWidth=1<<14,// Disable header width contribution to automatic width calculation.
ImGuiTableFlags_NoHostExtendY=1<<15,// (FIXME-TABLE: Reword as SizingPolicy?) 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<<16,// (FIXME-TABLE) Disable code that keeps column always minimally visible when table width gets too small and horizontal scrolling is off.
ImGuiTableFlags_NoClip=1<<17,// 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.
ImGuiTableFlags_SizingPolicyFixedX=1<<13,// Default if ScrollX is on. Columns will default to use _WidthFixed or _WidthAlwaysAutoResize policy. Read description above for more details.
ImGuiTableFlags_SizingPolicyStretchX=1<<14,// Default if ScrollX is off. Columns will default to use _WidthStretch policy. Read description above for more details.
ImGuiTableFlags_NoHeadersWidth=1<<15,// Disable header width contribution to automatic width calculation.
ImGuiTableFlags_NoHostExtendY=1<<16,// (FIXME-TABLE: Reword as SizingPolicy?) 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<<17,// (FIXME-TABLE) Disable code that keeps column always minimally visible when table width gets too small and horizontal scrolling is off.
ImGuiTableFlags_NoClip=1<<18,// 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.
// Scrolling
ImGuiTableFlags_ScrollX=1<<20,// Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollY=1<<21,// Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
ImGuiTableFlags_ScrollX=1<<19,// Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollY=1<<20,// Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
HelpMarker("By default, right-clicking over a TableHeadersRow()/TableHeader() line will open the default context-menu.\nUsing ImGuiTableFlags_ContextMenuInBody we also allow right-clicking over columns body.");
// [2.1] Right-click on the TableHeadersRow() line to open the default table context menu.
ImGui::TableHeadersRow();
for(introw=0;row<4;row++)
{
ImGui::TableNextRow();
for(intcolumn=0;column<COLUMNS_COUNT;column++)
{
// Submit dummy contents
ImGui::TableSetColumnIndex(column);
ImGui::Text("Cell %d,%d",column,row);
ImGui::SameLine();
// Context Menu 2: right-click on buttons open Custom Button Popup
// [2.2] Right-click on the ".." to open a custom popup
ImGui::PushID(row*COLUMNS_COUNT+column);
ImGui::SmallButton("..");
if(ImGui::BeginPopupContextItem())
{
ImGui::Text("This is the popup for Button() On Cell %d,%d",column,row);
ImGui::Selectable("Close");
ImGui::Text("This is the popup for Button(\"..\") in Cell %d,%d",column,row);
if(ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
ImGui::PopID();
}
}
// Context Menu 3: Right-click anywhere in columns opens a custom popup
// We use the ImGuiPopupFlags_NoOpenOverExistingPopup flag to avoid displaying over either the standard TableHeader context-menu or the Button context-menu.
// [2.3] Right-click anywhere in columns to open another custom popup
// (instead of testing for !IsAnyItemHovered() we could also call OpenPopup() with ImGuiPopupFlags_NoOpenOverExistingPopup
// to manage popup priority as the popups triggers, here "are we hovering a column" are overlapping)