FramePadding=ImVec2(4,3);// Padding within a framed rectangle (used by most widgets)
FramePadding=ImVec2(4,3);// Padding within a framed rectangle (used by most widgets)
FrameRounding=0.0f;// Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
FrameRounding=0.0f;// Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
FrameBorderSize=0.0f;// Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
FrameBorderSize=0.0f;// Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
TabBorderSize=0.0f;// Thickness of border around tabs.
ItemSpacing=ImVec2(8,4);// Horizontal and vertical spacing between widgets/lines
ItemSpacing=ImVec2(8,4);// Horizontal and vertical spacing between widgets/lines
ItemInnerSpacing=ImVec2(4,4);// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
ItemInnerSpacing=ImVec2(4,4);// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
TouchExtraPadding=ImVec2(0,0);// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
TouchExtraPadding=ImVec2(0,0);// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
IMGUI_APIvoidSetColumnOffset(intcolumn_index,floatoffset_x);// set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
IMGUI_APIvoidSetColumnOffset(intcolumn_index,floatoffset_x);// set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
IMGUI_APIintGetColumnsCount();
IMGUI_APIintGetColumnsCount();
// Tabs
// [BETA API] API may evolve.
IMGUI_APIboolBeginTabBar(constchar*str_id,ImGuiTabBarFlagsflags=0);// create and append into a TabBar
IMGUI_APIvoidEndTabBar();
IMGUI_APIboolBeginTabItem(constchar*label,bool*p_open=NULL,ImGuiTabItemFlags=0);// create a Tab. Returns true if the Tab is selected.
IMGUI_APIvoidEndTabItem();// only call EndTabItem() if BeginTabItem() returns true!
IMGUI_APIvoidSetTabItemClosed(constchar*tab_or_docked_window_label);// notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.
// Logging/Capture: all text output from interface is captured to tty/file/clipboard. By default, tree nodes are automatically opened during logging.
// Logging/Capture: all text output from interface is captured to tty/file/clipboard. By default, tree nodes are automatically opened during logging.
IMGUI_APIvoidLogToTTY(intmax_depth=-1);// start logging to tty
IMGUI_APIvoidLogToTTY(intmax_depth=-1);// start logging to tty
IMGUI_APIvoidLogToFile(intmax_depth=-1,constchar*filename=NULL);// start logging to file
IMGUI_APIvoidLogToFile(intmax_depth=-1,constchar*filename=NULL);// start logging to file
@ -623,7 +634,7 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_NoNavInputs=1<<18,// No gamepad/keyboard navigation within the window
ImGuiWindowFlags_NoNavInputs=1<<18,// No gamepad/keyboard navigation within the window
ImGuiWindowFlags_NoNavFocus=1<<19,// No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
ImGuiWindowFlags_NoNavFocus=1<<19,// No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
ImGuiWindowFlags_UnsavedDocument=1<<20,// Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker.
ImGuiWindowFlags_UnsavedDocument=1<<20,// Append '*' to title without altering the ID, as a convenience to avoid using the ### operator. When used in a tab/docking context, tab is selected on closure and closure is deferred by one frame to allow code to cancel the closure (with a confirmation popup, etc.) without flicker.
// [Internal]
// [Internal]
ImGuiWindowFlags_NavFlattened=1<<23,// [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
ImGuiWindowFlags_NavFlattened=1<<23,// [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
ImGuiTabBarFlags_Reorderable=1<<0,// Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
ImGuiTabBarFlags_AutoSelectNewTabs=1<<1,// Automatically select new tabs when they appear
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton=1<<2,// Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
ImGuiTabBarFlags_NoTabListPopupButton=1<<3,
ImGuiTabBarFlags_NoTabListScrollingButtons=1<<4,
ImGuiTabBarFlags_FittingPolicyResizeDown=1<<5,// Resize tabs when they don't fit
ImGuiTabBarFlags_FittingPolicyScroll=1<<6,// Add scroll buttons when tabs don't fit
ImGuiTabItemFlags_UnsavedDocument=1<<0,// Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator. Also: tab is selected on closure and closure is deferred by one frame to allow code to undo it without flicker.
ImGuiTabItemFlags_SetSelected=1<<1,// Trigger flag to programatically make the tab selected when calling BeginTabItem()
ImGuiTabItemFlags_NoCloseWithMiddleMouseButton=1<<2,// Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
ImGuiTabItemFlags_NoPushId=1<<3// Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem()
};
// Flags for ImGui::IsWindowFocused()
// Flags for ImGui::IsWindowFocused()
enumImGuiFocusedFlags_
enumImGuiFocusedFlags_
{
{
@ -909,6 +945,11 @@ enum ImGuiCol_
ImGuiCol_ResizeGrip,
ImGuiCol_ResizeGrip,
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripActive,
ImGuiCol_ResizeGripActive,
ImGuiCol_Tab,
ImGuiCol_TabHovered,
ImGuiCol_TabActive,
ImGuiCol_TabUnfocused,
ImGuiCol_TabUnfocusedActive,
ImGuiCol_PlotLines,
ImGuiCol_PlotLines,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotHistogram,
ImGuiCol_PlotHistogram,
@ -1052,6 +1093,7 @@ struct ImGuiStyle
ImVec2FramePadding;// Padding within a framed rectangle (used by most widgets).
ImVec2FramePadding;// Padding within a framed rectangle (used by most widgets).
floatFrameRounding;// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
floatFrameRounding;// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
floatFrameBorderSize;// Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
floatFrameBorderSize;// Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
floatTabBorderSize;// Thickness of border around tabs.
ImVec2ItemSpacing;// Horizontal and vertical spacing between widgets/lines.
ImVec2ItemSpacing;// Horizontal and vertical spacing between widgets/lines.
ImVec2ItemInnerSpacing;// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
ImVec2ItemInnerSpacing;// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
ImVec2TouchExtraPadding;// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
ImVec2TouchExtraPadding;// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.)");
ImGui::TextWrapped("(Using ImGui::BeginGroup()/EndGroup() to layout items. BeginGroup() basically locks the horizontal position. EndGroup() bundles the whole group so that you can use functions such as IsItemHovered() on it.)");
//if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on.
//if (ImGui::GetIO().KeyCtrl) ImGui::SetTabItemSelected(docs[1].Name); // [DEBUG] Test SetTabItemSelected(), probably not very useful as-is anyway..
structImGuiPopupRef;// Storage for current popup stack
structImGuiPopupRef;// Storage for current popup stack
structImGuiSettingsHandler;// Storage for one type registered in the .ini file
structImGuiSettingsHandler;// Storage for one type registered in the .ini file
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
structImGuiTabBar;// Storage for a tab bar
structImGuiTabItem;// Storage for a tab item (within a tab bar)
structImGuiWindow;// Storage for one window
structImGuiWindow;// Storage for one window
structImGuiWindowTempData;// Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame)
structImGuiWindowTempData;// Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame)
structImGuiWindowSettings;// Storage for window settings stored in .ini file (we keep one of those even if the actual window wasn't instanced during this session)
structImGuiWindowSettings;// Storage for window settings stored in .ini file (we keep one of those even if the actual window wasn't instanced during this session)
ImGuiTabBarFlags_DockNode=1<<20,// Part of a dock node
ImGuiTabBarFlags_DockNodeExplicitRoot=1<<21,// Part of an explicit dock node
ImGuiTabBarFlags_IsFocused=1<<22,
ImGuiTabBarFlags_SaveSettings=1<<23// FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
};
enumImGuiTabItemFlagsPrivate_
{
ImGuiTabItemFlags_DockedWindow=1<<20,
ImGuiTabItemFlags_Preview=1<<21
};
// Storage for one active tab item (sizeof() 32~40 bytes)
structImGuiTabItem
{
ImGuiIDID;
ImGuiTabItemFlagsFlags;
ImGuiWindow*Window;// When TabItem is part of a DockNode's TabBar, we hold on to a window.
intLastFrameVisible;
intLastFrameSelected;// This allows us to infer an ordered list of the last activated tabs with little maintenance
floatOffset;// Position relative to beginning of tab
floatWidth;// Width currently displayed
floatWidthContents;// Width of actual contents, stored during BeginTabItem() call
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
// NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
// NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
// Restore the last visible height if no tab is visible, this reduce vertical flicker/movement when a tabs gets removed without calling SetTabItemClosed().
// Refresh tab width immediately if we can (for manual tab bar, WidthContent will lag by one frame which is mostly noticeable when changing style.FramePadding.x)
// Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet,
// and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window.
floatmargin=g.FontSize*1.0f;// When to scroll to make Tab N+1 visible always make a bit of N visible to suggest more scrolling area (since we don't have a scrollbar)
tab_to_select=&tab_bar->Tabs[(target_order>=0&&target_order<tab_bar->Tabs.Size)?target_order:selected_order];// If we are at the end of the list, still scroll to make our tab visible
// If the user called us with *p_open == false, we early out and don't render. We make a dummy call to ItemAdd() so that attempts to use a contextual popup menu with an implicit ID won't use an older ID.
// We don't have CPU clipping primitives to clip the CloseButton (until it becomes a texture), so need to add an extra draw call (temporary in the case of vertical animation)
if(pressed||((flags&ImGuiTabItemFlags_SetSelected)&&!tab_contents_visible))// SetSelected can only be passed on explicit tab bar, so we don't need to set WantFocusTabId
tab_bar->NextSelectedTabId=id;
// Allow the close button to overlap unless we are dragging (in which case we don't want any overlapping tabs to be hovered)
// While rendering tabs, we trim 1 pixel off the top of our bounding box so they can fit within a regular frame height while looking "detached" from it.
// We are relying on a subtle and confusing distinction between 'hovered' and 'g.HoveredId' which happens because we are using ImGuiButtonFlags_AllowOverlapMode + SetItemAllowOverlap()
// 'hovered' will be true when hovering the Tab but NOT when hovering the close button
// 'g.HoveredId==id' will be true when hovering the Tab including when hovering the close button
// 'g.ActiveId==close_button_id' will be true when we are holding on the close button, in which case both hovered booleans are false