_(This library is free as in freedom, but needs your support to sustain its development. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out for invoiced financial support. If you are an individual using dear imgui, please consider donating via Patreon or PayPal.)_
// Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by back-end)
staticconstfloatWINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS=4.0f;// Extend outside and inside windows. Affect FindHoveredWindow().
staticconstfloatWINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER=0.04f;// Reduce visual noise by only highlighting the border after a certain time.
staticconstfloatWINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER=2.00f;// Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certaint time, unless mouse moved.
// Docking
staticconstfloatDOCKING_TRANSPARENT_PAYLOAD_ALPHA=0.50f;// For use with io.ConfigDockingTransparentPayload. Apply to Viewport _or_ WindowBg in host viewport.
enum{WRT_OuterRect,WRT_OuterRectClipped,WRT_InnerRect,WRT_InnerClipRect,WRT_WorkRect,WRT_Contents,WRT_ContentsRegionRect,WRT_Count};// Windows Rect Type
IMGUI_APIvoidAddCallback(ImDrawCallbackcallback,void*callback_data);// Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.
ImGui::SameLine();HelpMarker("Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n");
@ -3528,7 +3528,7 @@ struct ExampleAppConsole
Commands.push_back("CLEAR");
Commands.push_back("CLASSIFY");// "classify" is only here to provide an example of "C"+[tab] completing to "CL" and displaying matches.
AutoScroll=true;
ScrollToBottom=true;
ScrollToBottom=false;
AddLog("Welcome to Dear ImGui!");
}
~ExampleAppConsole()
@ -3549,7 +3549,6 @@ struct ExampleAppConsole
for(inti=0;i<Items.Size;i++)
free(Items[i]);
Items.clear();
ScrollToBottom=true;
}
voidAddLog(constchar*fmt,...)IM_FMTARGS(2)
@ -3562,8 +3561,6 @@ struct ExampleAppConsole
buf[IM_ARRAYSIZE(buf)-1]=0;
va_end(args);
Items.push_back(Strdup(buf));
if(AutoScroll)
ScrollToBottom=true;
}
voidDraw(constchar*title,bool*p_open)
@ -3592,8 +3589,7 @@ struct ExampleAppConsole
if(ImGui::SmallButton("Add Dummy Text")){AddLog("%d some text",Items.Size);AddLog("some more text");AddLog("display very important message here!");}ImGui::SameLine();
if(ImGui::SmallButton("Add Dummy Error")){AddLog("[error] something went wrong");}ImGui::SameLine();
ImGuiSelectableFlags_DrawFillAvailWidth=1<<23,// FIXME: We may be able to remove this (added in 6251d379 for menus)
ImGuiSelectableFlags_AllowItemOverlap=1<<24
ImGuiSelectableFlags_AllowItemOverlap=1<<24,
ImGuiSelectableFlags_DrawHoveredWhenHeld=1<<25// Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow.
};
// Extend ImGuiTreeNodeFlags_
@ -885,13 +886,13 @@ struct ImGuiShrinkWidthItem
floatWidth;
};
structImGuiTabBarRef
structImGuiPtrOrIndex
{
ImGuiTabBar*Ptr;// Either field can be set, not both. Dock node tab bars are loose while BeginTabBar() ones are in a pool.
intIndexInMainPool;
void*Ptr;// Either field can be set, not both. e.g. Dock node tab bars are loose while BeginTabBar() ones are in a pool.
ImGuiWindow*HoveredRootWindow;// Will catch mouse inputs (for focus/move only)
ImGuiWindow*HoveredWindowUnderMovingWindow;// Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
ImGuiWindow*MovingWindow;// Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
ImGuiWindow*WheelingWindow;
ImVec2WheelingWindowRefMousePos;
floatWheelingWindowTimer;
// Item/widgets state and tracking information
ImGuiIDHoveredId;// Hovered widget
@ -1129,9 +1133,9 @@ struct ImGuiContext
unsignedcharDragDropPayloadBufLocal[8];// Local buffer for small payloads
// Tab bars
ImPool<ImGuiTabBar>TabBars;
ImGuiTabBar*CurrentTabBar;
ImVector<ImGuiTabBarRef>CurrentTabBarStack;
ImPool<ImGuiTabBar>TabBars;
ImVector<ImGuiPtrOrIndex>CurrentTabBarStack;
ImVector<ImGuiShrinkWidthItem>ShrinkWidthBuffer;
// Widget state
@ -1211,6 +1215,8 @@ struct ImGuiContext
HoveredRootWindow=NULL;
HoveredWindowUnderMovingWindow=NULL;
MovingWindow=NULL;
WheelingWindow=NULL;
WheelingWindowTimer=0.0f;
HoveredId=0;
HoveredIdAllowOverlap=false;
@ -1605,7 +1611,7 @@ struct ImGuiTabBar
floatScrollingSpeed;
ImGuiTabBarFlagsFlags;
ImGuiIDReorderRequestTabId;
intReorderRequestDir;
ImS8ReorderRequestDir;
boolWantLayout;
boolVisibleTabWasSubmitted;
shortLastTabItemIdx;// For BeginTabItem()/EndTabItem()
// FIXME: This would work nicely if it was a public template, e.g. 'template<T> RadioButton(const char* label, T* v, T v_button)', but I'm not sure how we would expose it..