core

package module
v0.0.0-...-6e8b2b8 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Class_Element = "goui.ui.core.Element"
	Class_Control = "goui.ui.core.Control"
)

Variables

View Source
var (
	MD_Element = base.Extend(base.MD_ManagedObject, Class_Element,
		base.MDSettingConstructor(constructorElement),
		base.MetaModelBuilder(elementMetaDataBuilder),
	)
	MD_Control = base.Extend(MD_Element, Class_Control,
		base.MDSettingConstructor(constructorControl),
		base.MetaModelBuilder(controlMetaDataBuilder),
		PD_Controle_visible,
	)
)
View Source
var (
	PD_Controle_visible = base.MDSettingPropertyDef{base.PropertyDef{Name: "visible", Type: base.PropTypeBool, Required: true, DefaultValue: true}}
)

Functions

func BindingDescriptionOfBinding

func BindingDescriptionOfBinding(b com.Binding) com.BindingDescription

func BindingDescriptionOfContext

func BindingDescriptionOfContext(c com.Context) com.BindingDescription

func CalcBindingDescription

func CalcBindingDescription(baseBD com.BindingDescription, itemBD com.BindingDescription) com.BindingDescription

func PropTypeCSSSize

func PropTypeCSSSize(v interface{}) (interface{}, bool)

func TypeCheckCSSSize

func TypeCheckCSSSize(v interface{}) bool

func TypeCheckControl

func TypeCheckControl(v interface{}) bool

Types

type CSSClass

type CSSClass string

func (CSSClass) Class

func (c CSSClass) Class() string

func (CSSClass) Mtype

func (c CSSClass) Mtype() base.SettingType

type CSSSize

type CSSSize string

func CSSSizeOf

func CSSSizeOf(s string) CSSSize

func (CSSSize) String

func (s CSSSize) String() string

type Control

type Control interface {
	Element
	IsVisible() bool
}

func NewControl

func NewControl(n, id string, s ...base.InstanceSetting) Control

func NewControlMD

func NewControlMD(md ControlMetaData, id string, s ...base.InstanceSetting) Control

type ControlMetaData

type ControlMetaData interface {
	ElementMetaData
	CSSClasses() []string
}

type Core

type Core interface {
	StartApplication(placeAt string, appl Control)
	RegisterCSS(css string)
	RegisterMetaData(n string, md base.ManagedObjectMetaData)
	GetMetaData(n string) (base.ManagedObjectMetaData, bool)
	SetModel(name string, m model.Model) model.Model
	GetModel(name string) (model.Model, bool)
	GetModelName(m model.Model) (string, bool)
}

func GetCore

func GetCore() Core

type Element

type Element interface {
	base.ManagedObject
	Id() string
	Renderer() func(rm RenderManager, item Element)
	DomRef() (js.Value, bool)
	OnBeforeRendering()
	OnAfterRendering(v js.Value)
	FindDomChild(child Element) (js.Value, error)
	FindDomById(id string) (js.Value, error)
	Context() com.Context
	SetParent(p base.Object)
	Parent() Element
	ElementById(id string) Element
	BindObject(bd com.BindingDescription)
	BindAggregation(n string, b com.BindingDescription, of base.ObjectFactory)
	BindProperty(n string, b com.BindingDescription)
	String() string
}

type ElementMetaData

type ElementMetaData interface {
	base.ManagedObjectMetaData
	GetElementName() string
	Renderer() Renderer
}

type ISRenderer

type ISRenderer struct {
	Renderer Renderer
}

func (ISRenderer) IType

func (i ISRenderer) IType() base.SettingType

func (ISRenderer) Mtype

func (i ISRenderer) Mtype() base.SettingType

type RenderManager

type RenderManager interface {
	OpenStart(tag string)
	OpenStartElement(tag string, item Element)
	OpenEnd()
	Close(tag string)
	WriteControl(item Control)
	WriteText(txt string)
	WriteAttr(name string, value interface{})
	WriteStyle(name, value interface{})
	WriteClass(cls ...string)

	Build() (js.Value, error)
}

func NewRenderManager

func NewRenderManager() RenderManager

type Renderer

type Renderer func(rm RenderManager, item Element)

Directories

Path Synopsis
message module
mvc module
brick Module

Jump to

Keyboard shortcuts

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