Documentation ¶
Index ¶
- Constants
- Variables
- func AlignTextToFramePadding()
- func CalcTextSize(text string) (width, height float32)
- func Call(f func())
- func CallErr(f func() error) error
- func CallNonBlock(f func())
- func CallVal(f func() interface{}) interface{}
- func CloseCurrentPopup()
- func GetAvaiableRegion() (width, height float32)
- func GetCursorPos() image.Point
- func GetCursorScreenPos() image.Point
- func GetFramePadding() (float32, float32)
- func GetItemInnerSpacing() (float32, float32)
- func GetItemSpacing() (float32, float32)
- func GetMousePos() image.Point
- func GetWindowPadding() (float32, float32)
- func IsItemActive() bool
- func IsItemClicked(mouseButton MouseButton) bool
- func IsItemHovered() bool
- func IsKeyDown(key Key) bool
- func IsKeyPressed(key Key) bool
- func IsKeyReleased(key Key) bool
- func IsMouseClicked(button MouseButton) bool
- func IsMouseDoubleClicked(button MouseButton) bool
- func IsMouseDown(button MouseButton) bool
- func IsMouseReleased(button MouseButton) bool
- func IsWindowAppearing() bool
- func IsWindowCollapsed() bool
- func IsWindowFocused(flags FocusedFlags) bool
- func IsWindowHovered(flags HoveredFlags) bool
- func LoadImage(imgPath string) (*image.RGBA, error)
- func Msgbox(title, content string)
- func MsgboxV(title, content string, buttons MsgboxButtons, ...)
- func OpenPopup(name string)
- func PopClipRect()
- func PopFont()
- func PopItemWidth()
- func PopStyle()
- func PopStyleColor()
- func PopStyleColorV(count int)
- func PopStyleV(count int)
- func PopTextWrapPos()
- func PushButtonTextAlign(width, height float32)
- func PushClipRect(clipRectMin, clipRectMax image.Point, intersectWithClipRect bool)
- func PushColorButton(col color.RGBA)
- func PushColorButtonActive(col color.RGBA)
- func PushColorButtonHovered(col color.RGBA)
- func PushColorFrameBg(col color.RGBA)
- func PushColorText(col color.RGBA)
- func PushColorTextDisabled(col color.RGBA)
- func PushColorWindowBg(col color.RGBA)
- func PushFont(font imgui.Font)
- func PushFramePadding(width, height float32)
- func PushItemSpacing(width, height float32)
- func PushItemWidth(width float32)
- func PushSelectableTextAlign(width, height float32)
- func PushTextWrapPos()
- func PushWindowPadding(width, height float32)
- func Run(run func())
- func SameLine()
- func SetItemDefaultFocus()
- func SetKeyboardFocusHere()
- func SetKeyboardFocusHereV(i int)
- func SetMouseCursor(cursor MouseCursorType)
- func SetNextWindowPos(x, y float32)
- func SetNextWindowSize(width, height float32)
- func SetNextWindowSizeV(width, height float32, condition ExecCondition)
- func SingleWindow(title string, layout Layout)
- func SingleWindowWithMenuBar(title string, layout Layout)
- func ToVec2(pt image.Point) imgui.Vec2
- func ToVec4Color(col color.RGBA) imgui.Vec4
- func Update()
- func Vec4ToRGBA(vec4 imgui.Vec4) color.RGBA
- func Window(title string, x, y, width, height float32, layout Layout)
- func WindowV(title string, open *bool, flags WindowFlags, x, y, width, height float32, ...)
- type ArrowButtonWidget
- type BulletTextWidget
- type BulletWidget
- type ButtonWidget
- type Canvas
- func (c *Canvas) AddBezierCurve(pos0, cp0, cp1, pos1 image.Point, color color.RGBA, thickness float32, ...)
- func (c *Canvas) AddCircle(center image.Point, radius float32, color color.RGBA, thickness float32)
- func (c *Canvas) AddCircleFilled(center image.Point, radius float32, color color.RGBA)
- func (c *Canvas) AddImage(texture *Texture, pMin, pMax image.Point)
- func (c *Canvas) AddImageV(texture *Texture, pMin, pMax image.Point, uvMin, uvMax image.Point, ...)
- func (c *Canvas) AddLine(p1, p2 image.Point, color color.RGBA, thickness float32)
- func (c *Canvas) AddQuad(p1, p2, p3, p4 image.Point, color color.RGBA, thickness float32)
- func (c *Canvas) AddQuadFilled(p1, p2, p3, p4 image.Point, color color.RGBA)
- func (c *Canvas) AddRect(pMin, pMax image.Point, color color.RGBA, rounding float32, ...)
- func (c *Canvas) AddRectFilled(pMin, pMax image.Point, color color.RGBA, rounding float32, ...)
- func (c *Canvas) AddText(pos image.Point, color color.RGBA, text string)
- func (c *Canvas) AddTriangle(p1, p2, p3 image.Point, color color.RGBA, thickness float32)
- func (c *Canvas) AddTriangleFilled(p1, p2, p3 image.Point, color color.RGBA)
- func (c *Canvas) PathArcTo(center image.Point, radius, a_min, a_max float32, num_segments int)
- func (c *Canvas) PathArcToFast(center image.Point, radius float32, a_min_of_12, a_max_of_12 int)
- func (c *Canvas) PathBezierCurveTo(p1, p2, p3 image.Point, num_segments int)
- func (c *Canvas) PathClear()
- func (c *Canvas) PathFillConvex(color color.RGBA)
- func (c *Canvas) PathLineTo(pos image.Point)
- func (c *Canvas) PathLineToMergeDuplicate(pos image.Point)
- func (c *Canvas) PathStroke(color color.RGBA, closed bool, thickness float32)
- type CheckboxWidget
- type ChildWidget
- type ComboCustomWidget
- type ComboFlags
- type ComboWidget
- type ConditionWidget
- type ContextMenuWidget
- type CornerFlags
- type CustomWidget
- type DatePickerWidget
- type DialogResult
- type DialogResultCallback
- type Direction
- type Disposable
- type DragIntWidget
- type DummyWidget
- type ExecCondition
- type FastTabelWidget
- type FocusedFlags
- type GroupWidget
- type HSplitterWidget
- type HoveredFlags
- type ImageButtonWidget
- type ImageState
- type ImageWidget
- type ImageWithFileWidget
- type ImageWithUrlWidget
- type InputFloatWidget
- type InputIntWidget
- type InputTextFlags
- type InputTextMultilineWidget
- type InputTextWidget
- type InvisibleButtonWidget
- type Key
- type LabelWidget
- type Layout
- type LineWidget
- type ListBoxState
- type ListBoxWidget
- type MainMenuBarWidget
- type MasterWindow
- type MasterWindowFlags
- type MenuBarWidget
- type MenuItemWidget
- type MenuWidget
- type MouseButton
- type MouseCursorType
- type MsgboxButtons
- type MsgboxState
- type PlotLinesWidget
- type PopupModalWidget
- type PopupWidget
- type ProgressBarWidget
- type ProgressIndicatorState
- type ProgressIndicatorWidget
- type RadioButtonWidget
- type RowWidget
- type Rows
- type SelectableFlags
- type SelectableWidget
- type SeparatorWidget
- type SliderFloatWidget
- type SliderIntWidget
- type SmallButtonWidget
- type SpacingWidget
- type SplitDirection
- type SplitLayoutState
- type SplitLayoutWidget
- type TabBarFlags
- type TabBarWidget
- type TabItemFlags
- type TabItemWidget
- type TabelWidget
- type Texture
- type TooltipAdvanceWidget
- type TooltipWidget
- type TreeNodeFlags
- type TreeNodeWidget
- type VSplitterWidget
- type Widget
- type WindowFlags
Constants ¶
const ( DirectionLeft = iota DirectionRight = iota DirectionUp = iota DirectionDown = iota )
const ( TextureFilterNearest = iota TextureFilterLinear TextureFilterNearestMipmapNearest TextureFilterLinearMipmapNearest TextureFilterNearestMipmapLinear TextureFilterLinearMipmapLinear )
Texture filtering types.
Variables ¶
var (
Context context
)
Functions ¶
func AlignTextToFramePadding ¶
func AlignTextToFramePadding()
AlignTextToFramePadding vertically aligns upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items. Call if you have text on a line before a framed item.
func CalcTextSize ¶
func Call ¶
func Call(f func())
Call queues function f on the main thread and blocks until the function f finishes.
func CallNonBlock ¶
func CallNonBlock(f func())
CallNonBlock queues function f on the main thread and returns immediately. Does not wait until f finishes.
func CallVal ¶
func CallVal(f func() interface{}) interface{}
CallVal queues function f on the main thread and returns a value returned by f.
func CloseCurrentPopup ¶
func CloseCurrentPopup()
func GetAvaiableRegion ¶
func GetAvaiableRegion() (width, height float32)
func GetCursorPos ¶
func GetCursorScreenPos ¶
func GetFramePadding ¶
func GetItemInnerSpacing ¶
func GetItemSpacing ¶
func GetMousePos ¶
func GetWindowPadding ¶
func IsItemActive ¶
func IsItemActive() bool
func IsItemClicked ¶
func IsItemClicked(mouseButton MouseButton) bool
func IsItemHovered ¶
func IsItemHovered() bool
func IsKeyPressed ¶
func IsKeyReleased ¶
func IsMouseClicked ¶
func IsMouseClicked(button MouseButton) bool
func IsMouseDoubleClicked ¶
func IsMouseDoubleClicked(button MouseButton) bool
func IsMouseDown ¶
func IsMouseDown(button MouseButton) bool
func IsMouseReleased ¶
func IsMouseReleased(button MouseButton) bool
func IsWindowAppearing ¶
func IsWindowAppearing() bool
func IsWindowCollapsed ¶
func IsWindowCollapsed() bool
func IsWindowFocused ¶
func IsWindowFocused(flags FocusedFlags) bool
func IsWindowHovered ¶
func IsWindowHovered(flags HoveredFlags) bool
func MsgboxV ¶
func MsgboxV(title, content string, buttons MsgboxButtons, resultCallback func(DialogResult))
func PopClipRect ¶
func PopClipRect()
func PopItemWidth ¶
func PopItemWidth()
func PopStyleColor ¶
func PopStyleColor()
func PopStyleColorV ¶
func PopStyleColorV(count int)
func PopTextWrapPos ¶
func PopTextWrapPos()
func PushButtonTextAlign ¶
func PushButtonTextAlign(width, height float32)
Alignment for button text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
func PushClipRect ¶
func PushColorButton ¶
func PushColorButtonActive ¶
func PushColorButtonHovered ¶
func PushColorFrameBg ¶
func PushColorText ¶
func PushColorTextDisabled ¶
func PushColorWindowBg ¶
func PushFramePadding ¶
func PushFramePadding(width, height float32)
func PushItemSpacing ¶
func PushItemSpacing(width, height float32)
func PushItemWidth ¶
func PushItemWidth(width float32)
func PushSelectableTextAlign ¶
func PushSelectableTextAlign(width, height float32)
Alignment for selectable text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
func PushTextWrapPos ¶
func PushTextWrapPos()
func PushWindowPadding ¶
func PushWindowPadding(width, height float32)
func Run ¶
func Run(run func())
Run enables mainthread package functionality. To use mainthread package, put your main function code into the run function (the argument to Run) and simply call Run from the real main function.
Run returns when run (argument) function finishes.
func SetItemDefaultFocus ¶
func SetItemDefaultFocus()
func SetKeyboardFocusHere ¶
func SetKeyboardFocusHere()
func SetKeyboardFocusHereV ¶
func SetKeyboardFocusHereV(i int)
func SetMouseCursor ¶
func SetMouseCursor(cursor MouseCursorType)
func SetNextWindowPos ¶
func SetNextWindowPos(x, y float32)
func SetNextWindowSize ¶
func SetNextWindowSize(width, height float32)
func SetNextWindowSizeV ¶
func SetNextWindowSizeV(width, height float32, condition ExecCondition)
func SingleWindow ¶
func SingleWindowWithMenuBar ¶
Types ¶
type ArrowButtonWidget ¶
type ArrowButtonWidget struct {
// contains filtered or unexported fields
}
func ArrowButton ¶
func ArrowButton(id string, dir Direction, onClick func()) *ArrowButtonWidget
func (*ArrowButtonWidget) Build ¶
func (ab *ArrowButtonWidget) Build()
type BulletTextWidget ¶
type BulletTextWidget struct {
// contains filtered or unexported fields
}
func BulletText ¶
func BulletText(text string) *BulletTextWidget
func (*BulletTextWidget) Build ¶
func (bt *BulletTextWidget) Build()
type BulletWidget ¶
type BulletWidget struct{}
func Bullet ¶
func Bullet() *BulletWidget
func (*BulletWidget) Build ¶
func (b *BulletWidget) Build()
type ButtonWidget ¶
type ButtonWidget struct {
// contains filtered or unexported fields
}
func Button ¶
func Button(id string, onClick func()) *ButtonWidget
func ButtonV ¶
func ButtonV(id string, width, height float32, onClick func()) *ButtonWidget
func (*ButtonWidget) Build ¶
func (b *ButtonWidget) Build()
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
func (*Canvas) AddBezierCurve ¶
func (*Canvas) AddCircleFilled ¶
func (*Canvas) AddQuadFilled ¶
func (*Canvas) AddRectFilled ¶
func (*Canvas) AddTriangle ¶
func (*Canvas) AddTriangleFilled ¶
func (*Canvas) PathArcToFast ¶
func (*Canvas) PathBezierCurveTo ¶
func (*Canvas) PathFillConvex ¶
func (*Canvas) PathLineTo ¶
func (*Canvas) PathLineToMergeDuplicate ¶
type CheckboxWidget ¶
type CheckboxWidget struct {
// contains filtered or unexported fields
}
func Checkbox ¶
func Checkbox(text string, selected *bool, onChange func()) *CheckboxWidget
func (*CheckboxWidget) Build ¶
func (c *CheckboxWidget) Build()
type ChildWidget ¶
type ChildWidget struct {
// contains filtered or unexported fields
}
func Child ¶
func Child(id string, border bool, width, height float32, flags WindowFlags, layout Layout) *ChildWidget
func (*ChildWidget) Build ¶
func (c *ChildWidget) Build()
type ComboCustomWidget ¶
type ComboCustomWidget struct {
// contains filtered or unexported fields
}
func ComboCustom ¶
func ComboCustom(label, previewValue string, width float32, flags ComboFlags, layout Layout) *ComboCustomWidget
func (*ComboCustomWidget) Build ¶
func (cc *ComboCustomWidget) Build()
type ComboFlags ¶
type ComboFlags int
const ( // ComboFlagNone default ComboFlags = 0 ComboFlagNone ComboFlags = 0 // ComboFlagPopupAlignLeft aligns the popup toward the left by default. ComboFlagPopupAlignLeft ComboFlags = 1 << 0 // 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 // ComboFlagHeightRegular has max ~8 items visible (default). ComboFlagHeightRegular ComboFlags = 1 << 2 // ComboFlagHeightLarge has max ~20 items visible. ComboFlagHeightLarge ComboFlags = 1 << 3 // ComboFlagHeightLargest has as many fitting items as possible. ComboFlagHeightLargest ComboFlags = 1 << 4 // ComboFlagNoArrowButton displays on the preview box without the square arrow button. ComboFlagNoArrowButton ComboFlags = 1 << 5 // ComboFlagNoPreview displays only a square arrow button. ComboFlagNoPreview ComboFlags = 1 << 6 )
type ComboWidget ¶
type ComboWidget struct {
// contains filtered or unexported fields
}
func Combo ¶
func Combo(label, previewValue string, items []string, selected *int32, width float32, flags ComboFlags, onChange func()) *ComboWidget
func (*ComboWidget) Build ¶
func (c *ComboWidget) Build()
type ConditionWidget ¶
type ConditionWidget struct {
// contains filtered or unexported fields
}
func (*ConditionWidget) Build ¶
func (c *ConditionWidget) Build()
type ContextMenuWidget ¶
type ContextMenuWidget struct {
// contains filtered or unexported fields
}
func ContextMenu ¶
func ContextMenu(layout Layout) *ContextMenuWidget
func ContextMenuV ¶
func ContextMenuV(label string, mouseButton MouseButton, layout Layout) *ContextMenuWidget
func (*ContextMenuWidget) Build ¶
func (c *ContextMenuWidget) Build()
type CornerFlags ¶
type CornerFlags int
const ( CornerFlags_None CornerFlags = 0 CornerFlags_TopLeft CornerFlags = 1 << 0 // 0x1 CornerFlags_TopRight CornerFlags = 1 << 1 // 0x2 CornerFlags_BotLeft CornerFlags = 1 << 2 // 0x4 CornerFlags_BotRight CornerFlags = 1 << 3 // 0x8 CornerFlags_Top CornerFlags = CornerFlags_TopLeft | CornerFlags_TopRight // 0x3 CornerFlags_Bot CornerFlags = CornerFlags_BotLeft | CornerFlags_BotRight // 0xC CornerFlags_Left CornerFlags = CornerFlags_TopLeft | CornerFlags_BotLeft // 0x5 CornerFlags_Right CornerFlags = CornerFlags_TopRight | CornerFlags_BotRight // 0xA CornerFlags_All CornerFlags = 0xF // In your function calls you may use ~0 (= all bits sets) instead of ImDrawCornerFlags_All, as a convenience )
type CustomWidget ¶
type CustomWidget struct {
// contains filtered or unexported fields
}
func Custom ¶
func Custom(builder func()) *CustomWidget
func (*CustomWidget) Build ¶
func (c *CustomWidget) Build()
type DatePickerWidget ¶
type DatePickerWidget struct {
// contains filtered or unexported fields
}
func DatePicker ¶
func DatePicker(id string, date *time.Time, width float32, onChange func()) *DatePickerWidget
func (*DatePickerWidget) Build ¶
func (d *DatePickerWidget) Build()
type DialogResult ¶
type DialogResult uint8
const ( DialogResultOK DialogResult = 1 << iota DialogResultCancel DialogResultYes DialogResultNo )
type DialogResultCallback ¶
type DialogResultCallback func(DialogResult)
type Disposable ¶
type Disposable interface {
Dispose()
}
type DragIntWidget ¶
type DragIntWidget struct {
// contains filtered or unexported fields
}
func DragInt ¶
func DragInt(label string, value *int32) *DragIntWidget
func (*DragIntWidget) Build ¶
func (d *DragIntWidget) Build()
type DummyWidget ¶
type DummyWidget struct {
// contains filtered or unexported fields
}
func Dummy ¶
func Dummy(width, height float32) *DummyWidget
func (*DummyWidget) Build ¶
func (d *DummyWidget) Build()
type ExecCondition ¶
const ( ConditionAlways ExecCondition = ExecCondition(imgui.ConditionAlways) ConditionOnce ExecCondition = ExecCondition(imgui.ConditionOnce) ConditionFirstUseEver ExecCondition = ExecCondition(imgui.ConditionFirstUseEver) ConditionAppearing ExecCondition = ExecCondition(imgui.ConditionAppearing) )
type FastTabelWidget ¶
type FastTabelWidget struct {
// contains filtered or unexported fields
}
func FastTable ¶
func FastTable(label string, border bool, rows Rows) *FastTabelWidget
Create a fast table which only render visible rows. Note this only works with all rows have same height.
func (*FastTabelWidget) Build ¶
func (t *FastTabelWidget) Build()
type FocusedFlags ¶
type FocusedFlags int
const ( // FocusedFlagsNone default FocusedFlags = 0 FocusedFlagsNone FocusedFlags = 0 // FocusedFlagsChildWindows matches if any children of the window is focused FocusedFlagsChildWindows FocusedFlags = 1 << 0 // FocusedFlagsRootWindow tests from root window (top most parent of the current hierarchy) FocusedFlagsRootWindow FocusedFlags = 1 << 1 // FocusedFlagsAnyWindow matches if any window is focused. FocusedFlagsAnyWindow FocusedFlags = 1 << 2 // FocusedFlagsRootAndChildWindows combines FocusedFlagsRootWindow and FocusedFlagsChildWindows. FocusedFlagsRootAndChildWindows = FocusedFlagsRootWindow | FocusedFlagsChildWindows )
type GroupWidget ¶
type GroupWidget struct {
// contains filtered or unexported fields
}
func Group ¶
func Group(layout Layout) *GroupWidget
func (*GroupWidget) Build ¶
func (g *GroupWidget) Build()
type HSplitterWidget ¶
type HSplitterWidget struct {
// contains filtered or unexported fields
}
func (*HSplitterWidget) Build ¶
func (h *HSplitterWidget) Build()
type HoveredFlags ¶
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. 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 )
type ImageButtonWidget ¶
type ImageButtonWidget struct {
// contains filtered or unexported fields
}
func ImageButton ¶
func ImageButton(texture *Texture, width, height float32, onClick func()) *ImageButtonWidget
func ImageButtonV ¶
func (*ImageButtonWidget) Build ¶
func (i *ImageButtonWidget) Build()
type ImageState ¶
type ImageState struct { Texture *Texture // contains filtered or unexported fields }
func (*ImageState) Dispose ¶
func (is *ImageState) Dispose()
type ImageWidget ¶
type ImageWidget struct {
// contains filtered or unexported fields
}
func Image ¶
func Image(texture *Texture, width, height float32) *ImageWidget
func (*ImageWidget) BorderCol ¶
func (i *ImageWidget) BorderCol(x, y, z, w float32) *ImageWidget
func (*ImageWidget) Build ¶
func (i *ImageWidget) Build()
func (*ImageWidget) TintCol ¶
func (i *ImageWidget) TintCol(x, y, z, w float32) *ImageWidget
func (*ImageWidget) Uv0 ¶
func (i *ImageWidget) Uv0(x, y float32) *ImageWidget
func (*ImageWidget) Uv1 ¶
func (i *ImageWidget) Uv1(x, y float32) *ImageWidget
type ImageWithFileWidget ¶
type ImageWithFileWidget struct {
// contains filtered or unexported fields
}
func ImageWithFile ¶
func ImageWithFile(imgPath string, width, height float32) *ImageWithFileWidget
func (*ImageWithFileWidget) Build ¶
func (i *ImageWithFileWidget) Build()
type ImageWithUrlWidget ¶
type ImageWithUrlWidget struct {
// contains filtered or unexported fields
}
func ImageWithUrl ¶
func ImageWithUrl(url string, downloadTimeout time.Duration, width, height float32) *ImageWithUrlWidget
func ImageWithUrlV ¶
func (*ImageWithUrlWidget) Build ¶
func (i *ImageWithUrlWidget) Build()
type InputFloatWidget ¶
type InputFloatWidget struct {
// contains filtered or unexported fields
}
func InputFloat ¶
func InputFloat(label string, width float32, value *float32) *InputFloatWidget
func InputFloatV ¶
func InputFloatV(label string, width float32, value *float32, format string, flags InputTextFlags, onChange func()) *InputFloatWidget
func (*InputFloatWidget) Build ¶
func (i *InputFloatWidget) Build()
type InputIntWidget ¶
type InputIntWidget struct {
// contains filtered or unexported fields
}
func InputIntV ¶
func InputIntV(label string, width float32, value *int32, flags InputTextFlags, onChange func()) *InputIntWidget
func (*InputIntWidget) Build ¶
func (i *InputIntWidget) Build()
type InputTextFlags ¶
type InputTextFlags int
const ( // InputTextFlagsNone sets everything default. InputTextFlagsNone InputTextFlags = 0 // InputTextFlagsCharsDecimal allows 0123456789.+- InputTextFlagsCharsDecimal InputTextFlags = 1 << 0 // InputTextFlagsCharsHexadecimal allow 0123456789ABCDEFabcdef InputTextFlagsCharsHexadecimal InputTextFlags = 1 << 1 // InputTextFlagsCharsUppercase turns a..z into A..Z. InputTextFlagsCharsUppercase InputTextFlags = 1 << 2 // InputTextFlagsCharsNoBlank filters out spaces, tabs. InputTextFlagsCharsNoBlank InputTextFlags = 1 << 3 // InputTextFlagsAutoSelectAll selects entire text when first taking mouse focus. InputTextFlagsAutoSelectAll InputTextFlags = 1 << 4 // InputTextFlagsEnterReturnsTrue returns 'true' when Enter is pressed (as opposed to when the value was modified). InputTextFlagsEnterReturnsTrue InputTextFlags = 1 << 5 // InputTextFlagsCallbackCompletion for callback on pressing TAB (for completion handling). InputTextFlagsCallbackCompletion InputTextFlags = 1 << 6 // InputTextFlagsCallbackHistory for callback on pressing Up/Down arrows (for history handling). InputTextFlagsCallbackHistory InputTextFlags = 1 << 7 // InputTextFlagsCallbackAlways for callback on each iteration. User code may query cursor position, modify text buffer. InputTextFlagsCallbackAlways InputTextFlags = 1 << 8 // 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 = 1 << 9 // InputTextFlagsAllowTabInput when pressing TAB to input a '\t' character into the text field. InputTextFlagsAllowTabInput InputTextFlags = 1 << 10 // 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 // InputTextFlagsNoHorizontalScroll disables following the cursor horizontally. InputTextFlagsNoHorizontalScroll InputTextFlags = 1 << 12 // InputTextFlagsAlwaysInsertMode sets insert mode. InputTextFlagsAlwaysInsertMode InputTextFlags = 1 << 13 // InputTextFlagsReadOnly sets read-only mode. InputTextFlagsReadOnly InputTextFlags = 1 << 14 // InputTextFlagsPassword sets password mode, display all characters as '*'. InputTextFlagsPassword InputTextFlags = 1 << 15 // 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 = 1 << 16 // InputTextFlagsCharsScientific allows 0123456789.+-*/eE (Scientific notation input). InputTextFlagsCharsScientific InputTextFlags = 1 << 17 )
type InputTextMultilineWidget ¶
type InputTextMultilineWidget struct {
// contains filtered or unexported fields
}
func InputTextMultiline ¶
func InputTextMultiline(label string, text *string, width, height float32, flags InputTextFlags, cb imgui.InputTextCallback, onChange func()) *InputTextMultilineWidget
func (*InputTextMultilineWidget) Build ¶
func (i *InputTextMultilineWidget) Build()
type InputTextWidget ¶
type InputTextWidget struct {
// contains filtered or unexported fields
}
func InputTextV ¶
func InputTextV(label string, width float32, value *string, flags InputTextFlags, cb imgui.InputTextCallback, onChange func()) *InputTextWidget
func (*InputTextWidget) Build ¶
func (i *InputTextWidget) Build()
type InvisibleButtonWidget ¶
type InvisibleButtonWidget struct {
// contains filtered or unexported fields
}
func InvisibleButton ¶
func InvisibleButton(id string, width, height float32, onClick func()) *InvisibleButtonWidget
func (*InvisibleButtonWidget) Build ¶
func (ib *InvisibleButtonWidget) Build()
type Key ¶
type Key int
const ( KeyUnknown Key = Key(glfw.KeyUnknown) KeySpace Key = Key(glfw.KeySpace) KeyApostrophe Key = Key(glfw.KeyApostrophe) KeyComma Key = Key(glfw.KeyComma) KeyMinus Key = Key(glfw.KeyMinus) KeyPeriod Key = Key(glfw.KeyPeriod) KeySlash Key = Key(glfw.KeySlash) Key0 Key = Key(glfw.Key0) Key1 Key = Key(glfw.Key1) Key2 Key = Key(glfw.Key2) Key3 Key = Key(glfw.Key3) Key4 Key = Key(glfw.Key4) Key5 Key = Key(glfw.Key5) Key6 Key = Key(glfw.Key6) Key7 Key = Key(glfw.Key7) Key8 Key = Key(glfw.Key8) Key9 Key = Key(glfw.Key9) KeySemicolon Key = Key(glfw.KeySemicolon) KeyEqual Key = Key(glfw.KeyEqual) KeyA Key = Key(glfw.KeyA) KeyB Key = Key(glfw.KeyB) KeyC Key = Key(glfw.KeyC) KeyD Key = Key(glfw.KeyD) KeyE Key = Key(glfw.KeyE) KeyF Key = Key(glfw.KeyF) KeyG Key = Key(glfw.KeyG) KeyH Key = Key(glfw.KeyH) KeyI Key = Key(glfw.KeyI) KeyJ Key = Key(glfw.KeyJ) KeyK Key = Key(glfw.KeyK) KeyL Key = Key(glfw.KeyL) KeyM Key = Key(glfw.KeyM) KeyN Key = Key(glfw.KeyN) KeyO Key = Key(glfw.KeyO) KeyP Key = Key(glfw.KeyP) KeyQ Key = Key(glfw.KeyQ) KeyR Key = Key(glfw.KeyR) KeyS Key = Key(glfw.KeyS) KeyT Key = Key(glfw.KeyT) KeyU Key = Key(glfw.KeyU) KeyV Key = Key(glfw.KeyV) KeyW Key = Key(glfw.KeyW) KeyX Key = Key(glfw.KeyX) KeyY Key = Key(glfw.KeyY) KeyZ Key = Key(glfw.KeyZ) KeyLeftBracket Key = Key(glfw.KeyLeftBracket) KeyBackslash Key = Key(glfw.KeyBackslash) KeyRightBracket Key = Key(glfw.KeyRightBracket) KeyGraveAccent Key = Key(glfw.KeyGraveAccent) KeyWorld1 Key = Key(glfw.KeyWorld1) KeyWorld2 Key = Key(glfw.KeyWorld2) KeyEscape Key = Key(glfw.KeyEscape) KeyEnter Key = Key(glfw.KeyEnter) KeyTab Key = Key(glfw.KeyTab) KeyBackspace Key = Key(glfw.KeyBackspace) KeyInsert Key = Key(glfw.KeyInsert) KeyDelete Key = Key(glfw.KeyDelete) KeyRight Key = Key(glfw.KeyRight) KeyLeft Key = Key(glfw.KeyLeft) KeyDown Key = Key(glfw.KeyDown) KeyUp Key = Key(glfw.KeyUp) KeyPageUp Key = Key(glfw.KeyPageUp) KeyPageDown Key = Key(glfw.KeyPageDown) KeyHome Key = Key(glfw.KeyHome) KeyEnd Key = Key(glfw.KeyEnd) KeyCapsLock Key = Key(glfw.KeyCapsLock) KeyScrollLock Key = Key(glfw.KeyScrollLock) KeyNumLock Key = Key(glfw.KeyNumLock) KeyPrintScreen Key = Key(glfw.KeyPrintScreen) KeyPause Key = Key(glfw.KeyPause) KeyF1 Key = Key(glfw.KeyF1) KeyF2 Key = Key(glfw.KeyF2) KeyF3 Key = Key(glfw.KeyF3) KeyF4 Key = Key(glfw.KeyF4) KeyF5 Key = Key(glfw.KeyF5) KeyF6 Key = Key(glfw.KeyF6) KeyF7 Key = Key(glfw.KeyF7) KeyF8 Key = Key(glfw.KeyF8) KeyF9 Key = Key(glfw.KeyF9) KeyF10 Key = Key(glfw.KeyF10) KeyF11 Key = Key(glfw.KeyF11) KeyF12 Key = Key(glfw.KeyF12) KeyF13 Key = Key(glfw.KeyF13) KeyF14 Key = Key(glfw.KeyF14) KeyF15 Key = Key(glfw.KeyF15) KeyF16 Key = Key(glfw.KeyF16) KeyF17 Key = Key(glfw.KeyF17) KeyF18 Key = Key(glfw.KeyF18) KeyF19 Key = Key(glfw.KeyF19) KeyF20 Key = Key(glfw.KeyF20) KeyF21 Key = Key(glfw.KeyF21) KeyF22 Key = Key(glfw.KeyF22) KeyF23 Key = Key(glfw.KeyF23) KeyF24 Key = Key(glfw.KeyF24) KeyF25 Key = Key(glfw.KeyF25) KeyKP0 Key = Key(glfw.KeyKP0) KeyKP1 Key = Key(glfw.KeyKP1) KeyKP2 Key = Key(glfw.KeyKP2) KeyKP3 Key = Key(glfw.KeyKP3) KeyKP4 Key = Key(glfw.KeyKP4) KeyKP5 Key = Key(glfw.KeyKP5) KeyKP6 Key = Key(glfw.KeyKP6) KeyKP7 Key = Key(glfw.KeyKP7) KeyKP8 Key = Key(glfw.KeyKP8) KeyKP9 Key = Key(glfw.KeyKP9) KeyKPDecimal Key = Key(glfw.KeyKPDecimal) KeyKPDivide Key = Key(glfw.KeyKPDivide) KeyKPMultiply Key = Key(glfw.KeyKPMultiply) KeyKPSubtract Key = Key(glfw.KeyKPSubtract) KeyKPAdd Key = Key(glfw.KeyKPAdd) KeyKPEnter Key = Key(glfw.KeyKPEnter) KeyKPEqual Key = Key(glfw.KeyKPEqual) KeyLeftShift Key = Key(glfw.KeyLeftShift) KeyLeftControl Key = Key(glfw.KeyLeftControl) KeyLeftAlt Key = Key(glfw.KeyLeftAlt) KeyLeftSuper Key = Key(glfw.KeyLeftSuper) KeyRightShift Key = Key(glfw.KeyRightShift) KeyRightControl Key = Key(glfw.KeyRightControl) KeyRightAlt Key = Key(glfw.KeyRightAlt) KeyRightSuper Key = Key(glfw.KeyRightSuper) KeyMenu Key = Key(glfw.KeyMenu) KeyLast Key = Key(glfw.KeyLast) )
These key codes are inspired by the USB HID Usage Tables v1.12 (p. 53-60), but re-arranged to map to 7-bit ASCII for printable keys (function keys are put in the 256+ range).
type LabelWidget ¶
type LabelWidget struct {
// contains filtered or unexported fields
}
func Label ¶
func Label(label string) *LabelWidget
func LabelWrapped ¶
func LabelWrapped(label string) *LabelWidget
func (*LabelWidget) Build ¶
func (l *LabelWidget) Build()
type Layout ¶
type Layout []Widget
func PrepareMsgbox ¶
func PrepareMsgbox() Layout
Embed various Msgboxs to layout. Invoke this function in the same layout level where you call g.Msgbox.
func RangeBuilder ¶
Batch create widgets and render only which is visible.
type LineWidget ¶
type LineWidget struct {
// contains filtered or unexported fields
}
func Line ¶
func Line(widgets ...Widget) *LineWidget
func (*LineWidget) Build ¶
func (l *LineWidget) Build()
type ListBoxState ¶
type ListBoxState struct {
// contains filtered or unexported fields
}
func (*ListBoxState) Dispose ¶
func (s *ListBoxState) Dispose()
type ListBoxWidget ¶
type ListBoxWidget struct {
// contains filtered or unexported fields
}
func ListBox ¶
func ListBox(id string, items []string, onChange func(selectedIndex int), onDClick func(selectedIndex int)) *ListBoxWidget
func (*ListBoxWidget) Build ¶
func (l *ListBoxWidget) Build()
type MainMenuBarWidget ¶
type MainMenuBarWidget struct {
// contains filtered or unexported fields
}
func MainMenuBar ¶
func MainMenuBar(layout Layout) *MainMenuBarWidget
func (*MainMenuBarWidget) Build ¶
func (m *MainMenuBarWidget) Build()
type MasterWindow ¶
type MasterWindow struct {
// contains filtered or unexported fields
}
func NewMasterWindow ¶
func NewMasterWindow(title string, width, height int, flags MasterWindowFlags, loadFontFunc func()) *MasterWindow
func (*MasterWindow) GetPos ¶
func (w *MasterWindow) GetPos() (x, y int)
Return position of master window.
func (*MasterWindow) GetSize ¶
func (w *MasterWindow) GetSize() (width, height int)
Return size of master window.
func (*MasterWindow) Main ¶
func (w *MasterWindow) Main(loopFunc func())
Call the main loop. loopFunc will be used to construct the ui.
func (*MasterWindow) SetBgColor ¶
func (w *MasterWindow) SetBgColor(color color.RGBA)
Set background color of master window.
func (*MasterWindow) SetDropCallback ¶
func (w *MasterWindow) SetDropCallback(cb func([]string))
func (*MasterWindow) SetPos ¶
func (w *MasterWindow) SetPos(x, y int)
Set position of master window.
type MasterWindowFlags ¶
type MasterWindowFlags imgui.GLFWWindowFlags
const ( // Specifies the window will be fixed size. MasterWindowFlagsNotResizable MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsNotResizable) // Specifies whether the window is maximized. MasterWindowFlagsMaximized MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsMaximized) // Specifies whether the window will be always-on-top. MasterWindowFlagsFloating MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsFloating) // Specifies whether the window will be frameless. MasterWindowFlagsFrameless MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsFrameless) // Specifies whether the window will be transparent. MasterWindowFlagsTransparent MasterWindowFlags = MasterWindowFlags(imgui.GLFWWindowFlagsTransparent) )
type MenuBarWidget ¶
type MenuBarWidget struct {
// contains filtered or unexported fields
}
func MenuBar ¶
func MenuBar(layout Layout) *MenuBarWidget
func (*MenuBarWidget) Build ¶
func (m *MenuBarWidget) Build()
type MenuItemWidget ¶
type MenuItemWidget struct {
// contains filtered or unexported fields
}
func MenuItem ¶
func MenuItem(label string, onClick func()) *MenuItemWidget
func MenuItemV ¶
func MenuItemV(label string, selected, enabled bool, onClick func()) *MenuItemWidget
func (*MenuItemWidget) Build ¶
func (m *MenuItemWidget) Build()
type MenuWidget ¶
type MenuWidget struct {
// contains filtered or unexported fields
}
func Menu ¶
func Menu(label string, layout Layout) *MenuWidget
func (*MenuWidget) Build ¶
func (m *MenuWidget) Build()
type MouseButton ¶
type MouseButton int
const ( MouseButtonLeft MouseButton = 0 MouseButtonRight MouseButton = 1 MouseButtonMiddle MouseButton = 2 )
type MouseCursorType ¶
type MouseCursorType int
const ( // MouseCursorNone no mouse cursor MouseCursorNone MouseCursorType = -1 // MouseCursorArrow standard arrow mouse cursor MouseCursorArrow MouseCursorType = 0 // MouseCursorTextInput when hovering over InputText, etc. MouseCursorTextInput MouseCursorType = 1 // MouseCursorResizeAll (Unused by imgui functions) MouseCursorResizeAll MouseCursorType = 2 // MouseCursorResizeNS when hovering over an horizontal border MouseCursorResizeNS MouseCursorType = 3 // MouseCursorResizeEW when hovering over a vertical border or a column MouseCursorResizeEW MouseCursorType = 4 // MouseCursorResizeNESW when hovering over the bottom-left corner of a window MouseCursorResizeNESW MouseCursorType = 5 // MouseCursorResizeNWSE when hovering over the bottom-right corner of a window MouseCursorResizeNWSE MouseCursorType = 6 // MouseCursorHand (Unused by imgui functions. Use for e.g. hyperlinks) MouseCursorHand MouseCursorType = 7 MouseCursorCount MouseCursorType = 8 )
type MsgboxButtons ¶
type MsgboxButtons uint8
const ( MsgboxButtonsYesNo MsgboxButtons = 1 << iota MsgboxButtonsOkCancel MsgboxButtonsOk )
type MsgboxState ¶
type MsgboxState struct {
// contains filtered or unexported fields
}
func (*MsgboxState) Dispose ¶
func (ms *MsgboxState) Dispose()
type PlotLinesWidget ¶
type PlotLinesWidget struct {
// contains filtered or unexported fields
}
func PlotLines ¶
func PlotLines(label string, values []float32) *PlotLinesWidget
func PlotLinesV ¶
func (*PlotLinesWidget) Build ¶
func (p *PlotLinesWidget) Build()
type PopupModalWidget ¶
type PopupModalWidget struct {
// contains filtered or unexported fields
}
func PopupModal ¶
func PopupModal(name string, layout Layout) *PopupModalWidget
func PopupModalV ¶
func PopupModalV(name string, open *bool, flags WindowFlags, layout Layout) *PopupModalWidget
func (*PopupModalWidget) Build ¶
func (p *PopupModalWidget) Build()
type PopupWidget ¶
type PopupWidget struct {
// contains filtered or unexported fields
}
func Popup ¶
func Popup(name string, flags WindowFlags, layout Layout) *PopupWidget
func (*PopupWidget) Build ¶
func (p *PopupWidget) Build()
type ProgressBarWidget ¶
type ProgressBarWidget struct {
// contains filtered or unexported fields
}
func ProgressBar ¶
func ProgressBar(fraction float32, width, height float32, overlay string) *ProgressBarWidget
func (*ProgressBarWidget) Build ¶
func (p *ProgressBarWidget) Build()
type ProgressIndicatorState ¶
type ProgressIndicatorState struct {
// contains filtered or unexported fields
}
func (*ProgressIndicatorState) Dispose ¶
func (ps *ProgressIndicatorState) Dispose()
func (*ProgressIndicatorState) Update ¶
func (ps *ProgressIndicatorState) Update()
type ProgressIndicatorWidget ¶
type ProgressIndicatorWidget struct {
// contains filtered or unexported fields
}
func ProgressIndicator ¶
func ProgressIndicator(id, label string, width, height, radius float32) *ProgressIndicatorWidget
func (*ProgressIndicatorWidget) Build ¶
func (p *ProgressIndicatorWidget) Build()
type RadioButtonWidget ¶
type RadioButtonWidget struct {
// contains filtered or unexported fields
}
func RadioButton ¶
func RadioButton(text string, active bool, onChange func()) *RadioButtonWidget
func (*RadioButtonWidget) Build ¶
func (r *RadioButtonWidget) Build()
type SelectableFlags ¶
type SelectableFlags int
const ( // SelectableFlagsNone default SelectableFlags = 0 SelectableFlagsNone SelectableFlags = 0 // SelectableFlagsDontClosePopups makes clicking the selectable not close any parent popup windows. SelectableFlagsDontClosePopups SelectableFlags = 1 << 0 // SelectableFlagsSpanAllColumns allows the selectable frame to span all columns (text will still fit in current column). SelectableFlagsSpanAllColumns SelectableFlags = 1 << 1 // SelectableFlagsAllowDoubleClick generates press events on double clicks too. SelectableFlagsAllowDoubleClick SelectableFlags = 1 << 2 // SelectableFlagsDisabled disallows selection and displays text in a greyed out color. SelectableFlagsDisabled SelectableFlags = 1 << 3 )
type SelectableWidget ¶
type SelectableWidget struct {
// contains filtered or unexported fields
}
func Selectable ¶
func Selectable(label string, onClick func()) *SelectableWidget
func SelectableV ¶
func SelectableV(label string, selected bool, flags SelectableFlags, width, height float32, onClick func()) *SelectableWidget
func (*SelectableWidget) Build ¶
func (s *SelectableWidget) Build()
type SeparatorWidget ¶
type SeparatorWidget struct{}
func Separator ¶
func Separator() *SeparatorWidget
func (*SeparatorWidget) Build ¶
func (s *SeparatorWidget) Build()
type SliderFloatWidget ¶
type SliderFloatWidget struct {
// contains filtered or unexported fields
}
func SliderFloat ¶
func SliderFloat(label string, value *float32, min, max float32, format string) *SliderFloatWidget
func (*SliderFloatWidget) Build ¶
func (sf *SliderFloatWidget) Build()
type SliderIntWidget ¶
type SliderIntWidget struct {
// contains filtered or unexported fields
}
func SliderInt ¶
func SliderInt(label string, value *int32, min, max int32, format string) *SliderIntWidget
func (*SliderIntWidget) Build ¶
func (s *SliderIntWidget) Build()
type SmallButtonWidget ¶
type SmallButtonWidget struct {
// contains filtered or unexported fields
}
func SmallButton ¶
func SmallButton(id string, onClick func()) *SmallButtonWidget
func (*SmallButtonWidget) Build ¶
func (sb *SmallButtonWidget) Build()
type SpacingWidget ¶
type SpacingWidget struct{}
func Spacing ¶
func Spacing() *SpacingWidget
func (*SpacingWidget) Build ¶
func (s *SpacingWidget) Build()
type SplitDirection ¶
type SplitDirection uint8
const ( DirectionHorizontal SplitDirection = 1 << iota DirectionVertical )
type SplitLayoutState ¶
type SplitLayoutState struct {
// contains filtered or unexported fields
}
func (*SplitLayoutState) Dispose ¶
func (s *SplitLayoutState) Dispose()
type SplitLayoutWidget ¶
type SplitLayoutWidget struct {
// contains filtered or unexported fields
}
func SplitLayout ¶
func SplitLayout(id string, direction SplitDirection, border bool, sashPos float32, layout1, layout2 Widget) *SplitLayoutWidget
func (*SplitLayoutWidget) Build ¶
func (s *SplitLayoutWidget) Build()
type TabBarFlags ¶
type TabBarFlags int
const ( // TabBarFlagsNone default TabBarFlags = 0. TabBarFlagsNone TabBarFlags = 0 // TabBarFlagsReorderable Allow manually dragging tabs to re-order them + New tabs are appended at the end of list TabBarFlagsReorderable TabBarFlags = 1 << 0 // TabBarFlagsAutoSelectNewTabs Automatically select new tabs when they appear TabBarFlagsAutoSelectNewTabs TabBarFlags = 1 << 1 // TabBarFlagsTabListPopupButton Disable buttons to open the tab list popup TabBarFlagsTabListPopupButton TabBarFlags = 1 << 2 // 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 // TabBarFlagsNoTabListScrollingButtons Disable scrolling buttons (apply when fitting policy is // TabBarFlagsFittingPolicyScroll) TabBarFlagsNoTabListScrollingButtons TabBarFlags = 1 << 4 // TabBarFlagsNoTooltip Disable tooltips when hovering a tab TabBarFlagsNoTooltip TabBarFlags = 1 << 5 // TabBarFlagsFittingPolicyResizeDown Resize tabs when they don't fit TabBarFlagsFittingPolicyResizeDown TabBarFlags = 1 << 6 // TabBarFlagsFittingPolicyScroll Add scroll buttons when tabs don't fit TabBarFlagsFittingPolicyScroll TabBarFlags = 1 << 7 // TabBarFlagsFittingPolicyMask combines // TabBarFlagsFittingPolicyResizeDown and TabBarFlagsFittingPolicyScroll TabBarFlagsFittingPolicyMask TabBarFlags = TabBarFlagsFittingPolicyResizeDown | TabBarFlagsFittingPolicyScroll // TabBarFlagsFittingPolicyDefault alias for TabBarFlagsFittingPolicyResizeDown TabBarFlagsFittingPolicyDefault TabBarFlags = TabBarFlagsFittingPolicyResizeDown )
type TabBarWidget ¶
type TabBarWidget struct {
// contains filtered or unexported fields
}
func TabBar ¶
func TabBar(id string, layout Layout) *TabBarWidget
func TabBarV ¶
func TabBarV(id string, flags TabBarFlags, layout Layout) *TabBarWidget
func (*TabBarWidget) Build ¶
func (t *TabBarWidget) Build()
type TabItemFlags ¶
type TabItemFlags int
const ( // TabItemFlagsNone default TabItemFlags = 0 TabItemFlagsNone TabItemFlags = 0 // 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 // TabItemFlagsSetSelected Trigger flag to programmatically make the tab selected when calling BeginTabItem() TabItemFlagsSetSelected TabItemFlags = 1 << 1 // 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 // TabItemFlagsNoPushID Don't call PushID(tab->ID)/PopID() on BeginTabItem()/EndTabItem() TabItemFlagsNoPushID TabItemFlags = 1 << 3 )
type TabItemWidget ¶
type TabItemWidget struct {
// contains filtered or unexported fields
}
func TabItem ¶
func TabItem(label string, layout Layout) *TabItemWidget
func TabItemV ¶
func TabItemV(label string, open *bool, flags TabItemFlags, layout Layout) *TabItemWidget
func (*TabItemWidget) Build ¶
func (t *TabItemWidget) Build()
type TabelWidget ¶
type TabelWidget struct {
// contains filtered or unexported fields
}
func (*TabelWidget) Build ¶
func (t *TabelWidget) Build()
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
func NewTextureFromRgba ¶
Create new texture from rgba. Note: this function has to be invokded in a go routine. If call this in mainthread will result in stuck.
type TooltipAdvanceWidget ¶
type TooltipAdvanceWidget struct {
// contains filtered or unexported fields
}
func TooltipAdvance ¶
func TooltipAdvance(layout Layout) *TooltipAdvanceWidget
func (*TooltipAdvanceWidget) Build ¶
func (t *TooltipAdvanceWidget) Build()
type TooltipWidget ¶
type TooltipWidget struct {
// contains filtered or unexported fields
}
func Tooltip ¶
func Tooltip(tip string) *TooltipWidget
func (*TooltipWidget) Build ¶
func (t *TooltipWidget) Build()
type TreeNodeFlags ¶
type TreeNodeFlags int
const ( // TreeNodeFlagsNone default TreeNodeFlags = 0 TreeNodeFlagsNone TreeNodeFlags = 0 // TreeNodeFlagsSelected draws as selected. TreeNodeFlagsSelected TreeNodeFlags = 1 << 0 // TreeNodeFlagsFramed draws full colored frame (e.g. for CollapsingHeader). TreeNodeFlagsFramed TreeNodeFlags = 1 << 1 // TreeNodeFlagsAllowItemOverlap hit testing to allow subsequent widgets to overlap this one. TreeNodeFlagsAllowItemOverlap TreeNodeFlags = 1 << 2 // 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 // TreeNodeFlagsNoAutoOpenOnLog doesn't automatically and temporarily open node when Logging is active // (by default logging will automatically open tree nodes). TreeNodeFlagsNoAutoOpenOnLog TreeNodeFlags = 1 << 4 // TreeNodeFlagsDefaultOpen defaults node to be open. TreeNodeFlagsDefaultOpen TreeNodeFlags = 1 << 5 // TreeNodeFlagsOpenOnDoubleClick needs double-click to open node. TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = 1 << 6 // 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 // TreeNodeFlagsLeaf allows no collapsing, no arrow (use as a convenience for leaf nodes). TreeNodeFlagsLeaf TreeNodeFlags = 1 << 8 // TreeNodeFlagsBullet displays a bullet instead of an arrow. TreeNodeFlagsBullet TreeNodeFlags = 1 << 9 // 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 // 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 // TreeNodeFlagsSpanFullWidth extends hit box to the left-most and right-most edges (bypass the indented area). TreeNodeFlagsSpanFullWidth TreeNodeFlags = 1 << 12 // (items submitted between TreeNode and TreePop) TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = 1 << 13 // TreeNodeFlagsCollapsingHeader combines TreeNodeFlagsFramed and TreeNodeFlagsNoAutoOpenOnLog. TreeNodeFlagsCollapsingHeader TreeNodeFlags = TreeNodeFlagsFramed | TreeNodeFlagsNoTreePushOnOpen | TreeNodeFlagsNoAutoOpenOnLog )
type TreeNodeWidget ¶
type TreeNodeWidget struct {
// contains filtered or unexported fields
}
func TreeNode ¶
func TreeNode(label string, flags TreeNodeFlags, layout Layout) *TreeNodeWidget
func TreeNodeV ¶
func TreeNodeV(label string, flags TreeNodeFlags, eventHandler func(), layout Layout) *TreeNodeWidget
Create TreeNode with eventHandler You could detect events (e.g. IsItemClicked IsMouseDoubleClicked etc...) and handle them for TreeNode inside eventHandler
func (*TreeNodeWidget) Build ¶
func (t *TreeNodeWidget) Build()
type VSplitterWidget ¶
type VSplitterWidget struct {
// contains filtered or unexported fields
}
func (*VSplitterWidget) Build ¶
func (v *VSplitterWidget) Build()
type WindowFlags ¶
type WindowFlags int
const ( // WindowFlagsNone default WindowFlags = 0 WindowFlagsNone WindowFlags = 0 // WindowFlagsNoTitleBar disables title-bar. WindowFlagsNoTitleBar WindowFlags = 1 << 0 // WindowFlagsNoResize disables user resizing with the lower-right grip. WindowFlagsNoResize WindowFlags = 1 << 1 // WindowFlagsNoMove disables user moving the window. WindowFlagsNoMove WindowFlags = 1 << 2 // WindowFlagsNoScrollbar disables scrollbars. Window can still scroll with mouse or programmatically. WindowFlagsNoScrollbar WindowFlags = 1 << 3 // 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 // WindowFlagsNoCollapse disables user collapsing window by double-clicking on it. WindowFlagsNoCollapse WindowFlags = 1 << 5 // WindowFlagsAlwaysAutoResize resizes every window to its content every frame. WindowFlagsAlwaysAutoResize WindowFlags = 1 << 6 // WindowFlagsNoBackground disables drawing background color (WindowBg, etc.) and outside border. Similar as using // SetNextWindowBgAlpha(0.0f). WindowFlagsNoBackground WindowFlags = 1 << 7 // WindowFlagsNoSavedSettings will never load/save settings in .ini file. WindowFlagsNoSavedSettings WindowFlags = 1 << 8 // WindowFlagsNoMouseInputs disables catching mouse, hovering test with pass through. WindowFlagsNoMouseInputs WindowFlags = 1 << 9 // WindowFlagsMenuBar has a menu-bar. WindowFlagsMenuBar WindowFlags = 1 << 10 // 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 // WindowFlagsNoFocusOnAppearing disables taking focus when transitioning from hidden to visible state. WindowFlagsNoFocusOnAppearing WindowFlags = 1 << 12 // WindowFlagsNoBringToFrontOnFocus disables bringing window to front when taking focus. e.g. clicking on it or // programmatically giving it focus. WindowFlagsNoBringToFrontOnFocus WindowFlags = 1 << 13 // WindowFlagsAlwaysVerticalScrollbar always shows vertical scrollbar, even if ContentSize.y < Size.y . WindowFlagsAlwaysVerticalScrollbar WindowFlags = 1 << 14 // WindowFlagsAlwaysHorizontalScrollbar always shows horizontal scrollbar, even if ContentSize.x < Size.x . WindowFlagsAlwaysHorizontalScrollbar WindowFlags = 1 << 15 // WindowFlagsAlwaysUseWindowPadding ensures child windows without border uses style.WindowPadding (ignored by // default for non-bordered child windows, because more convenient). WindowFlagsAlwaysUseWindowPadding WindowFlags = 1 << 16 WindowFlagsNoNavInputs WindowFlags = 1 << 18 // (e.g. skipped by CTRL+TAB) WindowFlagsNoNavFocus WindowFlags = 1 << 19 // 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 WindowFlagsNoNav WindowFlags = WindowFlagsNoNavInputs | WindowFlagsNoNavFocus // WindowFlagsNoDecoration combines WindowFlagsNoTitleBar, WindowFlagsNoResize, WindowFlagsNoScrollbar and // WindowFlagsNoCollapse. WindowFlagsNoDecoration WindowFlags = WindowFlagsNoTitleBar | WindowFlagsNoResize | WindowFlagsNoScrollbar | WindowFlagsNoCollapse // WindowFlagsNoInputs combines WindowFlagsNoMouseInputs, WindowFlagsNoNavInputs and WindowFlagsNoNavFocus. WindowFlagsNoInputs WindowFlags = WindowFlagsNoMouseInputs | WindowFlagsNoNavInputs | WindowFlagsNoNavFocus )
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
examples
|
|
Package imgui contains all the functions to create an immediate mode graphical user interface based on Dear ImGui.
|
Package imgui contains all the functions to create an immediate mode graphical user interface based on Dear ImGui. |