From 010d8ec313bc311bf963e971ff0298669be13972 Mon Sep 17 00:00:00 2001 From: AllenDang Date: Wed, 29 Sep 2021 14:18:37 +0800 Subject: [PATCH] One on one map flags to imgui-go --- Flags.go | 646 ++++++++++++++++++++++--------------------------------- 1 file changed, 252 insertions(+), 394 deletions(-) diff --git a/Flags.go b/Flags.go index b51b7bd1..73a1d5a0 100644 --- a/Flags.go +++ b/Flags.go @@ -1,254 +1,250 @@ package giu +import "github.com/AllenDang/imgui-go" + type InputTextFlags int const ( - InputTextFlagsNone InputTextFlags = 0 - // Allow 0123456789.+-*/ - InputTextFlagsCharsDecimal InputTextFlags = 1 << 0 - // Allow 0123456789ABCDEFabcdef - InputTextFlagsCharsHexadecimal InputTextFlags = 1 << 1 - // Turn a..z into A..Z - InputTextFlagsCharsUppercase InputTextFlags = 1 << 2 - // Filter out spaces, tabs - InputTextFlagsCharsNoBlank InputTextFlags = 1 << 3 - // Select entire text when first taking mouse focus - InputTextFlagsAutoSelectAll InputTextFlags = 1 << 4 - // Return 'true' when Enter is pressed (as opposed to every time the value was modified). - // Consider looking at the IsItemDeactivatedAfterEdit() function. - InputTextFlagsEnterReturnsTrue InputTextFlags = 1 << 5 - // Callback on pressing TAB (for completion handling) - InputTextFlagsCallbackCompletion InputTextFlags = 1 << 6 - // Callback on pressing Up/Down arrows (for history handling) - InputTextFlagsCallbackHistory InputTextFlags = 1 << 7 - // Callback on each iteration. User code may query cursor position, modify text buffer. - InputTextFlagsCallbackAlways InputTextFlags = 1 << 8 - // Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. - InputTextFlagsCallbackCharFilter InputTextFlags = 1 << 9 - // Pressing TAB input a '\t' character into the text field - InputTextFlagsAllowTabInput InputTextFlags = 1 << 10 - // In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter + // InputTextFlagsNone sets everything default. + InputTextFlagsNone InputTextFlags = imgui.InputTextFlagsNone + // InputTextFlagsCharsDecimal allows 0123456789.+- + InputTextFlagsCharsDecimal InputTextFlags = imgui.InputTextFlagsCharsDecimal + // InputTextFlagsCharsHexadecimal allow 0123456789ABCDEFabcdef + InputTextFlagsCharsHexadecimal InputTextFlags = imgui.InputTextFlagsCharsHexadecimal + // InputTextFlagsCharsUppercase turns a..z into A..Z. + InputTextFlagsCharsUppercase InputTextFlags = imgui.InputTextFlagsCharsUppercase + // InputTextFlagsCharsNoBlank filters out spaces, tabs. + InputTextFlagsCharsNoBlank InputTextFlags = imgui.InputTextFlagsCharsNoBlank + // InputTextFlagsAutoSelectAll selects entire text when first taking mouse focus. + InputTextFlagsAutoSelectAll InputTextFlags = imgui.InputTextFlagsAutoSelectAll + // InputTextFlagsEnterReturnsTrue returns 'true' when Enter is pressed (as opposed to when the value was modified). + InputTextFlagsEnterReturnsTrue InputTextFlags = imgui.InputTextFlagsEnterReturnsTrue + // InputTextFlagsCallbackCompletion for callback on pressing TAB (for completion handling). + InputTextFlagsCallbackCompletion InputTextFlags = imgui.InputTextFlagsCallbackCompletion + // InputTextFlagsCallbackHistory for callback on pressing Up/Down arrows (for history handling). + InputTextFlagsCallbackHistory InputTextFlags = imgui.InputTextFlagsCallbackHistory + // InputTextFlagsCallbackAlways for callback on each iteration. User code may query cursor position, modify text buffer. + InputTextFlagsCallbackAlways InputTextFlags = imgui.InputTextFlagsCallbackAlways + // InputTextFlagsCallbackCharFilter for callback on character inputs to replace or discard them. + // Modify 'EventChar' to replace or discard, or return 1 in callback to discard. + InputTextFlagsCallbackCharFilter InputTextFlags = imgui.InputTextFlagsCallbackCharFilter + // InputTextFlagsAllowTabInput when pressing TAB to input a '\t' character into the text field. + InputTextFlagsAllowTabInput InputTextFlags = imgui.InputTextFlagsAllowTabInput + // InputTextFlagsCtrlEnterForNewLine in multi-line mode, unfocus with Enter, add new line with Ctrl+Enter // (default is opposite: unfocus with Ctrl+Enter, add line with Enter). - InputTextFlagsCtrlEnterForNewLine InputTextFlags = 1 << 11 - // Disable following the cursor horizontally - InputTextFlagsNoHorizontalScroll InputTextFlags = 1 << 12 - // Overwrite mode - InputTextFlagsAlwaysOverwrite InputTextFlags = 1 << 13 - // Read-only mode - InputTextFlagsReadOnly InputTextFlags = 1 << 14 - // Password mode, display all characters as '*' - InputTextFlagsPassword InputTextFlags = 1 << 15 - // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo - // stack you need e.g. to call ClearActiveID(). - InputTextFlagsNoUndoRedo InputTextFlags = 1 << 16 - // Allow 0123456789.+-*/eE (Scientific notation input) - InputTextFlagsCharsScientific InputTextFlags = 1 << 17 - // Callback on buffer capacity changes request (beyond 'bufsize' parameter value), allowing the string to grow. - // Notify when the string wants to be resized (for string types which hold a cache of their Size). - // You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imguistdlib.h for an example of using this) - InputTextFlagsCallbackResize InputTextFlags = 1 << 18 - // Callback on any edit (note that InputText() already returns true on edit, - // the callback is useful mainly to manipulate the underlying buffer while focus is active) - InputTextFlagsCallbackEdit InputTextFlags = 1 << 19 + InputTextFlagsCtrlEnterForNewLine InputTextFlags = imgui.InputTextFlagsCtrlEnterForNewLine + // InputTextFlagsNoHorizontalScroll disables following the cursor horizontally. + InputTextFlagsNoHorizontalScroll InputTextFlags = imgui.InputTextFlagsNoHorizontalScroll + // InputTextFlagsAlwaysInsertMode sets insert mode. + InputTextFlagsAlwaysInsertMode InputTextFlags = imgui.InputTextFlagsAlwaysInsertMode + // InputTextFlagsReadOnly sets read-only mode. + InputTextFlagsReadOnly InputTextFlags = imgui.InputTextFlagsReadOnly + // InputTextFlagsPassword sets password mode, display all characters as '*'. + InputTextFlagsPassword InputTextFlags = imgui.InputTextFlagsPassword + // InputTextFlagsNoUndoRedo disables undo/redo. Note that input text owns the text data while active, + // if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). + InputTextFlagsNoUndoRedo InputTextFlags = imgui.InputTextFlagsNoUndoRedo + // InputTextFlagsCharsScientific allows 0123456789.+-*/eE (Scientific notation input). + InputTextFlagsCharsScientific InputTextFlags = imgui.InputTextFlagsCharsScientific ) type WindowFlags int const ( - // WindowFlagsNone default WindowFlags = 0 - WindowFlagsNone WindowFlags = 0 + // WindowFlagsNone default = 0 + WindowFlagsNone WindowFlags = imgui.WindowFlagsNone // WindowFlagsNoTitleBar disables title-bar. - WindowFlagsNoTitleBar WindowFlags = 1 << 0 + WindowFlagsNoTitleBar WindowFlags = imgui.WindowFlagsNoTitleBar // WindowFlagsNoResize disables user resizing with the lower-right grip. - WindowFlagsNoResize WindowFlags = 1 << 1 + WindowFlagsNoResize WindowFlags = imgui.WindowFlagsNoResize // WindowFlagsNoMove disables user moving the window. - WindowFlagsNoMove WindowFlags = 1 << 2 + WindowFlagsNoMove WindowFlags = imgui.WindowFlagsNoMove // WindowFlagsNoScrollbar disables scrollbars. Window can still scroll with mouse or programmatically. - WindowFlagsNoScrollbar WindowFlags = 1 << 3 + WindowFlagsNoScrollbar WindowFlags = imgui.WindowFlagsNoScrollbar // WindowFlagsNoScrollWithMouse disables user vertically scrolling with mouse wheel. On child window, mouse wheel // will be forwarded to the parent unless NoScrollbar is also set. - WindowFlagsNoScrollWithMouse WindowFlags = 1 << 4 + WindowFlagsNoScrollWithMouse WindowFlags = imgui.WindowFlagsNoScrollWithMouse // WindowFlagsNoCollapse disables user collapsing window by double-clicking on it. - WindowFlagsNoCollapse WindowFlags = 1 << 5 + WindowFlagsNoCollapse WindowFlags = imgui.WindowFlagsNoCollapse // WindowFlagsAlwaysAutoResize resizes every window to its content every frame. - WindowFlagsAlwaysAutoResize WindowFlags = 1 << 6 + WindowFlagsAlwaysAutoResize WindowFlags = imgui.WindowFlagsAlwaysAutoResize // WindowFlagsNoBackground disables drawing background color (WindowBg, etc.) and outside border. Similar as using // SetNextWindowBgAlpha(0.0f). - WindowFlagsNoBackground WindowFlags = 1 << 7 + WindowFlagsNoBackground WindowFlags = imgui.WindowFlagsNoBackground // WindowFlagsNoSavedSettings will never load/save settings in .ini file. - WindowFlagsNoSavedSettings WindowFlags = 1 << 8 + WindowFlagsNoSavedSettings WindowFlags = imgui.WindowFlagsNoSavedSettings // WindowFlagsNoMouseInputs disables catching mouse, hovering test with pass through. - WindowFlagsNoMouseInputs WindowFlags = 1 << 9 + WindowFlagsNoMouseInputs WindowFlags = imgui.WindowFlagsNoMouseInputs // WindowFlagsMenuBar has a menu-bar. - WindowFlagsMenuBar WindowFlags = 1 << 10 + WindowFlagsMenuBar WindowFlags = imgui.WindowFlagsMenuBar // WindowFlagsHorizontalScrollbar allows horizontal scrollbar to appear (off by default). You may use // SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo // in the "Horizontal Scrolling" section. - WindowFlagsHorizontalScrollbar WindowFlags = 1 << 11 + WindowFlagsHorizontalScrollbar WindowFlags = imgui.WindowFlagsHorizontalScrollbar // WindowFlagsNoFocusOnAppearing disables taking focus when transitioning from hidden to visible state. - WindowFlagsNoFocusOnAppearing WindowFlags = 1 << 12 + WindowFlagsNoFocusOnAppearing WindowFlags = imgui.WindowFlagsNoFocusOnAppearing // WindowFlagsNoBringToFrontOnFocus disables bringing window to front when taking focus. e.g. clicking on it or // programmatically giving it focus. - WindowFlagsNoBringToFrontOnFocus WindowFlags = 1 << 13 + WindowFlagsNoBringToFrontOnFocus WindowFlags = imgui.WindowFlagsNoBringToFrontOnFocus // WindowFlagsAlwaysVerticalScrollbar always shows vertical scrollbar, even if ContentSize.y < Size.y . - WindowFlagsAlwaysVerticalScrollbar WindowFlags = 1 << 14 + WindowFlagsAlwaysVerticalScrollbar WindowFlags = imgui.WindowFlagsAlwaysVerticalScrollbar // WindowFlagsAlwaysHorizontalScrollbar always shows horizontal scrollbar, even if ContentSize.x < Size.x . - WindowFlagsAlwaysHorizontalScrollbar WindowFlags = 1 << 15 + WindowFlagsAlwaysHorizontalScrollbar WindowFlags = imgui.WindowFlagsAlwaysHorizontalScrollbar // WindowFlagsAlwaysUseWindowPadding ensures child windows without border uses style.WindowPadding (ignored by // default for non-bordered child windows, because more convenient). - WindowFlagsAlwaysUseWindowPadding WindowFlags = 1 << 16 + WindowFlagsAlwaysUseWindowPadding WindowFlags = imgui.WindowFlagsAlwaysUseWindowPadding // WindowFlagsNoNavInputs has no gamepad/keyboard navigation within the window. - WindowFlagsNoNavInputs WindowFlags = 1 << 18 + WindowFlagsNoNavInputs WindowFlags = imgui.WindowFlagsNoNavInputs // WindowFlagsNoNavFocus has no focusing toward this window with gamepad/keyboard navigation // (e.g. skipped by CTRL+TAB) - WindowFlagsNoNavFocus WindowFlags = 1 << 19 + WindowFlagsNoNavFocus WindowFlags = imgui.WindowFlagsNoNavFocus // WindowFlagsUnsavedDocument appends '*' 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. - WindowFlagsUnsavedDocument WindowFlags = 1 << 20 + WindowFlagsUnsavedDocument WindowFlags = imgui.WindowFlagsUnsavedDocument // WindowFlagsNoNav combines WindowFlagsNoNavInputs and WindowFlagsNoNavFocus. - WindowFlagsNoNav WindowFlags = WindowFlagsNoNavInputs | WindowFlagsNoNavFocus + WindowFlagsNoNav WindowFlags = imgui.WindowFlagsNoNav // WindowFlagsNoDecoration combines WindowFlagsNoTitleBar, WindowFlagsNoResize, WindowFlagsNoScrollbar and // WindowFlagsNoCollapse. - WindowFlagsNoDecoration WindowFlags = WindowFlagsNoTitleBar | WindowFlagsNoResize | WindowFlagsNoScrollbar | WindowFlagsNoCollapse + WindowFlagsNoDecoration WindowFlags = imgui.WindowFlagsNoDecoration // WindowFlagsNoInputs combines WindowFlagsNoMouseInputs, WindowFlagsNoNavInputs and WindowFlagsNoNavFocus. - WindowFlagsNoInputs WindowFlags = WindowFlagsNoMouseInputs | WindowFlagsNoNavInputs | WindowFlagsNoNavFocus + WindowFlagsNoInputs WindowFlags = imgui.WindowFlagsNoInputs ) type ComboFlags int const ( - // ComboFlagNone default ComboFlags = 0 - ComboFlagNone ComboFlags = 0 + // ComboFlagNone default = 0 + ComboFlagNone ComboFlags = imgui.ComboFlagNone // ComboFlagPopupAlignLeft aligns the popup toward the left by default. - ComboFlagPopupAlignLeft ComboFlags = 1 << 0 + ComboFlagPopupAlignLeft ComboFlags = imgui.ComboFlagPopupAlignLeft // ComboFlagHeightSmall has max ~4 items visible. // Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo(). - ComboFlagHeightSmall ComboFlags = 1 << 1 + ComboFlagHeightSmall ComboFlags = imgui.ComboFlagHeightSmall // ComboFlagHeightRegular has max ~8 items visible (default). - ComboFlagHeightRegular ComboFlags = 1 << 2 + ComboFlagHeightRegular ComboFlags = imgui.ComboFlagHeightRegular // ComboFlagHeightLarge has max ~20 items visible. - ComboFlagHeightLarge ComboFlags = 1 << 3 + ComboFlagHeightLarge ComboFlags = imgui.ComboFlagHeightLarge // ComboFlagHeightLargest has as many fitting items as possible. - ComboFlagHeightLargest ComboFlags = 1 << 4 + ComboFlagHeightLargest ComboFlags = imgui.ComboFlagHeightLargest // ComboFlagNoArrowButton displays on the preview box without the square arrow button. - ComboFlagNoArrowButton ComboFlags = 1 << 5 + ComboFlagNoArrowButton ComboFlags = imgui.ComboFlagNoArrowButton // ComboFlagNoPreview displays only a square arrow button. - ComboFlagNoPreview ComboFlags = 1 << 6 + ComboFlagNoPreview ComboFlags = imgui.ComboFlagNoPreview ) // SelectableFlags represents imgui.SelectableFlags type SelectableFlags int const ( - // SelectableFlagsNone default SelectableFlags = 0 - SelectableFlagsNone SelectableFlags = 0 + // SelectableFlagsNone default = 0 + SelectableFlagsNone SelectableFlags = imgui.SelectableFlagsNone // SelectableFlagsDontClosePopups makes clicking the selectable not close any parent popup windows. - SelectableFlagsDontClosePopups SelectableFlags = 1 << 0 + SelectableFlagsDontClosePopups SelectableFlags = imgui.SelectableFlagsDontClosePopups // SelectableFlagsSpanAllColumns allows the selectable frame to span all columns (text will still fit in current column). - SelectableFlagsSpanAllColumns SelectableFlags = 1 << 1 + SelectableFlagsSpanAllColumns SelectableFlags = imgui.SelectableFlagsSpanAllColumns // SelectableFlagsAllowDoubleClick generates press events on double clicks too. - SelectableFlagsAllowDoubleClick SelectableFlags = 1 << 2 + SelectableFlagsAllowDoubleClick SelectableFlags = imgui.SelectableFlagsAllowDoubleClick // SelectableFlagsDisabled disallows selection and displays text in a greyed out color. - SelectableFlagsDisabled SelectableFlags = 1 << 3 + SelectableFlagsDisabled SelectableFlags = imgui.SelectableFlagsDisabled ) // TabItemFlags represents tab item flags type TabItemFlags int const ( - // TabItemFlagsNone default TabItemFlags = 0 - TabItemFlagsNone TabItemFlags = 0 + // TabItemFlagsNone default = 0 + TabItemFlagsNone TabItemFlags = imgui.TabItemFlagsNone // TabItemFlagsUnsavedDocument 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. - TabItemFlagsUnsavedDocument TabItemFlags = 1 << 0 + TabItemFlagsUnsavedDocument TabItemFlags = imgui.TabItemFlagsUnsavedDocument // TabItemFlagsSetSelected Trigger flag to programmatically make the tab selected when calling BeginTabItem() - TabItemFlagsSetSelected TabItemFlags = 1 << 1 + TabItemFlagsSetSelected TabItemFlags = imgui.TabItemFlagsSetSelected // TabItemFlagsNoCloseWithMiddleMouseButton 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 TabItemFlags = false. - TabItemFlagsNoCloseWithMiddleMouseButton TabItemFlags = 1 << 2 + // (IsItemHovered() && IsMouseClicked(2)) *p_open = false. + TabItemFlagsNoCloseWithMiddleMouseButton TabItemFlags = imgui.TabItemFlagsNoCloseWithMiddleMouseButton // TabItemFlagsNoPushID Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem() - TabItemFlagsNoPushID TabItemFlags = 1 << 3 + TabItemFlagsNoPushID TabItemFlags = imgui.TabItemFlagsNoPushID ) type TabBarFlags int const ( - // TabBarFlagsNone default TabBarFlags = 0. - TabBarFlagsNone TabBarFlags = 0 + // TabBarFlagsNone default = 0. + TabBarFlagsNone TabBarFlags = imgui.TabBarFlagsNone // TabBarFlagsReorderable Allow manually dragging tabs to re-order them + New tabs are appended at the end of list - TabBarFlagsReorderable TabBarFlags = 1 << 0 + TabBarFlagsReorderable TabBarFlags = imgui.TabBarFlagsReorderable // TabBarFlagsAutoSelectNewTabs Automatically select new tabs when they appear - TabBarFlagsAutoSelectNewTabs TabBarFlags = 1 << 1 + TabBarFlagsAutoSelectNewTabs TabBarFlags = imgui.TabBarFlagsAutoSelectNewTabs // TabBarFlagsTabListPopupButton Disable buttons to open the tab list popup - TabBarFlagsTabListPopupButton TabBarFlags = 1 << 2 + TabBarFlagsTabListPopupButton TabBarFlags = imgui.TabBarFlagsTabListPopupButton // TabBarFlagsNoCloseWithMiddleMouseButton 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 TabBarFlags = false. - TabBarFlagsNoCloseWithMiddleMouseButton TabBarFlags = 1 << 3 + // (IsItemHovered() && IsMouseClicked(2)) *p_open = false. + TabBarFlagsNoCloseWithMiddleMouseButton TabBarFlags = imgui.TabBarFlagsNoCloseWithMiddleMouseButton // TabBarFlagsNoTabListScrollingButtons Disable scrolling buttons (apply when fitting policy is // TabBarFlagsFittingPolicyScroll) - TabBarFlagsNoTabListScrollingButtons TabBarFlags = 1 << 4 + TabBarFlagsNoTabListScrollingButtons TabBarFlags = imgui.TabBarFlagsNoTabListScrollingButtons // TabBarFlagsNoTooltip Disable tooltips when hovering a tab - TabBarFlagsNoTooltip TabBarFlags = 1 << 5 + TabBarFlagsNoTooltip TabBarFlags = imgui.TabBarFlagsNoTooltip // TabBarFlagsFittingPolicyResizeDown Resize tabs when they don't fit - TabBarFlagsFittingPolicyResizeDown TabBarFlags = 1 << 6 + TabBarFlagsFittingPolicyResizeDown TabBarFlags = imgui.TabBarFlagsFittingPolicyResizeDown // TabBarFlagsFittingPolicyScroll Add scroll buttons when tabs don't fit - TabBarFlagsFittingPolicyScroll TabBarFlags = 1 << 7 + TabBarFlagsFittingPolicyScroll TabBarFlags = imgui.TabBarFlagsFittingPolicyScroll // TabBarFlagsFittingPolicyMask combines // TabBarFlagsFittingPolicyResizeDown and TabBarFlagsFittingPolicyScroll - TabBarFlagsFittingPolicyMask TabBarFlags = TabBarFlagsFittingPolicyResizeDown | TabBarFlagsFittingPolicyScroll + TabBarFlagsFittingPolicyMask TabBarFlags = imgui.TabBarFlagsFittingPolicyMask // TabBarFlagsFittingPolicyDefault alias for TabBarFlagsFittingPolicyResizeDown - TabBarFlagsFittingPolicyDefault TabBarFlags = TabBarFlagsFittingPolicyResizeDown + TabBarFlagsFittingPolicyDefault TabBarFlags = imgui.TabBarFlagsFittingPolicyDefault ) // TreeNodeFlags represents tree node widget flags type TreeNodeFlags int const ( - // TreeNodeFlagsNone default TreeNodeFlags = 0 - TreeNodeFlagsNone TreeNodeFlags = 0 + // TreeNodeFlagsNone default = 0 + TreeNodeFlagsNone TreeNodeFlags = imgui.TreeNodeFlagsNone // TreeNodeFlagsSelected draws as selected. - TreeNodeFlagsSelected TreeNodeFlags = 1 << 0 + TreeNodeFlagsSelected TreeNodeFlags = imgui.TreeNodeFlagsSelected // TreeNodeFlagsFramed draws full colored frame (e.g. for CollapsingHeader). - TreeNodeFlagsFramed TreeNodeFlags = 1 << 1 + TreeNodeFlagsFramed TreeNodeFlags = imgui.TreeNodeFlagsFramed // TreeNodeFlagsAllowItemOverlap hit testing to allow subsequent widgets to overlap this one. - TreeNodeFlagsAllowItemOverlap TreeNodeFlags = 1 << 2 + TreeNodeFlagsAllowItemOverlap TreeNodeFlags = imgui.TreeNodeFlagsAllowItemOverlap // TreeNodeFlagsNoTreePushOnOpen doesn't do a TreePush() when open - // (e.g. for CollapsingHeader) TreeNodeFlags = no extra indent nor pushing on ID stack. - TreeNodeFlagsNoTreePushOnOpen TreeNodeFlags = 1 << 3 + // (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack. + TreeNodeFlagsNoTreePushOnOpen TreeNodeFlags = imgui.TreeNodeFlagsNoTreePushOnOpen // TreeNodeFlagsNoAutoOpenOnLog doesn't automatically and temporarily open node when Logging is active // (by default logging will automatically open tree nodes). - TreeNodeFlagsNoAutoOpenOnLog TreeNodeFlags = 1 << 4 + TreeNodeFlagsNoAutoOpenOnLog TreeNodeFlags = imgui.TreeNodeFlagsNoAutoOpenOnLog // TreeNodeFlagsDefaultOpen defaults node to be open. - TreeNodeFlagsDefaultOpen TreeNodeFlags = 1 << 5 + TreeNodeFlagsDefaultOpen TreeNodeFlags = imgui.TreeNodeFlagsDefaultOpen // TreeNodeFlagsOpenOnDoubleClick needs double-click to open node. - TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = 1 << 6 + TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = imgui.TreeNodeFlagsOpenOnDoubleClick // TreeNodeFlagsOpenOnArrow opens only when clicking on the arrow part. // If TreeNodeFlagsOpenOnDoubleClick is also set, single-click arrow or double-click all box to open. - TreeNodeFlagsOpenOnArrow TreeNodeFlags = 1 << 7 + TreeNodeFlagsOpenOnArrow TreeNodeFlags = imgui.TreeNodeFlagsOpenOnArrow // TreeNodeFlagsLeaf allows no collapsing, no arrow (use as a convenience for leaf nodes). - TreeNodeFlagsLeaf TreeNodeFlags = 1 << 8 + TreeNodeFlagsLeaf TreeNodeFlags = imgui.TreeNodeFlagsLeaf // TreeNodeFlagsBullet displays a bullet instead of an arrow. - TreeNodeFlagsBullet TreeNodeFlags = 1 << 9 + TreeNodeFlagsBullet TreeNodeFlags = imgui.TreeNodeFlagsBullet // TreeNodeFlagsFramePadding uses FramePadding (even for an unframed text node) to // vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). - TreeNodeFlagsFramePadding TreeNodeFlags = 1 << 10 + TreeNodeFlagsFramePadding TreeNodeFlags = imgui.TreeNodeFlagsFramePadding // TreeNodeFlagsSpanAvailWidth extends hit box to the right-most edge, even if not framed. // This is not the default in order to allow adding other items on the same line. // In the future we may refactor the hit system to be front-to-back, allowing natural overlaps // and then this can become the default. - TreeNodeFlagsSpanAvailWidth TreeNodeFlags = 1 << 11 + TreeNodeFlagsSpanAvailWidth TreeNodeFlags = imgui.TreeNodeFlagsSpanAvailWidth // TreeNodeFlagsSpanFullWidth extends hit box to the left-most and right-most edges (bypass the indented area). - TreeNodeFlagsSpanFullWidth TreeNodeFlags = 1 << 12 + TreeNodeFlagsSpanFullWidth TreeNodeFlags = imgui.TreeNodeFlagsSpanFullWidth // TreeNodeFlagsNavLeftJumpsBackHere (WIP) Nav: left direction may move to this TreeNode() from any of its child // (items submitted between TreeNode and TreePop) - TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = 1 << 13 + TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = imgui.TreeNodeFlagsNavLeftJumpsBackHere // TreeNodeFlagsCollapsingHeader combines TreeNodeFlagsFramed and TreeNodeFlagsNoAutoOpenOnLog. - TreeNodeFlagsCollapsingHeader TreeNodeFlags = TreeNodeFlagsFramed | TreeNodeFlagsNoTreePushOnOpen | TreeNodeFlagsNoAutoOpenOnLog + TreeNodeFlagsCollapsingHeader TreeNodeFlags = imgui.TreeNodeFlagsCollapsingHeader ) // FocusedFlags represents imgui.FocusedFlags @@ -271,94 +267,69 @@ const ( type HoveredFlags int const ( - // HoveredFlagsNone is the default and matches if directly over the item/window, - // not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them. - HoveredFlagsNone HoveredFlags = 0 - // HoveredFlagsChildWindows is for IsWindowHovered() and matches if any children of the window is hovered - HoveredFlagsChildWindows HoveredFlags = 1 << 0 - // HoveredFlagsRootWindow is for IsWindowHovered() and tests from root window (top most parent of the current hierarchy) - HoveredFlagsRootWindow HoveredFlags = 1 << 1 - // HoveredFlagsAnyWindow is for IsWindowHovered() and matches if any window is hovered - HoveredFlagsAnyWindow HoveredFlags = 1 << 2 - // HoveredFlagsAllowWhenBlockedByPopup matches even if a popup window is normally blocking access to this item/window - HoveredFlagsAllowWhenBlockedByPopup HoveredFlags = 1 << 3 - // HoveredFlagsAllowWhenBlockedByModal matches even if a modal popup window is normally blocking access to this item/window. - // UNIMPLEMENTED in imgui. - // HoveredFlagsAllowWhenBlockedByModal HoveredFlags = 1 << 4 - // HoveredFlagsAllowWhenBlockedByActiveItem matches true even if an active item is blocking access to this item/window. + // HoveredFlagsNone Return true if directly over the item/window, not obstructed by another window, + // not obstructed by an active popup or modal blocking inputs under them. + HoveredFlagsNone HoveredFlags = imgui.HoveredFlagsNone + // HoveredFlagsChildWindows IsWindowHovered() only: Return true if any children of the window is hovered. + HoveredFlagsChildWindows HoveredFlags = imgui.HoveredFlagsChildWindows + // HoveredFlagsRootWindow IsWindowHovered() only: Test from root window (top most parent of the current hierarchy). + HoveredFlagsRootWindow HoveredFlags = imgui.HoveredFlagsRootWindow + // HoveredFlagsAnyWindow IsWindowHovered() only: Return true if any window is hovered. + HoveredFlagsAnyWindow HoveredFlags = imgui.HoveredFlagsAnyWindow + // HoveredFlagsAllowWhenBlockedByPopup Return true even if a popup window is normally blocking access to this item/window. + HoveredFlagsAllowWhenBlockedByPopup HoveredFlags = imgui.HoveredFlagsAllowWhenBlockedByPopup + // HoveredFlagsAllowWhenBlockedByActiveItem Return true even if an active item is blocking access to this item/window. // Useful for Drag and Drop patterns. - HoveredFlagsAllowWhenBlockedByActiveItem HoveredFlags = 1 << 5 - // HoveredFlagsAllowWhenOverlapped matches even if the position is obstructed or overlapped by another window - HoveredFlagsAllowWhenOverlapped HoveredFlags = 1 << 6 - // HoveredFlagsAllowWhenDisabled matches even if the item is disabled - HoveredFlagsAllowWhenDisabled HoveredFlags = 1 << 7 - // HoveredFlagsRectOnly combines HoveredFlagsAllowWhenBlockedByPopup, - // HoveredFlagsAllowWhenBlockedByActiveItem, and HoveredFlagsAllowWhenOverlapped. - HoveredFlagsRectOnly HoveredFlags = HoveredFlagsAllowWhenBlockedByPopup | - HoveredFlagsAllowWhenBlockedByActiveItem | HoveredFlagsAllowWhenOverlapped - // HoveredFlagsRootAndChildWindows combines HoveredFlagsRootWindow and HoveredFlagsChildWindows. - HoveredFlagsRootAndChildWindows HoveredFlags = HoveredFlagsRootWindow | HoveredFlagsChildWindows + HoveredFlagsAllowWhenBlockedByActiveItem HoveredFlags = imgui.HoveredFlagsAllowWhenBlockedByActiveItem + // HoveredFlagsAllowWhenOverlapped Return true even if the position is overlapped by another window + HoveredFlagsAllowWhenOverlapped HoveredFlags = imgui.HoveredFlagsAllowWhenOverlapped + // HoveredFlagsAllowWhenDisabled Return true even if the item is disabled + HoveredFlagsAllowWhenDisabled HoveredFlags = imgui.HoveredFlagsAllowWhenDisabled ) // ColorEditFlags for ColorEdit3V(), etc. type ColorEditFlags int const ( - // ColorEditFlagsNone default = 0. - ColorEditFlagsNone ColorEditFlags = 0 + // ColorEditFlagsNone default = 0 + ColorEditFlagsNone ColorEditFlags = imgui.ColorEditFlagsNone // ColorEditFlagsNoAlpha ignores Alpha component (read 3 components from the input pointer). - ColorEditFlagsNoAlpha ColorEditFlags = 1 << 1 + ColorEditFlagsNoAlpha ColorEditFlags = imgui.ColorEditFlagsNoAlpha // ColorEditFlagsNoPicker disables picker when clicking on colored square. - ColorEditFlagsNoPicker ColorEditFlags = 1 << 2 + ColorEditFlagsNoPicker ColorEditFlags = imgui.ColorEditFlagsNoPicker // ColorEditFlagsNoOptions disables toggling options menu when right-clicking on inputs/small preview. - ColorEditFlagsNoOptions ColorEditFlags = 1 << 3 - // ColorEditFlagsNoSmallPreview disables colored square preview next to the inputs. (e.g. to show only the inputs). - ColorEditFlagsNoSmallPreview ColorEditFlags = 1 << 4 + ColorEditFlagsNoOptions ColorEditFlags = imgui.ColorEditFlagsNoOptions + // ColorEditFlagsNoSmallPreview disables colored square preview next to the inputs. (e.g. to show only the inputs) + ColorEditFlagsNoSmallPreview ColorEditFlags = imgui.ColorEditFlagsNoSmallPreview // ColorEditFlagsNoInputs disables inputs sliders/text widgets (e.g. to show only the small preview colored square). - ColorEditFlagsNoInputs ColorEditFlags = 1 << 5 + ColorEditFlagsNoInputs ColorEditFlags = imgui.ColorEditFlagsNoInputs // ColorEditFlagsNoTooltip disables tooltip when hovering the preview. - ColorEditFlagsNoTooltip ColorEditFlags = 1 << 6 + ColorEditFlagsNoTooltip ColorEditFlags = imgui.ColorEditFlagsNoTooltip // ColorEditFlagsNoLabel disables display of inline text label (the label is still forwarded to the tooltip and picker). - ColorEditFlagsNoLabel ColorEditFlags = 1 << 7 - // ColorEditFlagsNoSidePreview disables bigger color preview on right side of the picker, use small colored square preview instead. - ColorEditFlagsNoSidePreview ColorEditFlags = 1 << 8 + ColorEditFlagsNoLabel ColorEditFlags = imgui.ColorEditFlagsNoLabel // ColorEditFlagsNoDragDrop disables drag and drop target. ColorButton: disable drag and drop source. - ColorEditFlagsNoDragDrop ColorEditFlags = 1 << 9 - // ColorEditFlagsNoBorder disables border (which is enforced by default). - ColorEditFlagsNoBorder ColorEditFlags = 1 << 10 + ColorEditFlagsNoDragDrop ColorEditFlags = imgui.ColorEditFlagsNoDragDrop - // User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). - // The idea is that you probably don't want to override them in most of your calls, let the user choose and/or call - // SetColorEditOptions() during startup. + // User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). The idea is that you probably don't want to override them in most of your calls, let the user choose and/or call SetColorEditOptions() during startup. // ColorEditFlagsAlphaBar shows vertical alpha bar/gradient in picker. - ColorEditFlagsAlphaBar ColorEditFlags = 1 << 16 + ColorEditFlagsAlphaBar ColorEditFlags = imgui.ColorEditFlagsAlphaBar // ColorEditFlagsAlphaPreview displays preview as a transparent color over a checkerboard, instead of opaque. - ColorEditFlagsAlphaPreview ColorEditFlags = 1 << 17 + ColorEditFlagsAlphaPreview ColorEditFlags = imgui.ColorEditFlagsAlphaPreview // ColorEditFlagsAlphaPreviewHalf displays half opaque / half checkerboard, instead of opaque. - ColorEditFlagsAlphaPreviewHalf ColorEditFlags = 1 << 18 - // ColorEditFlagsHDR = (WIP) surrently only disable 0.0f..1.0f limits in RGBA edition. - // Note: you probably want to use ImGuiColorEditFlags_Float flag as well. - ColorEditFlagsHDR ColorEditFlags = 1 << 19 - // ColorEditFlagsRGB sets the format as RGB. - ColorEditFlagsRGB ColorEditFlags = 1 << 20 - // ColorEditFlagsHSV sets the format as HSV. - ColorEditFlagsHSV ColorEditFlags = 1 << 21 - // ColorEditFlagsHEX sets the format as HEX. - ColorEditFlagsHEX ColorEditFlags = 1 << 22 + ColorEditFlagsAlphaPreviewHalf ColorEditFlags = imgui.ColorEditFlagsAlphaPreviewHalf + // ColorEditFlagsHDR = (WIP) surrently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well). + ColorEditFlagsHDR ColorEditFlags = imgui.ColorEditFlagsHDR + // ColorEditFlagsRGB sets the format as RGB + ColorEditFlagsRGB ColorEditFlags = imgui.ColorEditFlagsRGB + // ColorEditFlagsHSV sets the format as HSV + ColorEditFlagsHSV ColorEditFlags = imgui.ColorEditFlagsHSV + // ColorEditFlagsHEX sets the format as HEX + ColorEditFlagsHEX ColorEditFlags = imgui.ColorEditFlagsHEX // ColorEditFlagsUint8 _display_ values formatted as 0..255. - ColorEditFlagsUint8 ColorEditFlags = 1 << 23 + ColorEditFlagsUint8 ColorEditFlags = imgui.ColorEditFlagsUint8 // ColorEditFlagsFloat _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. - ColorEditFlagsFloat ColorEditFlags = 1 << 24 - - // ColorEditFlagsPickerHueBar shows bar for Hue, rectangle for Sat/Value. - ColorEditFlagsPickerHueBar ColorEditFlags = 1 << 25 - // ColorEditFlagsPickerHueWheel shows wheel for Hue, triangle for Sat/Value. - ColorEditFlagsPickerHueWheel ColorEditFlags = 1 << 26 - // ColorEditFlagsInputRGB enables input and output data in RGB format. - ColorEditFlagsInputRGB ColorEditFlags = 1 << 27 - // ColorEditFlagsInputHSV enables input and output data in HSV format. - ColorEditFlagsInputHSV ColorEditFlags = 1 << 28 + ColorEditFlagsFloat ColorEditFlags = imgui.ColorEditFlagsFloat ) // TableFlags represents table flags @@ -366,173 +337,85 @@ type TableFlags int // Table flags enum: const ( - // Features - - TableFlagsNone TableFlags = 0 - // Enable resizing columns. - TableFlagsResizable TableFlags = 1 << 0 - // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers) - TableFlagsReorderable TableFlags = 1 << 1 - // Enable hiding/disabling columns in context menu. - TableFlagsHideable TableFlags = 1 << 2 - // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see TableFlagsSortMulti and TableFlagsSortTristate. - TableFlagsSortable TableFlags = 1 << 3 - // Disable persisting columns order, width and sort settings in the .ini file. - TableFlagsNoSavedSettings TableFlags = 1 << 4 - // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow(). - TableFlagsContextMenuInBody TableFlags = 1 << 5 - // Decorations - - // Set each RowBg color with ColTableRowBg or ColTableRowBgAlt - // (equivalent of calling TableSetBgColor with TableBgFlagsRowBg0 on each row manually) - TableFlagsRowBg TableFlags = 1 << 6 - // Draw horizontal borders between rows. - TableFlagsBordersInnerH TableFlags = 1 << 7 - // Draw horizontal borders at the top and bottom. - TableFlagsBordersOuterH TableFlags = 1 << 8 - // Draw vertical borders between columns. - TableFlagsBordersInnerV TableFlags = 1 << 9 - // Draw vertical borders on the left and right sides. - TableFlagsBordersOuterV TableFlags = 1 << 10 - // Draw horizontal borders. - TableFlagsBordersH TableFlags = TableFlagsBordersInnerH | TableFlagsBordersOuterH - // Draw vertical borders. - TableFlagsBordersV TableFlags = TableFlagsBordersInnerV | TableFlagsBordersOuterV - // Draw inner borders. - TableFlagsBordersInner TableFlags = TableFlagsBordersInnerV | TableFlagsBordersInnerH - // Draw outer borders. - TableFlagsBordersOuter TableFlags = TableFlagsBordersOuterV | TableFlagsBordersOuterH - // Draw all borders. - TableFlagsBorders TableFlags = TableFlagsBordersInner | TableFlagsBordersOuter - // [ALPHA] Disable vertical borders in columns Body (borders will always appears in Headers). -> May move to style - TableFlagsNoBordersInBody TableFlags = 1 << 11 - // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers). -> May move to style - TableFlagsNoBordersInBodyUntilResizeTableFlags TableFlags = 1 << 12 - // Sizing Policy (read above for defaults)TableFlags - - // Columns default to WidthFixed or WidthAuto (if resizable or not resizable), matching contents width. - TableFlagsSizingFixedFit TableFlags = 1 << 13 - // Columns default to WidthFixed or WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. - // Implicitly enable TableFlagsNoKeepColumnsVisible. - TableFlagsSizingFixedSame TableFlags = 2 << 13 - // Columns default to WidthStretch with default weights proportional to each columns contents widths. - TableFlagsSizingStretchProp TableFlags = 3 << 13 - // Columns default to WidthStretch with default weights all equal, unless overridden by TableSetupColumn(). - TableFlagsSizingStretchSame TableFlags = 4 << 13 - // Sizing Extra Options - - // Make outer width auto-fit to columns, overriding outersize.x value. - // Only available when ScrollX/ScrollY are disabled and Stretch columns are not used. - TableFlagsNoHostExtendX TableFlags = 1 << 16 - // Make outer height stop exactly at outersize.y (prevent auto-extending table past the limit). - // Only available when ScrollX/ScrollY are disabled. - // Data below the limit will be clipped and not visible. - TableFlagsNoHostExtendY TableFlags = 1 << 17 - // Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable. - TableFlagsNoKeepColumnsVisible TableFlags = 1 << 18 - // Disable distributing remainder width to stretched columns - // (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). - // With larger number of columns, resizing will appear to be less smooth. - TableFlagsPreciseWidths TableFlags = 1 << 19 - - // Clipping - - // Disable clipping rectangle for every individual columns (reduce draw command count, - // items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze(). - TableFlagsNoClip TableFlags = 1 << 20 - // Padding - - // Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers. - TableFlagsPadOuterX TableFlags = 1 << 21 - // Default if BordersOuterV is off. Disable outer-most padding. - TableFlagsNoPadOuterX TableFlags = 1 << 22 - // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off). - TableFlagsNoPadInnerX TableFlags = 1 << 23 - - // Scrolling - - // Enable horizontal scrolling. Require 'outersize' parameter of BeginTable() to specify the container size. - // Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX. - TableFlagsScrollX TableFlags = 1 << 24 - // Enable vertical scrolling. Require 'outersize' parameter of BeginTable() to specify the container size. - TableFlagsScrollY TableFlags = 1 << 25 - // Sorting - - // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1). - TableFlagsSortMulti TableFlags = 1 << 26 - // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0). - TableFlagsSortTristate TableFlags = 1 << 27 - - // [Internal] Combinations and masks - TableFlagsSizingMask TableFlags = TableFlagsSizingFixedFit | TableFlagsSizingFixedSame | - TableFlagsSizingStretchProp | TableFlagsSizingStretchSame + TableFlagsNone TableFlags = TableFlags(imgui.TableFlags_None) + TableFlagsResizable TableFlags = TableFlags(imgui.TableFlags_Resizable) + TableFlagsReorderable TableFlags = TableFlags(imgui.TableFlags_Reorderable) + TableFlagsHideable TableFlags = TableFlags(imgui.TableFlags_Hideable) + TableFlagsSortable TableFlags = TableFlags(imgui.TableFlags_Sortable) + TableFlagsNoSavedSettings TableFlags = TableFlags(imgui.TableFlags_NoSavedSettings) + TableFlagsContextMenuInBody TableFlags = TableFlags(imgui.TableFlags_ContextMenuInBody) + TableFlagsRowBg TableFlags = TableFlags(imgui.TableFlags_RowBg) + TableFlagsBordersInnerH TableFlags = TableFlags(imgui.TableFlags_BordersInnerH) + TableFlagsBordersOuterH TableFlags = TableFlags(imgui.TableFlags_BordersOuterH) + TableFlagsBordersInnerV TableFlags = TableFlags(imgui.TableFlags_BordersInnerV) + TableFlagsBordersOuterV TableFlags = TableFlags(imgui.TableFlags_BordersOuterV) + TableFlagsBordersH TableFlags = TableFlags(imgui.TableFlags_BordersH) + TableFlagsBordersV TableFlags = TableFlags(imgui.TableFlags_BordersV) + TableFlagsBordersInner TableFlags = TableFlags(imgui.TableFlags_BordersInner) + TableFlagsBordersOuter TableFlags = TableFlags(imgui.TableFlags_BordersOuter) + TableFlagsBorders TableFlags = TableFlags(imgui.TableFlags_Borders) + TableFlagsNoBordersInBody TableFlags = TableFlags(imgui.TableFlags_NoBordersInBody) + TableFlagsNoBordersInBodyUntilResize TableFlags = TableFlags(imgui.TableFlags_NoBordersInBodyUntilResizeTableFlags) + TableFlagsSizingFixedFit TableFlags = TableFlags(imgui.TableFlags_SizingFixedFit) + TableFlagsSizingFixedSame TableFlags = TableFlags(imgui.TableFlags_SizingFixedSame) + TableFlagsSizingStretchProp TableFlags = TableFlags(imgui.TableFlags_SizingStretchProp) + TableFlagsSizingStretchSame TableFlags = TableFlags(imgui.TableFlags_SizingStretchSame) + TableFlagsNoHostExtendX TableFlags = TableFlags(imgui.TableFlags_NoHostExtendX) + TableFlagsNoHostExtendY TableFlags = TableFlags(imgui.TableFlags_NoHostExtendY) + TableFlagsNoKeepColumnsVisible TableFlags = TableFlags(imgui.TableFlags_NoKeepColumnsVisible) + TableFlagsPreciseWidths TableFlags = TableFlags(imgui.TableFlags_PreciseWidths) + TableFlagsNoClip TableFlags = TableFlags(imgui.TableFlags_NoClip) + TableFlagsPadOuterX TableFlags = TableFlags(imgui.TableFlags_PadOuterX) + TableFlagsNoPadOuterX TableFlags = TableFlags(imgui.TableFlags_NoPadOuterX) + TableFlagsNoPadInnerX TableFlags = TableFlags(imgui.TableFlags_NoPadInnerX) + TableFlagsScrollX TableFlags = TableFlags(imgui.TableFlags_ScrollX) + TableFlagsScrollY TableFlags = TableFlags(imgui.TableFlags_ScrollY) + TableFlagsSortMulti TableFlags = TableFlags(imgui.TableFlags_SortMulti) + TableFlagsSortTristate TableFlags = TableFlags(imgui.TableFlags_SortTristate) + TableFlagsSizingMask_ TableFlags = TableFlags(imgui.TableFlags_SizingMask_) ) type TableRowFlags int const ( - TableRowFlagsNone TableRowFlags = 0 + TableRowFlagsNone TableRowFlags = TableRowFlags(imgui.TableRowFlags_None) // Identify header row (set default background color + width of its contents accounted different for auto column width) - TableRowFlagsHeaders TableRowFlags = 1 << 0 + TableRowFlagsHeaders TableRowFlags = TableRowFlags(imgui.TableRowFlags_Headers) ) type TableColumnFlags int const ( // Input configuration flags - TableColumnFlagsNone TableColumnFlags = 0 - // Default as a hidden/disabled column. - TableColumnFlagsDefaultHide TableColumnFlags = 1 << 0 - // Default as a sorting column. - TableColumnFlagsDefaultSort TableColumnFlags = 1 << 1 - // Column will stretch. Preferable with horizontal scrolling disabled - // (default if table sizing policy is SizingStretchSame or SizingStretchProp). - TableColumnFlagsWidthStretch TableColumnFlags = 1 << 2 - // Column will not stretch. Preferable with horizontal scrolling enabled - // (default if table sizing policy is SizingFixedFit and table is resizable). - TableColumnFlagsWidthFixed TableColumnFlags = 1 << 3 - // Disable manual resizing. - TableColumnFlagsNoResize TableColumnFlags = 1 << 4 - // Disable manual reordering this column, this will also prevent other columns from crossing over this column. - TableColumnFlagsNoReorder TableColumnFlags = 1 << 5 - // Disable ability to hide/disable this column. - TableColumnFlagsNoHide TableColumnFlags = 1 << 6 - // Disable clipping for this column (all NoClip columns will render in a same draw command). - TableColumnFlagsNoClip TableColumnFlags = 1 << 7 - // Disable ability to sort on this field (even if TableFlagsSortable is set on the table). - TableColumnFlagsNoSort TableColumnFlags = 1 << 8 - // Disable ability to sort in the ascending direction. - TableColumnFlagsNoSortAscending TableColumnFlags = 1 << 9 - // Disable ability to sort in the descending direction. - TableColumnFlagsNoSortDescending TableColumnFlags = 1 << 10 - // Disable header text width contribution to automatic column width. - TableColumnFlagsNoHeaderWidth TableColumnFlags = 1 << 11 - // Make the initial sort direction Ascending when first sorting on this column (default). - TableColumnFlagsPreferSortAscending TableColumnFlags = 1 << 12 - // Make the initial sort direction Descending when first sorting on this column. - TableColumnFlagsPreferSortDescending TableColumnFlags = 1 << 13 - // Use current Indent value when entering cell (default for column 0). - TableColumnFlagsIndentEnable TableColumnFlags = 1 << 14 - // Ignore current Indent value when entering cell (default for columns > 0). Indentation changes within the cell will still be honored. - TableColumnFlagsIndentDisable TableColumnFlags = 1 << 15 + TableColumnFlagsNone TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_None) + TableColumnFlagsDefaultHide TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_DefaultHide) + TableColumnFlagsDefaultSort TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_DefaultSort) + TableColumnFlagsWidthStretch TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_WidthStretch) + TableColumnFlagsWidthFixed TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_WidthFixed) + TableColumnFlagsNoResize TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoResize) + TableColumnFlagsNoReorder TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoReorder) + TableColumnFlagsNoHide TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoHide) + TableColumnFlagsNoClip TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoClip) + TableColumnFlagsNoSort TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoSort) + TableColumnFlagsNoSortAscending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoSortAscending) + TableColumnFlagsNoSortDescending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoSortDescending) + TableColumnFlagsNoHeaderWidth TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoHeaderWidth) + TableColumnFlagsPreferSortAscending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_PreferSortAscending) + TableColumnFlagsPreferSortDescending TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_PreferSortDescending) + TableColumnFlagsIndentEnable TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IndentEnable) + TableColumnFlagsIndentDisable TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IndentDisable) // Output status flags read-only via TableGetColumnFlags() - // Status: is enabled == not hidden by user/api (referred to as "Hide" in DefaultHide and NoHide) flags. - TableColumnFlagsIsEnabled TableColumnFlags = 1 << 20 - // Status: is visible == is enabled AND not clipped by scrolling. - TableColumnFlagsIsVisible TableColumnFlags = 1 << 21 - // Status: is currently part of the sort specs - TableColumnFlagsIsSorted TableColumnFlags = 1 << 22 - // Status: is hovered by mouse - TableColumnFlagsIsHovered TableColumnFlags = 1 << 23 + TableColumnFlagsIsEnabled TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsEnabled) + TableColumnFlagsIsVisible TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsVisible) + TableColumnFlagsIsSorted TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsSorted) + TableColumnFlagsIsHovered TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IsHovered) // [Internal] Combinations and masks - TableColumnFlagsWidthMask TableColumnFlags = TableColumnFlagsWidthStretch | TableColumnFlagsWidthFixed - TableColumnFlagsIndentMask TableColumnFlags = TableColumnFlagsIndentEnable | TableColumnFlagsIndentDisable - TableColumnFlagsStatusMask TableColumnFlags = TableColumnFlagsIsEnabled | - TableColumnFlagsIsVisible | TableColumnFlagsIsSorted | TableColumnFlagsIsHovered - // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge) - TableColumnFlagsNoDirectResize TableColumnFlags = 1 << 30 + TableColumnFlagsWidthMask_ TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_WidthMask_) + TableColumnFlagsIndentMask_ TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_IndentMask_) + TableColumnFlagsStatusMask_ TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_StatusMask_) + TableColumnFlagsNoDirectResize_ TableColumnFlags = TableColumnFlags(imgui.TableColumnFlags_NoDirectResize_) ) type SliderFlags int @@ -556,61 +439,36 @@ const ( type PlotFlags int const ( - // default - PlotFlagsNone PlotFlags = 0 - // the plot title will not be displayed (titles are also hidden if preceded by double hashes, e.g. "##MyPlot") - PlotFlagsNoTitle PlotFlags = 1 << 0 - // the legend will not be displayed - PlotFlagsNoLegend PlotFlags = 1 << 1 - // the user will not be able to open context menus with right-click - PlotFlagsNoMenus PlotFlags = 1 << 2 - // the user will not be able to box-select with right-click drag - PlotFlagsNoBoxSelect PlotFlags = 1 << 3 - // the mouse position, in plot coordinates, will not be displayed inside of the plot - PlotFlagsNoMousePos PlotFlags = 1 << 4 - // plot items will not be highlighted when their legend entry is hovered - PlotFlagsNoHighlight PlotFlags = 1 << 5 - // a child window region will not be used to capture mouse scroll (can boost performance for single Gui window applications) - PlotFlagsNoChild PlotFlags = 1 << 6 - // primary x and y axes will be constrained to have the same units/pixel (does not apply to auxiliary y-axes) - PlotFlagsEqual PlotFlags = 1 << 7 - // enable a 2nd y-axis on the right side - PlotFlagsYAxis2 PlotFlags = 1 << 8 - // enable a 3rd y-axis on the right side - PlotFlagsYAxis3 PlotFlags = 1 << 9 - // the user will be able to draw query rects with middle-mouse or CTRL + right-click drag - PlotFlagsQuery PlotFlags = 1 << 10 - // the default mouse cursor will be replaced with a crosshair when hovered - PlotFlagsCrosshairs PlotFlags = 1 << 11 - // plot lines will be software anti-aliased (not recommended for high density plots, prefer MSAA) - PlotFlagsAntiAliased PlotFlags = 1 << 12 - PlotFlagsCanvasOnly PlotFlags = PlotFlagsNoTitle | PlotFlagsNoLegend | PlotFlagsNoMenus | PlotFlagsNoBoxSelect | PlotFlagsNoMousePos + PlotFlagsNone = PlotFlags(imgui.ImPlotFlags_None) + PlotFlagsNoTitle = PlotFlags(imgui.ImPlotFlags_NoTitle) + PlotFlagsNoLegend = PlotFlags(imgui.ImPlotFlags_NoLegend) + PlotFlagsNoMenus = PlotFlags(imgui.ImPlotFlags_NoMenus) + PlotFlagsNoBoxSelect = PlotFlags(imgui.ImPlotFlags_NoBoxSelect) + PlotFlagsNoMousePos = PlotFlags(imgui.ImPlotFlags_NoMousePos) + PlotFlagsNoHighlight = PlotFlags(imgui.ImPlotFlags_NoHighlight) + PlotFlagsNoChild = PlotFlags(imgui.ImPlotFlags_NoChild) + PlotFlagsEqual = PlotFlags(imgui.ImPlotFlags_Equal) + PlotFlagsYAxis2 = PlotFlags(imgui.ImPlotFlags_YAxis2) + PlotFlagsYAxis3 = PlotFlags(imgui.ImPlotFlags_YAxis3) + PlotFlagsQuery = PlotFlags(imgui.ImPlotFlags_Query) + PlotFlagsCrosshairs = PlotFlags(imgui.ImPlotFlags_Crosshairs) + PlotFlagsAntiAliased = PlotFlags(imgui.ImPlotFlags_AntiAliased) + PlotFlagsCanvasOnly = PlotFlags(imgui.ImPlotFlags_CanvasOnly) ) type PlotAxisFlags int const ( - // default - PlotAxisFlagsNone PlotAxisFlags = 0 - // the axis label will not be displayed (axis labels also hidden if the supplied string name is NULL) - PlotAxisFlagsNoLabel PlotAxisFlags = 1 << 0 - // the axis grid lines will not be displayed - PlotAxisFlagsNoGridLines PlotAxisFlags = 1 << 1 - // the axis tick marks will not be displayed - PlotAxisFlagsNoTickMarks PlotAxisFlags = 1 << 2 - // the axis tick labels will not be displayed - PlotAxisFlagsNoTickLabels PlotAxisFlags = 1 << 3 - // a logartithmic (base 10) axis scale will be used (mutually exclusive with PlotAxisFlagsTime) - PlotAxisFlagsLogScale PlotAxisFlags = 1 << 4 - // axis will display date/time formatted labels (mutually exclusive with PlotAxisFlagsLogScale) - PlotAxisFlagsTime PlotAxisFlags = 1 << 5 - // the axis will be inverted - PlotAxisFlagsInvert PlotAxisFlags = 1 << 6 - // the axis minimum value will be locked when panning/zooming - PlotAxisFlagsLockMin PlotAxisFlags = 1 << 7 - // the axis maximum value will be locked when panning/zooming - PlotAxisFlagsLockMax PlotAxisFlags = 1 << 8 - PlotAxisFlagsLock PlotAxisFlags = PlotAxisFlagsLockMin | PlotAxisFlagsLockMax - PlotAxisFlagsNoDecorations PlotAxisFlags = PlotAxisFlagsNoLabel | PlotAxisFlagsNoGridLines | - PlotAxisFlagsNoTickMarks | PlotAxisFlagsNoTickLabels + PlotAxisFlagsNone = PlotAxisFlags(imgui.ImPlotAxisFlags_None) + PlotAxisFlagsNoLabel = PlotAxisFlags(imgui.ImPlotAxisFlags_NoLabel) + PlotAxisFlagsNoGridLines = PlotAxisFlags(imgui.ImPlotAxisFlags_NoGridLines) + PlotAxisFlagsNoTickMarks = PlotAxisFlags(imgui.ImPlotAxisFlags_NoTickMarks) + PlotAxisFlagsNoTickLabels = PlotAxisFlags(imgui.ImPlotAxisFlags_NoTickLabels) + PlotAxisFlagsLogScale = PlotAxisFlags(imgui.ImPlotAxisFlags_LogScale) + PlotAxisFlagsTime = PlotAxisFlags(imgui.ImPlotAxisFlags_Time) + PlotAxisFlagsInvert = PlotAxisFlags(imgui.ImPlotAxisFlags_Invert) + PlotAxisFlagsLockMin = PlotAxisFlags(imgui.ImPlotAxisFlags_LockMin) + PlotAxisFlagsLockMax = PlotAxisFlags(imgui.ImPlotAxisFlags_LockMax) + PlotAxisFlagsLock = PlotAxisFlags(imgui.ImPlotAxisFlags_Lock) + PlotAxisFlagsNoDecorations = PlotAxisFlags(imgui.ImPlotAxisFlags_NoDecorations) )