Inheritance diagram for wx.richtext.RichTextBuffer:
This class represents the whole buffer associated with a wx.richtext.RichTextCtrl.
This is a kind of box, used to represent the whole buffer.
Returns:
Adds an event handler to the buffer’s list of handlers.
A buffer associated with a control has the control as the only event handler, but the application is free to add more if further notification is required. All handlers are notified of an event originating from the buffer, such as the replacement of a style sheet during loading.
The buffer never deletes any of the event handlers, unless RemoveEventHandler is called with True as the second argument.
Parameters:
Returns:
bool
Adds a file handler.
Parameters:
Returns True if the buffer is currently collapsing commands into a single notional command.
Returns:
bool
Begins using alignment.
Parameters:
Returns:
bool
Begins collapsing undo/redo commands.
Parameters:
Returns:
bool
Note
Note that this may not work properly if combining commands that delete or insert content, changing ranges for subsequent actions.
Begin applying bold.
Returns:
bool
Begins applying the named character style.
Parameters:
Returns:
bool
Begins using the given point size.
Parameters:
Returns:
bool
Begins using italic.
Returns:
bool
Begin using leftIndent for the left indent, and optionally leftSubIndent for the sub-indent. Both are expressed in tenths of a millimetre.
The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines.
Parameters:
Returns:
bool
Begins line spacing using the specified value.
spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing. The following constants are defined for convenience:
Line Spacing Flags | Value |
---|---|
wx.richtext.TEXT_ATTR_LINE_SPACING_NORMAL | 10 |
wx.richtext.TEXT_ATTR_LINE_SPACING_HALF | 15 |
wx.richtext.TEXT_ATTR_LINE_SPACING_TWICE | 20 |
Parameters:
Returns:
bool
Begins using a specified list style. Optionally, you can also pass a level and a number.
Parameters:
Returns:
bool
Begins a numbered bullet.
This call will be needed for each item in the list, and the application should take care of incrementing the numbering.
Parameters:
bulletNumber (int): Is a number, usually starting with 1.
leftIndent (int): Value in tenths of a millimetre.
leftSubIndent (int): Value in tenths of a millimetre.
bulletStyle (int): A bitlist of the following values:
Bullet Style Flags |
Value |
---|---|
wx.richtext.TEXT_ATTR_BULLET_STYLE_NONE |
0x00000000 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_ARABIC |
0x00000001 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_UPPER |
0x00000002 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_LOWER |
0x00000004 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_UPPER |
0x00000008 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_LOWER |
0x00000010 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_SYMBOL |
0x00000020 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_BITMAP |
0x00000040 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_PARENTHESES |
0x00000080 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_PERIOD |
0x00000100 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_STANDARD |
0x00000200 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS |
0x00000400 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_OUTLINE |
0x00000800 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_LEFT |
0x00000000 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT |
0x00001000 |
wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE |
0x00002000 |
Of these, wx.richtext.TEXT_ATTR_BULLET_STYLE_BITMAP is unimplemented.
wx.richtext.RichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent.
Returns:
bool
Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.
Parameters:
Returns:
bool
Begins applying the named paragraph style.
Parameters:
Returns:
bool
Begins a right indent, specified in tenths of a millimetre.
Parameters:
Returns:
bool
Begins applying a standard bullet, using one of the standard bullet names (currently standard/circle or standard/square).
See BeginNumberedBullet for an explanation of how indentation is used to render the bulleted paragraph.
Parameters:
Returns:
bool
Begins using a specified style.
Parameters:
Returns:
bool
Begins suppressing undo/redo commands.
The way undo is suppressed may be implemented differently by each command. If not dealt with by a command implementation, then it will be implemented automatically by not storing the command in the undo history when the action is submitted to the command processor.
Returns:
bool
Begins applying a symbol bullet, using a character from the current font.
See BeginNumberedBullet for an explanation of how indentation is used to render the bulleted paragraph.
Parameters:
Returns:
bool
Begins using the specified text foreground colour.
Parameters:
Returns:
bool
Begins applying wx.TEXT_ATTR_URL to the content.
Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining.
Parameters:
Returns:
bool
Begins using underline.
Returns:
bool
Returns True if content can be pasted from the clipboard.
Returns:
bool
Clones the object.
Parameters:
Copy the given range to the clipboard.
Parameters:
Returns:
bool
Submits a command to delete the given range.
Parameters:
Returns:
bool
Ends alignment.
Returns:
bool
Ends all styles that have been started with a Begin... command.
Returns:
bool
Ends collapsing undo/redo commands, and submits the combined command.
Returns:
bool
Ends using bold.
Returns:
bool
Ends using the named character style.
Returns:
bool
Ends using a font.
Returns:
bool
Ends using a point size.
Returns:
bool
Ends using italic.
Returns:
bool
Ends using a left indent.
Returns:
bool
Ends using a line spacing.
Returns:
bool
Ends using a specified list style.
Returns:
bool
Ends a numbered bullet.
Returns:
bool
Ends paragraph spacing.
Returns:
bool
Ends applying a named character style.
Returns:
bool
Ends using a right indent.
Returns:
bool
Ends using a standard bullet.
Returns:
bool
Ends the current style.
Returns:
bool
Ends suppressing undo/redo commands.
Returns:
bool
Ends using a symbol bullet.
Returns:
bool
Ends using a text foreground colour.
Returns:
bool
Ends applying a URL.
Returns:
bool
Ends using underline.
Returns:
bool
Finds a handler by extension and type.
Parameters:
Returns:
Finds a handler by name and type.
Parameters:
Returns:
Finds a handler by name.
Parameters:
Returns:
Finds a handler by type.
Parameters:
Returns:
Gets the collapsed command.
Returns:
wxRichTextCommand
Gets the command processor. A text buffer always creates its own command processor when it is initialized.
Returns:
wx.CommandProcessor
Gets a wildcard incorporating all visible handlers.
If types is present, it will be filled with the file type corresponding to each filter. This can be used to determine the type to pass to LoadFile given a selected filter.
Parameters:
Returns:
string
Returns the list of file handlers.
Returns:
list of strings
Returns the object to be used to render certain aspects of the content, such as bullets.
Returns:
wx.richtext.RichTextRenderer
Parameters:
Returns:
Get the size of the style stack, for example to check correct nesting.
Returns:
long
Finds the text position for the given position, putting the position in textPosition if one is found.
pt is in logical units (a zero y position is at the beginning of the buffer).
The function returns one of the following values:
HitTest Flags | Value – Description |
---|---|
wx.richtext.RICHTEXT_HITTEST_NONE | 0x01 – The point was not on this object |
wx.richtext.RICHTEXT_HITTEST_BEFORE | 0x02 – The point was before the position returned from HitTest |
wx.richtext.RICHTEXT_HITTEST_AFTER | 0x04 – The point was after the position returned from HitTest |
wx.richtext.RICHTEXT_HITTEST_ON | 0x08 – The point was on the position returned from HitTest |
wx.richtext.RICHTEXT_HITTEST_OUTSIDE | 0x10 – The point was on space outside content |
Returns:
int
Initialises the standard handlers.
Currently, only the plain text loading/saving handler is initialised by default.
Inserts a handler at the front of the list.
Parameters:
Submits a command to insert the given image.
Parameters:
Returns:
bool
Submits a command to insert a newline.
Parameters:
Returns:
bool
Submits a command to insert a new paragraph.
Parameters:
Returns:
bool
Submits a command to insert the given text.
Parameters:
Returns:
bool
Returns True if the buffer has been modified.
Returns:
bool
Loads content from a file.
Parameters:
Returns:
bool
Load content from a text stream.
Parameters:
Returns:
bool
Marks the buffer as modified or unmodified.
Parameters:
Pastes the clipboard content to the buffer at the given position.
Parameters:
Returns:
bool
Parameters:
Returns:
bool
Removes an event handler from the buffer’s list of handlers, deleting the object if deleteHandler is True.
Parameters:
Returns:
bool
Removes a handler.
Parameters:
Returns:
bool
Saves content to a file.
Parameters:
Returns:
bool
Saves content to a string stream.
Parameters:
Returns:
bool
Parameters:
Parameters:
Parameters:
Sets renderer as the object to be used to render certain aspects of the content, such as bullets.
You can override default rendering by deriving a new class from wx.richtext.RichTextRenderer or wx.richtext.RichTextStdRenderer, overriding one or more virtual functions, and setting an instance of the class using this function.
Parameters:
Parameters:
Sets the current style sheet, if any. This will allow the application to use named character and paragraph styles found in the style sheet.
Parameters:
Parameters:
Returns:
bool
Submit an action immediately, or delay it according to whether collapsing is on.
Parameters:
Returns:
bool
Returns True if undo suppression is currently on.
Returns:
bool