layout

package
v0.0.0-...-e7ac65d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GridLayoutTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "GridLayout"}

The XML name of the element

View Source
var LinearLayoutTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "LinearLayout"}

The XML name of the element

Functions

func NewGridLayout

func NewGridLayout(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element

Function to create a new grid layout

func NewLinearLayout

func NewLinearLayout(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element

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) Draw

func (e *GridLayout) Draw()

Function to draw the element

func (*GridLayout) Init

func (e *GridLayout) Init(window *pixelgl.Window, bounds *pixel.Rect) error

Function to initialise the element

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) Reset

func (e *GridLayout) Reset()

Function to reset the element

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) Draw

func (e *LinearLayout) Draw()

Function to draw the element

func (*LinearLayout) Init

func (e *LinearLayout) Init(window *pixelgl.Window, bounds *pixel.Rect) error

Function to initialise the element

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) Reset

func (e *LinearLayout) Reset()

Function to reset the element

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL