HTk's editor widget. A text container for editing purposes. An editor widget can contain text tags, to which you can bind events, and also embedded windows.
- data Editor
- newEditor :: Container par => par -> [Config Editor] -> IO Editor
- deleteText :: HasIndex Editor i BaseIndex => Editor -> i -> IO ()
- deleteTextRange :: (HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) => Editor -> i1 -> i2 -> IO ()
- getTextRange :: (HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) => Editor -> i1 -> i2 -> IO String
- insertText :: (HasIndex Editor i BaseIndex, GUIValue a) => Editor -> i -> a -> IO ()
- insertNewline :: Editor -> IO ()
- getTextLine :: HasIndex Editor i BaseIndex => Editor -> i -> IO String
- appendText :: Editor -> String -> IO ()
- getIndexPosition :: HasIndex Editor i BaseIndex => Editor -> i -> IO Position
- compareIndices :: (HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) => Editor -> String -> i1 -> i2 -> IO Bool
- writeTextToFile :: Editor -> FilePath -> IO ()
- readTextFromFile :: Editor -> FilePath -> IO ()
- class GUIObject w => HasTabulators w where
- class GUIObject w => HasLineSpacing w where
- spaceAbove :: Distance -> Config w
- getSpaceAbove :: w -> IO Distance
- spaceWrap :: Distance -> Config w
- getSpaceWrap :: w -> IO Distance
- spaceBelow :: Distance -> Config w
- getSpaceBelow :: w -> IO Distance
- adjustViewTo :: HasIndex Editor i BaseIndex => Editor -> i -> IO ()
- scanMark :: HasIndex Editor i BaseIndex => Editor -> i -> IO ()
- scanDragTo :: HasIndex Editor i BaseIndex => Editor -> i -> IO ()
- data SearchDirection
- data SearchMode
- data SearchSwitch = SearchSwitch {}
- search :: HasIndex Editor i BaseIndex => Editor -> SearchSwitch -> String -> i -> IO (Maybe BaseIndex)
- newtype IndexModifiers = IndexModifiers [IndexModifier]
- data IndexModifier
- = ForwardChars Int
- | BackwardChars Int
- | ForwardLines Int
- | BackwardLines Int
- | LineStart
- | LineEnd
- | WordStart
- | WordEnd
- data WrapMode
- wrap :: WrapMode -> Config Editor
- getWrapMode :: Editor -> IO WrapMode
Documentation
The Editor
datatpe.
Eq Editor | |
Destroyable Editor | An editor widget can be destroyed. |
Synchronized Editor | You can synchronize on an editor widget. |
GUIObject Editor | Internal. |
HasEnable Editor | A editor widget is a stateful widget, it can be enabled or disabled. |
HasFont Editor | You can specify the font of an editor widget. |
HasBorder Editor | A editor widget has a configureable border. |
HasSize Editor | You can specify the size of an editor widget. |
HasColour Editor | An editor widget has a foreground and background colour. |
HasTooltip Editor | An editor widget can have a tooltip. |
Widget Editor | An editor widget has standard widget properties (concerning focus, cursor). |
Container Editor | An editor is also a container for widgets, because it can contain widgets in embedded windows. |
HasInsertionCursor Editor | An editor widget has an insertion cursor. |
HasSelection Editor | You can select text inside an editor widget. |
HasXSelection Editor | An editor widget has an X selection. |
HasScroller Editor | An editor is a scrollable widget. |
HasLineSpacing Editor | You can adjust the line spacing of an editor widget. |
HasTabulators Editor | An editor widget has adjustable tab stops. |
HasMarkupText Editor | An editor widget is a container for markup text. |
GUIValue a => HasValue Editor a | An editor widget has a value (its textual content). |
HasIndex Editor i BaseIndex => HasBBox Editor i | You can find out the bounding box of characters inside an editor widget. |
HasIndex Editor i BaseIndex => HasInsertionCursorIndexSet Editor i | The insertion cursor of an editor widget can be set by a base index. |
HasIndex Editor i BaseIndex => HasSelectionIndex Editor i | An editor widget's characters are selectable. |
HasIndex Editor BaseIndex BaseIndex | A base index is a valid index for an editor widget. |
HasIndex Editor Pixels BaseIndex | A position in pixels is a valid index for an editor widget. |
HasIndex Editor EndOfText BaseIndex | The |
HasIndex Editor MousePosition BaseIndex | Internal. |
HasIndex Editor Mark BaseIndex | Internal. |
HasIndex Editor EmbeddedTextWin BaseIndex | Internal. |
(HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) => HasSelectionIndexRange Editor i1 i2 | You can select a text range inside an editor widget. |
HasIndex Editor i BaseIndex => HasIndex Editor i (Distance, Distance) | Internal. |
HasIndex Editor (ICursor Editor) BaseIndex | Internal. |
HasIndex Editor (Selection Editor) BaseIndex | Internal. |
HasInsertionCursorIndexGet Editor (Distance, Distance) | You can get the position of the insertion cursor of an editor widget. |
HasSelectionBaseIndexRange Editor (Distance, Distance) | You can select a text range inside an editor widget. |
HasSelectionBaseIndex Editor ((Distance, Distance), (Distance, Distance)) | You can select a text range inside an editor widget. |
HasIndex Editor i BaseIndex => HasIndex Editor (i, IndexModifier) BaseIndex | A pair of a valid index and an index modifier is a valid index for an editor widget. |
HasIndex Editor i BaseIndex => HasIndex Editor (i, [IndexModifier]) BaseIndex | A pair of a valid index and a list of index modifiers is a valid index for an editor widget. |
HasIndex Editor (Distance, Distance) BaseIndex | A pair of line and character is a valid index for an editor widget. |
HasIndex Editor (TextTag, Last) BaseIndex | Internal. |
HasIndex Editor (TextTag, First) BaseIndex | Internal. |
:: Container par | |
=> par | the parent widget, which has to be a container widget
(an instance of |
-> [Config Editor] | the list of configuration options for this editor. |
-> IO Editor | An editor widget. |
Constructs a new editor widget and returns it as a value.
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> i | the concerned index. |
-> IO () | None. |
Deletes the character at the specified index.
:: (HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) | |
=> Editor | the start index. |
-> i1 | the end index. |
-> i2 | |
-> IO () | None. |
Deletes the text in the specified range.
:: (HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) | |
=> Editor | the concerned editor widget. |
-> i1 | the start index. |
-> i2 | the end index. |
-> IO String | The editor's text in the specified range. |
Gets the text in the specified range.
:: (HasIndex Editor i BaseIndex, GUIValue a) | |
=> Editor | the concerned editor widget. |
-> i | the index to insert the text. |
-> a | the text to insert. |
-> IO () | None. |
Inserts the given text at the specified index.
Inserts a newline character at the end of the editor widget.
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> i | an index in the requested text line. |
-> IO String | The requested line of text. |
Gets a text line from an editor widget.
Appends text at the end of the editor widget.
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> i | the concerned index. |
-> IO Position | The requested position. |
Returns the position on the text widget for a given index.
:: (HasIndex Editor i1 BaseIndex, HasIndex Editor i2 BaseIndex) | |
=> Editor | the concerned editor widget. |
-> String | an operation given as a string |
-> i1 | the first index. |
-> i2 | the second index. |
-> IO Bool |
|
Compares two indizes.
Writes the contained text to a file.
Reads a text from a file and inserts it into the editor pane.
class GUIObject w => HasTabulators w whereSource
Widgets with adjustable tab stops instantiate the
class HasTabulators
.
HasTabulators Editor | An editor widget has adjustable tab stops. |
HasTabulators TextTag | A text tag has adjustable tab stops. |
class GUIObject w => HasLineSpacing w whereSource
Widgets with an adjustable line spacing instantiate the
class HasLineSpacing
.
spaceAbove :: Distance -> Config wSource
getSpaceAbove :: w -> IO DistanceSource
spaceWrap :: Distance -> Config wSource
getSpaceWrap :: w -> IO DistanceSource
spaceBelow :: Distance -> Config wSource
getSpaceBelow :: w -> IO DistanceSource
HasLineSpacing Editor | You can adjust the line spacing of an editor widget. |
HasLineSpacing TextTag | A text tag has a configureable line spacing. |
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> i | the index to adjust the view to. |
-> IO () | None. |
Adjusts the view so that the character at the specified position is visible.
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> i | the concerned index. |
-> IO () | None. |
Anchor a scrolling operation.
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> i | the concerned index. |
-> IO () | None. |
Scroll based on a new position.
data SearchDirection Source
The SearchDirection
datatype.
data SearchMode Source
The SearchMode
datatype.
Enum SearchMode | |
Eq SearchMode | |
Ord SearchMode | |
Show SearchMode | Internal. |
:: HasIndex Editor i BaseIndex | |
=> Editor | the concerned editor widget. |
-> SearchSwitch | the search switch. |
-> String | the searched text or regular expression. |
-> i | the start index. |
-> IO (Maybe BaseIndex) | The index of the first match (if successful). |
Searches for text inside an editor widget.
data IndexModifier Source
The IndexModifier
datatype.
ForwardChars Int | |
BackwardChars Int | |
ForwardLines Int | |
BackwardLines Int | |
LineStart | |
LineEnd | |
WordStart | |
WordEnd |
Show IndexModifier | Internal. |
HasIndex Editor i BaseIndex => HasIndex Editor (i, IndexModifier) BaseIndex | A pair of a valid index and an index modifier is a valid index for an editor widget. |
HasIndex Editor i BaseIndex => HasIndex Editor (i, [IndexModifier]) BaseIndex | A pair of a valid index and a list of index modifiers is a valid index for an editor widget. |
The WrapMode
datatype.
getWrapMode :: Editor -> IO WrapModeSource
Gets the editor's wrap mode.