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) IsValid() 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: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes)
const ( // Editable means the element can be edited. Otherwise, it remains in // ReadOnly mode. Editable Abilities = iota // Selectable means it can be Selected Selectable // Activatable means it can be made Active Activatable // Pressable means it can be pressed but is not Activatable. // Pressed items receive Click events, but do not get the automatic // Active state otherwise associated with Activatable items. Pressable // LongPressable indicates that an element can be LongPressed LongPressable // DoubleClickable indicates that an element does something different // when it is clicked on twice in a row. If this is not set, DoubleClick // events are processed in the same way as Click events. DoubleClickable // 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 Focusable // FocusWithinable means it can be FocusedWithin FocusWithinable // 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.