m

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: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Class_Button         = "goui.ui.m.Button"
	Class_InputBase      = "goui.ui.m.InputBase"
	Class_Input          = "goui.ui.m.Input"
	Class_Label          = "goui.ui.m.Label"
	Class_List           = "goui.ui.m.List"
	Class_ListBase       = "goui.ui.m.ListBase"
	Class_ListItemBase   = "goui.ui.m.ListItemBase"
	Class_Panel          = "goui.ui.m.Panel"
	Class_CustomListItem = "goui.ui.m.CustomListItem"

	Event_inputHTML = "inputHTML"
	Event_expand    = "expand"

	//Fired when the context menu is opened. When the context menu is opened, the binding context of the item is set to the given contextMenu.
	Event_beforeOpenContextMenu = "beforeOpenContextMenu"

	Event_delete = "delete"

	Event_itemPress = "itemPress"

	Event_selectionChange = "selectionChange"

	Event_swipe = "swipe"

	// Fires after items binding is updated and processed by the control.
	Event_updateFinished = "updateFinished"

	//Fires before items binding is updated (e.g. sorting, filtering)
	//Note: Event handler should not invalidate the control.
	Event_updateStarted = "updateStarted"

	Event_press = "press"
)
View Source
const (
	InputType_Text   InputType = "text"
	InputType_Passwd           = "password"
	InputType_Tel              = "tel"
	InputType_Url              = "url"
	InputType_EMail            = "email"
)

Variables

View Source
var (
	MD_InputBase = base.Extend(core.MD_Control, Class_InputBase,
		base.MDSettingConstructor(constructorInputBase),
		base.MDSettingPropertyDef{base.PropertyDef{Name: "value", Type: base.PropTypeString, Required: false, DefaultValue: ""}},
		base.MDSettingPropertyDef{base.PropertyDef{Name: "name", Type: base.PropTypeString, Required: true, DefaultValue: ""}},
		base.MDSettingPropertyDef{base.PropertyDef{Name: "editable", Type: base.PropTypeBool, Required: true, DefaultValue: true}},
	).(core.ControlMetaData)
	MD_Input = base.Extend(MD_InputBase, Class_Input,
		base.MDSettingConstructor(constructorInput),
		base.MDSettingPropertyDef{base.PropertyDef{Name: "type", Type: PropTypeInputType, Required: true, DefaultValue: InputType_Text}},
		base.MDSettingEventDef{base.EventDef{Name: Event_inputHTML}},
	).(core.ControlMetaData)
	MD_Label = base.Extend(core.MD_Control, Class_Label,
		base.MDSettingConstructor(constructorLabel),
		base.MDSettingPropertyDef{base.PropertyDef{Name: "text", Type: base.PropTypeString, Required: false, DefaultValue: ""}},
	).(core.ControlMetaData)
	MD_ListBase = base.Extend(core.MD_Control, Class_ListBase,
		base.MDSettingConstructor(constructorListBase),
		base.MDSettingPropertyDef{base.PropertyDef{Name: "mode", Type: PropTypeListMode, DefaultValue: ListMode_None}},
		base.MDSettingAggregationDef{base.AggregationDef{Name: "items", Cardinality: "0..n", Type: TypeCheckListItemBase}},
		base.MDSettingEventDef{base.EventDef{Name: Event_beforeOpenContextMenu}},
		base.MDSettingEventDef{base.EventDef{Name: Event_delete}},
		base.MDSettingEventDef{base.EventDef{Name: Event_itemPress}},
		base.MDSettingEventDef{base.EventDef{Name: Event_selectionChange}},
		base.MDSettingEventDef{base.EventDef{Name: Event_swipe}},
		base.MDSettingEventDef{base.EventDef{Name: Event_updateFinished}},
		base.MDSettingEventDef{base.EventDef{Name: Event_updateStarted}},
	).(core.ControlMetaData)
	MD_ListItemBase = base.Extend(core.MD_Control, Class_ListItemBase,
		base.MDSettingConstructor(constructorListItemBase),
		base.MDSettingPropertyDef{base.PropertyDef{Name: "counter", Type: base.PropTypeInt, Required: true, DefaultValue: 0}},
		base.MDSettingPropertyDef{base.PropertyDef{Name: "selected", Type: base.PropTypeBool, Required: true, DefaultValue: false}},
		base.MDSettingPropertyDef{base.PropertyDef{Name: "unread", Type: base.PropTypeBool, Required: true, DefaultValue: false}},
		base.MDSettingPropertyDef{base.PropertyDef{Name: "visible", Type: base.PropTypeBool, Required: true, DefaultValue: false}},
	).(core.ControlMetaData)
	MD_List = base.Extend(MD_ListBase, Class_List,
		base.MDSettingConstructor(constructorList),
		base.MDSettingAggregationDef{base.AggregationDef{Name: "content", Cardinality: "0..n", Type: core.TypeCheckControl}},
		base.MDSettingEventDef{base.EventDef{Name: Event_expand}},
	).(core.ControlMetaData)
	MD_CustomListItem = base.Extend(MD_ListItemBase, Class_CustomListItem,
		base.MDSettingConstructor(constructorCustomListItem),
		base.MDSettingAggregationDef{base.AggregationDef{Name: "content", Cardinality: "0..n", Type: core.TypeCheckControl}},
	).(core.ControlMetaData)
	MD_Panel = base.Extend(core.MD_Control, Class_Panel,
		base.MDSettingConstructor(constructorPanel),
		base.MDSettingAggregationDef{base.AggregationDef{Name: "content", Cardinality: "0..n", Type: core.TypeCheckControl}},
	).(core.ControlMetaData)
	MD_Button = base.Extend(core.MD_Control, Class_Button,
		base.MDSettingConstructor(constructorButton),
		base.MDSettingEventDef{base.EventDef{Name: Event_press}},
		base.MDSettingPropertyDef{base.PropertyDef{Name: "text", Type: base.PropTypeString, Required: false, DefaultValue: ""}},
	).(core.ControlMetaData)
)

Functions

func NewEvent

func NewEvent(c core.Control, data interface{}) com.EventParam

func PropTypeInputType

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

func PropTypeListMode

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

func TypeCheckInputType

func TypeCheckInputType(v interface{}) bool

func TypeCheckListItemBase

func TypeCheckListItemBase(v interface{}) bool

func TypeCheckListMode

func TypeCheckListMode(v interface{}) bool

Types

type Button

type Button interface {
	core.Control
	AttachPress(data com.EventData, fn com.EventHandler)
	AttachPressOnce(data com.EventData, fn com.EventHandler)
	FirePress(param com.EventParam)
	DetachPress(fn com.EventHandler)
	HasPress() bool
}

type CustomerListItem

type CustomerListItem interface {
	ListItemBase
}

type EventListItemPresse

type EventListItemPresse struct {
	// contains filtered or unexported fields
}

type EventListSelectionChange

type EventListSelectionChange struct {
	// contains filtered or unexported fields
}

type Input

type Input interface {
	InputBase
}

type InputBase

type InputBase interface {
	core.Control
}

type InputType

type InputType string

type Label

type Label interface {
	core.Control
}

type List

type List interface {
	ListBase
}

type ListBase

type ListBase interface {
	core.Control
	AttachBeforeOpenContextMenu(data com.EventData, fn com.EventHandler)
	AttachBeforeOpenContextMenuOnce(data com.EventData, fn com.EventHandler)
	FireBeforeOpenContextMenu(param com.EventParam)
	DetachBeforeOpenContextMenu(fn com.EventHandler)
	HasBeforeOpenContextMenu() bool
	AttachDelete(data com.EventData, fn com.EventHandler)
	AttachDeleteOnce(data com.EventData, fn com.EventHandler)
	FireDelete(param com.EventParam)
	DetachDelete(fn com.EventHandler)
	HasDelete() bool
	AttachItemPress(data com.EventData, fn com.EventHandler)
	AttachItemPressOnce(data com.EventData, fn com.EventHandler)
	FireItemPress(param com.EventParam)
	DetachItemPress(fn com.EventHandler)
	HasItemPress() bool
	AttachSelectionChange(data com.EventData, fn com.EventHandler)
	AttachSelectionChangeOnce(data com.EventData, fn com.EventHandler)
	FireSelectionChange(param com.EventParam)
	DetachSelectionChange(fn com.EventHandler)
	HasSelectionChange() bool
	AttachSwipe(data com.EventData, fn com.EventHandler)
	AttachSwipeOnce(data com.EventData, fn com.EventHandler)
	FireSwipe(param com.EventParam)
	DetachSwipe(fn com.EventHandler)
	HasSwipe() bool
	AttachUpdateFinished(data com.EventData, fn com.EventHandler)
	AttachUpdateFinishedOnce(data com.EventData, fn com.EventHandler)
	FireUpdateFinished(param com.EventParam)
	DetachUpdateFinished(fn com.EventHandler)
	HasUpdateFinished() bool
	AttachUpdateStarted(data com.EventData, fn com.EventHandler)
	AttachUpdateStartedOnce(data com.EventData, fn com.EventHandler)
	FireUpdateStarted(param com.EventParam)
	DetachUpdateStarted(fn com.EventHandler)
	HasUpdateStarted() bool
	GetSelectedItems() []ListItemBase
}

type ListItemBase

type ListItemBase interface {
	core.Control
}

type ListMode

type ListMode string
const (
	ListMode_None         ListMode = "none"
	ListMode_SingleSelect ListMode = "SingleSelect"
	ListMode_MultiSelect  ListMode = "MultiSelect"
)

func (ListMode) IType

func (_ ListMode) IType() base.SettingType

type Panel

type Panel interface {
	core.Control
}

Jump to

Keyboard shortcuts

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