Home | Trees | Index | Help |
|
---|
Package wx :: Module richtext :: Class RichTextCtrl |
|
object
--+ |Object
--+ |EvtHandler
--+ |Window
--+ |Control
--+ | RichTextCtrl
Proxy of C++ RichTextCtrl class
Method Summary | |
---|---|
Control |
Create a Control. |
RichTextRange |
Add an image |
RichTextRange |
Add a new paragraph of text to the end of the buffer |
AdjustScrollbars(self)
| |
Append text to the end of the document. | |
bool |
Apply alignment to the selection |
bool |
Apply bold to the selection |
bool |
Apply italic to the selection |
bool |
Apply a named style to the selection |
bool |
Apply the style sheet to the buffer, for example if the styles have changed. |
bool |
Apply underline to the selection |
bool |
Are we batching undo history for commands? |
bool |
Begin using alignment |
bool |
Start batching undo history for commands |
bool |
Begin using bold |
bool |
Begin named character style |
bool |
Begin using this font |
bool |
Begin using point size |
bool |
Begin using italic |
bool |
Begin left indent |
bool |
Begin line spacing |
bool |
Begin named list style. |
bool |
Begin numbered bullet |
bool |
Begin paragraph spacing |
bool |
Begin named paragraph style |
bool |
Begin right indent |
bool |
Begin standard bullet |
bool |
Begin using a style |
bool |
Start suppressing undo history for commands. |
bool |
Begin symbol bullet |
bool |
Begin using this colour |
bool |
Begin using underline |
bool |
Begin URL. |
Point |
CalcScrolledPosition(int x, int y) -> (sx, sy) |
int | CalcScrollInc(self,
event)
|
Point |
CalcUnscrolledPosition(int x, int y) -> (ux, uy) |
bool |
Returns True if the selection can be copied to the clipboard. |
bool |
Returns True if the selection can be cut to the clipboard. |
bool |
Returns True if the selection can be removed from the document. |
bool |
Returns True if the current contents of the clipboard can be pasted into the document. |
bool |
Returns True if the last operation can be redone. |
bool |
Returns True if the last operation can be undone. |
ChangeValue(self,
value)
| |
Clear(self)
| |
bool | ClearListStyle(self,
range,
flags)
|
Copies the selected text to the clipboard. | |
bool |
Do the 2nd phase and create the GUI control. |
Copies the selected text to the clipboard and removes the selection. | |
bool | Delete(self,
range)
|
Remove the current selection. | |
Clears the dirty flag. | |
bool | EmulateKeyPress(self,
event)
|
EnableScrolling(self,
x_scrolling,
y_scrolling)
| |
bool |
End alignment |
bool |
End all styles |
bool |
End batching undo history for commands. |
bool |
End using bold |
bool |
End named character style |
bool |
End using a font |
bool |
End using point size |
bool |
End using italic |
bool |
End left indent |
bool |
End line spacing |
bool |
End named list style. |
bool |
End numbered bullet |
bool |
End paragraph spacing |
bool |
End named character style |
bool |
End right indent |
bool |
End standard bullet |
bool |
End the style |
bool |
End suppressing undo history for commands. |
bool |
End symbol bullet |
bool |
End using a colour |
bool |
End using underline |
bool |
End URL. |
TextAttrEx |
Get basic (overall) style |
RichTextBuffer |
Returns the buffer associated with the control. |
TextAttrEx |
Retrieves a copy of the default style object. |
long |
Get the threshold in character positions for doing layout optimization during sizing. |
String | GetFilename(self)
|
int |
Get the handler flags, controlling loading and saving. |
long |
Returns the insertion point. |
RichTextRange |
Get the selection range in character positions. |
long |
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)
|
double | GetScaleX(self)
|
double | GetScaleY(self)
|
int | GetScrollPageSize(self,
orient)
|
(xUnit, yUnit) |
Get the size of one logical unit in physical units. |
GetSelection() --> (start, end) | |
RichTextRange |
Get the selection range in character positions. |
String | GetStringSelection(self)
|
bool |
Retrieve the style used at the given position. |
bool |
Get the common set of styles for the range |
wxRichTextStyleSheet | GetStyleSheet(self)
|
Window | GetTargetWindow(self)
|
Cursor |
Get text cursor |
bool |
Get the content (uncombined) attributes for this position. |
Cursor |
Get URL cursor |
String | GetValue(self)
|
(x,y) |
Get the view start |
bool |
Test if this whole range has character attributes of the specified kind. |
bool |
Test if this whole range has paragraph attributes of the specified kind. |
bool | HasSelection(self)
|
HitTest(self, Point pt) --> (result, pos) | |
HitTestRC(self, Point pt) --> (result, col, row) | |
bool | IsEditable(self)
|
bool | IsEmpty(self)
|
bool | IsModified(self)
|
bool | IsMultiLine(self)
|
bool |
Is all of the selection aligned according to the specified flag? |
bool |
Is all of the selection bold? |
bool |
Is all of the selection italics? |
bool |
Is all of the selection underlined? |
bool | IsSingleLine(self)
|
bool |
Layout the buffer: which we must do before certain operations, such as setting the caret position. |
bool |
Insert a line break at the current insertion point. |
bool |
Load the contents of the document from the given filename. |
Sets the dirty flag, meaning that the contents of the control have changed and need to be saved. | |
bool |
Move the caret to the given character position |
bool |
Move down |
bool |
Move to the end of the buffer |
bool |
Move to the start of the buffer |
bool |
Move left |
bool |
Move right |
bool |
Move to the end of the line |
bool |
Move to the start of the line |
bool |
Move to the end of the paragraph |
bool |
Move to the start of the paragraph |
bool |
Move up |
bool |
Insert a newline (actually paragraph) at the current insertion point. |
bool | NumberList(self,
range,
defName,
flags,
startFrom,
specifiedLevel)
|
bool |
Move n pages down |
bool |
Move n pages up |
Pastes text from the clipboard into the document at the current insertion point. | |
wxRichTextStyleSheet |
Pop style sheet from top of stack |
PositionToXY(self, long pos) --> (x, y) | |
bool | PromoteList(self,
promoteBy,
range,
defName,
flags,
specifiedLevel)
|
bool |
Push style sheet to top of stack |
If the last operation can be redone, redoes the last operation. | |
Remove(self,
from,
to)
| |
Replace(self,
from,
to,
value)
| |
bool |
Save the contents of the document to the given filename, or if the empty string is passed then to the filename set with SetFilename . |
Scroll(self,
x,
y)
| |
Select all text in the document. | |
Clear the selection | |
bool |
Select the word at the given character position |
SetBasicStyle(self,
style)
| |
bool |
Set the style used by default for the rich text document. |
bool |
Sets the default style to the style under the cursor |
Set the threshold in character positions for doing layout optimization during sizing. | |
Makes the document editable or read-only, overriding the RE_READONLY flag. | |
SetFilename(self,
filename)
| |
Set the handler flags, controlling loading and saving. | |
Sets the insertion point at the given position. | |
Moves the insertion point to the end of the document. | |
Set the selection range in character positions. | |
bool | SetListStyle(self,
range,
defName,
flags,
startFrom,
specifiedLevel)
|
SetMaxLength(self, unsigned long len) | |
SetModified(self,
modified)
| |
SetScale(self,
xs,
ys)
| |
SetScrollbars(self,
pixelsPerUnitX,
pixelsPerUnitY,
noUnitsX,
noUnitsY,
xPos,
yPos,
noRefresh)
| |
SetScrollPageSize(self,
orient,
pageSize)
| |
SetScrollRate(self,
xstep,
ystep)
| |
Selects the text starting at the first position up to (but not including) the character at the last position. | |
Set the selection range in character positions. | |
bool |
Set the style for the text in range to style |
bool |
Extended style setting operation with flags including: RICHTEXT_SETSTYLE_WITH_UNDO, RICHTEXT_SETSTYLE_OPTIMIZE, RICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, RICHTEXT_SETSTYLE_CHARACTERS_ONLY |
Set style sheet, if any. | |
SetTargetWindow(self,
target)
| |
Set text cursor | |
Set URL cursor | |
SetValue(self,
value)
| |
Ensure that the given position in the document is visible. | |
bool |
Are we suppressing undo history for commands? |
If the last operation can be undone, undoes the last operation. | |
bool |
Move n words left |
bool |
Move n words right |
bool |
Write a bitmap at the current insertion point. |
bool |
Write an image at the current insertion point. |
bool |
Write an image block at the current insertion point. |
bool |
Load an image from file and write at the current insertion point. |
Insert text at the current position. | |
long |
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)
|
AddImage(self, image)Add an image
|
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.
|
ApplyAlignmentToSelection(self, alignment)Apply alignment to the selection
|
ApplyBoldToSelection(self)Apply bold to the selection
|
ApplyItalicToSelection(self)Apply italic to the selection
|
ApplyStyle(self, def)Apply a named style to the selection
|
ApplyStyleSheet(self, styleSheet=None)Apply the style sheet to the buffer, for example if the styles have changed.
|
ApplyUnderlineToSelection(self)Apply underline to the selection
|
BatchingUndo(self)Are we batching undo history for commands?
|
BeginAlignment(self, alignment)Begin using alignment
|
BeginBatchUndo(self, cmdName)Start batching undo history for commands
|
BeginBold(self)Begin using bold
|
BeginCharacterStyle(self, characterStyle)Begin named character style
|
BeginFont(self, font)Begin using this font
|
BeginFontSize(self, pointSize)Begin using point size
|
BeginItalic(self)Begin using italic
|
BeginLeftIndent(self, leftIndent, leftSubIndent=0)Begin left indent
|
BeginLineSpacing(self, lineSpacing)Begin line spacing
|
BeginListStyle(self, listStyle, level=1, number=1)Begin named list style.
|
BeginNumberedBullet(self, bulletNumber, leftIndent, leftSubIndent, bulletStyle=wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_...)Begin numbered bullet
|
BeginParagraphSpacing(self, before, after)Begin paragraph spacing
|
BeginParagraphStyle(self, paragraphStyle)Begin named paragraph style
|
BeginRightIndent(self, rightIndent)Begin right indent
|
BeginStandardBullet(self, bulletName, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_STANDARD)Begin standard bullet
|
BeginStyle(self, style)Begin using a style
|
BeginSuppressUndo(self)Start suppressing undo history for commands.
|
BeginSymbolBullet(self, symbol, leftIndent, leftSubIndent, bulletStyle=TEXT_ATTR_BULLET_STYLE_SYMBOL)Begin symbol bullet
|
BeginTextColour(self, colour)Begin using this colour
|
BeginUnderline(self)Begin using underline
|
BeginURL(self, url, characterStyle=wxEmptyString)Begin URL.
|
CalcScrolledPosition(self, pt)CalcScrolledPosition(int x, int y) -> (sx, sy) Translate between scrolled and unscrolled coordinates.
|
CalcUnscrolledPosition(self, pt)CalcUnscrolledPosition(int x, int y) -> (ux, uy) Translate between scrolled and unscrolled coordinates.
|
CanCopy(self)Returns True if the selection can be copied to the clipboard.
|
CanCut(self)Returns True if the selection can be cut to the clipboard.
|
CanDeleteSelection(self)Returns True if the selection can be removed from the document.
|
CanPaste(self)Returns True if the current contents of the clipboard can be pasted into the document.
|
CanRedo(self)Returns True if the last operation can be redone.
|
CanUndo(self)Returns True if the last operation can be undone.
|
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)Do the 2nd phase and create the GUI control.
|
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: |
EndAlignment(self)End alignment
|
EndAllStyles(self)End all styles
|
EndBatchUndo(self)End batching undo history for commands.
|
EndBold(self)End using bold
|
EndCharacterStyle(self)End named character style
|
EndFont(self)End using a font
|
EndFontSize(self)End using point size
|
EndItalic(self)End using italic
|
EndLeftIndent(self)End left indent
|
EndLineSpacing(self)End line spacing
|
EndListStyle(self)End named list style.
|
EndNumberedBullet(self)End numbered bullet
|
EndParagraphSpacing(self)End paragraph spacing
|
EndParagraphStyle(self)End named character style
|
EndRightIndent(self)End right indent
|
EndStandardBullet(self)End standard bullet
|
EndStyle(self)End the style
|
EndSuppressUndo(self)End suppressing undo history for commands.
|
EndSymbolBullet(self)End symbol bullet
|
EndTextColour(self)End using a colour
|
EndUnderline(self)End using underline
|
EndURL(self)End URL.
|
GetBasicStyle(self)Get basic (overall) style
|
GetBuffer(self)Returns the buffer associated with the control.
|
GetDefaultStyle(self)Retrieves a copy of the default style object.
|
GetDelayedLayoutThreshold(self)Get the threshold in character positions for doing layout optimization during sizing.
|
GetHandlerFlags(self)Get the handler flags, controlling loading and saving.
|
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.
|
GetInternalSelectionRange(self)Get the selection range in character positions. The range is in internal format, i.e. a single character selection is denoted by (n,n).
|
GetLastPosition(self)Returns the zero based index of the last position in the document.
|
GetScrollPixelsPerUnit()Get the size of one logical unit in physical units.
|
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.
|
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.
|
GetStyleForRange(self, range, style)Get the common set of styles for the range
|
GetTextCursor(self)Get text cursor
|
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.
|
GetURLCursor(self)Get URL cursor
|
GetViewStart()Get the view start
|
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.
|
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.
|
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:
|
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:
|
IsSelectionAligned(self, alignment)Is all of the selection aligned according to the specified flag?
|
IsSelectionBold(self)Is all of the selection bold?
|
IsSelectionItalics(self)Is all of the selection italics?
|
IsSelectionUnderlined(self)Is all of the selection underlined?
|
LayoutContent(self, onlyVisibleRect=False)Layout the buffer: which we must do before certain operations, such as setting the caret position.
|
LineBreak(self)Insert a line break at the current insertion point.
|
LoadFile(self, file, type=RICHTEXT_TYPE_ANY)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. |
MoveCaret(self, pos, showAtLineStart=False)Move the caret to the given character position
|
MoveDown(self, noLines=1, flags=0)Move down
|
MoveEnd(self, flags=0)Move to the end of the buffer
|
MoveHome(self, flags=0)Move to the start of the buffer
|
MoveLeft(self, noPositions=1, flags=0)Move left
|
MoveRight(self, noPositions=1, flags=0)Move right
|
MoveToLineEnd(self, flags=0)Move to the end of the line
|
MoveToLineStart(self, flags=0)Move to the start of the line
|
MoveToParagraphEnd(self, flags=0)Move to the end of the paragraph
|
MoveToParagraphStart(self, flags=0)Move to the start of the paragraph
|
MoveUp(self, noLines=1, flags=0)Move up
|
Newline(self)Insert a newline (actually paragraph) at the current insertion point.
|
PageDown(self, noPages=1, flags=0)Move n pages down
|
PageUp(self, noPages=1, flags=0)Move n pages up
|
Paste(self)Pastes text from the clipboard into the document at the current insertion point. |
PopStyleSheet(self)Pop style sheet from top of stack
|
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
|
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
|
SelectAll(self)Select all text in the document. |
SelectNone(self)Clear the selection |
SelectWord(self, position)Select the word at the given character position
|
SetDefaultStyle(self, style)Set the style used by default for the rich text document.
|
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.
|
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. The range is in internal format, i.e. a single character selection is denoted by (n,n).
|
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.
|
SetSelectionRange(self, range)Set the selection range in character positions. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the selection for a character at position 5, use the range (5,6).
|
SetStyle(self, range, style)Set the style for the text in range to style
|
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
|
SetStyleSheet(self, styleSheet)Set style sheet, if any.
|
SetTextCursor(self, cursor)Set text cursor
|
SetURLCursor(self, cursor)Set URL cursor
|
ShowPosition(self, position)Ensure that the given position in the document is visible.
|
SuppressingUndo(self)Are we suppressing undo history for commands?
|
Undo(self)If the last operation can be undone, undoes the last operation. |
WordLeft(self, noPages=1, flags=0)Move n words left
|
WordRight(self, noPages=1, flags=0)Move n words right
|
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.
|
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.
|
WriteImageBlock(self, imageBlock)Write an image block at the current insertion point.
|
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.
|
XYToPosition(self, x, y)Translate a col,row coordinants into a document position.
|
Property Details |
---|
BufferSee
|
DefaultStyleSee
|
DelayedLayoutThresholdSee
|
FilenameSee
|
InsertionPointSee
|
InternalSelectionRangeSee
|
LastPositionSee
|
NumberOfLinesSee
|
SelectionSee
|
SelectionRangeSee
|
StringSelection
|
StyleSheetSee
|
thisownThe membership flag
|
Value |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:54:19 2009 | http://epydoc.sf.net |