Documentation
¶
Index ¶
- type BaseComponent
- func (c *BaseComponent) Align(s string)
- func (c *BaseComponent) Bounds() image.Rectangle
- func (c *BaseComponent) Draw(ctx draw2d.GraphicContext)
- func (c *BaseComponent) Fill(col color.Color)
- func (c *BaseComponent) Font(font string)
- func (c *BaseComponent) GetInsets() (int, int, int, int)
- func (c *BaseComponent) GetType() string
- func (c *BaseComponent) Height() int
- func (c *BaseComponent) Inset(inset int)
- func (c *BaseComponent) InsetBounds() image.Rectangle
- func (c *BaseComponent) IsUpdateRequired() bool
- func (c *BaseComponent) Layout(_ draw2d.GraphicContext) bool
- func (c *BaseComponent) LineWidth(f float64)
- func (c *BaseComponent) SetBounds(b image.Rectangle)
- func (c *BaseComponent) SetPainter(painter Painter)
- func (c *BaseComponent) SetType(t string)
- func (c *BaseComponent) Stroke(col color.Color)
- func (c *BaseComponent) StrokeFill(col color.Color)
- func (c *BaseComponent) Width() int
- type Component
- type Container
- type Image
- type Painter
- type Text
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseComponent ¶
type BaseComponent struct {
Type string
// contains filtered or unexported fields
}
func (*BaseComponent) Align ¶
func (c *BaseComponent) Align(s string)
func (*BaseComponent) Bounds ¶
func (c *BaseComponent) Bounds() image.Rectangle
func (*BaseComponent) Draw ¶
func (c *BaseComponent) Draw(ctx draw2d.GraphicContext)
func (*BaseComponent) Fill ¶
func (c *BaseComponent) Fill(col color.Color)
func (*BaseComponent) Font ¶
func (c *BaseComponent) Font(font string)
func (*BaseComponent) GetType ¶
func (c *BaseComponent) GetType() string
func (*BaseComponent) Height ¶
func (c *BaseComponent) Height() int
func (*BaseComponent) Inset ¶
func (c *BaseComponent) Inset(inset int)
func (*BaseComponent) InsetBounds ¶
func (c *BaseComponent) InsetBounds() image.Rectangle
func (*BaseComponent) IsUpdateRequired ¶
func (c *BaseComponent) IsUpdateRequired() bool
func (*BaseComponent) Layout ¶
func (c *BaseComponent) Layout(_ draw2d.GraphicContext) bool
Layout the component. returns true if it has changed something
func (*BaseComponent) LineWidth ¶
func (c *BaseComponent) LineWidth(f float64)
func (*BaseComponent) SetBounds ¶
func (c *BaseComponent) SetBounds(b image.Rectangle)
func (*BaseComponent) SetPainter ¶
func (c *BaseComponent) SetPainter(painter Painter)
func (*BaseComponent) SetType ¶
func (c *BaseComponent) SetType(t string)
func (*BaseComponent) Stroke ¶
func (c *BaseComponent) Stroke(col color.Color)
func (*BaseComponent) StrokeFill ¶
func (c *BaseComponent) StrokeFill(col color.Color)
func (*BaseComponent) Width ¶
func (c *BaseComponent) Width() int
type Component ¶
type Component interface {
GetType() string
Bounds() image.Rectangle
SetBounds(image.Rectangle)
Draw(draw2d.GraphicContext)
Layout(draw2d.GraphicContext) bool
IsUpdateRequired() bool
Width() int
Height() int
Inset(int)
Align(string)
Font(string)
SetType(string)
Fill(color.Color)
Stroke(color.Color)
StrokeFill(color.Color)
LineWidth(float64)
}
Component is an entity within a frame
type Container ¶
func ColScaleContainer ¶
ColScaleContainer lays out it's components based on specific scaling horizontally
func FixedContainer ¶
func TitledContainer ¶
type Image ¶
type Image struct {
BaseComponent
// contains filtered or unexported fields
}
type Painter ¶
type Painter func(*draw2dimg.GraphicContext)
type Text ¶
type Text struct {
BaseComponent
// contains filtered or unexported fields
}
Text is a simple Component which renders a formatted string.
func NewText ¶
NewText creates a new Text component using the provided string. The string is passed to fmt.Sprintf() so it uses the same formatting.
type Value ¶
type Value struct {
BaseComponent
// contains filtered or unexported fields
}
Value is similar to Text except it consists of a Label as well as the text output. The label is rendered on the left of the component, whilst the value on the right