buttons

package
v0.0.0-...-8ea9ff3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package buttons manage all related button widgets

Package buttons manage all related button widgets

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GButton

type GButton struct {
	Icon      p.Icon      `json:"icon"`
	Mnemonic  int         `json:"mnemonic"`
	Alignment p.Alignment `json:"alignment"`
	Type      p.Type      `json:"type"`
	Text      string      `json:"text"`
	w.GComponent
}

GButton supports push button single functionality to trigger an event.

The following button displays a short text string and an image. Its content is on the left and centered vertically.
The second button resembles an HTML link, and when pressed invokes the method goHome.

	{"gbutton":{"text":"Button","icon":"image.gif","alignment":"left","tooltip":"ToolTip"}}
	{"gbutton":{"text":"www.thinlet.com","type":"link","action":"goHome"}}

Properties:
	Icon		: The icon image that the checkbox displays.
	Mnemonic 	: Specifies the index of underlined char and a key combination (Alt + the char) which invokes the
					(not necessarily focused, but enabled and visible) button's action listener. Default = -1.
	Alignment	: The alignment of the text and image similar to label. Possible values are: center, left, and
					right. The default value is center. Icons are always displayed to the left of text (if any).
					Default = center.
	Type		: Possible values are: normal, default, cancel, and link. The default value is normal. Default, and
					cancel values are for dialog control. Link changes the appearance of button so that it
					resembles HTML link. Default = normal.
	Text		: The text string that the button displays.
	GComponent	: @see GComponent.

Listeners:
	Action		: Invokes the given method when the button is pressed by mouse or keyboard.

Keyboard:
	Spacebar	: Activates button.
	Tab			: Navigate forward.
	ShiftTab	: Navigate backward.

func DefaultGButton

func DefaultGButton() *GButton

DefaultGButton returns a button structure with default values.

func (GButton) Action

func (gb GButton) Action()

Action invokes the given method when the button is pressed by mouse or keyboard.

type GCheckBox

type GCheckBox struct {
	Icon      p.Icon      `json:"icon"`
	Mnemonic  int         `json:"mnemonic"`
	Alignment p.Alignment `json:"alignment"`
	Selected  bool        `json:"selected"`
	Group     string      `json:"group"`
	Text      string      `json:"text"`
	w.GComponent
}

GCheckBox supports the use of single/multiple choice.

The first checkbox has a short text and an icon, its state is selected. The second one is a selected radio button,
and the last is deselected. A set of radio buttons identified by the group string id.

	{"gcheckbox":{"text":"CheckBox","icon":"image.gif","selected"="true"}}
	{"gcheckbox":{"text":"RadioButton-on","group":"group","selected"="true"}}
	{"gcheckbox":{"text":"RadioButton","group":"group"}}

Properties:
	Icon		: The icon image that the checkbox displays.
	Mnemonic	: Specifies the index of underlined char and a key combination (Alt + char) which change the
					checkboxs's state and invokes the action listener. Default = -1.
	Alignment	: The alignment of the text and image similar to label. Possible values are: left, center, and
					right. Default = center.
	Selected	: The state of the checkbox. True if the checkbox is selected, false if it's not. Default = false.
	Group		: Identifies the radio button group if not null. Only one radio button at a time can be selected.
					User can set on a radio button, the selected button of the group will be set off (the group
					members is searched only in the same parent).
	Text		: The text string that the checkbox displays.
	GComponent	: @see GComponent.

Listeners:
	Action		: Invokes the given method when the checkbox state is changed by mouse or keyboard event.

Keyboard:
	Spacebar	: Selects or deselects.
	Tab			: Navigate forward.
	ShiftTab	: Navigate backward.

func DefaultCheckBox

func DefaultCheckBox() *GCheckBox

DefaultCheckBox returns a check box structure with default values.

func (GCheckBox) Action

func (gcb GCheckBox) Action()

Action Invokes the given method when the checkbox state is changed by mouse or keyboard event.

type GToggleButton

type GToggleButton struct {
	GCheckBox
	w.GComponent
}

GToggleButton is used to display checked/unchecked states.

An implementation of a two-state button, behaves as checkbox.

	{"gtogglebutton":{"text":"ToggleButton","icon":"image.gif","selected":"true"}}
	{"gtogglebutton":{"text":"ToggleButton","group":"group"}}

Properties:
	GCheckBox	: @see GCheckBox.
	GComponent	: @see GComponent.

Keyboard:
	Spacebar	: Selects or deselects.
	Tab			: Navigate forward.
	ShiftTab	: Navigate backward.

func DefaultGToggleButton

func DefaultGToggleButton() *GToggleButton

DefaultGToggleButton returns a toggle button structure with default values.

Jump to

Keyboard shortcuts

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