Documentation ¶
Index ¶
- Variables
- func NewGridLayout(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- func NewLinearLayout(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- type GridLayout
- func (e *GridLayout) Draw()
- func (e *GridLayout) Init(window *pixelgl.Window, bounds *pixel.Rect) error
- func (e *GridLayout) IsInitialised() bool
- func (e *GridLayout) NewEvent(window *pixelgl.Window)
- func (e *GridLayout) Reset()
- func (e *GridLayout) ResetPosition()
- func (e *GridLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- type LinearLayout
- func (e *LinearLayout) Draw()
- func (e *LinearLayout) Init(window *pixelgl.Window, bounds *pixel.Rect) error
- func (e *LinearLayout) IsInitialised() bool
- func (e *LinearLayout) NewEvent(window *pixelgl.Window)
- func (e *LinearLayout) Reset()
- func (e *LinearLayout) ResetPosition()
- func (e *LinearLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
Constants ¶
This section is empty.
Variables ¶
var GridLayoutTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "GridLayout"}
The XML name of the element
var LinearLayoutTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "LinearLayout"}
The XML name of the element
Functions ¶
func NewGridLayout ¶
Function to create a new grid layout
func NewLinearLayout ¶
Function to create a new linear layout
Types ¶
type GridLayout ¶
type GridLayout struct { // A grid layout is an element element.Impl // It is also a layout element.LayoutImpl // The element's orientation Orientation util.Orientation `uixml:"http://github.com/bhollier/ui/api/schema orientation,optional"` // The number of columns on each row Columns uint `uixml:"http://github.com/bhollier/ui/api/schema columns,optional"` // The minimum width of a cell CellWidth util.RelativeSize `uixml:"http://github.com/bhollier/ui/api/schema cell-width,optional"` // The minimum height of a cell CellHeight util.RelativeSize `uixml:"http://github.com/bhollier/ui/api/schema cell-height,optional"` // contains filtered or unexported fields }
Layout type for displaying elements in a grid (either vertically or horizontally)
func (*GridLayout) IsInitialised ¶
func (e *GridLayout) IsInitialised() bool
Function to determine whether the element is initialised
func (*GridLayout) NewEvent ¶
func (e *GridLayout) NewEvent(window *pixelgl.Window)
Function that is called when there is a new event
func (*GridLayout) ResetPosition ¶
func (e *GridLayout) ResetPosition()
Function to reset the element's position
func (*GridLayout) UnmarshalXML ¶
func (e *GridLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
Function to unmarshal an XML element into an element. This function is usually only called by xml.Unmarshal
type LinearLayout ¶
type LinearLayout struct { // A linear layout is an element element.Impl // It is also a layout element.LayoutImpl // The element's orientation Orientation util.Orientation `uixml:"http://github.com/bhollier/ui/api/schema orientation,optional"` }
Layout type for displaying elements as a list (either vertically or horizontally)
func (*LinearLayout) IsInitialised ¶
func (e *LinearLayout) IsInitialised() bool
Function to determine whether the element is initialised
func (*LinearLayout) NewEvent ¶
func (e *LinearLayout) NewEvent(window *pixelgl.Window)
Function that is called when there is a new event
func (*LinearLayout) ResetPosition ¶
func (e *LinearLayout) ResetPosition()
Function to reset the element's position
func (*LinearLayout) UnmarshalXML ¶
func (e *LinearLayout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
Function to unmarshal an XML element into an element. This function is usually only called by xml.Unmarshal