ImGuiPopupRefpopup_ref=ImGuiPopupRef(id,window,window->GetID("##menus"),g.IO.MousePos);// Tagged as new ref because constructor sets Window to NULL (we are passing the ParentWindow info here)
// - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file).
// You can use the "##" or "###" markers to use the same label with different id, or same id with different label. See documentation at the top of this file.
// - Return false when window is collapsed, so you can early out in your code. You always need to call ImGui::End() even if false is returned.
// - Passing 'bool* p_opened' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
// - Passing 'bool* p_open' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
// - Passing non-zero 'size' is roughly equivalent to calling SetNextWindowSize(size, ImGuiSetCond_FirstUseEver) prior to calling Begin().
boolwindow_was_active=(window->LastFrameActive==current_frame-1);// Not using !WasActive because the implicit "Debug" window would always toggle off->on
ImVec2clip_max=ImVec2(window->Pos.x+window->Size.x-(p_opened?title_bar_rect.GetHeight()-3:style.FramePadding.x),text_max.y);// Match the size of CloseWindowButton()
ImVec2clip_max=ImVec2(window->Pos.x+window->Size.x-(p_open?title_bar_rect.GetHeight()-3:style.FramePadding.x),text_max.y);// Match the size of CloseWindowButton()
// NB: '##' is normally used to hide text (as a library-wide feature), so we need to specify the text range to make sure the ## aren't stripped out here.
IMGUI_APIvoidShowTestWindow(bool* opened=NULL);// test window demonstrating ImGui features
IMGUI_APIvoidShowMetricsWindow(bool* opened=NULL);// metrics window for debugging ImGui
IMGUI_APIvoidShowTestWindow(bool*p_open =NULL);// test window demonstrating ImGui features
IMGUI_APIvoidShowMetricsWindow(bool*p_open =NULL);// metrics window for debugging ImGui
// Window
IMGUI_APIboolBegin(constchar*name,bool*p_opened=NULL,ImGuiWindowFlagsflags=0);// push window to the stack and start appending to it. see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_opened' creates a widget on the upper-right to close the window (which sets your bool to false).
IMGUI_APIboolBegin(constchar*name,bool*p_opened,constImVec2&size_on_first_use,floatbg_alpha=-1.0f,ImGuiWindowFlagsflags=0);// OBSOLETE. this is the older/longer API. the extra parameters aren't very relevant. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! might obsolete this API eventually.
IMGUI_APIvoidEnd();// finish appending to current window, pop it off the window stack.
IMGUI_APIboolBeginChild(constchar*str_id,constImVec2&size=ImVec2(0,0),boolborder=false,ImGuiWindowFlagsextra_flags=0);// begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
IMGUI_APIboolBegin(constchar*name,bool*p_open=NULL,ImGuiWindowFlagsflags=0);// push window to the stack and start appending to it. see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_open' creates a widget on the upper-right to close the window (which sets your bool to false).
IMGUI_APIboolBegin(constchar*name,bool*p_open,constImVec2&size_on_first_use,floatbg_alpha=-1.0f,ImGuiWindowFlagsflags=0);// OBSOLETE. this is the older/longer API. the extra parameters aren't very relevant. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! might obsolete this API eventually.
IMGUI_APIvoidEnd();// finish appending to current window, pop it off the window stack.
IMGUI_APIboolBeginChild(constchar*str_id,constImVec2&size=ImVec2(0,0),boolborder=false,ImGuiWindowFlagsextra_flags=0);// begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
IMGUI_APIImVec2GetContentRegionMax();// current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
IMGUI_APIvoidTreePush(constchar*str_id=NULL);// already called by TreeNode(), but you can call Push/Pop yourself for layout purpose
IMGUI_APIvoidTreePush(constvoid*ptr_id=NULL);// "
IMGUI_APIvoidTreePop();
IMGUI_APIvoidSetNextTreeNodeOpened(bool opened,ImGuiSetCondcond=0);// set next tree node/collapsing header to be opened.
IMGUI_APIvoidSetNextTreeNodeOpen(boolis_open,ImGuiSetCondcond=0);// set next TreeNode/CollapsingHeader open state.
IMGUI_APIfloatGetTreeNodeToLabelSpacing(ImGuiTreeNodeFlagsflags=0);// return horizontal distance between cursor and text label due to collapsing node. == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
IMGUI_APIboolCollapsingHeader(constchar*label,ImGuiTreeNodeFlagsflags=0);// if returning 'true' the header is open. user doesn't have to call TreePop().
IMGUI_APIboolCollapsingHeader(constchar*label,bool*p_open,ImGuiTreeNodeFlagsflags=0);// when 'p_open' isn't NULL, display an additional small close button on upper right of the header
@ -360,15 +360,15 @@ namespace ImGui
// Popups
IMGUI_APIvoidOpenPopup(constchar*str_id);// mark popup as open. popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
IMGUI_APIboolBeginPopup(constchar*str_id);// return true if popup if opened and start outputting to it. only call EndPopup() if BeginPopup() returned true!
IMGUI_APIboolBeginPopupModal(constchar*name,bool*p_opened=NULL,ImGuiWindowFlagsextra_flags=0);// modal dialog (can't close them by clicking outside)
IMGUI_APIboolBeginPopup(constchar*str_id);// return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returned true!
IMGUI_APIboolBeginPopupModal(constchar*name,bool*p_open=NULL,ImGuiWindowFlagsextra_flags=0);// modal dialog (can't close them by clicking outside)
IMGUI_APIboolBeginPopupContextItem(constchar*str_id,intmouse_button=1);// helper to open and begin popup when clicked on last item. read comments in .cpp!
IMGUI_APIboolBeginPopupContextWindow(boolalso_over_items=true,constchar*str_id=NULL,intmouse_button=1);// helper to open and begin popup when clicked on current window.
IMGUI_APIboolBeginPopupContextVoid(constchar*str_id=NULL,intmouse_button=1);// helper to open and begin popup when clicked in void (no window).
IMGUI_APIvoidEndPopup();
IMGUI_APIvoidCloseCurrentPopup();// close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
// Logging: all text output from interface is redirected to tty/file/clipboard. Tree nodes are automatically opened.
// Logging: all text output from interface is redirected to tty/file/clipboard. By default, tree nodes are automatically opened during logging.
IMGUI_APIvoidLogToTTY(intmax_depth=-1);// start logging to tty
IMGUI_APIvoidLogToFile(intmax_depth=-1,constchar*filename=NULL);// start logging to file
IMGUI_APIvoidLogToClipboard(intmax_depth=-1);// start logging to OS clipboard
ImGuiTreeNodeFlags_Selected=1<<0,// Draw as selected
ImGuiTreeNodeFlags_Framed=1<<1,// Full colored frame (e.g. for CollapsingHeader)
ImGuiTreeNodeFlags_AllowOverlapMode=1<<2,// Hit testing to allow subsequent widgets to overlap this one
ImGuiTreeNodeFlags_NoTreePushOnOpen=1<<3,// Don't do a TreePush() when opened (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
ImGuiTreeNodeFlags_NoTreePushOnOpen=1<<3,// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
ImGuiTreeNodeFlags_NoAutoOpenOnLog=1<<4,// Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
ImGuiTreeNodeFlags_DefaultOpen=1<<5,// Default node to be opened
ImGuiTreeNodeFlags_DefaultOpen=1<<5,// Default node to be open
ImGuiTreeNodeFlags_OpenOnDoubleClick=1<<6,// Need double-click to open node
ImGuiTreeNodeFlags_OpenOnArrow=1<<7,// Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
ImGuiTreeNodeFlags_AlwaysOpen=1<<8,// No collapsing, no arrow (use as a convenience for leaf nodes).
//ImGuiTreeNodeFlags_UnindentArrow = 1 << 9, // FIXME: TODO: Unindent tree so that Label is aligned to current X position
//ImGuITreeNodeFlags_SpanAllAvailWidth = 1 << 10, // FIXME: TODO: Extend hit box horizontally even if not framed
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 11, // FIXME: TODO: Automatically scroll on TreePop() if node got just opened and contents is not visible
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 11, // FIXME: TODO: Automatically scroll on TreePop() if node got just open and contents is not visible
if(ImGui::TreeNode("Node##1")){for(inti=0;i<6;i++)ImGui::BulletText("Item %d..",i);ImGui::TreePop();}// Dummy tree data
ImGui::AlignFirstTextHeightToWidgets();// Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit).
booltree_opened=ImGui::TreeNode("Node##2");// Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content.
boolnode_open=ImGui::TreeNode("Node##2");// Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content.
ImGui::PushID(uid);// Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
ImGui::AlignFirstTextHeightToWidgets();// Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high.
IMGUI_APIboolTreeNodeBehaviorIsOpened(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging
IMGUI_APIboolTreeNodeBehaviorIsOpen(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging