@ -74,6 +74,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- input text: display bug when clicking a drag/slider after an input text in a different window has all-selected text (order dependent). actually a very old bug but no one appears to have noticed it.
- input text: allow centering/positioning text so that ctrl+clicking Drag or Slider keeps the textual value at the same pixel position.
- input text: what's the easiest way to implement a nice IP/Mac address input editor?
- input text: Global callback system so user can plug in an expression evaluator easily.
- input text multi-line: don't directly call AddText() which does an unnecessary vertex reserve for character count prior to clipping. and/or more line-based clipping to AddText(). and/or reorganize TextUnformatted/RenderText for more efficiency for large text (e.g TextUnformatted could clip and log separately, etc).
- input text multi-line: support for cut/paste without selection (cut/paste the current line)
- input text multi-line: line numbers? status bar? (follow up on #200)
@ -253,8 +254,11 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- font: add support for kerning, probably optional. A) perhaps default to (32..128)^2 matrix ~ 9K entries = 36KB, then hash for non-ascii?. B) or sparse lookup into per-char list?
- font: add a simpler CalcTextSizeA() api? current one ok but not welcome if user needs to call it directly (without going through ImGui::CalcTextSize)
- font: fix AddRemapChar() to work before font has been built.
- font: (api breaking) removed "TTF" from symbol names. also because it now supports OTF.
- font: (api breaking) remove "TTF" from symbol names. also because it now supports OTF.
- font/opt: Considering storing standalone AdvanceX table as 16-bit fixed point integer?
- font/opt: Glyph currently 40 bytes (2+9*4). Consider storing UV as 16 bits integer? (->32 bytes). X0/Y0/X1/Y1 as 16 fixed-point integers? Or X0/Y0 as float and X1/Y1 as fixed8_8?
- nav: NavScrollToBringItemIntoView() with item bigger than view should focus top-right? Repro: using Nav in "About Window"
- nav: wrap around logic to allow e.g. grid based layout (pressing NavRight on the right-most element would go to the next row, etc.). see internal's NavMoveRequestTryWrapping().
- nav: patterns to make it possible for arrows key to update selection
- nav: restore/find nearest navid when current one disappear (e.g. pressed a button that disappear, or perhaps auto restoring when current button change name)
@ -266,8 +270,10 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- nav: NavFlattened: init request doesn't select items that are part of a NavFlattened child
- nav: NavFlattened: cannot access menu-bar of a flattened child window with Alt/menu key (not a very common use case..).
- nav: Left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
- nav: menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
- nav: menus: allow pressing Menu to leave a sub-menu.
- nav/menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
- nav/menus: allow pressing Menu to leave a sub-menu.
- nav/menus: a way to access the main menu bar with Alt? (currently needs CTRL+TAB)
- nav/menus: when using the main menu bar, even though we restore focus after, the underlying window loses its title bar highlight during menu manipulation. could we prevent it?
- nav: simulate right-click or context activation? (SHIFT+F10)
- nav: tabs should go through most/all widgets (in submission order?).
- nav: when CTRL-Tab/windowing is active, the HoveredWindow detection doesn't take account of the window display re-ordering.
// NOT checking: DC.ItemWidth, DC.AllowKeyboardFocus, DC.ButtonRepeat, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
ImGuiContext&g=*GImGui;
int*p_backup=&window->DC.StackSizesBackup[0];
{intcurrent=window->IDStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup==current&&"PushID/PopID or TreeNode/TreePop Mismatch!");p_backup++;}// Too few or too many PopID()/TreePop()
{intcurrent=window->DC.GroupStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup==current&&"BeginGroup/EndGroup Mismatch!");p_backup++;}// Too few or too many EndGroup()
{intcurrent=g.CurrentPopupStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup==current&&"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch");p_backup++;}// Too few or too many EndMenu()/EndPopup()
short*p_backup=&window->DC.StackSizesBackup[0];
{intcurrent=window->IDStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup==current&&"PushID/PopID or TreeNode/TreePop Mismatch!");p_backup++;}// Too few or too many PopID()/TreePop()
{intcurrent=window->DC.GroupStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup==current&&"BeginGroup/EndGroup Mismatch!");p_backup++;}// Too few or too many EndGroup()
{intcurrent=g.CurrentPopupStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup==current&&"BeginMenu/EndMenu or BeginPopup/EndPopup Mismatch");p_backup++;}// Too few or too many EndMenu()/EndPopup()
// For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them.
{intcurrent=g.ColorModifiers.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup>=current&&"PushStyleColor/PopStyleColor Mismatch!");p_backup++;}// Too few or too many PopStyleColor()
{intcurrent=g.StyleModifiers.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup>=current&&"PushStyleVar/PopStyleVar Mismatch!");p_backup++;}// Too few or too many PopStyleVar()
{intcurrent=g.FontStack.Size;if(write)*p_backup=current;elseIM_ASSERT(*p_backup>=current&&"PushFont/PopFont Mismatch!");p_backup++;}// Too few or too many PopFont()
{intcurrent=g.ColorModifiers.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushStyleColor/PopStyleColor Mismatch!");p_backup++;}// Too few or too many PopStyleColor()
{intcurrent=g.StyleModifiers.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushStyleVar/PopStyleVar Mismatch!");p_backup++;}// Too few or too many PopStyleVar()
{intcurrent=g.FontStack.Size;if(write)*p_backup=(short)current;elseIM_ASSERT(*p_backup>=current&&"PushFont/PopFont Mismatch!");p_backup++;}// Too few or too many PopFont()
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY00 then bounced up to XYY01 when release tagging happens)
ImGuiNavLayer_Menu=1,// Menu layer (access with Alt/ImGuiNavInput_Menu)
ImGuiNavLayer_COUNT
};
enumImGuiPopupPositionPolicy
{
ImGuiPopupPositionPolicy_Default,
ImGuiPopupPositionPolicy_ComboBox
};
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D and maintenance of some patches)
// 1D vector (this odd construct is used to facilitate the transition between 1D and 2D, and the maintenance of some branches/patches)
structImVec1
{
floatx;
@ -809,7 +816,7 @@ struct ImGuiContext
floatNavWindowingTimer;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
intNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
ImGuiNavLayerNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
intNavIdTabCounter;// == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRefRectRel is valid
boolNavMousePosDirty;// When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
ImRectLastItemDisplayRect;// End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
boolNavHideHighlightOneFrame;
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
intNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
ImGuiNavLayerNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
intNavLayerCurrentMask;// = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
intNavLayerActiveMask;// Which layer have been written to (result from previous frame)
intNavLayerActiveMaskNext;// Which layer have been written to (buffer for current frame)
boolNavHideHighlightOneFrame;
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
boolMenuBarAppending;// FIXME: Remove this
ImVec2MenuBarOffset;// MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
boolAppearing;// Set during the frame where the window is appearing (or re-appearing)
boolHidden;// Do not display (== (HiddenFramesForResize > 0) ||
boolHasCloseButton;// Set when the window has a close button (p_open != NULL)
int BeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
int BeginOrderWithinParent;// Order within immediate parent window, if we are a child window. Otherwise 0.
int BeginOrderWithinContext;// Order within entire imgui context. This is mostly used for debugging submission order related issues.
shortBeginCount;// Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
shortBeginOrderWithinParent;// Order within immediate parent window, if we are a child window. Otherwise 0.
shortBeginOrderWithinContext;// Order within entire imgui context. This is mostly used for debugging submission order related issues.
ImGuiIDPopupId;// ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
intAutoFitFramesX,AutoFitFramesY;
boolAutoFitOnlyGrows;
@ -1160,8 +1167,8 @@ struct IMGUI_API ImGuiWindow
ImGuiWindow*RootWindowForNav;// Point to ourself or first ancestor which doesn't have the NavFlattened flag.
ImGuiWindow*NavLastChildNavWindow;// When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
ImGuiIDNavLastIds[2];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[2];// Reference rectangle, in window relative space
ImGuiIDNavLastIds[ImGuiNavLayer_COUNT];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[ImGuiNavLayer_COUNT];// Reference rectangle, in window relative space
// Navigation / Focus
// FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext