Documentation
¶
Overview ¶
Package components is standard component library of GoVision.
Index ¶
- Constants
- func BuildCreateWindowMessage(w *Window) base.Message
- func BuildDestroyWindowMessage(w *Window) base.Message
- func DefaultDrawBottomBar(canvas base.TCanvas, bottomBounds base.Rect, borders []rune)
- func DefaultDrawLeftOrRightBorder(canvas base.TCanvas, bounds base.Rect, borders []rune)
- func DefaultDrawTitleBar(canvas base.TCanvas, titleBounds base.Rect, caption string, borders []rune)
- type BorderType
- type OnTimer
- type Timer
- type Window
- func (w *Window) AddChild(c base.TComponent)
- func (w *Window) Canvas() base.TCanvas
- func (w *Window) Children() []base.TComponent
- func (w *Window) ClientCanvas() base.TCanvas
- func (w *Window) Draw()
- func (w *Window) GetBackgroundColor() tcell.Color
- func (w *Window) GetBounds() base.Rect
- func (w *Window) GetClientBounds() base.Rect
- func (w *Window) GetEnabled() bool
- func (w *Window) GetFocused() bool
- func (w *Window) GetForegroundColor() tcell.Color
- func (w *Window) GetMessageBus() base.Bus
- func (w *Window) GetOnActivate() base.OnActivate
- func (w *Window) GetOnChangeBounds() base.OnChangeBounds
- func (w *Window) GetOnDraw() base.OnDraw
- func (w *Window) GetOnEnabled() base.OnEnabled
- func (w *Window) GetOnReceiveMessage() base.OnReceiveMessage
- func (w *Window) GetParent() base.TComponent
- func (w *Window) GetVisible() bool
- func (w *Window) GetZorder() int
- func (w *Window) HandleMessage(msg base.Message) bool
- func (w *Window) Handler() uuid.UUID
- func (w *Window) Name() string
- func (w *Window) RemoveChild(c base.TComponent)
- func (w *Window) SetBackgroundColor(c tcell.Color)
- func (w *Window) SetBounds(r base.Rect)
- func (w *Window) SetEnabled(e bool)
- func (w *Window) SetFocused(f bool)
- func (w *Window) SetForegroundColor(c tcell.Color)
- func (w *Window) SetOnActivate(f base.OnActivate)
- func (w *Window) SetOnChangeBounds(f base.OnChangeBounds)
- func (w *Window) SetOnDraw(f base.OnDraw)
- func (w *Window) SetOnEnabled(f base.OnEnabled)
- func (w *Window) SetOnReceiveMessage(f base.OnReceiveMessage)
- func (w *Window) SetParent(p base.TComponent)
- func (w *Window) SetVisible(s bool)
- func (w *Window) SetZorder(o int)
- type WindowBorder
Constants ¶
const ( // BorderTypeSingle border with single line. BorderTypeSingle = 0 // BorderTypeDouble border with double line. BorderTypeDouble = 1 // BorderTypeEmpty border without line. BorderTypeEmpty = 2 // ULCorner upper left corner. ULCorner = 0 // HLine horizontal line. HLine = 1 // CloseLeft close character left. CloseLeft = 2 // CloseRight close character right. CloseRight = 3 // Close close character. Close = 4 // URCorner upper right corner. URCorner = 5 // CaptionSpace space before/after caption in title bar. CaptionSpace = 6 // LLCorner lower left corner. LLCorner = 7 // LRCorner lower right corner. LRCorner = 8 // VLine vertical line. VLine = 9 )
Variables ¶
This section is empty.
Functions ¶
func BuildCreateWindowMessage ¶
BuildCreateWindowMessage return a message when create window.
func BuildDestroyWindowMessage ¶
BuildDestroyWindowMessage return a message when destroy window.
func DefaultDrawBottomBar ¶
DefaultDrawBottomBar draw bottom border of window. Give └───────────┘
func DefaultDrawLeftOrRightBorder ¶
DefaultDrawLeftOrRightBorder draw left or right border of window.
Types ¶
type Timer ¶
type Timer struct { // OnTimer is callback when timer is done. OnTimer OnTimer base.Component // contains filtered or unexported fields }
Timer is the base object of all widget.
func (*Timer) GetIntervale ¶
GetIntervale return interval value.
func (*Timer) SetEnabled ¶
SetEnabled active or disable timer.
func (*Timer) SetIntervale ¶
SetIntervale set new interval and reset timer.
type Window ¶
type Window struct { // Window title. Caption string // Border Border WindowBorder // contains filtered or unexported fields }
Window is the base object of all widget.
func (*Window) AddChild ¶
func (w *Window) AddChild(c base.TComponent)
AddChild add a child to component.
func (*Window) Children ¶
func (w *Window) Children() []base.TComponent
Children return list of children of component.
func (*Window) ClientCanvas ¶
ClientCanvas return client canvas of view.
func (*Window) GetBackgroundColor ¶
GetBackgroundColor return background color.
func (*Window) GetClientBounds ¶
GetClientBounds return client bounds.
func (*Window) GetEnabled ¶
GetEnabled return is component is enable.
func (*Window) GetFocused ¶
GetFocused return true if component has focus.
func (*Window) GetForegroundColor ¶
GetForegroundColor return text color.
func (*Window) GetMessageBus ¶
GetMessageBus return application bus.
func (*Window) GetOnActivate ¶
func (w *Window) GetOnActivate() base.OnActivate
GetOnActivate return OnActivate event.
func (*Window) GetOnChangeBounds ¶
func (w *Window) GetOnChangeBounds() base.OnChangeBounds
GetOnChangeBounds return OnChangeBounds event.
func (*Window) GetOnEnabled ¶
GetOnEnabled return function to be execute when receive enable message.
func (*Window) GetOnReceiveMessage ¶
func (w *Window) GetOnReceiveMessage() base.OnReceiveMessage
GetOnReceiveMessage return function to be execute when receive message.
func (*Window) GetParent ¶
func (w *Window) GetParent() base.TComponent
GetParent get parent component.
func (*Window) HandleMessage ¶
HandleMessage is use to manage message.
func (*Window) RemoveChild ¶
func (w *Window) RemoveChild(c base.TComponent)
RemoveChild remove a child to component.
func (*Window) SetBackgroundColor ¶
SetBackgroundColor change background color.
func (*Window) SetForegroundColor ¶
SetForegroundColor change text color.
func (*Window) SetOnActivate ¶
func (w *Window) SetOnActivate(f base.OnActivate)
SetOnActivate set OnActivate event.
func (*Window) SetOnChangeBounds ¶
func (w *Window) SetOnChangeBounds(f base.OnChangeBounds)
SetOnChangeBounds set OnChangeBounds event.
func (*Window) SetOnEnabled ¶
SetOnEnabled set function when set enable.
func (*Window) SetOnReceiveMessage ¶
func (w *Window) SetOnReceiveMessage(f base.OnReceiveMessage)
SetOnReceiveMessage set function when receive message.
func (*Window) SetParent ¶
func (w *Window) SetParent(p base.TComponent)
SetParent set parent component.
type WindowBorder ¶
type WindowBorder struct { // Border type. Type BorderType // Border color. BackgroundColor tcell.Color // Border color. ForegroundColor tcell.Color }
WindowBorder is border style