Documentation ¶
Index ¶
- func SetFocusHolder(holder FocusHolder)
- type Dropdown
- func (d *Dropdown) AddItem(name string, selected bool)
- func (o *Dropdown) Destroy()
- func (o *Dropdown) Extract()
- func (o *Dropdown) FirstNode() js.Value
- func (d *Dropdown) FocusLeaving()
- func (d *Dropdown) Init(kind SelectorKind, indicator IndicatorKind, caption string)
- func (o *Dropdown) InsertInto(parent js.Value, before js.Value)
- func (d *Dropdown) Root() js.Value
- func (d *Dropdown) SetItem(index int, value bool)
- type DropdownController
- type DropdownList
- func (l *DropdownList) Append(item *Dropdown)
- func (l *DropdownList) Destroy(index int)
- func (l *DropdownList) DestroyAll()
- func (l *DropdownList) Init(container js.Value, index int)
- func (l *DropdownList) Insert(index int, item *Dropdown)
- func (l *DropdownList) Item(index int) *Dropdown
- func (l *DropdownList) Len() int
- func (l *DropdownList) Remove(index int) *Dropdown
- type FocusHolder
- type IndicatorKind
- type OptionalDropdown
- type OptionalPopupBase
- type OptionalSwitch
- type OptionaldropdownItem
- type OptionalpopupInput
- type OptionalpopupTemplateItem
- type OptionalpopupTemplateList
- type OptionalpopupText
- type PopupBase
- func (pb *PopupBase) Confirm(text string, cb func())
- func (o *PopupBase) Destroy()
- func (pb *PopupBase) ErrorMsg(text string, cb func())
- func (o *PopupBase) Extract()
- func (o *PopupBase) FirstNode() js.Value
- func (o *PopupBase) Init()
- func (o *PopupBase) InsertInto(parent js.Value, before js.Value)
- func (pb *PopupBase) Show(title string, content PopupContent, confirmCaption, cancelCaption string)
- func (pb *PopupBase) TextInput(title, label string, cb func(input string))
- type PopupBaseList
- func (l *PopupBaseList) Append(item *PopupBase)
- func (l *PopupBaseList) Destroy(index int)
- func (l *PopupBaseList) DestroyAll()
- func (l *PopupBaseList) Init(container js.Value, index int)
- func (l *PopupBaseList) Insert(index int, item *PopupBase)
- func (l *PopupBaseList) Item(index int) *PopupBase
- func (l *PopupBaseList) Len() int
- func (l *PopupBaseList) Remove(index int) *PopupBase
- type PopupContent
- type SelectorKind
- type Switch
- type SwitchController
- type SwitchList
- func (l *SwitchList) Append(item *Switch)
- func (l *SwitchList) Destroy(index int)
- func (l *SwitchList) DestroyAll()
- func (l *SwitchList) Init(container js.Value, index int)
- func (l *SwitchList) Insert(index int, item *Switch)
- func (l *SwitchList) Item(index int) *Switch
- func (l *SwitchList) Len() int
- func (l *SwitchList) Remove(index int) *Switch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFocusHolder ¶
func SetFocusHolder(holder FocusHolder)
Types ¶
type Dropdown ¶
type Dropdown struct { // Controller is the adapter for events generated from this component. // if nil, events that would be passed to the controller will not be handled. Controller DropdownController Disabled askew.BoolValue CurIndex int // contains filtered or unexported fields }
Dropdown is a DOM component autogenerated by Askew
func NewDropdown ¶
func NewDropdown(kind SelectorKind, indicator IndicatorKind, caption string) *Dropdown
NewDropdown creates a new Dropdown and initializes it.
func (*Dropdown) Destroy ¶
func (o *Dropdown) Destroy()
Destroy destroys this element (and all contained components). If it is currently inserted anywhere, it gets removed before.
func (*Dropdown) Extract ¶
func (o *Dropdown) Extract()
Extract removes this component from its current parent. The component will be in initial state afterwards.
func (*Dropdown) FirstNode ¶
FirstNode returns the first DOM node of this component. It implements the askew.Component interface.
func (*Dropdown) FocusLeaving ¶
func (d *Dropdown) FocusLeaving()
FocusLeaving implements controls.FocusHolder and is called when the focus leaves this dropdown.
func (*Dropdown) Init ¶
func (d *Dropdown) Init(kind SelectorKind, indicator IndicatorKind, caption string)
Init initializes the Dropdown.
func (*Dropdown) InsertInto ¶
InsertInto inserts this component into the given object. The component will be in inserted state afterwards.
The component will be inserted in front of 'before', or at the end if 'before' is 'js.Undefined()'.
type DropdownController ¶
DropdownController can be implemented to handle external events generated by Dropdown
type DropdownList ¶
type DropdownList struct { DefaultController DropdownController // contains filtered or unexported fields }
DropdownList is a list of Dropdown whose manipulation methods auto-update the corresponding nodes in the document.
func (*DropdownList) Append ¶
func (l *DropdownList) Append(item *Dropdown)
Append appends the given item to the list.
func (*DropdownList) Destroy ¶
func (l *DropdownList) Destroy(index int)
Destroy destroys the item at the given index and removes it from the list.
func (*DropdownList) DestroyAll ¶
func (l *DropdownList) DestroyAll()
DestroyAll destroys all items in the list and empties it.
func (*DropdownList) Init ¶
func (l *DropdownList) Init(container js.Value, index int)
Init initializes the list, discarding previous data. The list's items will be placed in the given container, starting at the given index.
func (*DropdownList) Insert ¶
func (l *DropdownList) Insert(index int, item *Dropdown)
Insert inserts the given item at the given index into the list.
func (*DropdownList) Item ¶
func (l *DropdownList) Item(index int) *Dropdown
Item returns the item at the current index.
func (*DropdownList) Len ¶
func (l *DropdownList) Len() int
Len returns the number of items in the list.
func (*DropdownList) Remove ¶
func (l *DropdownList) Remove(index int) *Dropdown
Remove removes the item at the given index from the list and returns it.
type FocusHolder ¶
type FocusHolder interface { // Root returns the root element of the component. Root() js.Value // FocusLeaving is called when the focus is leaving the root element, but // before the focus has actually left. FocusLeaving() }
FocusHolder is a UI component that needs to react when the focus leaves its root element.
type IndicatorKind ¶
type IndicatorKind int
IndicatorKind defines what kind of indicator is displayed in front of a menu item depending on its selection status.
const ( // SelectionIndicator shows a general „selected“ icon if the item is selected. SelectionIndicator IndicatorKind = iota // VisibilityIndicator shows a visibility icon if the item is selected. VisibilityIndicator // InvisibilityIndicator shows an invisibility icon if the item is deselected. InvisibilityIndicator )
type OptionalDropdown ¶
type OptionalDropdown struct { DefaultController DropdownController // contains filtered or unexported fields }
OptionalDropdown is a nillable embeddable container for Dropdown.
func (*OptionalDropdown) Init ¶
func (o *OptionalDropdown) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalDropdown) Item ¶
func (o *OptionalDropdown) Item() *Dropdown
Item returns the current item, or nil if no item is assigned
func (*OptionalDropdown) Remove ¶
func (o *OptionalDropdown) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalDropdown) Set ¶
func (o *OptionalDropdown) Set(value *Dropdown)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionalPopupBase ¶
type OptionalPopupBase struct {
// contains filtered or unexported fields
}
OptionalPopupBase is a nillable embeddable container for PopupBase.
func (*OptionalPopupBase) Init ¶
func (o *OptionalPopupBase) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalPopupBase) Item ¶
func (o *OptionalPopupBase) Item() *PopupBase
Item returns the current item, or nil if no item is assigned
func (*OptionalPopupBase) Remove ¶
func (o *OptionalPopupBase) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalPopupBase) Set ¶
func (o *OptionalPopupBase) Set(value *PopupBase)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionalSwitch ¶
type OptionalSwitch struct { DefaultController SwitchController // contains filtered or unexported fields }
OptionalSwitch is a nillable embeddable container for Switch.
func (*OptionalSwitch) Init ¶
func (o *OptionalSwitch) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalSwitch) Item ¶
func (o *OptionalSwitch) Item() *Switch
Item returns the current item, or nil if no item is assigned
func (*OptionalSwitch) Remove ¶
func (o *OptionalSwitch) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalSwitch) Set ¶
func (o *OptionalSwitch) Set(value *Switch)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionaldropdownItem ¶
type OptionaldropdownItem struct { DefaultController dropdownItemController // contains filtered or unexported fields }
OptionaldropdownItem is a nillable embeddable container for dropdownItem.
func (*OptionaldropdownItem) Init ¶
func (o *OptionaldropdownItem) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionaldropdownItem) Item ¶
func (o *OptionaldropdownItem) Item() *dropdownItem
Item returns the current item, or nil if no item is assigned
func (*OptionaldropdownItem) Remove ¶
func (o *OptionaldropdownItem) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionaldropdownItem) Set ¶
func (o *OptionaldropdownItem) Set(value *dropdownItem)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionalpopupInput ¶
type OptionalpopupInput struct {
// contains filtered or unexported fields
}
OptionalpopupInput is a nillable embeddable container for popupInput.
func (*OptionalpopupInput) Init ¶
func (o *OptionalpopupInput) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalpopupInput) Item ¶
func (o *OptionalpopupInput) Item() *popupInput
Item returns the current item, or nil if no item is assigned
func (*OptionalpopupInput) Remove ¶
func (o *OptionalpopupInput) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalpopupInput) Set ¶
func (o *OptionalpopupInput) Set(value *popupInput)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionalpopupTemplateItem ¶
type OptionalpopupTemplateItem struct {
// contains filtered or unexported fields
}
OptionalpopupTemplateItem is a nillable embeddable container for popupTemplateItem.
func (*OptionalpopupTemplateItem) Init ¶
func (o *OptionalpopupTemplateItem) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalpopupTemplateItem) Item ¶
func (o *OptionalpopupTemplateItem) Item() *popupTemplateItem
Item returns the current item, or nil if no item is assigned
func (*OptionalpopupTemplateItem) Remove ¶
func (o *OptionalpopupTemplateItem) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalpopupTemplateItem) Set ¶
func (o *OptionalpopupTemplateItem) Set(value *popupTemplateItem)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionalpopupTemplateList ¶
type OptionalpopupTemplateList struct {
// contains filtered or unexported fields
}
OptionalpopupTemplateList is a nillable embeddable container for popupTemplateList.
func (*OptionalpopupTemplateList) Init ¶
func (o *OptionalpopupTemplateList) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalpopupTemplateList) Item ¶
func (o *OptionalpopupTemplateList) Item() *popupTemplateList
Item returns the current item, or nil if no item is assigned
func (*OptionalpopupTemplateList) Remove ¶
func (o *OptionalpopupTemplateList) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalpopupTemplateList) Set ¶
func (o *OptionalpopupTemplateList) Set(value *popupTemplateList)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type OptionalpopupText ¶
type OptionalpopupText struct {
// contains filtered or unexported fields
}
OptionalpopupText is a nillable embeddable container for popupText.
func (*OptionalpopupText) Init ¶
func (o *OptionalpopupText) Init(container js.Value, index int)
Init initializes the container to be empty. The contained item, if any, will be placed in the given container at the given index.
func (*OptionalpopupText) Item ¶
func (o *OptionalpopupText) Item() *popupText
Item returns the current item, or nil if no item is assigned
func (*OptionalpopupText) Remove ¶
func (o *OptionalpopupText) Remove() askew.Component
Remove removes the current item and returns it. Returns nil if there is no current item.
func (*OptionalpopupText) Set ¶
func (o *OptionalpopupText) Set(value *popupText)
Set sets the contained item destroying the current one. Give nil as value to simply destroy the current item.
type PopupBase ¶
type PopupBase struct { Display askew.StringValue Visibility askew.StringValue Title askew.StringValue CancelCaption askew.StringValue ConfirmCaption askew.StringValue Content askew.GenericOptional // contains filtered or unexported fields }
PopupBase is a DOM component autogenerated by Askew
func NewPopupBase ¶
func NewPopupBase() *PopupBase
NewPopupBase creates a new component and initializes it with the given parameters.
func (*PopupBase) Destroy ¶
func (o *PopupBase) Destroy()
Destroy destroys this element (and all contained components). If it is currently inserted anywhere, it gets removed before.
func (*PopupBase) ErrorMsg ¶
ErrorMsg shows the popup containing the given text titled as 'Error'. Calls cb after the user dismisses the message.
func (*PopupBase) Extract ¶
func (o *PopupBase) Extract()
Extract removes this component from its current parent. The component will be in initial state afterwards.
func (*PopupBase) FirstNode ¶
FirstNode returns the first DOM node of this component. It implements the askew.Component interface.
func (*PopupBase) Init ¶
func (o *PopupBase) Init()
Init initializes the component with the given arguments.
func (*PopupBase) InsertInto ¶
InsertInto inserts this component into the given object. The component will be in inserted state afterwards.
The component will be inserted in front of 'before', or at the end if 'before' is 'js.Undefined()'.
func (*PopupBase) Show ¶
func (pb *PopupBase) Show(title string, content PopupContent, confirmCaption, cancelCaption string)
Show shows the given content inside the popup. Calling show does not block; you are responsible for awaiting for user confirmation or cancellation via the Cancel() / Confirm() callbacks of the content.
type PopupBaseList ¶
type PopupBaseList struct {
// contains filtered or unexported fields
}
PopupBaseList is a list of PopupBase whose manipulation methods auto-update the corresponding nodes in the document.
func (*PopupBaseList) Append ¶
func (l *PopupBaseList) Append(item *PopupBase)
Append appends the given item to the list.
func (*PopupBaseList) Destroy ¶
func (l *PopupBaseList) Destroy(index int)
Destroy destroys the item at the given index and removes it from the list.
func (*PopupBaseList) DestroyAll ¶
func (l *PopupBaseList) DestroyAll()
DestroyAll destroys all items in the list and empties it.
func (*PopupBaseList) Init ¶
func (l *PopupBaseList) Init(container js.Value, index int)
Init initializes the list, discarding previous data. The list's items will be placed in the given container, starting at the given index.
func (*PopupBaseList) Insert ¶
func (l *PopupBaseList) Insert(index int, item *PopupBase)
Insert inserts the given item at the given index into the list.
func (*PopupBaseList) Item ¶
func (l *PopupBaseList) Item(index int) *PopupBase
Item returns the item at the current index.
func (*PopupBaseList) Len ¶
func (l *PopupBaseList) Len() int
Len returns the number of items in the list.
func (*PopupBaseList) Remove ¶
func (l *PopupBaseList) Remove(index int) *PopupBase
Remove removes the item at the given index from the list and returns it.
type PopupContent ¶
PopupContent supplies the content of the popup and implements its controller.
type SelectorKind ¶
type SelectorKind int
SelectorKind defines how items in a dropdown menu are selected.
const ( // SelectAtMostOne is like SelectOne but adds an additional item „None“ to the // list of selectable items. SelectAtMostOne SelectorKind = iota // SelectOne is used when selecting a new item unselects the previous one. SelectOne // SelectMultiple is used when multiple items can be selected at the same time. SelectMultiple )
type Switch ¶
type Switch struct { // Controller is the adapter for events generated from this component. // if nil, events that would be passed to the controller will not be handled. Controller SwitchController Value askew.BoolValue // contains filtered or unexported fields }
Switch is a DOM component autogenerated by Askew
func NewSwitch ¶
func NewSwitch() *Switch
NewSwitch creates a new component and initializes it with the given parameters.
func (*Switch) Destroy ¶
func (o *Switch) Destroy()
Destroy destroys this element (and all contained components). If it is currently inserted anywhere, it gets removed before.
func (*Switch) Extract ¶
func (o *Switch) Extract()
Extract removes this component from its current parent. The component will be in initial state afterwards.
func (*Switch) FirstNode ¶
FirstNode returns the first DOM node of this component. It implements the askew.Component interface.
type SwitchController ¶
type SwitchController interface {
Swapped()
}
SwitchController can be implemented to handle external events generated by Switch
type SwitchList ¶
type SwitchList struct { DefaultController SwitchController // contains filtered or unexported fields }
SwitchList is a list of Switch whose manipulation methods auto-update the corresponding nodes in the document.
func (*SwitchList) Append ¶
func (l *SwitchList) Append(item *Switch)
Append appends the given item to the list.
func (*SwitchList) Destroy ¶
func (l *SwitchList) Destroy(index int)
Destroy destroys the item at the given index and removes it from the list.
func (*SwitchList) DestroyAll ¶
func (l *SwitchList) DestroyAll()
DestroyAll destroys all items in the list and empties it.
func (*SwitchList) Init ¶
func (l *SwitchList) Init(container js.Value, index int)
Init initializes the list, discarding previous data. The list's items will be placed in the given container, starting at the given index.
func (*SwitchList) Insert ¶
func (l *SwitchList) Insert(index int, item *Switch)
Insert inserts the given item at the given index into the list.
func (*SwitchList) Item ¶
func (l *SwitchList) Item(index int) *Switch
Item returns the item at the current index.
func (*SwitchList) Len ¶
func (l *SwitchList) Len() int
Len returns the number of items in the list.
func (*SwitchList) Remove ¶
func (l *SwitchList) Remove(index int) *Switch
Remove removes the item at the given index from the list and returns it.