htmlbutton

package
v0.0.0-...-948f7eb Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package htmlbutton handle html button(group)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQuery

func GetQuery() (url.Values, error)

Types

type HTMLButton

type HTMLButton struct {
	// new args
	KeyCode    string
	IDBase     string
	ButtonText []string // state count
	ToolTip    string
	ClickFn    func(obj interface{}, v *HTMLButton)
	State      int

	// made obj
	JSID     string
	JSFnName string
	JSFn     func(this js.Value, args []js.Value) interface{}
}

func New

func New(
	KeyCode string,
	IDBase string,
	ButtonText []string,
	ToolTip string,
	ClickFn func(obj interface{}, v *HTMLButton),
	State int,
) *HTMLButton

func (HTMLButton) Disable

func (v HTMLButton) Disable()

func (HTMLButton) Enable

func (v HTMLButton) Enable()

func (HTMLButton) Hide

func (v HTMLButton) Hide()

func (HTMLButton) JSButton

func (v HTMLButton) JSButton() js.Value

func (*HTMLButton) RegisterJSFn

func (v *HTMLButton) RegisterJSFn(obj interface{})

func (HTMLButton) Show

func (v HTMLButton) Show()

func (HTMLButton) UpdateButtonText

func (v HTMLButton) UpdateButtonText()

type HTMLButtonGroup

type HTMLButtonGroup struct {
	Name           string
	ButtonList     []*HTMLButton
	ID2Button      map[string]*HTMLButton
	KeyCode2Button map[string]*HTMLButton
}

func NewButtonGroup

func NewButtonGroup(name string, buttons []*HTMLButton) *HTMLButtonGroup

func (HTMLButtonGroup) GetByIDBase

func (hbl HTMLButtonGroup) GetByIDBase(idb string) *HTMLButton

func (HTMLButtonGroup) GetByKeyCode

func (hbl HTMLButtonGroup) GetByKeyCode(kcode string) *HTMLButton

func (HTMLButtonGroup) MakeButtonToolTipTop

func (hbl HTMLButtonGroup) MakeButtonToolTipTop(buf *bytes.Buffer)

func (HTMLButtonGroup) MakeHTML

func (hbl HTMLButtonGroup) MakeHTML(buf *bytes.Buffer)

func (*HTMLButtonGroup) RegisterJSFn

func (hbl *HTMLButtonGroup) RegisterJSFn(obj interface{})

func (*HTMLButtonGroup) SetFromURLArg

func (hbl *HTMLButtonGroup) SetFromURLArg() error

SetFromURLArg set button state from url name=value

Jump to

Keyboard shortcuts

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