Documentation
¶
Overview ¶
Package textselect is what the Windows and Linux backends share of a selection across the texts of an area (driver.SelectionModel): the texts as the model reads them, hit-tested through their layouts.
Index ¶
- func AreaAt[V any](under []V, taker func(V) Taker) (area V, ok bool)
- type Selection
- func (s *Selection) Content(i int) string
- func (s *Selection) Frame(i int) driver.Bounds
- func (s *Selection) Key(i int) uint64
- func (s *Selection) Len() int
- func (s *Selection) OffsetAt(i int, p driver.Point) int
- func (s *Selection) Ranges() map[driver.NodeID]driver.SelectionRange
- func (s *Selection) Spans(i int) []driver.TextSpan
- func (s *Selection) Tell(origin driver.Point, cleared bool) (driver.Event, bool)
- type Taker
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Selection ¶
type Selection struct {
Area driver.NodeID
Texts []Text
Model driver.SelectionModel
Dragging bool
// Told and ToldText are the extent and the text the area last reported.
Told driver.Bounds
ToldText string
}
Selection is the selection of one area: the model over the area's texts, listed again before each use, and whether the pointer that started it is still down.
func (*Selection) Ranges ¶
func (s *Selection) Ranges() map[driver.NodeID]driver.SelectionRange
Ranges returns what each text, by its ID, has selected.
type Taker ¶
type Taker uint8
Taker is what a view under a press is to a selection.
const ( // Passes lets the press go on to the views around. Passes Taker = iota // Keeps takes the press itself: a field, a page, a pressable view or // one that follows pans. Keeps // Area is a selection area: a view with SelectionArea. Area // SelectableText is a text with SelectableOn outside any area. SelectableText )