Skip to content

Commit

Permalink
Sync ComboFlags, SelectableFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDang committed Oct 14, 2021
1 parent c45f011 commit 44ef1d5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 37 deletions.
34 changes: 18 additions & 16 deletions ComboFlags.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
package imgui

const (
// ComboFlagNone default = 0
ComboFlagNone = 0
// ComboFlagPopupAlignLeft aligns the popup toward the left by default.
ComboFlagPopupAlignLeft = 1 << 0
// ComboFlagHeightSmall has max ~4 items visible.
// ComboFlagsNone default = 0
ComboFlagsNone = 0
// ComboFlagsPopupAlignLeft aligns the popup toward the left by default.
ComboFlagsPopupAlignLeft = 1 << 0
// ComboFlagsHeightSmall 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 = 1 << 1
// ComboFlagHeightRegular has max ~8 items visible (default).
ComboFlagHeightRegular = 1 << 2
// ComboFlagHeightLarge has max ~20 items visible.
ComboFlagHeightLarge = 1 << 3
// ComboFlagHeightLargest has as many fitting items as possible.
ComboFlagHeightLargest = 1 << 4
// ComboFlagNoArrowButton displays on the preview box without the square arrow button.
ComboFlagNoArrowButton = 1 << 5
// ComboFlagNoPreview displays only a square arrow button.
ComboFlagNoPreview = 1 << 6
ComboFlagsHeightSmall = 1 << 1
// ComboFlagsHeightRegular has max ~8 items visible (default).
ComboFlagsHeightRegular = 1 << 2
// ComboFlagsHeightLarge has max ~20 items visible.
ComboFlagsHeightLarge = 1 << 3
// ComboFlagsHeightLargest has as many fitting items as possible.
ComboFlagsHeightLargest = 1 << 4
// ComboFlagsNoArrowButton displays on the preview box without the square arrow button.
ComboFlagsNoArrowButton = 1 << 5
// ComboFlagsNoPreview displays only a square arrow button.
ComboFlagsNoPreview = 1 << 6

ComboFlagsHeightMask = ComboFlagsHeightSmall | ComboFlagsHeightRegular | ComboFlagsHeightLarge | ComboFlagsHeightLargest
)
14 changes: 7 additions & 7 deletions FocusFlags.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package imgui
type GocusedFlags int

const (
FocusedFlagsNone = 0
FocusedFlagsChildWindows = 1 << 0 // Return true if any children of the window is focused
FocusedFlagsRootWindow = 1 << 1 // Test from root window (top most parent of the current hierarchy)
FocusedFlagsAnyWindow = 1 << 2 // Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ!
FocusedFlagsNoPopupHierarchy = 1 << 3 // Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with ChildWindows or RootWindow)
//FocusedFlagsDockHierarchy = 1 << 4 // Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with ChildWindows or RootWindow)
FocusedFlagsRootAndChildWindows = FocusedFlagsRootWindow | FocusedFlagsChildWindows
FocusedFlagsNone = 0
FocusedFlagsChildWindows = 1 << 0 // Return true if any children of the window is focused
FocusedFlagsRootWindow = 1 << 1 // Test from root window (top most parent of the current hierarchy)
FocusedFlagsAnyWindow = 1 << 2 // Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ!
FocusedFlagsNoPopupHierarchy = 1 << 3 // Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with ChildWindows or RootWindow)
//FocusedFlagsDockHierarchy = 1 << 4 // Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with ChildWindows or RootWindow)
FocusedFlagsRootAndChildWindows = FocusedFlagsRootWindow | FocusedFlagsChildWindows
)
27 changes: 13 additions & 14 deletions HoveredFlags.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package imgui

const (
HoveredFlagsNone = 0 // 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.
HoveredFlagsChildWindows = 1 << 0 // IsWindowHovered() only: Return true if any children of the window is hovered
HoveredFlagsRootWindow = 1 << 1 // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
HoveredFlagsAnyWindow = 1 << 2 // IsWindowHovered() only: Return true if any window is hovered
HoveredFlagsNoPopupHierarchy = 1 << 3 // IsWindowHovered() only: Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with ChildWindows or RootWindow)
//HoveredFlagsDockHierarchy = 1 << 4 // IsWindowHovered() only: Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with ChildWindows or RootWindow)
HoveredFlagsAllowWhenBlockedByPopup = 1 << 5 // Return true even if a popup window is normally blocking access to this item/window
//HoveredFlagsAllowWhenBlockedByModal = 1 << 6 // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
HoveredFlagsAllowWhenBlockedByActiveItem = 1 << 7 // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
HoveredFlagsAllowWhenOverlapped = 1 << 8 // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window
HoveredFlagsAllowWhenDisabled = 1 << 9 // IsItemHovered() only: Return true even if the item is disabled
HoveredFlagsRectOnly = HoveredFlagsAllowWhenBlockedByPopup | HoveredFlagsAllowWhenBlockedByActiveItem | HoveredFlagsAllowWhenOverlapped
HoveredFlagsRootAndChildWindows = HoveredFlagsRootWindow | HoveredFlagsChildWindows
HoveredFlagsNone = 0 // 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.
HoveredFlagsChildWindows = 1 << 0 // IsWindowHovered() only: Return true if any children of the window is hovered
HoveredFlagsRootWindow = 1 << 1 // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
HoveredFlagsAnyWindow = 1 << 2 // IsWindowHovered() only: Return true if any window is hovered
HoveredFlagsNoPopupHierarchy = 1 << 3 // IsWindowHovered() only: Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with ChildWindows or RootWindow)
//HoveredFlagsDockHierarchy = 1 << 4 // IsWindowHovered() only: Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with ChildWindows or RootWindow)
HoveredFlagsAllowWhenBlockedByPopup = 1 << 5 // Return true even if a popup window is normally blocking access to this item/window
//HoveredFlagsAllowWhenBlockedByModal = 1 << 6 // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
HoveredFlagsAllowWhenBlockedByActiveItem = 1 << 7 // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
HoveredFlagsAllowWhenOverlapped = 1 << 8 // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window
HoveredFlagsAllowWhenDisabled = 1 << 9 // IsItemHovered() only: Return true even if the item is disabled
HoveredFlagsRectOnly = HoveredFlagsAllowWhenBlockedByPopup | HoveredFlagsAllowWhenBlockedByActiveItem | HoveredFlagsAllowWhenOverlapped
HoveredFlagsRootAndChildWindows = HoveredFlagsRootWindow | HoveredFlagsChildWindows
)

2 changes: 2 additions & 0 deletions SelectableFlags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ const (
SelectableFlagsAllowDoubleClick = 1 << 2
// SelectableFlagsDisabled disallows selection and displays text in a greyed out color.
SelectableFlagsDisabled = 1 << 3

SelectableFlags_AllowItemOverlap = 1 << 4 // (WIP) Hit testing to allow subsequent widgets to overlap this one
)

0 comments on commit 44ef1d5

Please sign in to comment.