Package wx :: Module richtext :: Class RichTextCtrl

[frames | no frames]

## Type RichTextCtrl

    object --+
             |
        Object --+
                 |
        EvtHandler --+
                     |
                Window --+
                         |
                     Panel --+
                             |
                ScrolledWindow --+
                                 |
                                RichTextCtrl

Proxy of C++ RichTextCtrl class

Method Summary
Window | ``__init__`(self, parent, id, pos, size, style, name)` Construct and show a generic Window.
RichTextRange | ``AddImage`(self, image)` Add an image
RichTextRange | ``AddParagraph`(self, text)` Add a new paragraph of text to the end of the buffer
| ``AppendText`(self, text)` Append text to the end of the document.
bool | ``ApplyAlignmentToSelection`(self, alignment)` Apply alignment to the selection
bool | ``ApplyBoldToSelection`(self)` Apply bold to the selection
bool | ``ApplyItalicToSelection`(self)` Apply italic to the selection
bool | ``ApplyStyle`(self, def)` Apply a named style to the selection
bool | ``ApplyStyleSheet`(self, styleSheet)` Apply the style sheet to the buffer, for example if the styles have changed.
bool | ``ApplyUnderlineToSelection`(self)` Apply underline to the selection
bool | ``BatchingUndo`(self)` Are we batching undo history for commands?
bool | ``BeginAlignment`(self, alignment)` Begin using alignment
bool | ``BeginBatchUndo`(self, cmdName)` Start batching undo history for commands
bool | ``BeginBold`(self)` Begin using bold
bool | ``BeginCharacterStyle`(self, characterStyle)` Begin named character style
bool | ``BeginFont`(self, font)` Begin using this font
bool | ``BeginFontSize`(self, pointSize)` Begin using point size
bool | ``BeginItalic`(self)` Begin using italic
bool | ``BeginLeftIndent`(self, leftIndent, leftSubIndent)` Begin left indent
bool | ``BeginLineSpacing`(self, lineSpacing)` Begin line spacing
bool | ``BeginListStyle`(self, listStyle, level, number)` Begin named list style.
bool | ``BeginNumberedBullet`(self, bulletNumber, leftIndent, leftSubIndent, bulletStyle)` Begin numbered bullet
bool | ``BeginParagraphSpacing`(self, before, after)` Begin paragraph spacing
bool | ``BeginParagraphStyle`(self, paragraphStyle)` Begin named paragraph style
bool | ``BeginRightIndent`(self, rightIndent)` Begin right indent
bool | ``BeginStandardBullet`(self, bulletName, leftIndent, leftSubIndent, bulletStyle)` Begin standard bullet
bool | ``BeginStyle`(self, style)` Begin using a style
bool | ``BeginSuppressUndo`(self)` Start suppressing undo history for commands.
bool | ``BeginSymbolBullet`(self, symbol, leftIndent, leftSubIndent, bulletStyle)` Begin symbol bullet
bool | ``BeginTextColour`(self, colour)` Begin using this colour
bool | ``BeginUnderline`(self)` Begin using underline
bool | ``BeginURL`(self, url, characterStyle)` Begin URL.
bool | ``CanCopy`(self)` Returns `True` if the selection can be copied to the clipboard.
bool | ``CanCut`(self)` Returns `True` if the selection can be cut to the clipboard.
bool | ``CanDeleteSelection`(self)` Returns `True` if the selection can be removed from the document.
bool | ``CanPaste`(self)` Returns `True` if the current contents of the clipboard can be pasted into the document.
bool | ``CanRedo`(self)` Returns `True` if the last operation can be redone.
bool | ``CanUndo`(self)` Returns `True` if the last operation can be undone.
| `Clear(self)`
bool | `ClearListStyle(self, range, flags)`
| ``Copy`(self)` Copies the selected text to the clipboard.
bool | ``Create`(self, parent, id, pos, size, style, name)` Create the GUI part of the Window for 2-phase creation mode.
| ``Cut`(self)` Copies the selected text to the clipboard and removes the selection.
bool | `Delete(self, range)`
| ``DeleteSelection`(self)` Remove the current selection.
| ``DiscardEdits`(self)` Clears the dirty flag.
bool | ``EndAlignment`(self)` End alignment
bool | ``EndAllStyles`(self)` End all styles
bool | ``EndBatchUndo`(self)` End batching undo history for commands.
bool | ``EndBold`(self)` End using bold
bool | ``EndCharacterStyle`(self)` End named character style
bool | ``EndFont`(self)` End using a font
bool | ``EndFontSize`(self)` End using point size
bool | ``EndItalic`(self)` End using italic
bool | ``EndLeftIndent`(self)` End left indent
bool | ``EndLineSpacing`(self)` End line spacing
bool | ``EndListStyle`(self)` End named list style.
bool | ``EndNumberedBullet`(self)` End numbered bullet
bool | ``EndParagraphSpacing`(self)` End paragraph spacing
bool | ``EndParagraphStyle`(self)` End named character style
bool | ``EndRightIndent`(self)` End right indent
bool | ``EndStandardBullet`(self)` End standard bullet
bool | ``EndStyle`(self)` End the style
bool | ``EndSuppressUndo`(self)` End suppressing undo history for commands.
bool | ``EndSymbolBullet`(self)` End symbol bullet
bool | ``EndTextColour`(self)` End using a colour
bool | ``EndUnderline`(self)` End using underline
bool | ``EndURL`(self)` End URL.
TextAttrEx | ``GetBasicStyle`(self)` Get basic (overall) style
RichTextBuffer | ``GetBuffer`(self)` Returns the buffer associated with the control.
TextAttrEx | ``GetDefaultStyle`(self)` Retrieves a copy of the default style object.
long | ``GetDelayedLayoutThreshold`(self)` Get the threshold in character positions for doing layout optimization during sizing.
String | `GetFilename(self)`
int | ``GetHandlerFlags`(self)` Get the handler flags, controlling loading and saving.
long | ``GetInsertionPoint`(self)` Returns the insertion point.
RichTextRange | ``GetInternalSelectionRange`(self)` Get the selection range in character positions.
long | ``GetLastPosition`(self)` Returns the zero based index of the last position in the document.
int | `GetLineLength(self, lineNo)`
String | `GetLineText(self, lineNo)`
int | `GetNumberOfLines(self)`
String | `GetRange(self, from, to)`
| ``GetSelection`(*args, **kwargs)` GetSelection() --> (start, end)
RichTextRange | ``GetSelectionRange`(self)` Get the selection range in character positions.
String | `GetStringSelection(self)`
bool | ``GetStyle`(self, position, style)` Retrieve the style used at the given position.
bool | ``GetStyleForRange`(self, range, style)` Get the common set of styles for the range
wxRichTextStyleSheet | `GetStyleSheet(self)`
bool | ``GetUncombinedStyle`(self, position, style)` Get the content (uncombined) attributes for this position.
String | `GetValue(self)`
bool | ``HasCharacterAttributes`(self, range, style)` Test if this whole range has character attributes of the specified kind.
bool | ``HasParagraphAttributes`(self, range, style)` Test if this whole range has paragraph attributes of the specified kind.
bool | `HasSelection(self)`
| ``HitTest`(*args, **kwargs)` HitTest(self, Point pt) --> (result, pos)
| ``HitTestXY`(*args, **kwargs)` HitTestRC(self, Point pt) --> (result, col, row)
bool | `IsEditable(self)`
bool | `IsModified(self)`
bool | `IsMultiLine(self)`
bool | ``IsSelectionAligned`(self, alignment)` Is all of the selection aligned according to the specified flag?
bool | ``IsSelectionBold`(self)` Is all of the selection bold?
bool | ``IsSelectionItalics`(self)` Is all of the selection italics?
bool | ``IsSelectionUnderlined`(self)` Is all of the selection underlined?
bool | `IsSingleLine(self)`
bool | ``LayoutContent`(self, onlyVisibleRect)` Layout the buffer: which we must do before certain operations, such as setting the caret position.
bool | ``LineBreak`(self)` Insert a line break at the current insertion point.
bool | ``LoadFile`(self, file, type)` Load the contents of the document from the given filename.
| ``MarkDirty`(self)` Sets the dirty flag, meaning that the contents of the control have changed and need to be saved.
bool | ``MoveCaret`(self, pos, showAtLineStart)` Move the caret to the given character position
bool | ``MoveDown`(self, noLines, flags)` Move down
bool | ``MoveEnd`(self, flags)` Move to the end of the buffer
bool | ``MoveHome`(self, flags)` Move to the start of the buffer
bool | ``MoveLeft`(self, noPositions, flags)` Move left
bool | ``MoveRight`(self, noPositions, flags)` Move right
bool | ``MoveToLineEnd`(self, flags)` Move to the end of the line
bool | ``MoveToLineStart`(self, flags)` Move to the start of the line
bool | ``MoveToParagraphEnd`(self, flags)` Move to the end of the paragraph
bool | ``MoveToParagraphStart`(self, flags)` Move to the start of the paragraph
bool | ``MoveUp`(self, noLines, flags)` Move up
bool | ``Newline`(self)` Insert a newline (actually paragraph) at the current insertion point.
bool | `NumberList(self, range, defName, flags, startFrom, specifiedLevel)`
bool | ``PageDown`(self, noPages, flags)` Move n pages down
bool | ``PageUp`(self, noPages, flags)` Move n pages up
| ``Paste`(self)` Pastes text from the clipboard into the document at the current insertion point.
wxRichTextStyleSheet | ``PopStyleSheet`(self)` Pop style sheet from top of stack
| ``PositionToXY`(*args, **kwargs)` PositionToXY(self, long pos) --> (x, y)
bool | `PromoteList(self, promoteBy, range, defName, flags, specifiedLevel)`
bool | ``PushStyleSheet`(self, styleSheet)` Push style sheet to top of stack
| ``Redo`(self)` If the last operation can be redone, redoes the last operation.
| `Remove(self, from, to)`
| `Replace(self, from, to, value)`
bool | ``SaveFile`(self, file, type)` Save the contents of the document to the given filename, or if the empty string is passed then to the filename set with `SetFilename`.
| ``SelectAll`(self)` Select all text in the document.
| ``SelectNone`(self)` Clear the selection
bool | ``SelectWord`(self, position)` Select the word at the given character position
| `SetBasicStyle(self, style)`
bool | ``SetDefaultStyle`(self, style)` Set the style used by default for the rich text document.
bool | ``SetDefaultStyleToCursorStyle`(self)` Sets the default style to the style under the cursor
| ``SetDelayedLayoutThreshold`(self, threshold)` Set the threshold in character positions for doing layout optimization during sizing.
| ``SetEditable`(self, editable)` Makes the document editable or read-only, overriding the RE_READONLY flag.
| `SetFilename(self, filename)`
| ``SetHandlerFlags`(self, flags)` Set the handler flags, controlling loading and saving.
| ``SetInsertionPoint`(self, pos)` Sets the insertion point at the given position.
| ``SetInsertionPointEnd`(self)` Moves the insertion point to the end of the document.
| ``SetInternalSelectionRange`(self, range)` Set the selection range in character positions.
bool | `SetListStyle(self, range, defName, flags, startFrom, specifiedLevel)`
| ``SetMaxLength`(*args, **kwargs)` SetMaxLength(self, unsigned long len)
| ``SetSelection`(self, from, to)` Selects the text starting at the first position up to (but not including) the character at the last position.
| ``SetSelectionRange`(self, range)` Set the selection range in character positions.
bool | ``SetStyle`(self, range, style)` Set the style for the text in `range` to `style`
bool | ``SetStyleEx`(self, range, style, flags)` Extended style setting operation with flags including: RICHTEXT_SETSTYLE_WITH_UNDO, RICHTEXT_SETSTYLE_OPTIMIZE, RICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, RICHTEXT_SETSTYLE_CHARACTERS_ONLY
| ``SetStyleSheet`(self, styleSheet)` Set style sheet, if any.
| `SetValue(self, value)`
| ``ShowPosition`(self, position)` Ensure that the given position in the document is visible.
bool | ``SuppressingUndo`(self)` Are we suppressing undo history for commands?
| ``Undo`(self)` If the last operation can be undone, undoes the last operation.
bool | ``WordLeft`(self, noPages, flags)` Move n words left
bool | ``WordRight`(self, noPages, flags)` Move n words right
bool | ``WriteBitmap`(self, bitmap, bitmapType)` Write a bitmap at the current insertion point.
bool | ``WriteImage`(self, image, bitmapType)` Write an image at the current insertion point.
bool | ``WriteImageBlock`(self, imageBlock)` Write an image block at the current insertion point.
bool | ``WriteImageFile`(self, filename, bitmapType)` Load an image from file and write at the current insertion point.
| ``WriteText`(self, text)` Insert text at the current position.
long | ``XYToPosition`(self, x, y)` Translate a col,row coordinants into a document position.

Property Summary
| `Buffer`: See `GetBuffer`
| `DefaultStyle`: See `GetDefaultStyle` and `SetDefaultStyle`
| `DelayedLayoutThreshold`: See `GetDelayedLayoutThreshold` and `SetDelayedLayoutThreshold`
| `Filename`: See `GetFilename` and `SetFilename`
| `InsertionPoint`: See `GetInsertionPoint` and `SetInsertionPoint`
| `InternalSelectionRange`: See `GetInternalSelectionRange` and `SetInternalSelectionRange`
| `LastPosition`: See `GetLastPosition`
| `NumberOfLines`: See `GetNumberOfLines`
| `Selection`: See `GetSelection` and `SetSelection`
| `SelectionRange`: See `GetSelectionRange` and `SetSelectionRange`
| `StringSelection`: See `GetStringSelection`
| `StyleSheet`: See `GetStyleSheet` and `SetStyleSheet`
| `thisown`: The membership flag
| `Value`: See `GetValue` and `SetValue`

Instance Method Details

### __init__(self, parent, id=-1, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=RE_MULTILINE, validator=DefaultValidator, name=RichTextCtrlNameStr)
(Constructor)

Construct and show a generic Window.

  Parameters:
    `parent`
    (type=Window)

    `id`
    (type=int)

    `pos`
    (type=Point)

    `size`
    (type=Size)

    `style`
    (type=long)

    `name`
    (type=String)

  Returns:
    Window
  Overrides:
    `wx.ScrolledWindow.__init__` (inherited documentation)

### AddImage(self, image)

Add an image

  Parameters:
    `image`
    (type=Image)

  Returns:
    RichTextRange

### AddParagraph(self, text)

Add a new paragraph of text to the end of the buffer

  Parameters:
    `text`
    (type=String)

  Returns:
    RichTextRange

### AppendText(self, text)

Append text to the end of the document.

  Parameters:
    `text`
    (type=String)

### ApplyAlignmentToSelection(self, alignment)

Apply alignment to the selection

  Parameters:
    `alignment`
    (type=int)

  Returns:
    bool

### ApplyBoldToSelection(self)

Apply bold to the selection

  Returns:
    bool

### ApplyItalicToSelection(self)

Apply italic to the selection

  Returns:
    bool

### ApplyStyle(self, def)

Apply a named style to the selection

  Parameters:
    `def`
    (type=wxRichTextStyleDefinition)

  Returns:
    bool

### ApplyStyleSheet(self, styleSheet=None)

Apply the style sheet to the buffer, for example if the styles have changed.

  Parameters:
    `styleSheet`
    (type=wxRichTextStyleSheet)

  Returns:
    bool

### ApplyUnderlineToSelection(self)

Apply underline to the selection

  Returns:
    bool

### BatchingUndo(self)

Are we batching undo history for commands?

  Returns:
    bool

### BeginAlignment(self, alignment)

Begin using alignment

  Parameters:
    `alignment`
    (type=int)

  Returns:
    bool

### BeginBatchUndo(self, cmdName)

Start batching undo history for commands

  Parameters:
    `cmdName`
    (type=String)

  Returns:
    bool

### BeginBold(self)

Begin using bold

  Returns:
    bool

### BeginCharacterStyle(self, characterStyle)

Begin named character style

  Parameters:
    `characterStyle`
    (type=String)

  Returns:
    bool

### BeginFont(self, font)

Begin using this font

  Parameters:
    `font`
    (type=Font)

  Returns:
    bool

### BeginFontSize(self, pointSize)

Begin using point size

  Parameters:
    `pointSize`
    (type=int)

  Returns:
    bool

### BeginItalic(self)

Begin using italic

  Returns:
    bool

### BeginLeftIndent(self, leftIndent, leftSubIndent=0)

Begin left indent

  Parameters:
    `leftIndent`
    (type=int)

    `leftSubIndent`
    (type=int)

  Returns:
    bool

### BeginLineSpacing(self, lineSpacing)

Begin line spacing

  Parameters:
    `lineSpacing`
    (type=int)

  Returns:
    bool

### BeginListStyle(self, listStyle, level=1, number=1)

Begin named list style.

  Parameters:
    `listStyle`
    (type=String)

    `level`
    (type=int)

    `number`
    (type=int)

  Returns:
    bool

### BeginNumberedBullet(self, bulletNumber, leftIndent, leftSubIndent, bulletStyle=wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_...)

Begin numbered bullet

  Parameters:
    `bulletNumber`
    (type=int)

    `leftIndent`
    (type=int)

    `leftSubIndent`
    (type=int)

    `bulletStyle`
    (type=int)

  Returns:
    bool

### BeginParagraphSpacing(self, before, after)

Begin paragraph spacing

  Parameters:
    `before`
    (type=int)

    `after`
    (type=int)

  Returns:
    bool

### BeginParagraphStyle(self, paragraphStyle)

Begin named paragraph style

  Parameters:
    `paragraphStyle`
    (type=String)

  Returns:
    bool

### BeginRightIndent(self, rightIndent)

Begin right indent

  Parameters:
    `rightIndent`
    (type=int)

  Returns:
    bool

### BeginStandardBullet(self, bulletName, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_STANDARD)

Begin standard bullet

  Parameters:
    `bulletName`
    (type=String)

    `leftIndent`
    (type=int)

    `leftSubIndent`
    (type=int)

    `bulletStyle`
    (type=int)

  Returns:
    bool

### BeginStyle(self, style)

Begin using a style

  Parameters:
    `style`
    (type=TextAttrEx)

  Returns:
    bool

### BeginSuppressUndo(self)

Start suppressing undo history for commands.

  Returns:
    bool

### BeginSymbolBullet(self, symbol, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_SYMBOL)

Begin symbol bullet

  Parameters:
    `symbol`
    (type=String)

    `leftIndent`
    (type=int)

    `leftSubIndent`
    (type=int)

    `bulletStyle`
    (type=int)

  Returns:
    bool

### BeginTextColour(self, colour)

Begin using this colour

  Parameters:
    `colour`
    (type=Colour)

  Returns:
    bool

### BeginUnderline(self)

Begin using underline

  Returns:
    bool

### BeginURL(self, url, characterStyle=wxEmptyString)

Begin URL.

  Parameters:
    `url`
    (type=String)

    `characterStyle`
    (type=String)

  Returns:
    bool

### CanCopy(self)

Returns `True` if the selection can be copied to the clipboard.

  Returns:
    bool

### CanCut(self)

Returns `True` if the selection can be cut to the clipboard.

  Returns:
    bool

### CanDeleteSelection(self)

Returns `True` if the selection can be removed from the document.

  Returns:
    bool

### CanPaste(self)

Returns `True` if the current contents of the clipboard can be pasted into the document.

  Returns:
    bool

### CanRedo(self)

Returns `True` if the last operation can be redone.

  Returns:
    bool

### CanUndo(self)

Returns `True` if the last operation can be undone.

  Returns:
    bool

### Copy(self)

Copies the selected text to the clipboard.

### Create(self, parent, id=-1, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=RE_MULTILINE, validator=DefaultValidator, name=RichTextCtrlNameStr)

Create the GUI part of the Window for 2-phase creation mode.

  Parameters:
    `parent`
    (type=Window)

    `id`
    (type=int)

    `pos`
    (type=Point)

    `size`
    (type=Size)

    `style`
    (type=long)

    `name`
    (type=String)

  Returns:
    bool
  Overrides:
    `wx.ScrolledWindow.Create` (inherited documentation)

### Cut(self)

Copies the selected text to the clipboard and removes the selection.

### DeleteSelection(self)

Remove the current selection.

### DiscardEdits(self)

Clears the dirty flag. :see: `MarkDirty`

### EndAlignment(self)

End alignment

  Returns:
    bool

### EndAllStyles(self)

End all styles

  Returns:
    bool

### EndBatchUndo(self)

End batching undo history for commands.

  Returns:
    bool

### EndBold(self)

End using bold

  Returns:
    bool

### EndCharacterStyle(self)

End named character style

  Returns:
    bool

### EndFont(self)

End using a font

  Returns:
    bool

### EndFontSize(self)

End using point size

  Returns:
    bool

### EndItalic(self)

End using italic

  Returns:
    bool

### EndLeftIndent(self)

End left indent

  Returns:
    bool

### EndLineSpacing(self)

End line spacing

  Returns:
    bool

### EndListStyle(self)

End named list style.

  Returns:
    bool

### EndNumberedBullet(self)

End numbered bullet

  Returns:
    bool

### EndParagraphSpacing(self)

End paragraph spacing

  Returns:
    bool

### EndParagraphStyle(self)

End named character style

  Returns:
    bool

### EndRightIndent(self)

End right indent

  Returns:
    bool

### EndStandardBullet(self)

End standard bullet

  Returns:
    bool

### EndStyle(self)

End the style

  Returns:
    bool

### EndSuppressUndo(self)

End suppressing undo history for commands.

  Returns:
    bool

### EndSymbolBullet(self)

End symbol bullet

  Returns:
    bool

### EndTextColour(self)

End using a colour

  Returns:
    bool

### EndUnderline(self)

End using underline

  Returns:
    bool

### EndURL(self)

End URL.

  Returns:
    bool

### GetBasicStyle(self)

Get basic (overall) style

  Returns:
    TextAttrEx

### GetBuffer(self)

Returns the buffer associated with the control.

  Returns:
    RichTextBuffer

### GetDefaultStyle(self)

Retrieves a copy of the default style object.

  Returns:
    TextAttrEx

### GetDelayedLayoutThreshold(self)

Get the threshold in character positions for doing layout optimization during sizing.

  Returns:
    long

### GetHandlerFlags(self)

Get the handler flags, controlling loading and saving.

  Returns:
    int

### GetInsertionPoint(self)

Returns the insertion point. This is defined as the zero based index of the character position to the right of the insertion point.

  Returns:
    long

### GetInternalSelectionRange(self)

Get the selection range in character positions. -1, -1 means no selection. The range is in internal format, i.e. a single character selection is denoted by (n, n).

  Returns:
    RichTextRange

### GetLastPosition(self)

Returns the zero based index of the last position in the document.

  Returns:
    long

### GetSelection(*args, **kwargs)

GetSelection() --> (start, end)

Returns the start and end positions of the current selection. If the values are the same then there is no selection.

### GetSelectionRange(self)

Get the selection range in character positions.

  Returns:
    RichTextRange

### GetStyle(self, position, style)

Retrieve the style used at the given position. Copies the style values at `position` into the `style` parameter and returns `True` if successful. Returns `False` otherwise.

  Parameters:
    `position`
    (type=long)

    `style`
    (type=wxRichTextAttr)

  Returns:
    bool

### GetStyleForRange(self, range, style)

Get the common set of styles for the range

  Parameters:
    `range`
    (type=RichTextRange)

    `style`
    (type=TextAttrEx)

  Returns:
    bool

### GetUncombinedStyle(self, position, style)

Get the content (uncombined) attributes for this position. Copies the style values at `position` into the `style` parameter and returns `True` if successful. Returns `False` otherwise.

  Parameters:
    `position`
    (type=long)

    `style`
    (type=TextAttrEx)

  Returns:
    bool

### HasCharacterAttributes(self, range, style)

Test if this whole range has character attributes of the specified kind. If any of the attributes are different within the range, the test fails. You can use this to implement, for example, bold button updating. style must have flags indicating which attributes are of interest.

  Parameters:
    `range`
    (type=RichTextRange)

    `style`
    (type=TextAttrEx)

  Returns:
    bool

### HasParagraphAttributes(self, range, style)

Test if this whole range has paragraph attributes of the specified kind. If any of the attributes are different within the range, the test fails. You can use this to implement, for example, centering button updating. style must have flags indicating which attributes are of interest.

  Parameters:
    `range`
    (type=RichTextRange)

    `style`
    (type=TextAttrEx)

  Returns:
    bool

### HitTest(*args, **kwargs)

HitTest(self, Point pt) --> (result, pos)

Returns the character position at the given point in pixels. Note that `pt` should be given in device coordinates, and not be adjusted for the client area origin nor for scrolling. The return value is a tuple of the hit test result and the position.

Possible result values are a bitmask of these flags:

> RICHTEXT_HITTEST_NONE | The point was not on this object.

> RICHTEXT_HITTEST_BEFORE

> The point was before the position
>   returned from HitTest.

> RICHTEXT_HITTEST_AFTER | The point was after the position returned from HitTest.
> RICHTEXT_HITTEST_ON | The point was on the position returned from HitTest

  Overrides:
    `wx.Window.HitTest`

### HitTestXY(*args, **kwargs)

HitTestRC(self, Point pt) --> (result, col, row)

Returns the column and row of the given point in pixels. Note that `pt` should be given in device coordinates, and not be adjusted for the client area origin nor for scrolling. The return value is a tuple of the hit test result and the column and row values. :see: `HitTest`

  Overrides:
    `wx.Window.HitTestXY`

### IsSelectionAligned(self, alignment)

Is all of the selection aligned according to the specified flag?

  Parameters:
    `alignment`
    (type=int)

  Returns:
    bool

### IsSelectionBold(self)

Is all of the selection bold?

  Returns:
    bool

### IsSelectionItalics(self)

Is all of the selection italics?

  Returns:
    bool

### IsSelectionUnderlined(self)

Is all of the selection underlined?

  Returns:
    bool

### LayoutContent(self, onlyVisibleRect=False)

Layout the buffer: which we must do before certain operations, such as setting the caret position.

  Parameters:
    `onlyVisibleRect`
    (type=bool)

  Returns:
    bool

### LineBreak(self)

Insert a line break at the current insertion point.

  Returns:
    bool

### LoadFile(self, file, type=RICHTEXT_TYPE_ANY)

Load the contents of the document from the given filename.

  Parameters:
    `file`
    (type=String)

    `type`
    (type=int)

  Returns:
    bool

### MarkDirty(self)

Sets the dirty flag, meaning that the contents of the control have changed and need to be saved.

### MoveCaret(self, pos, showAtLineStart=False)

Move the caret to the given character position

  Parameters:
    `pos`
    (type=long)

    `showAtLineStart`
    (type=bool)

  Returns:
    bool

### MoveDown(self, noLines=1, flags=0)

Move down

  Parameters:
    `noLines`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool

### MoveEnd(self, flags=0)

Move to the end of the buffer

  Parameters:
    `flags`
    (type=int)

  Returns:
    bool

### MoveHome(self, flags=0)

Move to the start of the buffer

  Parameters:
    `flags`
    (type=int)

  Returns:
    bool

### MoveLeft(self, noPositions=1, flags=0)

Move left

  Parameters:
    `noPositions`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool

### MoveRight(self, noPositions=1, flags=0)

Move right

  Parameters:
    `noPositions`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool

### MoveToLineEnd(self, flags=0)

Move to the end of the line

  Parameters:
    `flags`
    (type=int)

  Returns:
    bool

### MoveToLineStart(self, flags=0)

Move to the start of the line

  Parameters:
    `flags`
    (type=int)

  Returns:
    bool

### MoveToParagraphEnd(self, flags=0)

Move to the end of the paragraph

  Parameters:
    `flags`
    (type=int)

  Returns:
    bool

### MoveToParagraphStart(self, flags=0)

Move to the start of the paragraph

  Parameters:
    `flags`
    (type=int)

  Returns:
    bool

### MoveUp(self, noLines=1, flags=0)

Move up

  Parameters:
    `noLines`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool

### Newline(self)

Insert a newline (actually paragraph) at the current insertion point.

  Returns:
    bool

### PageDown(self, noPages=1, flags=0)

Move n pages down

  Parameters:
    `noPages`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool
  Overrides:
    `wx.Window.PageDown`

### PageUp(self, noPages=1, flags=0)

Move n pages up

  Parameters:
    `noPages`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool
  Overrides:
    `wx.Window.PageUp`

### Paste(self)

Pastes text from the clipboard into the document at the current insertion point.

### PopStyleSheet(self)

Pop style sheet from top of stack

  Returns:
    wxRichTextStyleSheet

### PositionToXY(*args, **kwargs)

PositionToXY(self, long pos) --> (x, y)

Retrieves the col,row for the given position within the document

### PushStyleSheet(self, styleSheet)

Push style sheet to top of stack

  Parameters:
    `styleSheet`
    (type=wxRichTextStyleSheet)

  Returns:
    bool

### Redo(self)

If the last operation can be redone, redoes the last operation.

### SaveFile(self, file=EmptyString, type=RICHTEXT_TYPE_ANY)

Save the contents of the document to the given filename, or if the empty string is passed then to the filename set with `SetFilename`.

  Parameters:
    `file`
    (type=String)

    `type`
    (type=int)

  Returns:
    bool

### SelectAll(self)

Select all text in the document.

### SelectNone(self)

Clear the selection

### SelectWord(self, position)

Select the word at the given character position

  Parameters:
    `position`
    (type=long)

  Returns:
    bool

### SetDefaultStyle(self, style)

Set the style used by default for the rich text document.

  Parameters:
    `style`
    (type=TextAttrEx)

  Returns:
    bool

### SetDefaultStyleToCursorStyle(self)

Sets the default style to the style under the cursor

  Returns:
    bool

### SetDelayedLayoutThreshold(self, threshold)

Set the threshold in character positions for doing layout optimization during sizing.

  Parameters:
    `threshold`
    (type=long)

### SetEditable(self, editable)

Makes the document editable or read-only, overriding the RE_READONLY flag.

  Parameters:
    `editable`
    (type=bool)

### SetHandlerFlags(self, flags)

Set the handler flags, controlling loading and saving.

  Parameters:
    `flags`
    (type=int)

### SetInsertionPoint(self, pos)

Sets the insertion point at the given position.

  Parameters:
    `pos`
    (type=long)

### SetInsertionPointEnd(self)

Moves the insertion point to the end of the document.

### SetInternalSelectionRange(self, range)

Set the selection range in character positions. -1, -1 means no selection. The range is in internal format, i.e. a single character selection is denoted by (n, n).

  Parameters:
    `range`
    (type=RichTextRange)

### SetMaxLength(*args, **kwargs)

SetMaxLength(self, unsigned long len)

Set the max number of characters which may be entered in a single line text control.

### SetSelection(self, from, to)

Selects the text starting at the first position up to (but not including) the character at the last position. If both parameters are equal to -1 then all text in the control is selected.

  Parameters:
    `from`
    (type=long)

    `to`
    (type=long)

### SetSelectionRange(self, range)

Set the selection range in character positions. -1, -1 means no selection.

  Parameters:
    `range`
    (type=RichTextRange)

### SetStyle(self, range, style)

Set the style for the text in `range` to `style`

  Parameters:
    `range`
    (type=RichTextRange)

    `style`
    (type=TextAttrEx)

  Returns:
    bool

### SetStyleEx(self, range, style, flags=RICHTEXT_SETSTYLE_WITH_UNDO)

Extended style setting operation with flags including: RICHTEXT_SETSTYLE_WITH_UNDO, RICHTEXT_SETSTYLE_OPTIMIZE, RICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, RICHTEXT_SETSTYLE_CHARACTERS_ONLY

  Parameters:
    `range`
    (type=RichTextRange)

    `style`
    (type=TextAttrEx)

    `flags`
    (type=int)

  Returns:
    bool

### SetStyleSheet(self, styleSheet)

Set style sheet, if any.

  Parameters:
    `styleSheet`
    (type=wxRichTextStyleSheet)

### ShowPosition(self, position)

Ensure that the given position in the document is visible.

  Parameters:
    `position`
    (type=long)

### SuppressingUndo(self)

Are we suppressing undo history for commands?

  Returns:
    bool

### Undo(self)

If the last operation can be undone, undoes the last operation.

### WordLeft(self, noPages=1, flags=0)

Move n words left

  Parameters:
    `noPages`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool

### WordRight(self, noPages=1, flags=0)

Move n words right

  Parameters:
    `noPages`
    (type=int)

    `flags`
    (type=int)

  Returns:
    bool

### WriteBitmap(self, bitmap, bitmapType=BITMAP_TYPE_PNG)

Write a bitmap at the current insertion point. Supply optional type to use for internal and file storage of the raw data.

  Parameters:
    `bitmap`
    (type=Bitmap)

    `bitmapType`
    (type=int)

  Returns:
    bool

### WriteImage(self, image, bitmapType=BITMAP_TYPE_PNG)

Write an image at the current insertion point. Supply optional type to use for internal and file storage of the raw data.

  Parameters:
    `image`
    (type=Image)

    `bitmapType`
    (type=int)

  Returns:
    bool

### WriteImageBlock(self, imageBlock)

Write an image block at the current insertion point.

  Parameters:
    `imageBlock`
    (type=wxRichTextImageBlock)

  Returns:
    bool

### WriteImageFile(self, filename, bitmapType)

Load an image from file and write at the current insertion point.

  Parameters:
    `filename`
    (type=String)

    `bitmapType`
    (type=int)

  Returns:
    bool

### WriteText(self, text)

Insert text at the current position.

  Parameters:
    `text`
    (type=String)

### XYToPosition(self, x, y)

Translate a col,row coordinants into a document position.

  Parameters:
    `x`
    (type=long)

    `y`
    (type=long)

  Returns:
    long

Property Details

### Buffer

See `GetBuffer`

  Get Method:
    `GetBuffer`(self)

### DefaultStyle

See `GetDefaultStyle` and `SetDefaultStyle`

  Get Method:
    `GetDefaultStyle`(self)
  Set Method:
    `SetDefaultStyle`(self, style)

### DelayedLayoutThreshold

See `GetDelayedLayoutThreshold` and `SetDelayedLayoutThreshold`

  Get Method:
    `GetDelayedLayoutThreshold`(self)
  Set Method:
    `SetDelayedLayoutThreshold`(self, threshold)

### Filename

See `GetFilename` and `SetFilename`

  Get Method:
    `GetFilename`(self)
  Set Method:
    `SetFilename`(self, filename)

### InsertionPoint

See `GetInsertionPoint` and `SetInsertionPoint`

  Get Method:
    `GetInsertionPoint`(self)
  Set Method:
    `SetInsertionPoint`(self, pos)

### InternalSelectionRange

See `GetInternalSelectionRange` and `SetInternalSelectionRange`

  Get Method:
    `GetInternalSelectionRange`(self)
  Set Method:
    `SetInternalSelectionRange`(self, range)

### LastPosition

See `GetLastPosition`

  Get Method:
    `GetLastPosition`(self)

### NumberOfLines

See `GetNumberOfLines`

  Get Method:
    `GetNumberOfLines`(self)

### Selection

See `GetSelection` and `SetSelection`

  Get Method:
    `GetSelection`(*args, **kwargs)
  Set Method:
    `SetSelectionRange`(self, range)

### SelectionRange

See `GetSelectionRange` and `SetSelectionRange`

  Get Method:
    `GetSelectionRange`(self)
  Set Method:
    `SetSelectionRange`(self, range)

### StringSelection

See `GetStringSelection`

  Get Method:
    `GetStringSelection`(self)

### StyleSheet

See `GetStyleSheet` and `SetStyleSheet`

  Get Method:
    `GetStyleSheet`(self)
  Set Method:
    `SetStyleSheet`(self, styleSheet)

### thisown

The membership flag

  Get Method:
    unknown-43025784(...)
  Set Method:
    unknown-43025904(...)

### Value

See `GetValue` and `SetValue`

  Get Method:
    `GetValue`(self)
  Set Method:
    `SetValue`(self, value)

Generated by Epydoc 2.1.20050511.rpd on Wed Sep 26 13:46:52 2007 | http://epydoc.sf.net