Documentation ¶
Index ¶
- type Abilities
- func (i Abilities) BitIndexString() string
- func (i Abilities) Desc() string
- func (i Abilities) HasFlag(f enums.BitFlag) bool
- func (i Abilities) Int64() int64
- func (ab *Abilities) Is(flag enums.BitFlag) bool
- func (ab *Abilities) IsHoverable() bool
- func (ab *Abilities) IsPressable() bool
- func (i Abilities) MarshalText() ([]byte, error)
- func (i *Abilities) SetFlag(on bool, f ...enums.BitFlag)
- func (i *Abilities) SetInt64(in int64)
- func (i *Abilities) SetString(s string) error
- func (i *Abilities) SetStringOr(s string) error
- func (i Abilities) String() string
- func (i *Abilities) UnmarshalText(text []byte) error
- func (i Abilities) Values() []enums.Enum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Abilities ¶
type Abilities int64 //enums:bitflag
Abilities represent abilities of GUI elements to take on different States, and are aligned with the States flags. All elements can be disabled. These correspond to some of the global attributes in CSS: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
const ( // Selectable means it can be Selected Selectable Abilities = iota // Activatable means it can be made Active by pressing down on it, // which gives it a visible state layer color change. // This also implies Clickable, receiving Click events when // the user executes a mouse down and up event on the same element. Activatable // Clickable means it can be Clicked, receiving Click events when // the user executes a mouse down and up event on the same element, // but otherwise does not change its rendering when pressed // (as Activatable does). Use this for items that are more passively // clickable, such as frames or tables, whereas e.g., a Button is // Activatable. Clickable // DoubleClickable indicates that an element does something different // when it is clicked on twice in a row. DoubleClickable // TripleClickable indicates that an element does something different // when it is clicked on three times in a row. TripleClickable // RepeatClickable indicates that an element should receive repeated // click events when the pointer is held down on it. RepeatClickable // LongPressable indicates that an element can be LongPressed LongPressable // Draggable means it can be Dragged Draggable // Droppable means it can receive DragEnter, DragLeave, and Drop events // (not specific to current Drag item, just generally) Droppable // Slideable means it has a slider element that can be dragged // to change value. Cannot be both Draggable and Slideable. Slideable // Checkable means it can be Checked Checkable // Scrollable means it can be Scrolled Scrollable // Focusable means it can be Focused: capable of receiving and processing key events directly // and typically changing the style when focused to indicate this property to the user. Focusable // Hoverable means it can be Hovered Hoverable // LongHoverable means it can be LongHovered LongHoverable )
const AbilitiesN Abilities = 15
AbilitiesN is the highest valid value for type Abilities, plus one.
func AbilitiesValues ¶
func AbilitiesValues() []Abilities
AbilitiesValues returns all possible values for the type Abilities.
func (Abilities) BitIndexString ¶
BitIndexString returns the string representation of this Abilities value if it is a bit index value (typically an enum constant), and not an actual bit flag value.
func (*Abilities) IsHoverable ¶
IsHoverable is true for both Hoverable and LongHoverable
func (*Abilities) IsPressable ¶
IsPressable returns true when an element is Selectable, Activatable, DoubleClickable, Draggable, Slideable, or Checkable
func (Abilities) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Abilities) SetFlag ¶
SetFlag sets the value of the given flags in these flags to the given value.
func (*Abilities) SetString ¶
SetString sets the Abilities value from its string representation, and returns an error if the string is invalid.
func (*Abilities) SetStringOr ¶
SetStringOr sets the Abilities value from its string representation while preserving any bit flags already set, and returns an error if the string is invalid.
func (*Abilities) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.