This class is a Rich Text edit control implemented for Transana

RichTextEditCtrl contains the following public methods:

MethodDescription
GetStyleAccessor() This method is simply a public wrapper around __GetStyle()
CurrentSpec() No description
InsertRisingIntonation() Insert the Rising Intonation (Up Arrow) symbol
InsertFallingIntonation() Insert the Falling Intonation (Down Arrow) symbol
InsertInBreath() Insert the In Breath (Closed Dot) symbol
InsertWhisper() Insert the Whisper (Open Dot) symbol
InsertSymbol() Insert a character in Symbol Font into the text
InsertUnicodeChar() Insert a Unicode character, which may not have a length of 1, into the text
InsertHiddenText() Insert hidden text at current cursor position.
InsertStyledText() Insert text with the current style.
ClearDoc() Clear the document buffer.
LoadRTFData() Load a RTF document into the editor with the document as a buffer (string).
InsertRTFText() Add RTF text at the cursor, without clearing the whole document. Used to insert Clip Transcripts into TextReports.
LoadRTFFile() Load a RTF file into the editor.
LoadDocument() Load a file into the editor.
GetBold() Get bold state for current font or for the selected text.
GetItalic() Get italic state for current font or for the selected text.
GetUnderline() Get underline state for current font or for the selected text.
SetBold() Set bold state for current font or for the selected text.
SetItalic() Set italic state for current font or for the selected text.
SetUnderline() Set underline state for current font or for the selected text.
SetFont() Set the font.
GetFont() Get the current (font face, size, color) in a tuple.
GetRTFBuffer() Get a string of data in RTF format of the current document in memory. If select_only = 1, then only the current selection will be processed instead of the whole document.
GetPickledBuffer() Get the current document as a pickled string. This is useful for saving to the database.
SaveRTFDocument() Save the document in memory to the given file.
SetDragEvent() No description
OnCharAdded() Called when a character is added to the document.
OnUpdateUI() Called when the the User Interface needs to be updated.
OnModified() Triggered when the document is modified, including style changes.
SetSavePoint() Override the existing SetSavePoint to account for style changes.
GetModify() Override the existing GetModify to account for style changes.
set_default_font() Change the default font.
set_font() Change the current font or the font for the selected text.
cut_selected_text() Delete selected text and place in clipboard.
copy_seleted_text() Copy selected text to clipboard.
paste_text() Paste text from clipboard.
select_all() Select all document text.
find_text() Find text in document.
cursor_find() Move the cursor to the next occurrence of given text in the transcript (for word tracking).
select_find() Select the text from the current cursor position to the next occurrence of given text (for word tracking).
spell_check() Interactively spell-check document.
undo() Undo last operation(s).
redo() Redo last undone operation(s).
MoveAfterInTabOrder() MoveAfterInTabOrder(self, Window win) Moves this window in the tab navigation order after the specified sibling window. This means that when the user presses the TAB key on that other window, the focus switches to this window. The default tab order is the same as creation order. This function and `MoveBeforeInTabOrder` allow to change it after creating all the windows.
Fit() Fit(self) Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows and will only really work correctly if sizers are used for the subwindows layout. Also, if the window has exactly one subwindow it is better (faster and the result is more precise as Fit adds some margin to account for fuzziness of its calculations) to call window.SetClientSize(child.GetSize()) instead of calling Fit.
SetWrapStartIndent() SetWrapStartIndent(self, int indent) Set the start indent for wrapped lines.
GetStyleBits() GetStyleBits(self) -> int Retrieve number of bits in style bytes used to hold the lexical state.
InitDialog() InitDialog(self) Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators.
GetAlignment() GetAlignment(self) -> int Get the control alignment (left/right/centre, top/bottom/centre)
AutoCompPosStart() AutoCompPosStart(self) -> int Retrieve the position of the caret when the auto-completion list was displayed.
IsEnabled() IsEnabled(self) -> bool Returns true if the window is enabled for input, false otherwise.
Refresh() Refresh(self, bool eraseBackground=True, Rect rect=None) Mark the specified rectangle (or the whole window) as "dirty" so it will be repainted. Causes an EVT_PAINT event to be generated and sent to the window.
GetPasteConvertEndings() GetPasteConvertEndings(self) -> bool Get convert-on-paste setting
SetIndent() SetIndent(self, int indentSize) Set the number of spaces used for one level of indentation.
IsExposed() IsExposed(self, int x, int y, int w=1, int h=1) -> bool Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.
SetHelpTextForId() SetHelpTextForId(self, String text) Associate this help text with all windows with the same id as this one.
SetHelpText() SetHelpText(self, String text) Sets the help text to be used as context-sensitive help for this window. Note that the text is actually stored by the current `wx.HelpProvider` implementation, and not in the window object itself.
CanRedo() CanRedo(self) -> bool Are there any redoable actions in the undo history?
GetLineRaw() GetLineRaw(self, int line) -> wxCharBuffer Retrieve the contents of a line. The returned value is a utf-8 encoded string in unicode builds of wxPython, or raw 8-bit text otherwise.
Disconnect() Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool
AutoCompSetSeparator() AutoCompSetSeparator(self, int separatorCharacter) Change the separator character in the string setting up an auto-completion list. Default is space but can be changed if items contain space.
SearchNext() SearchNext(self, int flags, String text) -> int Find some text starting at the search anchor. Does not ensure the selection is visible.
StyleSetEOLFilled() StyleSetEOLFilled(self, int style, bool filled) Set a style to have its end of line filled or not.
HitTest() HitTest(self, Point pt) -> int Test where the given (in client coords) point lies
SetSizeWH() SetSizeWH(self, int width, int height) Sets the size of the window in pixels.
PointFromPosition() PointFromPosition(self, int pos) -> Point Retrieve the point in the window where a position is displayed.
GetClientSizeTuple() GetClientSizeTuple() -> (width, height) This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc.
LineEndWrap() LineEndWrap(self)
PrepareDC() PrepareDC(self, DC dc) Call this function to prepare the device context for drawing a scrolled image. It sets the device origin according to the current scroll position.
InsertText() InsertText(self, int pos, String text) Insert string at a position.
DeleteBackNotLine() DeleteBackNotLine(self) Delete the selection or if no selection, the character before the caret. Will not delete the character before at the start of a line.
CanPaste() CanPaste(self) -> bool Will a paste succeed?
HomeRectExtend() HomeRectExtend(self) Move caret to first position on line, extending rectangular selection to new caret position.
MarkerPrevious() MarkerPrevious(self, int lineStart, int markerMask) -> int Find the previous line before lineStart that includes a marker in mask.
LinesOnScreen() LinesOnScreen(self) -> int Retrieves the number of lines completely visible.
AppendTextUTF8() Append a UTF8 string to the end of the document without changing the selection. Works 'natively' in a unicode build of wxPython, and will also work in an ansi build if the UTF8 text is compatible with the current encoding.
GetThemeEnabled() GetThemeEnabled(self) -> bool Return the themeEnabled flag.
GetDocPointer() GetDocPointer(self) -> void Retrieve a pointer to the document object.
SetIndentationGuides() SetIndentationGuides(self, bool show) Show or hide indentation guides.
SetValidator() SetValidator(self, Validator validator) Deletes the current validator (if any) and sets the window validator, having called wx.Validator.Clone to create a new validator of this type.
Home() Home(self) Move caret to first position on line.
SetFocus() SetFocus(self) Set's the focus to this window, allowing it to receive keyboard input.
AutoCompSetTypeSeparator() AutoCompSetTypeSeparator(self, int separatorCharacter) Change the type-separator character in the string setting up an auto-completion list. Default is '?' but can be changed if items contain '?'.
GetIndentationGuides() GetIndentationGuides(self) -> bool Are the indentation guides visible?
GetLineState() GetLineState(self, int line) -> int Retrieve the extra styling information for a line.
Allocate() Allocate(self, int bytes) Enlarge the document to a particular size of text bytes.
GetUseVerticalScrollBar() GetUseVerticalScrollBar(self) -> bool Is the vertical scroll bar visible?
GetTextExtent() GetTextExtent(String string) -> (width, height) Get the width and height of the text using the current font.
SetMaxSize() SetMaxSize(self, Size maxSize) A more convenient method than `SetSizeHints` for setting just the max size.
StyleSetFontAttr() StyleSetFontAttr(self, int styleNum, int size, String faceName, bool bold, bool italic, bool underline, int encoding=wxFONTENCODING_DEFAULT) Set all font style attributes at once.
SetFoldMarginColour() SetFoldMarginColour(self, bool useSetting, Colour back) Set the colours used as a chequerboard pattern in the fold margin
GetFoldParent() GetFoldParent(self, int line) -> int Find the parent line of a child line.
GetStyleAt() GetStyleAt(self, int pos) -> int Returns the style byte at the position.
ParaUp() ParaUp(self)
SetSizeHints() SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1) Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) Sizers will also inspect the minimum window size and will use that value if set when calculating layout. The resizing increments are only significant under Motif or Xt.
HasMultiplePages() HasMultiplePages(self) -> bool
SetSTCFocus() SetSTCFocus(self, bool focus) Change internal focus flag.
MoveBeforeInTabOrder() MoveBeforeInTabOrder(self, Window win) Same as `MoveAfterInTabOrder` except that it inserts this window just before win instead of putting it right after it.
AutoCompStops() AutoCompStops(self, String characterSet) Define a set of character that when typed cancel the auto-completion list.
SetSelAlpha() SetSelAlpha(self, int alpha) Set the alpha of the selection.
LineCut() LineCut(self) Cut the line containing the caret.
GetVirtualSizeTuple() GetVirtualSizeTuple() -> (width, height) Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
GetStyledText() GetStyledText(self, int startPos, int endPos) -> wxMemoryBuffer Retrieve a buffer of cells.
SetSelection() SetSelection(self, int start, int end) Select a range of text.
StyleSetCase() StyleSetCase(self, int style, int caseForce) Set a style to be mixed case, or to force upper or lower case.
DelLineRight() DelLineRight(self) Delete forwards from the current position to the end of the line.
SetMarginSensitive() SetMarginSensitive(self, int margin, bool sensitive) Make a margin sensitive or insensitive to mouse clicks.
HasTransparentBackground() HasTransparentBackground(self) -> bool Returns True if this window's background is transparent (as, for example, for `wx.StaticText`) and should show the parent window's background. This method is mostly used internally by the library itself and you normally shouldn't have to call it. You may, however, have to override it in your custom control classes to ensure that background is painted correctly.
CharRight() CharRight(self) Move caret right one character.
GetCodePage() GetCodePage(self) -> int Get the code page used to interpret the bytes of the document as characters.
GetConstraints() GetConstraints(self) -> LayoutConstraints Returns a pointer to the window's layout constraints, or None if there are none.
AssociateHandle() AssociateHandle(self, long handle) Associate the window with a new native handle
GetTargetStart() GetTargetStart(self) -> int Get the position that starts the target.
IsExposedRect() IsExposedRect(self, Rect rect) -> bool Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.
PushEventHandler() PushEventHandler(self, EvtHandler handler) Pushes this event handler onto the event handler stack for the window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to a handler function.) By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. wx.Window.PushEventHandler allows an application to set up a chain of event handlers, where an event not handled by one event handler is handed to the next one in the chain. Use `wx.Window.PopEventHandler` to remove the event handler. Ownership of the handler is *not* given to the window, so you should be sure to pop the handler before the window is destroyed and either let PopEventHandler destroy it, or call its Destroy method yourself.
ScrollToColumn() ScrollToColumn(self, int column) Scroll enough to make the given column visible
Lower() Lower(self) Lowers the window to the bottom of the window hierarchy. In current version of wxWidgets this works both for managed and child windows.
SetSelForeground() SetSelForeground(self, bool useSetting, Colour fore) Set the foreground colour of the selection and whether to use this setting.
AutoCompCancel() AutoCompCancel(self) Remove the auto-completion list from the screen.
GetIndent() GetIndent(self) -> int Retrieve indentation size.
GetTextLength() GetTextLength(self) -> int Retrieve the number of characters in the document.
SetOwnFont() SetOwnFont(self, Font font)
WordStartPosition() WordStartPosition(self, int pos, bool onlyWordCharacters) -> int Get position of start of word.
EditToggleOvertype() EditToggleOvertype(self) Switch from insert to overtype mode or the reverse.
GetScreenRect() GetScreenRect(self) -> Rect Returns the size and position of the window in screen coordinantes as a `wx.Rect` object.
Hide() Hide(self) -> bool Equivalent to calling Show(False).
SetWindowStyle() SetWindowStyleFlag(self, long style) Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.
MarkerLineFromHandle() MarkerLineFromHandle(self, int handle) -> int Retrieve the line number at which a particular marker is located.
AdjustForLayoutDirection() AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int Mirror coordinates for RTL layout if this window uses it and if the mirroring is not done automatically like Win32.
ToggleCaretSticky() ToggleCaretSticky(self) Switch between sticky and non-sticky: meant to be bound to a key.
SetToolTipString() SetToolTipString(self, String tip) Attach a tooltip to the window.
SetVirtualSizeWH() SetVirtualSizeWH(self, int w, int h) Set the the virtual size of a window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
GetUseTabs() GetUseTabs(self) -> bool Retrieve whether tabs will be used in indentation.
GetChildren() GetChildren(self) -> PyObject Returns a list of the window's children. NOTE: Currently this is a copy of the child window list maintained by the window, so the return value of this function is only valid as long as the window's children do not change.
LinesSplit() LinesSplit(self, int pixelWidth) Split the lines in the target into lines that are less wide than pixelWidth where possible.
StyleSetChangeable() StyleSetChangeable(self, int style, bool changeable) Set a style to be changeable or not (read only). Experimental feature, currently buggy.
SetEOLMode() SetEOLMode(self, int eolMode) Set the current end of line mode.
SetHScrollBar() SetHScrollBar(self, wxScrollBar bar) Set the horizontal scrollbar to use instead of the ont that's built-in.
GetFoldExpanded() GetFoldExpanded(self, int line) -> bool Is a header line expanded?
SetScrollPos() SetScrollPos(self, int orientation, int pos, bool refresh=True) Sets the position of one of the built-in scrollbars.
GetMinSize() GetMinSize(self) -> Size
SetCaretLineBackAlpha() SetCaretLineBackAlpha(self, int alpha) Set background alpha of the caret line.
HideSelection() HideSelection(self, bool normal) Draw the selection in normal style or with selection highlighted.
GetLineSelEndPosition() GetLineSelEndPosition(self, int line) -> int Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
CanSetTransparent() CanSetTransparent(self) -> bool Returns ``True`` if the platform supports setting the transparency for this window. Note that this method will err on the side of caution, so it is possible that this will return ``False`` when it is in fact possible to set the transparency. NOTE: On X-windows systems the X server must have the composite extension loaded, and there must be a composite manager program (such as xcompmgr) running.
DelWordRight() DelWordRight(self) Delete the word to the right of the caret.
RefreshRect() RefreshRect(self, Rect rect, bool eraseBackground=True) Redraws the contents of the given rectangle: the area inside it will be repainted. This is the same as Refresh but has a nicer syntax.
MakeModal() MakeModal(self, bool modal=True) Disables all other windows in the application so that the user can only interact with this window. Passing False will reverse this effect.
HitTestXY() HitTestXY(self, int x, int y) -> int Test where the given (in client coords) point lies
GetMaxSize() GetMaxSize(self) -> Size
MarkerDeleteHandle() MarkerDeleteHandle(self, int handle) Delete a marker.
StyleSetBold() StyleSetBold(self, int style, bool bold) Set a style to be bold or not.
SetDimensions() SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are equal to -1. ======================== ====================================== wx.SIZE_AUTO A -1 indicates that a class-specific default should be used. wx.SIZE_USE_EXISTING Axisting dimensions should be used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be interpreted as real dimensions, not default values. ======================== ======================================
Enable() Enable(self, bool enable=True) -> bool Enable or disable the window for user input. Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is. Returns true if the window has been enabled or disabled, false if nothing was done, i.e. if the window had already been in the specified state.
CaptureMouse() CaptureMouse(self) Directs all mouse input to this window. Call wx.Window.ReleaseMouse to release the capture. Note that wxWindows maintains the stack of windows having captured the mouse and when the mouse is released the capture returns to the window which had had captured it previously and it is only really released if there were no previous window. In particular, this means that you must release the mouse as many times as you capture it, unless the window receives the `wx.MouseCaptureLostEvent` event. Any application which captures the mouse in the beginning of some operation *must* handle `wx.MouseCaptureLostEvent` and cancel this operation when it receives the event. The event handler must not recapture mouse.
SetCaret() SetCaret(self, Caret caret) Sets the caret associated with the window.
FindWindowById() FindWindowById(self, long winid) -> Window Find a chld of this window by window ID
ScrollLines() ScrollLines(self, int lines) -> bool If the platform and window class supports it, scrolls the window by the given number of lines down, if lines is positive, or up if lines is negative. Returns True if the window was scrolled, False if it was already on top/bottom and nothing was done.
SetWordChars() SetWordChars(self, String characters) Set the set of characters making up words for when moving or selecting by word. First sets deaults like SetCharsDefault.
GetLength() GetLength(self) -> int Returns the number of characters in the document.
SelectionIsRectangle() SelectionIsRectangle(self) -> bool Is the selection rectangular? The alternative is the more common stream selection.
LoadFile() LoadFile(self, String filename) -> bool Load the contents of filename into the editor
SetLexerLanguage() SetLexerLanguage(self, String language) Set the lexing language of the document based on string name.
SetBackgroundColour() SetBackgroundColour(self, Colour colour) -> bool Sets the background colour of the window. Returns True if the colour was changed. The background colour is usually painted by the default EVT_ERASE_BACKGROUND event handler function under Windows and automatically under GTK. Using `wx.NullColour` will reset the window to the default background colour. Note that setting the background colour may not cause an immediate refresh, so you may wish to call `ClearBackground` or `Refresh` after calling this function. Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system.
Colourise() Colourise(self, int start, int end) Colourise a segment of the document using the current lexing language.
VCHomeWrapExtend() VCHomeWrapExtend(self)
SetOvertype() SetOvertype(self, bool overtype) Set to overtype (true) or insert mode.
GetTextUTF8() Retrieve all the text in the document as UTF8. In an ansi build of wxPython the text retrieved from the document is assumed to be in the current default encoding.
WrapCount() WrapCount(self, int line) -> int The number of display lines needed to wrap a document line
GetWindowStyle() GetWindowStyleFlag(self) -> long Gets the window style that was passed to the constructor or Create method.
CharRightExtend() CharRightExtend(self) Move caret right one character extending selection to new caret position.
GetExtraStyle() GetExtraStyle(self) -> long Returns the extra style bits for the window.
WordRightEnd() WordRightEnd(self) Move caret right one word, position cursor at end of word.
UseBgCol() UseBgCol(self) -> bool
GetScrollPos() GetScrollPos(self, int orientation) -> int Returns the built-in scrollbar position.
GetSelectedTextUTF8() Retrieve the selected text as UTF8. In an ansi build of wxPython the text retrieved from the document is assumed to be in the current default encoding.
LineDownExtend() LineDownExtend(self) Move caret down one line extending selection to new caret position.
SetId() SetId(self, int winid) Sets the identifier of the window. Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently.
SetTabIndents() SetTabIndents(self, bool tabIndents) Sets whether a tab pressed when caret is within indentation indents.
SaveFile() SaveFile(self, String filename) -> bool Write the contents of the editor to filename
SetEventHandler() SetEventHandler(self, EvtHandler handler) Sets the event handler for this window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to handler function.) By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. It is usually better to use `wx.Window.PushEventHandler` since this sets up a chain of event handlers, where an event not handled by one event handler is handed off to the next one in the chain.
AutoCompSetAutoHide() AutoCompSetAutoHide(self, bool autoHide) Set whether or not autocompletion is hidden automatically when nothing matches.
GetMinWidth() GetMinWidth(self) -> int
GetLineIndentPosition() GetLineIndentPosition(self, int line) -> int Retrieve the position before the first non indentation character on a line.
SetSTCCursor() SetSTCCursor(self, int cursorType) Sets the cursor to one of the SC_CURSOR* values.
GetEdgeColour() GetEdgeColour(self) -> Colour Retrieve the colour used in edge indication.
GetTextRangeRaw() GetTextRangeRaw(self, int startPos, int endPos) -> wxCharBuffer Retrieve a range of text. The returned value is a utf-8 encoded string in unicode builds of wxPython, or raw 8-bit text otherwise.
SetReadOnly() SetReadOnly(self, bool readOnly) Set to read only or read write.
HomeDisplay() HomeDisplay(self) Move caret to first position on display line.
GetSizeTuple() GetSizeTuple() -> (width, height) Get the window size.
CopyText() CopyText(self, int length, String text) Copy argument text to the clipboard.
ClientToScreen() ClientToScreen(self, Point pt) -> Point Converts to screen coordinates from coordinates relative to this window.
CmdKeyExecute() CmdKeyExecute(self, int cmd) Perform one of the operations defined by the wx.stc.STC_CMD_* constants.
GetTabWidth() GetTabWidth(self) -> int Retrieve the visible size of a tab.
SetSizerAndFit() SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) The same as SetSizer, except it also sets the size hints for the window based on the sizer's minimum size.
Cancel() Cancel(self) Cancel any modes such as call tip or auto-completion list display.
SetVScrollBar() SetVScrollBar(self, wxScrollBar bar) Set the vertical scrollbar to use instead of the one that's built-in.
GetProperty() GetProperty(self, String key) -> String Retrieve a 'property' value previously set with SetProperty.
GetLastChild() GetLastChild(self, int line, int level) -> int Find the last child line of a header line.
TransferDataToWindow() TransferDataToWindow(self) -> bool Transfers values to child controls from data areas specified by their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call TransferDataToWindow() of all child windows.
VisibleFromDocLine() VisibleFromDocLine(self, int line) -> int Find the display line of a document line taking hidden lines into account.
AutoCompGetDropRestOfWord() AutoCompGetDropRestOfWord(self) -> bool Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
StyleClearAll() StyleClearAll(self) Clear all the styles and make equivalent to the global default style.
VCHome() VCHome(self) Move caret to before first visible character on line. If already there move to first character on line.
GetLine() GetLine(self, int line) -> String Retrieve the contents of a line.
SendSizeEvent() No description
SetExtraStyle() SetExtraStyle(self, long exStyle) Sets the extra style bits for the window. Extra styles are the less often used style bits which can't be set with the constructor or with SetWindowStyleFlag()
GetRect() GetRect(self) -> Rect Returns the size and position of the window as a `wx.Rect` object.
LineScrollDown() LineScrollDown(self) Scroll the document down, keeping the caret visible.
GetAnchor() GetAnchor(self) -> int Returns the position of the opposite end of the selection to the caret.
LineUpRectExtend() LineUpRectExtend(self) Move caret up one line, extending rectangular selection to new caret position.
CenterOnParent() CenterOnParent(self, int dir=BOTH) Center with respect to the the parent window
UpdateWindowUI() UpdateWindowUI(self, long flags=UPDATE_UI_NONE) This function sends EVT_UPDATE_UI events to the window. The particular implementation depends on the window; for example a wx.ToolBar will send an update UI event for each toolbar button, and a wx.Frame will send an update UI event for each menubar menu item. You can call this function from your application to ensure that your UI is up-to-date at a particular point in time (as far as your EVT_UPDATE_UI handlers are concerned). This may be necessary if you have called `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to limit the overhead that wxWindows incurs by sending update UI events in idle time.
AcceptsFocus() AcceptsFocus(self) -> bool Can this window have focus?
SetXCaretPolicy() SetXCaretPolicy(self, int caretPolicy, int caretSlop) Set the way the caret is kept visible when going sideway. The exclusion zone is given in pixels.
SetConstraints() SetConstraints(self, LayoutConstraints constraints) Sets the window to have the given layout constraints. If an existing layout constraints object is already owned by the window, it will be deleted. Pass None to disassociate and delete the window's current constraints. You must call SetAutoLayout to tell a window to use the constraints automatically in its default EVT_SIZE handler; otherwise, you must handle EVT_SIZE yourself and call Layout() explicitly. When setting both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have effect.
GetPropertyInt() GetPropertyInt(self, String key) -> int Retrieve a 'property' value previously set with SetProperty, interpreted as an int AFTER any '$()' variable replacement.
GetUpdateClientRect() GetUpdateClientRect(self) -> Rect Get the update rectangle region bounding box in client coords.
GetCaretLineVisible() GetCaretLineVisible(self) -> bool Is the background of the line containing the caret in a different colour?
MoveCaretInsideView() MoveCaretInsideView(self) Move the caret inside current view if it's not there already.
SetSelBackground() SetSelBackground(self, bool useSetting, Colour back) Set the background colour of the selection and whether to use this setting.
StyleResetDefault() StyleResetDefault(self) Reset the default style to its state at startup
DocumentStartExtend() DocumentStartExtend(self) Move caret to first position in document extending selection to new caret position.
GetClientAreaOrigin() GetClientAreaOrigin(self) -> Point Get the origin of the client area of the window relative to the window's top left corner (the client area may be shifted because of the borders, scrollbars, other decorations...)
IsSameAs() IsSameAs(self, Object p) -> bool For wx.Objects that use C++ reference counting internally, this method can be used to determine if two objects are referencing the same data object.
StyleSetItalic() StyleSetItalic(self, int style, bool italic) Set a style to be italic or not.
GetWrapStartIndent() GetWrapStartIndent(self) -> int Retrive the start indent for wrapped lines.
UserListShow() UserListShow(self, int listType, String itemList) Display a list of strings and send notification when user chooses one.
SetContainingSizer() SetContainingSizer(self, Sizer sizer) This normally does not need to be called by application code. It is called internally when a window is added to a sizer, and is used so the window can remove itself from the sizer when it is destroyed.
ScreenToClientXY() ScreenToClientXY(int x, int y) -> (x,y) Converts from screen to client window coordinates.
SetVirtualSizeHints() SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the virtual area of the window outside the given bounds.
GetMarginLeft() GetMarginLeft(self) -> int Returns the size in pixels of the left margin.
IsFrozen() IsFrozen(self) -> bool Returns ``True`` if the window has been frozen and not thawed yet. :see: `Freeze` and `Thaw`
ClearBackground() ClearBackground(self) Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated.
GetForegroundColour() GetForegroundColour(self) -> Colour Returns the foreground colour of the window. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all.
SetModEventMask() SetModEventMask(self, int mask) Set which document modification events are sent to the container.
CacheBestSize() CacheBestSize(self, Size size) Cache the best size so it doesn't need to be calculated again, (at least until some properties of the window change.)
GetSearchFlags() GetSearchFlags(self) -> int Get the search flags used by SearchInTarget.
SetBackSpaceUnIndents() SetBackSpaceUnIndents(self, bool bsUnIndents) Sets whether a backspace pressed when caret is within indentation unindents.
GetCaretPeriod() GetCaretPeriod(self) -> int Get the time in milliseconds that the caret is on and off.
GetSTCCursor() GetSTCCursor(self) -> int Get cursor type.
BraceHighlight() BraceHighlight(self, int pos1, int pos2) Highlight the characters at two positions.
SetLineState() SetLineState(self, int line, int state) Used to hold extra styling information for each line.
HomeWrap() HomeWrap(self) These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
LineDown() LineDown(self) Move caret down one line.
Create() Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=wxSTCNameStr) -> bool
LineEndExtend() LineEndExtend(self) Move caret to last position on line extending selection to new caret position.
SetFoldExpanded() SetFoldExpanded(self, int line, bool expanded) Show the children of a header line.
WordRightEndExtend() WordRightEndExtend(self) Move caret right one word, position cursor at end of word, extending selection to new caret position.
GetBufferedDraw() GetBufferedDraw(self) -> bool Is drawing done first into a buffer or direct to the screen?
GetCaret() GetCaret(self) -> Caret Returns the caret associated with the window.
Close() Close(self, bool force=False) -> bool This function simply generates a EVT_CLOSE event whose handler usually tries to close the window. It doesn't close the window itself, however. If force is False (the default) then the window's close handler will be allowed to veto the destruction of the window.
CharLeftRectExtend() CharLeftRectExtend(self) Move caret left one character, extending rectangular selection to new caret position.
GetUndoCollection() GetUndoCollection(self) -> bool Is undo history being collected?
SetToolTip() SetToolTip(self, ToolTip tip) Attach a tooltip to the window.
GetBackgroundColour() GetBackgroundColour(self) -> Colour Returns the background colour of the window.
IsShownOnScreen() IsShownOnScreen(self) -> bool Returns ``True`` if the window is physically visible on the screen, i.e. it is shown and all its parents up to the toplevel window are shown as well.
GetLayoutDirection() GetLayoutDirection(self) -> int Get the layout direction (LTR or RTL) for this window. Returns ``wx.Layout_Default`` if layout direction is not supported.
SetProperty() SetProperty(self, String key, String value) Set up a value that may be used by a lexer for some optional feature.
AutoCompGetMaxHeight() AutoCompGetMaxHeight(self) -> int Set the maximum height, in rows, of auto-completion and user lists.
DocumentEnd() DocumentEnd(self) Move caret to last position in document.
StopRecord() StopRecord(self) Stop notifying the container of all key presses and commands.
SetHotspotActiveForeground() SetHotspotActiveForeground(self, bool useSetting, Colour fore) Set a fore colour for active hotspots.
SetCharsDefault() SetCharsDefault(self) Reset the set of characters for whitespace and word characters to the defaults.
SetStyleBytes() SetStyleBytes(self, int length, char styleBytes) Set the styles for a segment of the document.
SetFoldMarginHiColour() SetFoldMarginHiColour(self, bool useSetting, Colour fore)
SetMouseDwellTime() SetMouseDwellTime(self, int periodMilliseconds) Sets the time the mouse must sit still to generate a mouse dwell event.
StutteredPageUp() StutteredPageUp(self) Move caret to top of page, or one page up if already at top of page.
SetSelectionStart() SetSelectionStart(self, int pos) Sets the position that starts the selection - this becomes the anchor.
GetReadOnly() GetReadOnly(self) -> bool In read-only mode?
MarkerSetForeground() MarkerSetForeground(self, int markerNumber, Colour fore) Set the foreground colour used for a particular marker number.
SetMargins() SetMargins(self, int left, int right) Set the left and right margin in the edit area, measured in pixels.
FitInside() FitInside(self) Similar to Fit, but sizes the interior (virtual) size of a window. Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won't do anything if there are no subwindows.
GetContainingSizer() GetContainingSizer(self) -> Sizer Return the sizer that this window is a member of, if any, otherwise None.
CallTipPosAtStart() CallTipPosAtStart(self) -> int Retrieve the position where the caret was before displaying the call tip.
DocLineFromVisible() DocLineFromVisible(self, int lineDisplay) -> int Find the document line of a display line taking hidden lines into account.
SetMarginLeft() SetMarginLeft(self, int pixelWidth) Sets the size in pixels of the left margin.
SetBufferedDraw() SetBufferedDraw(self, bool buffered) If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.
GetFirstVisibleLine() GetFirstVisibleLine(self) -> int Retrieve the display line at the top of the display.
GetScreenPosition() GetScreenPosition(self) -> Point Get the position of the window in screen coordinantes.
StyleSetFaceName() StyleSetFaceName(self, int style, String fontName) Set the font of a style.
SetLastKeydownProcessed() SetLastKeydownProcessed(self, bool val)
PositionFromLine() PositionFromLine(self, int line) -> int Retrieve the position at the start of a line.
EnsureVisibleEnforcePolicy() EnsureVisibleEnforcePolicy(self, int line) Ensure a particular line is visible by expanding any header line hiding it. Use the currently set visibility policy to determine which range to display.
GetUpdateRegion() GetUpdateRegion(self) -> Region Returns the region specifying which parts of the window have been damaged. Should only be called within an EVT_PAINT handler.
BraceBadLight() BraceBadLight(self, int pos) Highlight the character at a position indicating there is no matching brace.
StyleSetCharacterSet() StyleSetCharacterSet(self, int style, int characterSet) Set the character set of the font in a style. Converts the Scintilla wx.stc.STC_CHARSET_* set values to a wxFontEncoding.
OnPaint() OnPaint(self, PaintEvent event)
SetWhitespaceChars() SetWhitespaceChars(self, String characters) Set the set of characters making up whitespace for when moving or selecting by word. Should be called after SetWordChars.
PageDown() PageDown(self) Move caret one page down.
SetCodePage() SetCodePage(self, int codePage) Set the code page used to interpret the bytes of the document as characters.
ReleaseMouse() ReleaseMouse(self) Releases mouse input captured with wx.Window.CaptureMouse.
EndUndoAction() EndUndoAction(self) End a sequence of actions that is undone and redone as a unit.
AutoCompGetAutoHide() AutoCompGetAutoHide(self) -> bool Retrieve whether or not autocompletion is hidden automatically when nothing matches.
SetBackgroundStyle() SetBackgroundStyle(self, int style) -> bool Returns the background style of the window. The background style indicates how the background of the window is drawn. ====================== ======================================== wx.BG_STYLE_SYSTEM The background colour or pattern should be determined by the system wx.BG_STYLE_COLOUR The background should be a solid colour wx.BG_STYLE_CUSTOM The background will be implemented by the application. ====================== ======================================== On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of a custom background, such as a tiled bitmap. Currently the style has no effect on other platforms. :see: `GetBackgroundStyle`, `SetBackgroundColour`
MarkerAdd() MarkerAdd(self, int line, int markerNumber) -> int Add a marker to a line, returning an ID which can be used to find or delete the marker.
Connect() Connect(self, int id, int lastId, int eventType, PyObject func)
IsTopLevel() IsTopLevel(self) -> bool Returns true if the given window is a top-level one. Currently all frames and dialogs are always considered to be top-level windows (even if they have a parent window).
CallTipActive() CallTipActive(self) -> bool Is there an active call tip?
GetBestFittingSize() Use `GetEffectiveMinSize` instead.
WordPartLeftExtend() WordPartLeftExtend(self) Move to the previous change in capitalisation extending selection to new caret position.
GetHelpTextAtPoint() GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String Get the help string associated with the given position in this window. Notice that pt may be invalid if event origin is keyboard or unknown and this method should return the global window help text then
StutteredPageDownExtend() StutteredPageDownExtend(self) Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
GetMinHeight() GetMinHeight(self) -> int
GetDropTarget() GetDropTarget(self) -> DropTarget Returns the associated drop target, which may be None.
Copy() Copy(self) Copy the selection to the clipboard.
SendMsg() SendMsg(self, int msg, long wp=0, long lp=0) -> long Send a message to Scintilla.
GetName() GetName(self) -> String Returns the windows name. This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via wx.Window.SetName.
GetStatus() GetStatus(self) -> int Get error status.
GetMouseDwellTime() GetMouseDwellTime(self) -> int Retrieve the time the mouse must sit still to generate a mouse dwell event.
SetStatus() SetStatus(self, int statusCode) Change error status - 0 = OK.
GetBackgroundStyle() GetBackgroundStyle(self) -> int Returns the background style of the window. :see: `SetBackgroundStyle`
LineScrollUp() LineScrollUp(self) Scroll the document up, keeping the caret visible.
GetAdjustedBestSize() Use `GetEffectiveMinSize` instead.
CopyRange() CopyRange(self, int start, int end) Copy a range of text to the clipboard. Positions are clipped into the document.
SetLineIndentation() SetLineIndentation(self, int line, int indentSize) Change the indentation of a line to a number of columns.
GetNextHandler() GetNextHandler(self) -> EvtHandler
RemoveEventHandler() RemoveEventHandler(self, EvtHandler handler) -> bool Find the given handler in the event handler chain and remove (but not delete) it from the event handler chain, returns True if it was found and False otherwise (this also results in an assert failure so this function should only be called when the handler is supposed to be there.)
UpperCase() UpperCase(self) Transform the selection to upper case.
GetGrandParent() GetGrandParent(self) -> Window Returns the parent of the parent of this window, or None if there isn't one.
ProcessEvent() ProcessEvent(self, Event event) -> bool
SetMarginRight() SetMarginRight(self, int pixelWidth) Sets the size in pixels of the right margin.
HomeDisplayExtend() HomeDisplayExtend(self) Move caret to first position on display line extending selection to new caret position.
VCHomeExtend() VCHomeExtend(self) Like VCHome but extending selection to new caret position.
StyleSetVisible() StyleSetVisible(self, int style, bool visible) Set a style to be visible or not.
SetYCaretPolicy() SetYCaretPolicy(self, int caretPolicy, int caretSlop) Set the way the line the caret is on is kept visible. The exclusion zone is given in lines.
PageUpRectExtend() PageUpRectExtend(self) Move caret one page up, extending rectangular selection to new caret position.
SetEdgeColour() SetEdgeColour(self, Colour edgeColour) Change the colour used in edge indication.
StyleSetUnderline() StyleSetUnderline(self, int style, bool underline) Set a style to be underlined or not.
LineCopy() LineCopy(self) Copy the line containing the caret.
AutoCompShow() AutoCompShow(self, int lenEntered, String itemList) Display a auto-completion list. The lenEntered parameter indicates how many characters before the caret should be used to provide context.
LineTranspose() LineTranspose(self) Switch the current line with the previous.
ClearRegisteredImages() ClearRegisteredImages(self) Clear all the registered images.
AutoCompSetChooseSingle() AutoCompSetChooseSingle(self, bool chooseSingle) Should a single item auto-completion list automatically choose the item.
SetCaretLineBackground() SetCaretLineBackground(self, Colour back) Set the colour of the background of the line containing the caret.
AddPendingEvent() AddPendingEvent(self, Event event)
AutoCompSelect() AutoCompSelect(self, String text) Select the item in the auto-completion list that starts with a string.
RegisterHotKey() RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window will receive a hotkey event. It will receive the event even if the application is in the background and does not have the input focus because the user is working with some other application. To bind an event handler function to this hotkey use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the hotkey was registered successfully.
AutoCompGetTypeSeparator() AutoCompGetTypeSeparator(self) -> int Retrieve the auto-completion list type-separator character.
ScrollWindow() ScrollWindow(self, int dx, int dy, Rect rect=None) Physically scrolls the pixels in the window and move child windows accordingly. Use this function to optimise your scrolling implementations, to minimise the area that must be redrawn. Note that it is rarely required to call this function from a user program.
GetLastKeydownProcessed() GetLastKeydownProcessed(self) -> bool
AutoCompGetSeparator() AutoCompGetSeparator(self) -> int Retrieve the auto-completion list separator character.
AutoCompSetCancelAtStart() AutoCompSetCancelAtStart(self, bool cancel) Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
StyleSetSpec() StyleSetSpec(self, int styleNum, String spec) Extract style settings from a spec-string which is composed of one or more of the following comma separated elements:: bold turns on bold italic turns on italics fore:[name or #RRGGBB] sets the foreground colour back:[name or #RRGGBB] sets the background colour face:[facename] sets the font face name to use size:[num] sets the font size in points eol turns on eol filling underline turns on underlining
LowerCase() LowerCase(self) Transform the selection to lower case.
GetPropertyExpanded() GetPropertyExpanded(self, String key) -> String Retrieve a 'property' value previously set with SetProperty, with '$()' variable replacement on returned buffer.
GetCharAt() GetCharAt(self, int pos) -> int Returns the character byte at the position.
SetMarginMask() SetMarginMask(self, int margin, int mask) Set a mask that determines which markers are displayed in a margin.
AutoCompGetChooseSingle() AutoCompGetChooseSingle(self) -> bool Retrieve whether a single item auto-completion list automatically choose the item.
SetPreviousHandler() SetPreviousHandler(self, EvtHandler handler)
GetScrollWidth() GetScrollWidth(self) -> int Retrieve the document width assumed for scrolling.
ChooseCaretX() ChooseCaretX(self) Set the last x chosen value to be the caret x position.
ToggleFold() ToggleFold(self, int line) Switch a header line between expanded and contracted.
HasCapture() HasCapture(self) -> bool Returns true if this window has the current mouse capture.
GetSTCFocus() GetSTCFocus(self) -> bool Get internal focus flag.
Command() Command(self, CommandEvent event) Simulates the effect of the user issuing a command to the item. :see: `wx.CommandEvent`
GetLineVisible() GetLineVisible(self, int line) -> bool Is a line visible?
SetControlCharSymbol() SetControlCharSymbol(self, int symbol) Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.
GetClassName() GetClassName(self) -> String Returns the class name of the C++ class using wxRTTI.
GetCharHeight() GetCharHeight(self) -> int Get the (average) character size for the current font.
InsertTextUTF8() Insert UTF8 encoded text at a position. Works 'natively' in a unicode build of wxPython, and will also work in an ansi build if the UTF8 text is compatible with the current encoding.
LineScroll() LineScroll(self, int columns, int lines) Scroll horizontally and vertically.
SearchInTarget() SearchInTarget(self, String text) -> int Search for a counted string in the target and set the target to the found range. Text is counted so it can contain NULs. Returns length of range or -1 for failure in which case target is not moved.
LineEndDisplayExtend() LineEndDisplayExtend(self) Move caret to last position on display line extending selection to new caret position.
GetBackSpaceUnIndents() GetBackSpaceUnIndents(self) -> bool Does a backspace pressed when caret is within indentation unindent?
AutoCompGetMaxWidth() AutoCompGetMaxWidth(self) -> int Get the maximum width, in characters, of auto-completion and user lists.
Cut() Cut(self) Cut the selection to the clipboard.
ParaUpExtend() ParaUpExtend(self)
SetEndAtLastLine() SetEndAtLastLine(self, bool endAtLastLine) Sets the scroll range so that maximum scroll position has the last line at the bottom of the view (default). Setting this to false allows scrolling one page below the last line.
TransferDataFromWindow() TransferDataFromWindow(self) -> bool Transfers values from child controls to data areas specified by their validators. Returns false if a transfer failed. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call TransferDataFromWindow() of all child windows.
SetKeyWords() SetKeyWords(self, int keywordSet, String keyWords) Set up the key words used by the lexer.
GetParent() GetParent(self) -> Window Returns the parent window of this window, or None if there isn't one.
ZoomOut() ZoomOut(self) Make the displayed text smaller by decreasing the sizes by 1 point.
FindColumn() FindColumn(self, int line, int column) -> int Find the position of a column on a line taking into account tabs and multi-byte characters. If beyond end of line, return line end position.
SetPrintMagnification() SetPrintMagnification(self, int magnification) Sets the print magnification added to the point size of each style for printing.
SetMarginType() SetMarginType(self, int margin, int marginType) Set a margin to be either numeric or symbolic.
SetPrintWrapMode() SetPrintWrapMode(self, int mode) Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
GetHelpText() GetHelpText(self) -> String Gets the help text to be used as context-sensitive help for this window. Note that the text is actually stored by the current `wx.HelpProvider` implementation, and not in the window object itself.
IsShown() IsShown(self) -> bool Returns true if the window is shown, false if it has been hidden.
GetMarginSensitive() GetMarginSensitive(self, int margin) -> bool Retrieve the mouse click sensitivity of a margin.
StyleSetSize() StyleSetSize(self, int style, int sizePoints) Set the size of characters of a style.
InvalidateBestSize() InvalidateBestSize(self) Reset the cached best size value so it will be recalculated the next time it is needed.
SetSizeHintsSz() SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) Sizers will also inspect the minimum window size and will use that value if set when calculating layout. The resizing increments are only significant under Motif or Xt.
GetCharWidth() GetCharWidth(self) -> int Get the (average) character size for the current font.
SetAutoLayout() SetAutoLayout(self, bool autoLayout) Determines whether the Layout function will be called automatically when the window is resized. lease note that this only happens for the windows usually used to contain children, namely `wx.Panel` and `wx.TopLevelWindow` (and the classes deriving from them). This method is called implicitly by `SetSizer` but if you use `SetConstraints` you should call it manually or otherwise the window layout won't be correctly updated when its size changes.
GetLexer() GetLexer(self) -> int Retrieve the lexing language of the document.
InsertTextRaw() InsertTextRaw(self, int pos, char text) Insert string at a position. The text should be utf-8 encoded on unicode builds of wxPython, or can be any 8-bit text in ansi builds.
SetEdgeColumn() SetEdgeColumn(self, int column) Set the column number of the edge. If text goes past the edge then it is highlighted.
ConvertPixelPointToDialog() ConvertPixelPointToDialog(self, Point pt) -> Point
AcceptsFocusFromKeyboard() AcceptsFocusFromKeyboard(self) -> bool Can this window be given focus by keyboard navigation? if not, the only way to give it focus (provided it accepts it at all) is to click it.
GetCaretWidth() GetCaretWidth(self) -> int Returns the width of the insert mode caret.
FindText() FindText(self, int minPos, int maxPos, String text, int flags=0) -> int Find some text in the document.
WordRightExtend() WordRightExtend(self) Move caret right one word extending selection to new caret position.
HomeWrapExtend() HomeWrapExtend(self)
StyleSetBackground() StyleSetBackground(self, int style, Colour back) Set the background colour of a style.
AutoCompActive() AutoCompActive(self) -> bool Is there an auto-completion list visible?
SetVirtualSizeHintsSz() SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the virtual area of the window outside the given bounds.
MarkerAddSet() MarkerAddSet(self, int line, int set) Add a set of markers to a line.
ToggleWindowStyle() ToggleWindowStyle(self, int flag) -> bool Turn the flag on if it had been turned off before and vice versa, returns True if the flag is turned on by this function call.
ShouldInheritColours() ShouldInheritColours(self) -> bool Return true from here to allow the colours of this window to be changed by InheritAttributes, returning false forbids inheriting them from the parent window. The base class version returns false, but this method is overridden in wxControl where it returns true.
WordLeftEndExtend() WordLeftEndExtend(self) Move caret left one word, position cursor at end of word, extending selection to new caret position.
LineUp() LineUp(self) Move caret up one line.
CmdKeyClearAll() CmdKeyClearAll(self) Drop all key mappings.
SetScrollWidth() SetScrollWidth(self, int pixelWidth) Sets the document width assumed for scrolling.
GetCursor() GetCursor(self) -> Cursor Return the cursor associated with this window.
DLG_PNT() DLG_PNT(self, Point pt) -> Point Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
WordPartRightExtend() WordPartRightExtend(self) Move to the next change in capitalisation extending selection to new caret position.
SetText() SetText(self, String text) Replace the contents of the document with the argument text.
WordLeft() WordLeft(self) Move caret left one word.
SetHighlightGuide() SetHighlightGuide(self, int column) Set the highlighted indentation guide column. 0 = no highlighted guide.
GetColumn() GetColumn(self, int pos) -> int Retrieve the column number of a position, taking tab width into account.
GetWindowBorderSize() GetWindowBorderSize(self) -> Size Return the size of the left/right and top/bottom borders.
PageUpExtend() PageUpExtend(self) Move caret one page up extending selection to new caret position.
SearchAnchor() SearchAnchor(self) Sets the current caret position to be the search anchor.
LineEndRectExtend() LineEndRectExtend(self) Move caret to last position on line, extending rectangular selection to new caret position.
IndicatorGetStyle() IndicatorGetStyle(self, int indic) -> int Retrieve the style of an indicator.
LineFromPosition() LineFromPosition(self, int pos) -> int Retrieve the line containing a position.
AutoCompGetCurrent() AutoCompGetCurrent(self) -> int Get currently selected item position in the auto-completion list
VCHomeWrap() VCHomeWrap(self)
MarkerNext() MarkerNext(self, int lineStart, int markerMask) -> int Find the next line after lineStart that includes a marker in mask.
GetClientRect() GetClientRect(self) -> Rect Get the client area position and size as a `wx.Rect` object.
DocumentStart() DocumentStart(self) Move caret to first position in document.
DelLineLeft() DelLineLeft(self) Delete back from the current position to the start of the line.
ParaDownExtend() ParaDownExtend(self)
ConvertPixelSizeToDialog() ConvertPixelSizeToDialog(self, Size sz) -> Size
SetViewWhiteSpace() SetViewWhiteSpace(self, int viewWS) Make white space characters invisible, always visible or visible outside indentation.
Tab() Tab(self) If selection is empty or all on one line replace the selection with a tab character. If more than one line selected, indent the lines.
EmptyUndoBuffer() EmptyUndoBuffer(self) Delete the undo history.
GetFoldLevel() GetFoldLevel(self, int line) -> int Retrieve the fold level of a line.
AutoCompComplete() AutoCompComplete(self) User has selected an item so remove the list and insert the selection.
BraceMatch() BraceMatch(self, int pos) -> int Find the position of a matching brace or INVALID_POSITION if no match.
GetAcceleratorTable() GetAcceleratorTable(self) -> AcceleratorTable Gets the accelerator table for this window.
GetSelectedTextRaw() GetSelectedTextRaw(self) -> wxCharBuffer Retrieve the selected text. The returned value is a utf-8 encoded string in unicode builds of wxPython, or raw 8-bit text otherwise.
IsDoubleBuffered() IsDoubleBuffered(self) -> bool Returns ``True`` if the window contents is double-buffered by the system, i.e. if any drawing done on the window is really done on a temporary backing surface and transferred to the screen all at once later.
SetStyling() SetStyling(self, int length, int style) Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.
SetWrapVisualFlagsLocation() SetWrapVisualFlagsLocation(self, int wrapVisualFlagsLocation) Set the location of visual flags for wrapped lines.
GetPreviousHandler() GetPreviousHandler(self) -> EvtHandler
GetClientSize() GetClientSize(self) -> Size This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc.
GetStyleBitsNeeded() GetStyleBitsNeeded(self) -> int Retrieve the number of bits the current lexer needs for styling.
GetHandle() GetHandle(self) -> long Returns the platform-specific handle (as a long integer) of the physical window. Currently on wxMac it returns the handle of the toplevel parent of the window.
StyleSetFont() StyleSetFont(self, int styleNum, Font font) Set style size, face, bold, italic, and underline attributes from the attributes of a `wx.Font`.
DeleteBack() DeleteBack(self) Delete the selection or if no selection, the character before the caret.
AddText() AddText(self, String text) Add text to the document at current position.
GetModEventMask() GetModEventMask(self) -> int Get which document modification events are sent to the container.
GetViewWhiteSpace() GetViewWhiteSpace(self) -> int Are white space characters currently visible? Returns one of SCWS_* constants.
GetCaretSticky() GetCaretSticky(self) -> bool Can the caret preferred x position only be changed by explicit movement commands?
SetWindowStyleFlag() SetWindowStyleFlag(self, long style) Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.
IsBeingDeleted() IsBeingDeleted(self) -> bool Is the window in the process of being deleted?
ClearAll() ClearAll(self) Delete all text in the document.
SelectAll() SelectAll(self) Select all the text in the document.
GetMarginWidth() GetMarginWidth(self, int margin) -> int Retrieve the width of a margin in pixels.
SetDoubleBuffered() SetDoubleBuffered(self, bool on) Currently wxGTK2 only.
ClearDocumentStyle() ClearDocumentStyle(self) Set all style bytes to 0, remove all folding information.
GetCaretLineBackAlpha() GetCaretLineBackAlpha(self) -> int Get the background alpha of the caret line.
LineLength() LineLength(self, int line) -> int How many characters are on a line, not including end of line characters?
SetOwnForegroundColour() SetOwnForegroundColour(self, Colour colour)
SetFoldFlags() SetFoldFlags(self, int flags) Set some style options for folding.
Freeze() Freeze(self) Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all. Thaw must be called to reenable window redrawing. Calls to Freeze/Thaw may be nested, with the actual Thaw being delayed until all the nesting has been undone. This method is useful for visual appearance optimization (for example, it is a good idea to use it before inserting large amount of text into a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWindows and not a mandatory directive.
InheritAttributes() InheritAttributes(self) This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours. By 'intelligently' the following is meant: by default, all windows use their own default attributes. However if some of the parent's attributes are explicitly changed (that is, using SetFont and not SetOwnFont) and if the corresponding attribute hadn't been explicitly set for this window itself, then this window takes the same value as used by the parent. In addition, if the window overrides ShouldInheritColours to return false, the colours will not be changed no matter what and only the font might. This rather complicated logic is necessary in order to accommodate the different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can't inherit the same value from the parent. However it was also deemed desirable to allow to simply change the attributes of all children at once by just changing the font or colour of their common parent, hence in this case we do inherit the parents attributes.
PageDownRectExtend() PageDownRectExtend(self) Move caret one page down, extending rectangular selection to new caret position.
DestroyChildren() DestroyChildren(self) -> bool Destroys all children of a window. Called automatically by the destructor.
ScreenToClient() ScreenToClient(self, Point pt) -> Point Converts from screen to client window coordinates.
HasScrollbar() HasScrollbar(self, int orient) -> bool Does the window have the scrollbar for this orientation?
SetName() SetName(self, String name) Sets the window's name. The window name is used for ressource setting in X, it is not the same as the window title/label
MarkerDelete() MarkerDelete(self, int line, int markerNumber) Delete a marker from a line.
GetCaretForeground() GetCaretForeground(self) -> Colour Get the foreground colour of the caret.
GetPrintColourMode() GetPrintColourMode(self) -> int Returns the print colour mode.
FormFeed() FormFeed(self) Insert a Form Feed character.
SetSelectionEnd() SetSelectionEnd(self, int pos) Sets the position that ends the selection - this becomes the currentPosition.
EnsureCaretVisible() EnsureCaretVisible(self) Ensure the caret is visible.
GetControlCharSymbol() GetControlCharSymbol(self) -> int Get the way control characters are displayed.
GetUseHorizontalScrollBar() GetUseHorizontalScrollBar(self) -> bool Is the horizontal scroll bar visible?
SetAnchor() SetAnchor(self, int posAnchor) Set the selection anchor to a position. The anchor is the opposite end of the selection from the caret.
GetMarginRight() GetMarginRight(self) -> int Returns the size in pixels of the right margin.
WordLeftExtend() WordLeftExtend(self) Move caret left one word extending selection to new caret position.
CharLeft() CharLeft(self) Move caret left one character.
HideLines() HideLines(self, int lineStart, int lineEnd) Make a range of lines invisible.
GetMarginType() GetMarginType(self, int margin) -> int Retrieve the type of a margin.
CmdKeyAssign() CmdKeyAssign(self, int key, int modifiers, int cmd) When key+modifier combination km is pressed perform msg.
GetPrintWrapMode() GetPrintWrapMode(self) -> int Is printing line wrapped?
SetPasteConvertEndings() SetPasteConvertEndings(self, bool convert) Enable/Disable convert-on-paste for line endings
StutteredPageDown() StutteredPageDown(self) Move caret to bottom of page, or one page down if already at bottom of page.
GetWrapVisualFlags() GetWrapVisualFlags(self) -> int Retrive the display mode of visual flags for wrapped lines.
Raise() Raise(self) Raises the window to the top of the window hierarchy. In current version of wxWidgets this works both for managed and child windows.
GetVirtualSize() GetVirtualSize(self) -> Size Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
GetEndAtLastLine() GetEndAtLastLine(self) -> bool Retrieve whether the maximum scroll position has the last line at the bottom of the view.
ReplaceSelection() ReplaceSelection(self, String text) Replace the selected text with the argument text.
GetMaxWidth() GetMaxWidth(self) -> int
SetCaretLineVisible() SetCaretLineVisible(self, bool show) Display the background of the line containing the caret in a different colour.
CreateDocument() CreateDocument(self) -> void Create a new document object. Starts with reference count of 1 and not selected into editor.
PageUp() PageUp(self) Move caret one page up.
AutoCompSetIgnoreCase() AutoCompSetIgnoreCase(self, bool ignoreCase) Set whether case is significant when performing auto-completion searches.
StutteredPageUpExtend() StutteredPageUpExtend(self) Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
GetEdgeMode() GetEdgeMode(self) -> int Retrieve the edge highlight mode.
GetSelectionEnd() GetSelectionEnd(self) -> int Returns the position at the end of the selection.
WordPartLeft() WordPartLeft(self) Move to the previous change in capitalisation.
LineEnd() LineEnd(self) Move caret to last position on line.
SetSearchFlags() SetSearchFlags(self, int flags) Set the search flags used by SearchInTarget.
GetCurrentLine() GetCurrentLine(self) -> int Returns the line number of the line with the caret.
SetWhitespaceBackground() SetWhitespaceBackground(self, bool useSetting, Colour back) Set the background colour of all whitespace and whether to use this setting.
WordEndPosition() WordEndPosition(self, int pos, bool onlyWordCharacters) -> int Get position of end of word.
SetPrintColourMode() SetPrintColourMode(self, int mode) Modify colours when printing for clearer printed text.
MarkerSetAlpha() MarkerSetAlpha(self, int markerNumber, int alpha) Set the alpha used for a marker that is drawn in the text area, not the margin.
SetCaretLineBack() SetCaretLineBackground(self, Colour back) Set the colour of the background of the line containing the caret.
GetScreenPositionTuple() GetScreenPositionTuple() -> (x,y) Get the position of the window in screen coordinantes.
PostCreate() Phase 3 of the 2-phase create Call this method after precreating the window with the 2-phase create method.
SetThemeEnabled() SetThemeEnabled(self, bool enableTheme) This function tells a window if it should use the system's "theme" code to draw the windows' background instead if its own background drawing code. This will only have an effect on platforms that support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user's selected theme. Dialogs, notebook pages and the status bar have this flag set to true by default so that the default look and feel is simulated best.
SetBestFittingSize() Use `SetInitialSize`
ScrollPages() ScrollPages(self, int pages) -> bool If the platform and window class supports it, scrolls the window by the given number of pages down, if pages is positive, or up if pages is negative. Returns True if the window was scrolled, False if it was already on top/bottom and nothing was done.
SetNextHandler() SetNextHandler(self, EvtHandler handler)
WarpPointer() WarpPointer(self, int x, int y) Moves the pointer to the given position on the window. NOTE: This function is not supported under Mac because Apple Human Interface Guidelines forbid moving the mouse cursor programmatically.
MarkerDefine() MarkerDefine(self, int markerNumber, int markerSymbol, Colour foreground=wxNullColour, Colour background=wxNullColour) Set the symbol used for a particular marker number, and optionally the fore and background colours.
GetSelAlpha() GetSelAlpha(self) -> int Get the alpha of the selection.
CentreOnParent() CenterOnParent(self, int dir=BOTH) Center with respect to the the parent window
GetTextRange() GetTextRange(self, int startPos, int endPos) -> String Retrieve a range of text.
SetHotspotActiveUnderline() SetHotspotActiveUnderline(self, bool underline) Enable / Disable underlining active hotspots.
GetEvtHandlerEnabled() GetEvtHandlerEnabled(self) -> bool
SetTargetEnd() SetTargetEnd(self, int pos) Sets the position that ends the target which is used for updating the document without affecting the scroll position.
SetLexer() SetLexer(self, int lexer) Set the lexing language of the document.
InheritsBackgroundColour() InheritsBackgroundColour(self) -> bool
Navigate() Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool Does keyboard navigation from this window to another, by sending a `wx.NavigationKeyEvent`.
UsePopUp() UsePopUp(self, bool allowPopUp) Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button.
SetHotspotActiveBackground() SetHotspotActiveBackground(self, bool useSetting, Colour back) Set a back colour for active hotspots.
DocumentEndExtend() DocumentEndExtend(self) Move caret to last position in document extending selection to new caret position.
PositionBefore() PositionBefore(self, int pos) -> int Given a valid document position, return the previous position taking code page into account. Returns 0 if passed 0.
IndicatorSetForeground() IndicatorSetForeground(self, int indic, Colour fore) Set the foreground colour of an indicator.
GetLineEndPosition() GetLineEndPosition(self, int line) -> int Get the position after the last visible characters on a line.
GetEOLMode() GetEOLMode(self) -> int Retrieve the current end of line mode - one of CRLF, CR, or LF.
CallTipSetForegroundHighlight() CallTipSetForegroundHighlight(self, Colour fore) Set the foreground colour for the highlighted part of the call tip.
GetLineUTF8() Retrieve the contents of a line as UTF8. In an ansi build of wxPython the text retrieved from the document is assumed to be in the current default encoding.
NewLine() NewLine(self) Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
RemoveChild() RemoveChild(self, Window child) Removes a child window. This is called automatically by window deletion functions so should not be required by the application programmer.
GetMarginMask() GetMarginMask(self, int margin) -> int Retrieve the marker mask of a margin.
DissociateHandle() DissociateHandle(self) Dissociate the current native handle from the window
Centre() Center(self, int direction=BOTH) Centers the window. The parameter specifies the direction for cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may also include wx.CENTER_ON_SCREEN flag if you want to center the window on the entire screen and not on its parent window. If it is a top-level window and has no parent then it will always be centered relative to the screen.
LineEndDisplay() LineEndDisplay(self) Move caret to last position on display line.
GetText() GetText(self) -> String Retrieve all the text in the document.
GetSize() GetSize(self) -> Size Get the window size.
LineDownRectExtend() LineDownRectExtend(self) Move caret down one line, extending rectangular selection to new caret position.
GetTextRaw() GetTextRaw(self) -> wxCharBuffer Retrieve all the text in the document. The returned value is a utf-8 encoded string in unicode builds of wxPython, or raw 8-bit text otherwise.
DoDropText() DoDropText(self, long x, long y, String data) -> bool Allow for simulating a DnD DropText.
Bind() Bind an event to an event handler. :param event: One of the EVT_* objects that specifies the type of event to bind, :param handler: A callable object to be invoked when the event is delivered to self. Pass None to disconnect an event handler. :param source: Sometimes the event originates from a different window than self, but you still want to catch it in self. (For example, a button event delivered to a frame.) By passing the source of the event, the event handling system is able to differentiate between the same event type from different controls. :param id: Used to spcify the event source by ID instead of instance. :param id2: Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE.
SetEdgeMode() SetEdgeMode(self, int mode) The edge may be displayed by a line (EDGE_LINE) or by highlighting text that goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
SetStyleBits() SetStyleBits(self, int bits) Divide each styling byte into lexical class bits (default: 5) and indicator bits (default: 3). If a lexer requires more than 32 lexical states, then this is used to expand the possible states.
TargetFromSelection() TargetFromSelection(self) Make the target range start and end be the same as the selection range start and end.
GetWrapMode() GetWrapMode(self) -> int Retrieve whether text is word wrapped.
SetXOffset() SetXOffset(self, int newOffset) Get and Set the xOffset (ie, horizonal scroll position).
EnsureVisible() EnsureVisible(self, int line) Ensure a particular line is visible by expanding any header line hiding it.
Redo() Redo(self) Redoes the next action on the undo history.
GetPosition() GetPosition(self) -> Point Get the window's position. Notice that the position is in client coordinates for child windows and screen coordinates for the top level ones, use `GetScreenPosition` if you need screen coordinates for all kinds of windows.
GetWindowVariant() GetWindowVariant(self) -> int
GetSelectionMode() GetSelectionMode(self) -> int Get the mode of the current selection.
AddChild() AddChild(self, Window child) Adds a child window. This is called automatically by window creation functions so should not be required by the application programmer.
AutoCompSetMaxHeight() AutoCompSetMaxHeight(self, int rowCount) Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
BeginUndoAction() BeginUndoAction(self) Start a sequence of actions that is undone and redone as a unit. May be nested.
LineDelete() LineDelete(self) Delete the line containing the caret.
GetSelectedText() GetSelectedText(self) -> String Retrieve the selected text.
SetWrapMode() SetWrapMode(self, int mode) Sets whether text is word wrapped.
DragAcceptFiles() DragAcceptFiles(self, bool accept) Enables or disables eligibility for drop file events, EVT_DROP_FILES. Only functional on Windows.
ShowLines() ShowLines(self, int lineStart, int lineEnd) Make a range of lines visible.
ProcessPendingEvents() ProcessPendingEvents(self)
GetId() GetId(self) -> int Returns the identifier of the window. Each window has an integer identifier. If the application has not provided one (or the default Id -1 is used) then an unique identifier with a negative value will be generated.
SetAcceleratorTable() SetAcceleratorTable(self, AcceleratorTable accel) Sets the accelerator table for this window.
SetSizer() SetSizer(self, Sizer sizer, bool deleteOld=True) Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout sizer object is already owned by the window, it will be deleted if the deleteOld parameter is true. Note that this function will also call SetAutoLayout implicitly with a True parameter if the sizer is non-None, and False otherwise.
PositionFromPoint() PositionFromPoint(self, Point pt) -> int Find the position from a point within the window.
GetOvertype() GetOvertype(self) -> bool Returns true if overtype mode is active otherwise false is returned.
SetPosition() Move(self, Point pt, int flags=SIZE_USE_EXISTING) Moves the window to the given position.
AutoCompGetCancelAtStart() AutoCompGetCancelAtStart(self) -> bool Retrieve whether auto-completion cancelled by backspacing before start.
SetOwnBackgroundColour() SetOwnBackgroundColour(self, Colour colour)
SetClientSize() SetClientSize(self, Size size) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.
SetEvtHandlerEnabled() SetEvtHandlerEnabled(self, bool enabled)
GetTwoPhaseDraw() GetTwoPhaseDraw(self) -> bool Is drawing done in two phases with backgrounds drawn before foregrounds?
GotoPos() GotoPos(self, int pos) Set caret to a position and ensure it is visible.
RegisterImage() RegisterImage(self, int type, Bitmap bmp) Register an image for use in autocompletion lists.
LineEndWrapExtend() LineEndWrapExtend(self)
SetWindowVariant() SetWindowVariant(self, int variant) Sets the variant of the window/font size to use for this window, if the platform supports variants, for example, wxMac.
ReleaseDocument() ReleaseDocument(self, void docPointer) Release a reference to the document, deleting document if it fades to black.
Update() Update(self) Calling this method immediately repaints the invalidated area of the window instead of waiting for the EVT_PAINT event to happen, (normally this would usually only happen when the flow of control returns to the event loop.) Notice that this function doesn't refresh the window and does nothing if the window has been already repainted. Use `Refresh` first if you want to immediately redraw the window (or some portion of it) unconditionally.
Undo() Undo(self) Undo one action in the undo history.
FindWindowByName() FindWindowByName(self, String name) -> Window Find a child of this window by name
SetUndoCollection() SetUndoCollection(self, bool collectUndo) Choose between collecting actions into the undo history and discarding them.
VCHomeRectExtend() VCHomeRectExtend(self) Move caret to before first visible character on line. If already there move to first character on line. In either case, extend rectangular selection to new caret position.
Validate() Validate(self) -> bool Validates the current values of the child controls using their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call Validate() of all child windows. Returns false if any of the validations failed.
SetMinS