This module provides access to a widgets selection (e.g. inside a listbox, editor or entry widget).
- newtype Selection w = Selection w
- class GUIObject w => HasSelection w where
- clearSelection :: w -> IO ()
- class HasSelectionIndex w i where
- selection :: i -> Config w
- isSelected :: w -> i -> IO Bool
- class HasSelectionBaseIndex w i where
- getSelection :: w -> IO (Maybe i)
- class HasSelectionIndexRange w i1 i2 where
- selectionRange :: i1 -> i2 -> Config w
- class HasSelectionIndex w i => HasSelectionBaseIndexRange w i where
- getSelectionStart :: w -> IO (Maybe i)
- getSelectionEnd :: w -> IO (Maybe i)
- getSelectionRange :: w -> IO (Maybe (i, i))
Documentation
The Selection
datatype.
HasIndex Editor (Selection Editor) BaseIndex | Internal. |
GUIObject w => GUIObject (Selection w) | Internal. |
(HasSelection w, Widget w) => HasBorder (Selection w) | The selection has a configureable border. |
(HasSelection w, Widget w) => HasColour (Selection w) | The selected entries have a configureable foreground and background colour. |
HasIndex (Entry a) (Selection (Entry a), Last) BaseIndex | The selection end is a valid index position for an entry widget. |
HasIndex (Entry a) (Selection (Entry a), First) BaseIndex | The selection start is a valid index position for an entry widget. |
class GUIObject w => HasSelection w whereSource
A widget with a selectable content instantiates the class
HasSelection
.
clearSelection :: w -> IO ()Source
HasSelection Editor | You can select text inside an editor widget. |
HasSelection (Entry a) | You can select text inside an entry widget. |
HasSelection (ListBox a) | You can select entries inside a listbox widget. |
class HasSelectionIndex w i whereSource
A widget with a indexable selection instantiates the class
HasSelectionIndex
.
HasIndex Editor i BaseIndex => HasSelectionIndex Editor i | An editor widget's characters are selectable. |
HasIndex (Entry a) i BaseIndex => HasSelectionIndex (Entry a) i | An entry widget's characters are selectable. |
HasIndex (ListBox a) i Int => HasSelectionIndex (ListBox a) i | A listbox'es entries are selectable. |
class HasSelectionBaseIndex w i whereSource
A widget with an indexable selection base instantiates the class
HasSelectionBaseIndex
.
getSelection :: w -> IO (Maybe i)Source
HasSelectionBaseIndex Editor ((Distance, Distance), (Distance, Distance)) | You can select a text range inside an editor widget. |
HasSelectionBaseIndex (ListBox a) [Int] | You can select a range of elements inside a listbox widget. |
HasSelectionBaseIndex (Entry a) (Int, Int) | You can select a text range inside an entry widget. |
class HasSelectionIndexRange w i1 i2 whereSource
A widget with an indexable selection range instantiates the class
HasSelectionIndexRange
.
selectionRange :: i1 -> i2 -> Config wSource
(HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) => HasSelectionIndexRange Editor i1 i2 | You can select a text range inside an editor widget. |
(HasIndex (Entry a) i1 BaseIndex, HasIndex (Entry a) i2 BaseIndex) => HasSelectionIndexRange (Entry a) i1 i2 | You can select a text range inside an entry widget. |
(HasIndex (ListBox a) i1 Int, HasIndex (ListBox a) i2 Int) => HasSelectionIndexRange (ListBox a) i1 i2 | You can select a range of elements inside a listbox widget. |
class HasSelectionIndex w i => HasSelectionBaseIndexRange w i whereSource
A widget with an indexable selection index range instantiates the
class HasSelectionBaseIndexRange
.
getSelectionStart :: w -> IO (Maybe i)Source
getSelectionEnd :: w -> IO (Maybe i)Source
getSelectionRange :: w -> IO (Maybe (i, i))Source
HasSelectionBaseIndexRange Editor (Distance, Distance) | You can select a text range inside an editor widget. |
HasSelectionBaseIndexRange (Entry a) Int | You can select a text range inside an entry widget. |
HasSelectionBaseIndexRange (ListBox a) Int | You can select a range of entries inside a listbox widget. |