@ -1372,11 +1377,19 @@ void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native
#endif
}
// Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
NavMoveRequestSubmit(ImGuiDir_None,offset<0?ImGuiDir_Up:ImGuiDir_Down,ImGuiNavMoveFlags_Tabbing|ImGuiNavMoveFlags_FocusApi,scroll_flags);// FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
NavMoveRequestSubmit(ImGuiDir_None,clip_dir,ImGuiNavMoveFlags_Tabbing,scroll_flags);// FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
ImGuiKey_KeysData_SIZE=ImGuiKey_NamedKey_COUNT,// Size of KeysData[]: only hold named keys
ImGuiKey_KeysData_OFFSET=ImGuiKey_NamedKey_BEGIN// First key stored in KeysData[0]
ImGuiKey_KeysData_OFFSET=ImGuiKey_NamedKey_BEGIN// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
#else
ImGuiKey_KeysData_SIZE=ImGuiKey_COUNT,// Size of KeysData[]: hold legacy 0..512 keycodes + named keys
ImGuiKey_KeysData_OFFSET=0// First key stored in KeysData[0]
ImGuiKey_KeysData_OFFSET=0// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
#endif
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
@ -1524,6 +1526,7 @@ enum ImGuiModFlags_
};
// Gamepad/Keyboard navigation
// Since >= 1.87 backends you generally don't need to care about this enum since io.NavInputs[] is setup automatically. This might become private/internal some day.
// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.AddKeyEvent() calls.
// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Backend: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
// Read instructions in imgui.cpp for more details. Download PNG/PSD at http://dearimgui.org/controls_sheets.
@ -1576,7 +1579,7 @@ enum ImGuiConfigFlags_
ImGuiConfigFlags_DpiEnableScaleViewports=1<<14,// [BETA: Don't use] FIXME-DPI: Reposition and resize imgui windows when the DpiScale of a viewport changed (mostly useful for the main viewport hosting other window). Note that resizing the main window itself is up to your application.
ImGuiConfigFlags_DpiEnableScaleFonts=1<<15,// [BETA: Don't use] FIXME-DPI: Request bitmap-scaled fonts to match DpiScale. This is a very low-quality workaround. The correct way to handle DPI is _currently_ to replace the atlas and/or fonts in the Platform_OnChangedViewport callback, but this is all early work in progress.
// User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core Dear ImGui)
// User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are NOT used by core Dear ImGui)
ImGuiConfigFlags_IsSRGB=1<<20,// Application is SRGB-aware.
ImGuiConfigFlags_IsTouchScreen=1<<21// Application is using a touch screen instead of a mouse.
};
@ -1629,10 +1632,10 @@ enum ImGuiCol_
ImGuiCol_Separator,
ImGuiCol_SeparatorHovered,
ImGuiCol_SeparatorActive,
ImGuiCol_ResizeGrip,
ImGuiCol_ResizeGrip,// Resize grip in lower-right and lower-left corners of windows.
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
IMGUI_APIvoidAddInputCharacterUTF16(ImWchar16c);// Queue a new character input from an UTF-16 character, it can be a surrogate
IMGUI_APIvoidAddInputCharactersUTF8(constchar*str);// Queue a new characters input from an UTF-8 string
IMGUI_APIvoidSetKeyEventNativeData(ImGuiKeykey,intnative_keycode,intnative_scancode,intnative_legacy_index=-1);// [Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.
IMGUI_APIvoidSetAppAcceptingEvents(boolaccepting_events);// Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
IMGUI_APIvoidClearInputCharacters();// [Internal] Clear the text input buffer manually
IMGUI_APIvoidClearInputKeys();// [Internal] Release all keys
IMGUI_APIvoidSetKeyEventNativeData(ImGuiKeykey,intnative_keycode,intnative_scancode,intnative_legacy_index=-1);// [Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.
ImGuiWindow*Window;// Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
ImGuiWindow*SourceWindow;// Set on OpenPopup() copy of NavWindow at the time of opening the popup
intParentNavLayer;// Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value
intOpenFrameCount;// Set on OpenPopup()
ImGuiIDOpenParentId;// Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
ImVec2OpenPopupPos;// Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
ImVec2OpenMousePos;// Set on OpenPopup(), copy of mouse position at the time of opening popup
if(src_channel->_CmdBuffer.Size>0&&src_channel->_CmdBuffer.back().ElemCount==0&&src_channel->_CmdBuffer.back().UserCallback!=NULL)// Equivalent of PopUnusedDrawCmd()
if(src_channel->_CmdBuffer.Size>0&&src_channel->_CmdBuffer.back().ElemCount==0&&src_channel->_CmdBuffer.back().UserCallback==NULL)// Equivalent of PopUnusedDrawCmd()
ImFormatString(g.TempBuffer,IM_ARRAYSIZE(g.TempBuffer),"%.*s%%d%s",(int)(fmt_start-fmt),fmt,fmt_end);// Honor leading and trailing decorations, but lose alignment/precision.
returng.TempBuffer;
constchar*tmp_format;
ImFormatStringToTempBuffer(&tmp_format,NULL,"%.*s%%d%s",(int)(fmt_start-fmt),fmt,fmt_end);// Honor leading and trailing decorations, but lose alignment/precision.
returntmp_format;
#else
IM_ASSERT(0&&"DragInt(): Invalid format string!");// Old versions used a default parameter of "%.0f", please replace with e.g. "%d"
state->CurLenA=(int)(buf_end-buf);// We can't get the result from ImStrncpy() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
// Preserve cursor position and undo/redo stack if we come back to same widget
// FIXME: For non-readonly widgets we might be able to require that TextAIsValid && TextA == buf ? (untested) and discard undo stack if user buffer has changed.
IM_ASSERT(callback_data.BufTextLen==(int)strlen(callback_data.Buf));// You need to maintain BufTextLen if you change the text!
InputTextReconcileUndoStateAfterUserCallback(state,callback_data.Buf,callback_data.BufTextLen);// FIXME: Move the rest of this block inside function and rename to InputTextReconcileStateAfterUserCallback() ?
// Initially we used 'OpenParentId' to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items) based on parent ID.
// Initially we used 'upper_popup->OpenParentId == window->IDStack.back()' to differentiate multiple menu sets from each others
// (e.g. inside menu bar vs loose menu items) based on parent ID.
// This would however prevent the use of e.g. PuhsID() user code submitting menus.
// Previously this worked between popup and a first child menu because the first child menu always had the _ChildWindow flag,
// making hovering on parent popup possible while first child menu was focused - but this was generally a bug with other side effects.
// Instead we don't treat Popup specifically (in order to consistently support menu features in them), maybe the first child menu of a Popup
// doesn't have the _ChildWindow flag, and we rely on this IsRootOfOpenMenuSet() check to allow hovering between root window/popup and first chilld menu.
// doesn't have the _ChildWindow flag, and we rely on this IsRootOfOpenMenuSet() check to allow hovering between root window/popup and first child menu.
// In the end, lack of ID check made it so we could no longer differentiate between separate menu sets. To compensate for that, we at least check parent window nav layer.
// This fixes the most common case of menu opening on hover when moving between window content and menu bar. Multiple different menu sets in same nav layer would still
// open on hover, but that should be a lesser problem, because if such menus are close in proximity in window content then it won't feel weird and if they are far apart
// Sub-menus are ChildWindow so that mouse can be hovering across them (otherwise top-most popup menu would steal focus and not allow hovering on parent menu)
// The first menu in a hierarchy isn't so hovering doesn't get accross (otherwise e.g. resizing borders with ImGuiButtonFlags_FlattenChildren would react), but top-most BeginMenu() will bypass that limitation.
// The first menu in a hierarchy isn't so hovering doesn't get across (otherwise e.g. resizing borders with ImGuiButtonFlags_FlattenChildren would react), but top-most BeginMenu() will bypass that limitation.