dion

package
v0.0.0-...-dfd1d14 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit()

Exit выходит из приложения

func GetDPI

func GetDPI() (float32, float32)

GetDPI возвращает dpi

func Init

func Init()

Init инициализирует библиотеку

func Run

func Run() int

Run запускает цикл обработки сообщений

Types

type AbsoluteLayout

type AbsoluteLayout interface {
	Layout
	AddWidget(w widget)
}

func NewAbsoluteLayout

func NewAbsoluteLayout() AbsoluteLayout

type Button

type Button interface {
	// contains filtered or unexported methods
}

func NewButton

func NewButton(text string, x, y, width, height, fontSize float32, onClick interface{}) Button

NewButton создает новую кнопку

type Canvas

type Canvas struct {
	Child []CanvasObject
}

type CanvasObject

type CanvasObject interface {
	SetColorRGBA(color Color)
	// contains filtered or unexported methods
}

func NewRectangle

func NewRectangle(x, y, width, height float32, filled bool, color Color, strokeWidth float32) CanvasObject

type Color

type Color struct {
	R, G, B, A byte
}

type GridLayout

type GridLayout interface {
	Layout
	AddWidget(w widget, row, col uint32)
	SetPadding(x, y float32)
}

TODO: add x and y offsets

func NewGridLayout

func NewGridLayout(x, y float32, rows, cols uint32) GridLayout

type Label

type Label interface {
	SetTextColor(textColor Color)
	SetText(text string)
	SetFontName(fontName string)
	SetFontSize(fontSize float32)
	SetTextAlignment(hAlign LabelHorizontalAlign, vAlign LabelVerticalAlign)
	// contains filtered or unexported methods
}

func NewLabel

func NewLabel(text, fontName string, x, y, width, height, fontSize float32, textColor Color) Label

NewLabel создает новый текст

type LabelHorizontalAlign

type LabelHorizontalAlign int32
const (
	LabelLeftH LabelHorizontalAlign = iota
	LabelRightH
	LabelCenterH
	LabelJustifiedH
)

type LabelVerticalAlign

type LabelVerticalAlign int32
const (
	LabelTopV LabelVerticalAlign = iota
	LabelBottomV
	LabelCenterV
)

type Layout

type Layout interface {
	// contains filtered or unexported methods
}

type StackLayout

type StackLayout interface {
	Layout
	AddWidget(w widget)
	SetPadding(x, y float32)
}

func NewStackLayout

func NewStackLayout(x, y float32, orientation StackLayoutOrientation) StackLayout

type StackLayoutOrientation

type StackLayoutOrientation byte
const (
	StackH StackLayoutOrientation = iota
	StackV
)

type Window

type Window interface {
	SetTitle(title string)
	SetPos(x, y int)
	SetSize(width, height int)

	GetHandle() user32.HWND
	GetTitle() string
	GetSize() (width, height int)
	GetPos() (x, y int)

	Enable(enable bool)

	AttachCallback(callbackType WindowCallbackType, callback interface{})
	DetachCallback(callbackType WindowCallbackType)

	SetWidget(wdgt widget)

	SetBackgroundColor(r, g, b, a byte)
	SetCanvas(canvas *Canvas)

	Close()
	Hide()
	Show()
}

Window определяет внешний интерфейс взаимодействия с окном

func NewWindow

func NewWindow(title string, x, y, width, height int, parent Window) (Window, error)

NewWindow возвращает новый экземпляр окна

type WindowCallbackType

type WindowCallbackType int
const (
	OnLMouseButtonDown WindowCallbackType = iota
	OnLMouseButtonUp

	OnRMouseButtonDown
	OnRMouseButtonUp

	OnMouseMove

	OnClose

	OnResize
)

type WindowState

type WindowState interface {
	GetWindow() *Window

	LoadUIFromFile(filePath string)
	LoadUIFromFileWithInterval(filePath string, interval time.Duration)
}

WindowState внешний интерфейс взаимодействия с движком

func NewWindowEngine

func NewWindowEngine(windowFunctions map[string]interface{}) (WindowState, error)

NewWindowEngine иниициализирует движок для декларативного создания окна

Jump to

Keyboard shortcuts

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