A wxWidgets implementation of the Scintilla source code editing component.
As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code. These include support for syntax styling, error indicators, code completion and call tips.
The selection margin can contain markers like those used in debuggers to indicate breakpoints and the current line. Styling choices are more open than with many editors, allowing the use of proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts.
wx.stc.StyledTextCtrl is a 1 to 1 mapping of “raw” scintilla interface, whose documentation can be found in the Scintilla website (http://www.scintilla.org/).
Please see wx.stc.StyledTextEvent for the documentation of all event types you can use with wx.stc.StyledTextCtrl.
Links for quick access to the various categories of wx.stc.StyledTextCtrl functions:
See also
In addition to the standard Scintilla functions, wxPython includes the following methods to better integrate better with other features.
Call this function to enable auto-completion of the text typed in a single-line text control using the given choices. |
|
Call this function to enable auto-completion of the text using the file system directories. |
|
Call this function to enable auto-completion of the text typed in a single-line text control using all valid file system paths. |
|
Returns |
|
Returns |
|
Sets the new text control value. |
|
Convert all text entered into the control to upper case. |
|
Returns the style currently used for the new text. |
|
Returns the current hint string. |
|
Returns the margins used by the control. |
|
Returns the string containing the text starting in the positions from and up to to in the control. |
|
Gets the text currently selected in the control. |
|
Gets the contents of the control. |
|
Finds the position of the character at the specified point. |
|
Returns |
|
Converts given text position to client coordinates in pixels. |
|
Sets a hint shown in an empty unfocused text control. |
|
Sets the insertion point at the end of the text control. |
|
This function sets the maximum number of characters the user can enter into the control. |
|
Marks the control as being modified by the user or not. |
|
Sets the new text control value. |
|
|
|
Append text to the textctrl, for file-like compatibility. |
Add array of cells to document. |
|
Add text to the document at current position. |
|
Enlarge the document to a particular size of text bytes. |
|
Allocate some extended (>255) style numbers and return the start of the range. |
|
Append a string to the end of the document without changing the selection. |
|
Change the text that is being inserted in response to |
|
Delete all text in the document. |
|
Set all style bytes to 0, remove all folding information. |
|
Delete a range of text in the document. |
|
Returns the character byte at the position. |
|
Retrieve the contents of a line. |
|
In read-only mode? |
|
Returns the style byte at the position. |
|
Retrieve a buffer of cells. |
|
Retrieve all the text in the document. |
|
Retrieve a range of text. |
|
Insert string at a position. |
|
Release all extended (>255) style numbers. |
|
Replace the selected text with the argument text. |
|
Set to read only or read write. |
|
Remember the current position in the undo history as the position at which the document was saved. |
|
Replace the contents of the document with the argument text. |
Find some text in the document. |
|
Get the search flags used by SearchInTarget. |
|
Retrieve the value of a tag from a regular expression search. |
|
Get the position that ends the target. |
|
Get the position that starts the target. |
|
Retrieve the text in the target. |
|
Replace the target text with the argument text. |
|
Replace the target text with the argument text after \d processing. |
|
Sets the current caret position to be the search anchor. |
|
Search for a counted string in the target and set the target to the found range. |
|
Find some text starting at the search anchor. |
|
Find some text starting at the search anchor and moving backwards. |
|
Set the search flags used by SearchInTarget. |
|
Sets the position that ends the target which is used for updating the document without affecting the scroll position. |
|
Sets both the start and end of the target in one call. |
|
Sets the position that starts the target which is used for updating the document without affecting the scroll position. |
|
Make the target range start and end be the same as the selection range start and end. |
|
Sets the target to the whole document. |
Returns |
|
Set to overtype ( |
Will a paste succeed? |
|
Clear the selection. |
|
Copy the selection to the clipboard. |
|
Copy the selection, if selection empty copy the line with the caret. |
|
Copy a range of text to the clipboard. |
|
Copy argument text to the clipboard. |
|
Cut the selection to the clipboard. |
|
Get convert-on-paste setting. |
|
Paste the contents of the clipboard into the document replacing the selection. |
|
Enable/Disable convert-on-paste for line endings. |
Get error status. |
|
Change error status - 0 = |
Add a container action to the undo stack. |
|
Start a sequence of actions that is undone and redone as a unit. |
|
Are there any redoable actions in the undo history? |
|
Are there any undoable actions in the undo history? |
|
Delete the undo history. |
|
End a sequence of actions that is undone and redone as a unit. |
|
Is undo history being collected? |
|
Redoes the next action on the undo history. |
|
Choose between collecting actions into the undo history and discarding them. |
|
Undo one action in the undo history. |
Find the position of a character from a point within the window. |
|
Find the position of a character from a point within the window. |
|
Set the last x chosen value to be the caret x position. |
|
Count characters between two positions. |
|
Find the position of a column on a line taking into account tabs and multi-byte characters. |
|
Returns the position of the opposite end of the selection to the caret. |
|
Retrieve the column number of a position, taking tab width into account. |
|
Retrieve the text of the line containing the caret. |
|
Returns the position of the caret. |
|
Returns the number of bytes in the document. |
|
Returns the number of lines in the document. |
|
Get the position after the last visible characters on a line. |
|
Retrieve the position of the end of the selection at the given line (wx``wx.stc.STC_INVALID_POSITION`` if no selection on this line). |
|
Retrieve the position of the start of the selection at the given line (wx``wx.stc.STC_INVALID_POSITION`` if no selection on this line). |
|
Is the document different from when it was last saved? |
|
Whether switching to rectangular mode while selecting with the mouse is allowed. |
|
Retrieve the selected text. |
|
Returns the position at the end of the selection. |
|
Get the mode of the current selection. |
|
Returns the position at the start of the selection. |
|
Retrieve the number of characters in the document. |
|
Set caret to start of a line and ensure it is visible. |
|
Set caret to a position and ensure it is visible. |
|
Draw the selection in normal style or with selection highlighted. |
|
Retrieve the line containing a position. |
|
How many characters are on a line, including end of line characters? |
|
Retrieves the number of lines completely visible. |
|
Move the caret inside current view if it’s not there already. |
|
Move the selected lines down one line, shifting the line below before the selection. |
|
Move the selected lines up one line, shifting the line above after the selection. |
|
Retrieve the point in the window where a position is displayed. |
|
Given a valid document position, return the next position taking code page into account. |
|
Given a valid document position, return the previous position taking code page into account. |
|
Retrieve the position at the start of a line. |
|
Find the position from a point within the window. |
|
Find the position from a point within the window but return |
|
Given a valid document position, return a position that differs in a number of characters. |
|
Select all the text in the document. |
|
Is the selection rectangular? The alternative is the more common stream selection. |
|
Set the selection anchor to a position. |
|
Sets the position of the caret. |
|
Set caret to a position, while removing any existing selection. |
|
Set whether switching to rectangular mode while selecting with the mouse is allowed. |
|
Sets the position that ends the selection - this becomes the caret. |
|
Set the selection mode to stream (wx``wx.stc.STC_SEL_STREAM``) or rectangular (wxSTC_SEL_RECTANGLE/wxSTC_SEL_THIN) or by lines (wx``wx.stc.STC_SEL_LINES``). |
|
Sets the position that starts the selection - this becomes the anchor. |
|
Retrieve the height of a particular line of text in pixels. |
|
Measure the pixel width of some text in a particular style. |
Add a selection. |
|
Clear selections to a single empty stream selection. |
|
Drop one selection. |
|
Get the foreground colour of additional carets. |
|
Whether additional carets will blink. |
|
Whether additional carets are visible. |
|
Get the alpha of the selection. |
|
Whether typing can be performed into multiple selections. |
|
Which selection is the main selection. |
|
Retrieve the effect of pasting when there are multiple selections. |
|
Whether multiple selections can be made. |
|
Return the anchor position of the rectangular selection. |
|
Return the virtual space of the anchor of the rectangular selection. |
|
Return the caret position of the rectangular selection. |
|
Return the virtual space of the caret of the rectangular selection. |
|
Get the modifier key used for rectangular selection. |
|
Is every selected range empty? |
|
Return the anchor position of the nth selection. |
|
Return the virtual space of the anchor of the nth selection. |
|
Return the caret position of the nth selection. |
|
Return the virtual space of the caret of the nth selection. |
|
Returns the position at the end of the selection. |
|
Returns the position at the start of the selection. |
|
How many selections are there? |
|
Return options for virtual space behaviour. |
|
Add each occurrence of the main selection in the target to the set of selections. |
|
Add the next occurrence of the main selection to the set of selections as main. |
|
Set the main selection to the next selection. |
|
Set the foreground colour of additional carets. |
|
Set whether additional carets will blink. |
|
Set whether additional carets are visible. |
|
Set the alpha of the selection. |
|
Set the background colour of additional selections. |
|
Set the foreground colour of additional selections. |
|
Set whether typing can be performed into multiple selections. |
|
Set the main selection. |
|
Change the effect of pasting when there are multiple selections. |
|
Set whether multiple selections can be made. |
|
Set the anchor position of the rectangular selection. |
|
Set the virtual space of the anchor of the rectangular selection. |
|
Set the caret position of the rectangular selection. |
|
Set the virtual space of the caret of the rectangular selection. |
|
On GTK+, allow selecting the modifier key to use for mouse-based rectangular selection. |
|
Set the anchor position of the nth selection. |
|
Set the virtual space of the anchor of the nth selection. |
|
Set the caret position of the nth selection. |
|
Set the virtual space of the caret of the nth selection. |
|
Sets the position that ends the selection - this becomes the currentPosition. |
|
Sets the position that starts the selection - this becomes the anchor. |
|
Set options for virtual space behaviour. |
|
Swap that caret and anchor of the main selection. |
Ensure the caret is visible. |
|
Retrieve whether the maximum scroll position has the last line at the bottom of the view. |
|
Retrieve the display line at the top of the display. |
|
Retrieve the document width assumed for scrolling. |
|
Retrieve whether the scroll width tracks wide lines. |
|
Is the horizontal scroll bar visible? |
|
Is the vertical scroll bar visible? |
|
Get the xOffset (ie, horizontal scroll position). |
|
Scroll horizontally and vertically. |
|
Scroll the argument positions and the range between them into view giving priority to the primary position then the secondary position. |
|
Sets the scroll range so that maximum scroll position has the last line at the bottom of the view (default). |
|
Scroll so that a display line is at the top of the display. |
|
Sets the document width assumed for scrolling. |
|
Sets whether the maximum width line displayed is used to set scroll width. |
|
Show or hide the horizontal scroll bar. |
|
Show or hide the vertical scroll bar. |
|
Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc. |
|
Set the way the caret is kept visible when going sideways. |
|
Set the xOffset (ie, horizontal scroll position). |
|
Set the way the line the caret is on is kept visible. |
Get extra ascent for each line. |
|
Get extra descent for each line. |
|
Retrieve the current tab draw mode. |
|
Are white space characters currently visible? Returns one of |
|
Get the size of the dots used to mark space characters. |
|
Set extra ascent for each line. |
|
Set extra descent for each line. |
|
Set how tabs are drawn when visible. |
|
Make white space characters invisible, always visible or visible outside indentation. |
|
Set the background colour of all whitespace and whether to use this setting. |
|
Set the foreground colour of all whitespace and whether to use this setting. |
|
Set the size of the dots used to mark space characters. |
Get cursor type. |
|
Sets the cursor to one of the |
Get whether mouse gets captured. |
|
Get whether mouse wheel can be active outside the window. |
|
Set whether the mouse is captured when its button is pressed. |
|
Set whether the mouse wheel can be active outside the window. |
Convert all line endings in the document to one mode. |
|
Retrieve the current end of line mode - one of |
|
Get the line end types currently recognised. |
|
Get the line end types currently allowed. |
|
Bit set of LineEndType enumertion for which line ends beyond the standard |
|
Are the end of line characters visible? |
|
Set the current end of line mode. |
|
Set the line end types that the application wants to use. |
|
Make the end of line characters visible or invisible. |
Get the set of characters making up punctuation characters. |
|
Get the set of characters making up whitespace for when moving or selecting by word. |
|
Get the set of characters making up words for when moving or selecting by word. |
|
Is the range start..end considered a word? |
|
Reset the set of characters for whitespace and word characters to the defaults. |
|
Set the set of characters making up punctuation characters Should be called after SetWordChars. |
|
Set the set of characters making up whitespace for when moving or selecting by word. |
|
Set the set of characters making up words for when moving or selecting by word. |
|
Get position of end of word. |
|
Get position of start of word. |
Retrieve the position of the last correctly styled character. |
|
Retrieve the limits to idle styling. |
|
Retrieve the extra styling information for a line. |
|
Retrieve the last line number that has line state. |
|
Sets limits to idle styling. |
|
Used to hold extra styling information for each line. |
|
Set the styles for a segment of the document. |
|
Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment. |
|
Set the current styling position to start. |
Clear all the styles and make equivalent to the global default style. |
|
Get the background colour of a style. |
|
Get is a style bold or not. |
|
Get is a style mixed case, or to force upper or lower case. |
|
Get is a style changeable or not (read only). |
|
Get the character get of the font in a style. |
|
Get is a style to have its end of line filled or not. |
|
Get the font facename of a style. |
|
Get the foreground colour of a style. |
|
Get is a style a hotspot or not. |
|
Get is a style italic or not. |
|
Get the size of characters of a style. |
|
Get the size of characters of a style in points multiplied by 100. |
|
Get is a style underlined or not. |
|
Get is a style visible or not. |
|
Get the weight of characters of a style. |
|
Reset the default style to its state at startup. |
|
Set the background colour of a style. |
|
Set a style to be bold or not. |
|
Set a style to be mixed case, or to force upper or lower case. |
|
Set a style to be changeable or not (read only). |
|
Set the character set of the font in a style. |
|
Set a style to have its end of line filled or not. |
|
Set the font of a style. |
|
Set the foreground colour of a style. |
|
Set a style to be a hotspot or not. |
|
Set a style to be italic or not. |
|
Set the size of characters of a style. |
|
Set the size of characters of a style. |
|
Set a style to be underlined or not. |
|
Set a style to be visible or not. |
|
Set the weight of characters of a style. |
Get the foreground colour of the caret. |
|
Get the background alpha of the caret line. |
|
Get the colour of the background of the line containing the caret. |
|
Is the background of the line containing the caret in a different colour? |
|
Is the caret line always visible? |
|
Get the time in milliseconds that the caret is on and off. |
|
Can the caret preferred x position only be changed by explicit movement commands? |
|
Returns the current style of the caret. |
|
Returns the width of the insert mode caret. |
|
Get the back colour for active hotspots. |
|
Get the fore colour for active hotspots. |
|
Get whether underlining for active hotspots. |
|
Get the HotspotSingleLine property. |
|
Get the alpha of the selection. |
|
Is the selection end of line filled? |
|
Set the foreground colour of the caret. |
|
Set background alpha of the caret line. |
|
Set the colour of the background of the line containing the caret. |
|
Display the background of the line containing the caret in a different colour. |
|
Sets the caret line to always visible. |
|
Get the time in milliseconds that the caret is on and off. |
|
Stop the caret preferred x position changing when the user types. |
|
Set the style of the caret to be drawn. |
|
Set the width of the insert mode caret. |
|
Set a back colour for active hotspots. |
|
Set a fore colour for active hotspots. |
|
Enable / Disable underlining active hotspots. |
|
Limit hotspots to single line so hotspots on two lines don’t merge. |
|
Set the alpha of the selection. |
|
Set the background colour of the main and additional selections and whether to use this setting. |
|
Set the selection to have its end of line filled or not. |
|
Set the foreground colour of the main and additional selections and whether to use this setting. |
|
Switch between sticky and non-sticky: meant to be bound to a key. |
Remove a character representation. |
|
Get the way control characters are displayed. |
|
Set the way a character is drawn. |
|
Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character. |
|
Set the way a character is drawn. |
Retrieve the background colour of a margin. |
|
How many margins are there?. |
|
Retrieve the cursor shown in a margin. |
|
Returns the size in pixels of the left margin. |
|
Retrieve the marker mask of a margin. |
|
Get the margin options. |
|
Returns the size in pixels of the right margin. |
|
Retrieve the mouse click sensitivity of a margin. |
|
Retrieve the type of a margin. |
|
Retrieve the width of a margin in pixels. |
|
Get the style number for the text margin for a line. |
|
Get the start of the range of style numbers used for margin text. |
|
Get the styles in the text margin for a line. |
|
Get the text in the text margin for a line. |
|
Set the style number for the text margin for a line. |
|
Get the start of the range of style numbers used for margin text. |
|
Set the style in the text margin for a line. |
|
Set the text in the text margin for a line. |
|
Clear the margin text on all lines. |
|
Set one of the colours used as a chequerboard pattern in the fold margin. |
|
Set the other colour used as a chequerboard pattern in the fold margin. |
|
Set the background colour of a margin. |
|
Allocate a non-standard number of margins. |
|
Set the cursor shown when the mouse is inside a margin. |
|
Sets the size in pixels of the left margin. |
|
Set a mask that determines which markers are displayed in a margin. |
|
Set the margin options. |
|
Sets the size in pixels of the right margin. |
|
Make a margin sensitive or insensitive to mouse clicks. |
|
Set a margin to be either numeric or symbolic. |
|
Set the width of a margin to a width expressed in pixels. |
Clear the annotations from all lines. |
|
Get the number of annotation lines for a line. |
|
Get the style number for the annotations for a line. |
|
Get the start of the range of style numbers used for annotations. |
|
Get the annotation styles for a line. |
|
Get the annotation text for a line. |
|
Get the visibility for the annotations for a view. |
|
Set the style number for the annotations for a line. |
|
Get the start of the range of style numbers used for annotations. |
|
Set the annotation styles for a line. |
|
Set the annotation text for a line. |
|
Set the visibility for the annotations for a view. |
Is drawing done first into a buffer or direct to the screen? |
|
Get the code page used to interpret the bytes of the document as characters. |
|
Retrieve the quality level for text. |
|
Is the |
|
How many phases is drawing done in? |
|
Get internal focus flag. |
|
Get the tech. |
|
Is drawing done in two phases with backgrounds drawn before foregrounds? |
|
If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker. |
|
Set the code page used to interpret the bytes of the document as characters. |
|
Choose the quality level for text. |
|
Choose to display the |
|
Sets the degree of caching of layout information. |
|
In one phase draw, text is drawn in a series of rectangular blocks with no overlap. |
|
Change internal focus flag. |
|
Set the technology used. |
|
In twoPhaseDraw mode, drawing is performed in two phases, first the background and then the foreground. |
Highlight the character at a position indicating there is no matching brace. |
|
Use specified indicator to highlight non matching brace instead of changing its style. |
|
Highlight the characters at two positions. |
|
Use specified indicator to highlight matching braces instead of changing their style. |
|
Find the position of a matching brace or |
Add an explicit tab stop for a line. |
|
Clear explicit tabstops on a line. |
|
Does a backspace pressed when caret is within indentation unindent? |
|
Get the highlighted indentation guide column. |
|
Retrieve indentation size. |
|
Are the indentation guides visible? |
|
Retrieve the position before the first non indentation character on a line. |
|
Retrieve the number of columns that a line is indented. |
|
Find the next explicit tab stop position on a line after a position. |
|
Does a tab pressed when caret is within indentation indent? |
|
Retrieve the visible size of a tab. |
|
Retrieve whether tabs will be used in indentation. |
|
Sets whether a backspace pressed when caret is within indentation unindents. |
|
Set the highlighted indentation guide column. |
|
Set the number of spaces used for one level of indentation. |
|
Show or hide indentation guides. |
|
Change the indentation of a line to a number of columns. |
|
Sets whether a tab pressed when caret is within indentation indents. |
|
Change the visible size of a tab to be a multiple of the width of a space character. |
|
Indentation will only use space characters if useTabs is |
See also
Which symbol was defined for markerNumber with MarkerDefine. |
|
Add a marker to a line, returning an |
|
Add a set of markers to a line. |
|
Set the symbol used for a particular marker number, and optionally the fore and background colours. |
|
Define a marker from |
|
Delete a marker from a line. |
|
Delete all markers with a particular number from all lines. |
|
Delete a marker. |
|
Enable/disable highlight for current folding block (smallest one that contains the caret) |
|
Get a bit mask of all the markers set on a line. |
|
Retrieve the line number at which a particular marker is located. |
|
Find the next line at or after lineStart that includes a marker in mask. |
|
Find the previous line before lineStart that includes a marker in mask. |
|
Set the alpha used for a marker that is drawn in the text area, not the margin. |
|
Set the background colour used for a particular marker number. |
|
Set the background colour used for a particular marker number when its folding block is selected. |
|
Set the foreground colour used for a particular marker number. |
|
Set the height for future |
|
Set the scale factor in percent for future |
|
Set the width for future |
Get the current indicator. |
|
Get the current indicator value. |
|
Are any indicators present at pos? |
|
Turn an indicator off over a range. |
|
Where does a particular indicator end? |
|
Turn an indicator on over a range. |
|
Get the alpha fill colour of the given indicator. |
|
Retrieve the attributes of an indicator. |
|
Retrieve the foreground colour of an indicator. |
|
Retrieve the foreground hover colour of an indicator. |
|
Retrieve the hover style of an indicator. |
|
Get the alpha outline colour of the given indicator. |
|
Retrieve the style of an indicator. |
|
Retrieve whether indicator drawn under or over text. |
|
Set the alpha fill colour of the given indicator. |
|
Set the attributes of an indicator. |
|
Set the foreground colour of an indicator. |
|
Set the foreground hover colour of an indicator. |
|
Set a hover indicator to plain, squiggle or |
|
Set the alpha outline colour of the given indicator. |
|
Set an indicator to plain, squiggle or |
|
Set an indicator to draw under text or over(default). |
|
Where does a particular indicator start? |
|
What value does a particular indicator have at a position? |
|
Set the indicator used for IndicatorFillRange and IndicatorClearRange. |
|
Set the value used for IndicatorFillRange. |
See also
Is there an auto-completion list visible? |
|
Remove the auto-completion list from the screen. |
|
User has selected an item so remove the list and insert the selection. |
|
Retrieve whether or not autocompletion is hidden automatically when nothing matches. |
|
Retrieve whether auto-completion cancelled by backspacing before start. |
|
Get auto-completion case insensitive behaviour. |
|
Retrieve whether a single item auto-completion list automatically choose the item. |
|
Get currently selected item position in the auto-completion list. |
|
Get currently selected item text in the auto-completion list. |
|
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion. |
|
Retrieve state of ignore case flag. |
|
Set the maximum height, in rows, of auto-completion and user lists. |
|
Get the maximum width, in characters, of auto-completion and user lists. |
|
Retrieve the effect of autocompleting when there are multiple selections. |
|
Get the way autocompletion lists are ordered. |
|
Retrieve the auto-completion list separator character. |
|
Retrieve the auto-completion list type-separator character. |
|
Retrieve the position of the caret when the auto-completion list was displayed. |
|
Select the item in the auto-completion list that starts with a string. |
|
Set whether or not autocompletion is hidden automatically when nothing matches. |
|
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created. |
|
Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. |
|
Should a single item auto-completion list automatically choose the item. |
|
Set whether or not autocompletion deletes any word characters after the inserted text upon completion. |
|
Define a set of characters that when typed will cause the autocompletion to choose the selected item. |
|
Set whether case is significant when performing auto-completion searches. |
|
Set the maximum height, in rows, of auto-completion and user lists. |
|
Set the maximum width, in characters, of auto-completion and user lists. |
|
Change the effect of autocompleting when there are multiple selections. |
|
Set the way autocompletion lists are ordered. |
|
Change the separator character in the string setting up an auto-completion list. |
|
Change the type-separator character in the string setting up an auto-completion list. |
|
Display an auto-completion list. |
|
Define a set of character that when typed cancel the auto-completion list. |
|
Clear all the registered images. |
|
Register an |
Display a list of strings and send notification when user chooses one. |
Is there an active call tip? |
|
Remove the call tip from the screen. |
|
Retrieve the position where the caret was before displaying the call tip. |
|
Set the background colour for the call tip. |
|
Set the foreground colour for the call tip. |
|
Set the foreground colour for the highlighted part of the call tip. |
|
Highlight a segment of the definition. |
|
Set the start position in order to change when backspacing removes the calltip. |
|
Set position of calltip, above or below text. |
|
Show a call tip containing a definition near position pos. |
|
Enable use of |
Dedent the selected lines. |
|
Cancel any modes such as call tip or auto-completion list display. |
|
Move caret left one character. |
|
Move caret left one character extending selection to new caret position. |
|
Move caret left one character, extending rectangular selection to new caret position. |
|
Move caret right one character. |
|
Move caret right one character extending selection to new caret position. |
|
Move caret right one character, extending rectangular selection to new caret position. |
|
Delete back from the current position to the start of the line. |
|
Delete forwards from the current position to the end of the line. |
|
Delete the word to the left of the caret. |
|
Delete the word to the right of the caret. |
|
Delete the word to the right of the caret, but not the trailing non-word characters. |
|
Delete the selection or if no selection, the character before the caret. |
|
Delete the selection or if no selection, the character before the caret. |
|
Move caret to last position in document. |
|
Move caret to last position in document extending selection to new caret position. |
|
Move caret to first position in document. |
|
Move caret to first position in document extending selection to new caret position. |
|
Switch from insert to overtype mode or the reverse. |
|
Insert a Form Feed character. |
|
Move caret to first position on line. |
|
Move caret to first position on display line. |
|
Move caret to first position on display line extending selection to new caret position. |
|
Move caret to first position on line extending selection to new caret position. |
|
Move caret to first position on line, extending rectangular selection to new caret position. |
|
Like Home but when word-wrap is enabled goes first to start of display line HomeDisplay, then to start of document line Home. |
|
Like HomeExtend but when word-wrap is enabled extends first to start of display line HomeDisplayExtend, then to start of document line HomeExtend. |
|
Copy the line containing the caret. |
|
Cut the line containing the caret. |
|
Delete the line containing the caret. |
|
Move caret down one line. |
|
Move caret down one line extending selection to new caret position. |
|
Move caret down one line, extending rectangular selection to new caret position. |
|
Duplicate the current line. |
|
Move caret to last position on line. |
|
Move caret to last position on display line. |
|
Move caret to last position on display line extending selection to new caret position. |
|
Move caret to last position on line extending selection to new caret position. |
|
Move caret to last position on line, extending rectangular selection to new caret position. |
|
Like LineEnd but when word-wrap is enabled goes first to end of display line LineEndDisplay, then to start of document line LineEnd. |
|
Like LineEndExtend but when word-wrap is enabled extends first to end of display line LineEndDisplayExtend, then to start of document line LineEndExtend. |
|
Scroll the document down, keeping the caret visible. |
|
Scroll the document up, keeping the caret visible. |
|
Switch the current line with the previous. |
|
Move caret up one line. |
|
Move caret up one line extending selection to new caret position. |
|
Move caret up one line, extending rectangular selection to new caret position. |
|
Transform the selection to lower case. |
|
Insert a new line, may use a |
|
Move caret one page down. |
|
Move caret one page down extending selection to new caret position. |
|
Move caret one page down, extending rectangular selection to new caret position. |
|
Move caret one page up. |
|
Move caret one page up extending selection to new caret position. |
|
Move caret one page up, extending rectangular selection to new caret position. |
|
Move caret down one paragraph (delimited by empty lines). |
|
Extend selection down one paragraph (delimited by empty lines). |
|
Move caret up one paragraph (delimited by empty lines). |
|
Extend selection up one paragraph (delimited by empty lines). |
|
Scroll to end of document. |
|
Scroll to start of document. |
|
Duplicate the selection. |
|
Move caret to bottom of page, or one page down if already at bottom of page. |
|
Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. |
|
Move caret to top of page, or one page up if already at top of page. |
|
Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. |
|
If selection is empty or all on one line replace the selection with a tab character. |
|
Transform the selection to upper case. |
|
Move caret to before first visible character on line. |
|
Move caret to before first visible character on display line. |
|
Like VCHomeDisplay but extending selection to new caret position. |
|
Like VCHome but extending selection to new caret position. |
|
Move caret to before first visible character on line. |
|
Like VCHome but when word-wrap is enabled goes first to start of display line VCHomeDisplay, then behaves like VCHome. |
|
Like VCHomeExtend but when word-wrap is enabled extends first to start of display line VCHomeDisplayExtend, then behaves like VCHomeExtend. |
|
Centre current line in window. |
|
Move caret left one word. |
|
Move caret left one word, position cursor at end of word. |
|
Move caret left one word, position cursor at end of word, extending selection to new caret position. |
|
Move caret left one word extending selection to new caret position. |
|
Move to the previous change in capitalisation. |
|
Move to the previous change in capitalisation extending selection to new caret position. |
|
Move to the change next in capitalisation. |
|
Move to the next change in capitalisation extending selection to new caret position. |
|
Move caret right one word. |
|
Move caret right one word, position cursor at end of word. |
|
Move caret right one word, position cursor at end of word, extending selection to new caret position. |
|
Move caret right one word extending selection to new caret position. |
When key+modifier combination keyDefinition is pressed perform sciCommand. |
|
When key+modifier combination keyDefinition is pressed do nothing. |
|
Drop all key mappings. |
Start notifying the container of all key presses and commands. |
|
Stop notifying the container of all key presses and commands. |
On Windows, will draw the document into a display context such as a printer. |
|
Returns the print colour mode. |
|
Returns the print magnification. |
|
Is printing line wrapped? |
|
Modify colours when printing for clearer printed text. |
|
Sets the print magnification added to the point size of each style for printing. |
|
Set printing to line wrapped (wx``wx.stc.STC_WRAP_WORD``) or not line wrapped (wx``wx.stc.STC_WRAP_NONE``). |
Compact the document buffer and return a read-only memoryview |
|
Retrieve a pointer to a function that processes messages for this Scintilla. |
|
Retrieve a pointer value to use as the first argument when calling the function returned by GetDirectFunction. |
|
Return a position which, to avoid performance costs, should not be within the range of a call to GetRangePointer. |
|
Return a read-only pointer to a range of characters in the |
Extend life of document. |
|
Create a new document object. |
|
Retrieve a pointer to the document object. |
|
Release a reference to the document, deleting document if it fades to black. |
|
Change the document object used. |
Create an ILoader. |
Find the next line at or after lineStart that is a contracted fold header line. |
|
Find the document line of a display line taking hidden lines into account. |
|
Ensure a particular line is visible by expanding any header line hiding it. |
|
Ensure a particular line is visible by expanding any header line hiding it. |
|
Expand a fold header and all children. |
|
Expand or contract all fold headers. |
|
Expand or contract a fold header and its children. |
|
Set the style of fold display text. |
|
Expand or contract a fold header. |
|
Are all lines visible? |
|
Get automatic folding behaviours. |
|
Is a header line expanded? |
|
Retrieve the fold level of a line. |
|
Find the parent line of a child line. |
|
Find the last child line of a header line. |
|
Is a line visible? |
|
Make a range of lines invisible. |
|
Set automatic folding behaviours. |
|
Show the children of a header line. |
|
Set some style options for folding. |
|
Set the fold level of a line. |
|
Make a range of lines visible. |
|
Switch a header line between expanded and contracted. |
|
Switch a header line between expanded and contracted and show some text after the line. |
|
Find the display line of a document line taking hidden lines into account. |
Retrieve the degree of caching of layout information. |
|
How many entries are allocated to the position cache? |
|
Retrieve how wrapped sublines are placed. |
|
Retrieve whether text is word wrapped. |
|
Retrieve the start indent for wrapped lines. |
|
Retrieve the display mode of visual flags for wrapped lines. |
|
Retrieve the location of visual flags for wrapped lines. |
|
Join the lines in the target. |
|
Split the lines in the target into lines that are less wide than pixelWidth where possible. |
|
Set number of entries in position cache. |
|
Sets how wrapped sublines are placed. |
|
Sets whether text is word wrapped. |
|
Set the start indent for wrapped lines. |
|
Set the display mode of visual flags for wrapped lines. |
|
Set the location of visual flags for wrapped lines. |
|
The number of display lines needed to wrap a document line. |
Retrieve the zoom level. |
|
Set the zoom level. |
|
Magnify the displayed text by increasing the sizes by 1 point. |
|
Make the displayed text smaller by decreasing the sizes by 1 point. |
Retrieve the colour used in edge indication. |
|
Retrieve the column number which text should be kept within. |
|
Retrieve the edge highlight mode. |
|
Add a new vertical edge to the view. |
|
Clear all vertical edges. |
|
Change the colour used in edge indication. |
|
Set the column number of the edge. |
|
The edge may be displayed by a line (wxSTC_EDGE_LINE/wxSTC_EDGE_MULTILINE) or by highlighting text that goes beyond it (wx``wx.stc.STC_EDGE_BACKGROUND``) or not displayed at all (wx``wx.stc.STC_EDGE_NONE``). |
Allocate a set of sub styles for a particular base style, returning start of range. |
|
Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw. |
|
Colourise a segment of the document using the current lexing language. |
|
Retrieve a ‘\n’ separated list of descriptions of the keyword sets understood by the current lexer. |
|
Describe a property. |
|
Where styles are duplicated by a feature such as active/inactive code return the distance between the two types. |
|
Free allocated sub styles. |
|
Retrieve the lexing language of the document. |
|
Retrieve the lexing language of the document. |
|
For a secondary style, return the primary style, else return the argument. |
|
Retrieve a “property” value previously set with SetProperty. |
|
Retrieve a “property” value previously set with SetProperty, with “$()” variable replacement on returned buffer. |
|
Retrieve a “property” value previously set with SetProperty, interpreted as an int |
|
For a sub style, return the base style, else return the argument. |
|
Get the set of base styles that can be extended with sub styles. |
|
The number of sub styles associated with a base style. |
|
The starting style number for the sub styles associated with a base style. |
|
Load a lexer library (dll / so). |
|
For private communication between an application and a known lexer. |
|
Retrieve a ‘\n’ separated list of properties understood by the current lexer. |
|
Retrieve the type of a property. |
|
Set the identifiers that are shown in a particular style. |
|
Set up the key words used by the lexer. |
|
Set the lexing language of the document. |
|
Set the lexing language of the document based on string name. |
|
Set up a value that may be used by a lexer for some optional feature. |
These methods should not be used in new code.
Retrieve number of bits in style bytes used to hold the lexical state. |
|
Retrieve the number of bits the current lexer needs for styling. |
|
Divide each styling byte into lexical class bits (default: 5) and indicator bits (default: 3). |
In addition to the standard Scintilla functions, wxStyledTextCtrl includes the following functions to simplify some tasks.
Clear annotations from the given line. |
|
Perform one of the operations defined by the |
|
Allow for simulating a DnD DragEnter. |
|
Allow for simulating a DnD DragLeave. |
|
Allow for simulating a DnD DragOver. |
|
Allow for simulating a DnD DropText. |
|
Returns the line number of the line with the caret. |
|
Can be used to prevent the |
|
Returns the current UseAntiAliasing setting. |
|
Load the contents of filename into the editor. |
|
Define a marker with a wx.Bitmap. |
|
Register an image for use in autocompletion lists. |
|
Write the contents of the editor to filename. |
|
Scroll enough to make the given column visible. |
|
Scroll enough to make the given line visible. |
|
Scintilla API call. |
|
Set the horizontal scrollbar to use instead of the one that’s built-in. |
|
Returns the line number of the line with the caret. |
|
Set the left and right margin in the edit area, measured in pixels. |
|
Specify whether anti-aliased fonts should be used. |
|
Set the vertical scrollbar to use instead of the one that’s built-in. |
|
Get the font of a style. |
|
Set style size, face, bold, italic, and underline attributes from a wx.Font’s attributes. |
|
Set all font style attributes at once. |
|
Set the font encoding to be used by a style. |
|
Extract style settings from a spec-string which is composed of one or more of the following comma separated elements |
These methods allow data to be sent to or received from the control using character buffers instead of using a wxString.
Add text to the document at current position. |
|
Append a string to the end of the document without changing the selection. |
|
Retrieve the text of the line containing the caret. |
|
Retrieve the contents of a line. |
|
Retrieve the selected text. |
|
Retrieve the target text. |
|
Retrieve a range of text. |
|
Retrieve all the text in the document. |
|
Insert string at a position. |
|
Replace the current selection with text. |
|
Replace the current target with text using regular expressions. |
|
Replace the current target with text. |
|
Replace the contents of the document with the argument text. |
Returns the insertion point, or cursor, position. |
|
Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control. |
|
Gets the current selection span. |
|
Returns |
|
Removes the text starting at the first given position up to (but not including) the character at the last position. |
|
Replaces the text starting at the first position up to (but not including) the character at the last position with the given text. |
|
Deselects selected text in the control. |
|
Makes the text item editable or read-only, overriding the |
|
Sets the insertion point at the given position. |
|
Selects the text starting at the first position up to (but not including) the character at the last position. |
|
Writes the text into the text control at the current insertion position. |
Resets the internal modified flag as if the current changes had been saved. |
|
Returns the version of the Scintilla library used by this control. |
|
Gets the length of the specified line, not including any trailing newline character(s). |
|
Returns the contents of a given line in the text control, not including any trailing newline character(s). |
|
Returns the number of lines in the text control buffer. |
|
This method is inherited from TextAreaBase but is not implemented in wx.stc.StyledTextCtrl. |
|
Finds the row and column of the character at the specified point. |
|
Returns |
|
Mark text as modified (dirty). |
|
Converts given position to a zero-based column, line number pair. |
|
This method is inherited from TextAreaBase but is not implemented in wx.stc.StyledTextCtrl. |
|
This method is inherited from TextAreaBase but is not implemented in wx.stc.StyledTextCtrl. |
|
Makes the line containing the given position visible. |
|
Converts the given zero based column and line number to a position. |
Possible constructors:
StyledTextCtrl(parent : Window, id: int=ID_ANY, pos:
Point=DefaultPosition, size: Size=DefaultSize, style: int=0, name:
str=STCNameStr) -> None
StyledTextCtrl() -> None
A wxWidgets implementation of the Scintilla source code editing component.
__init__ (self, parent : Window, id: int=ID_ANY, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0, name: str=STCNameStr)
Ctor.
None
__init__ (self)
Default constructor.
None
Extend life of document.
docPointer
None
Add a selection.
caret (int)
anchor (int)
int
Add array of cells to document.
data (MemoryBuffer)
None
Add an explicit tab stop for a line.
line (int)
x (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Add text to the document at current position.
text (string)
None
Add text to the document at current position.
text (int)
length (int)
None
Add a container action to the undo stack.
The flags argument can be either 0 or wx.stc.STC_UNDO_MAY_COALESCE
.
token (int)
flags (int)
None
Enlarge the document to a particular size of text bytes.
bytes (int)
None
Allocate some extended (>255) style numbers and return the start of the range.
numberStyles (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Allocate a set of sub styles for a particular base style, returning start of range.
styleBase (int)
numberStyles (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Clear the annotations from all lines.
None
Clear annotations from the given line.
line (int)
None
Get the number of annotation lines for a line.
line (int)
int
Get the style number for the annotations for a line.
line (int)
int
Get the start of the range of style numbers used for annotations.
int
Get the annotation styles for a line.
line (int)
str
Get the annotation text for a line.
line (int)
str
Get the visibility for the annotations for a view.
The return value will be one of the STC_ANNOTATION_*
constants.
int
Set the style number for the annotations for a line.
line (int)
style (int)
None
Get the start of the range of style numbers used for annotations.
style (int)
None
Set the annotation styles for a line.
line (int)
styles (string)
None
Set the annotation text for a line.
line (int)
text (string)
None
Set the visibility for the annotations for a view.
The input should be one of the STC_ANNOTATION_*
constants.
visible (int)
None
Append a string to the end of the document without changing the selection.
text (string)
None
Append a string to the end of the document without changing the selection.
text (int)
length (int)
None
Is there an auto-completion list visible?
bool
Remove the auto-completion list from the screen.
None
User has selected an item so remove the list and insert the selection.
None
Retrieve whether or not autocompletion is hidden automatically when nothing matches.
bool
Retrieve whether auto-completion cancelled by backspacing before start.
bool
Get auto-completion case insensitive behaviour.
The return value will be one of the STC_CASEINSENSITIVEBEHAVIOUR_*
constants.
int
Retrieve whether a single item auto-completion list automatically choose the item.
bool
Get currently selected item position in the auto-completion list.
int
Get currently selected item text in the auto-completion list.
str
Added in version 4.1/wxWidgets-3.1.1.
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
bool
Retrieve state of ignore case flag.
bool
Set the maximum height, in rows, of auto-completion and user lists.
int
Get the maximum width, in characters, of auto-completion and user lists.
int
Retrieve the effect of autocompleting when there are multiple selections.
The return value will be one of the STC_MULTIAUTOC_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Get the way autocompletion lists are ordered.
The return value will be one of the STC_ORDER_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Retrieve the auto-completion list separator character.
int
Retrieve the auto-completion list type-separator character.
int
Retrieve the position of the caret when the auto-completion list was displayed.
int
Select the item in the auto-completion list that starts with a string.
select (string)
None
Set whether or not autocompletion is hidden automatically when nothing matches.
autoHide (bool)
None
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
cancel (bool)
None
Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
The input should be one of the STC_CASEINSENSITIVEBEHAVIOUR_*
constants.
behaviour (int)
None
Should a single item auto-completion list automatically choose the item.
chooseSingle (bool)
None
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
dropRestOfWord (bool)
None
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
characterSet (string)
None
Set whether case is significant when performing auto-completion searches.
ignoreCase (bool)
None
Set the maximum height, in rows, of auto-completion and user lists.
The default is 5 rows.
rowCount (int)
None
Set the maximum width, in characters, of auto-completion and user lists.
Set to 0 to autosize to fit longest item, which is the default.
characterCount (int)
None
Change the effect of autocompleting when there are multiple selections.
The input should be one of the STC_MULTIAUTOC_*
constants.
multi (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set the way autocompletion lists are ordered.
The input should be one of the STC_ORDER_*
constants.
order (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Change the separator character in the string setting up an auto-completion list.
Default is space but can be changed if items contain space.
separatorCharacter (int)
None
Change the type-separator character in the string setting up an auto-completion list.
Default is ‘?’ but can be changed if items contain ‘?’.
separatorCharacter (int)
None
Display an auto-completion list.
The lengthEntered parameter indicates how many characters before the caret should be used to provide context.
lengthEntered (int)
itemList (string)
None
Define a set of character that when typed cancel the auto-completion list.
characterSet (string)
None
AutoComplete (self, choices : List[str])
Call this function to enable auto-completion of the text typed in a single-line text control using the given choices.
choices (list of strings)
bool
True
if the auto-completion was enabled or False
if the operation failed, typically because auto-completion is not supported by the current platform.
Added in version 2.9.0.
See also
AutoComplete (self, completer : TextCompleter)
Enable auto-completion using the provided completer object.
This method should be used instead of AutoComplete
overload taking the array of possible completions if the total number of strings is too big as it allows returning the completions dynamically, depending on the text already entered by user and so is more efficient.
The specified completer object will be used to retrieve the list of possible completions for the already entered text and will be deleted by wx.TextEntry itself when it’s not needed any longer.
Notice that you need to include /textcompleter.h in order to define your class inheriting from wx.TextCompleter.
completer (wx.TextCompleter) – The object to be used for generating completions if not None
. If it is None
, auto-completion is disabled. The wx.TextEntry object takes ownership of this pointer and will delete it in any case (i.e. even if this method returns False
).
bool
True
if the auto-completion was enabled or False
if the operation failed, typically because auto-completion is not supported by the current platform.
Added in version 2.9.2.
See also
Call this function to enable auto-completion of the text using the file system directories.
Unlike AutoCompleteFileNames
which completes both file names and directories, this function only completes the directory names.
Notice that currently this function is only implemented in wxMSW port and does nothing under the other platforms.
bool
True
if the auto-completion was enabled or False
if the operation failed, typically because auto-completion is not supported by the current platform.
Added in version 2.9.3.
See also
Call this function to enable auto-completion of the text typed in a single-line text control using all valid file system paths.
Notice that currently this function is only implemented in wxMSW port and does nothing under the other platforms.
bool
True
if the auto-completion was enabled or False
if the operation failed, typically because auto-completion is not supported by the current platform.
Added in version 2.9.0.
See also
Dedent the selected lines.
None
Start a sequence of actions that is undone and redone as a unit.
May be nested.
None
Highlight the character at a position indicating there is no matching brace.
pos (int)
None
Use specified indicator to highlight non matching brace instead of changing its style.
useSetting (bool)
indicator (int)
None
Highlight the characters at two positions.
posA (int)
posB (int)
None
Use specified indicator to highlight matching braces instead of changing their style.
useSetting (bool)
indicator (int)
None
Find the position of a matching brace or wx.stc.STC_INVALID_POSITION
if no match.
The maxReStyle must be 0 for now. It may be defined in a future release.
pos (int)
maxReStyle (int)
int
Is there an active call tip?
bool
Remove the call tip from the screen.
None
Retrieve the position where the caret was before displaying the call tip.
int
Added in version 4.1/wxWidgets-3.1.0.
Set the background colour for the call tip.
back (wx.Colour)
None
Set the foreground colour for the call tip.
fore (wx.Colour)
None
Set the foreground colour for the highlighted part of the call tip.
fore (wx.Colour)
None
Highlight a segment of the definition.
highlightStart (int)
highlightEnd (int)
None
Set the start position in order to change when backspacing removes the calltip.
posStart (int)
None
Set position of calltip, above or below text.
above (bool)
None
Show a call tip containing a definition near position pos.
pos (int)
definition (string)
None
Enable use of wx.stc.STC_STYLE_CALLTIP
and set call tip tab size in pixels.
tabSize (int)
None
Returns True
if the selection can be copied to the clipboard.
bool
Returns True
if the selection can be cut to the clipboard.
bool
Will a paste succeed?
bool
Are there any redoable actions in the undo history?
bool
Are there any undoable actions in the undo history?
bool
Cancel any modes such as call tip or auto-completion list display.
None
Change the text that is being inserted in response to wx.stc.STC_MOD_INSERTCHECK
.
length (int)
text (string)
None
Added in version 4.1/wxWidgets-3.1.0.
Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.
start (int)
end (int)
int
Sets the new text control value.
It also marks the control as not-modified which means that IsModified() would return False
immediately after the call to ChangeValue
.
The insertion point is set to the start of the control (i.e. position 0) by this function.
This functions does not generate the wxEVT_TEXT
event but otherwise is identical to SetValue
.
See User Generated Events vs Programmatically Generated Events for more information.
value (string) – The new value to set. It may contain newline characters if the text control is multi-line.
None
Added in version 2.7.1.
Move caret left one character.
None
Move caret left one character extending selection to new caret position.
None
Move caret left one character, extending rectangular selection to new caret position.
None
Find the position of a character from a point within the window.
x (int)
y (int)
int
Find the position of a character from a point within the window.
Return wx.stc.STC_INVALID_POSITION
if not close to text.
x (int)
y (int)
int
Move caret right one character.
None
Move caret right one character extending selection to new caret position.
None
Move caret right one character, extending rectangular selection to new caret position.
None
Set the last x chosen value to be the caret x position.
None
Clear the selection.
None
Delete all text in the document.
None
Set all style bytes to 0, remove all folding information.
None
Clear all the registered images.
None
Remove a character representation.
encodedCharacter (string)
None
Added in version 4.1/wxWidgets-3.1.0.
Clear selections to a single empty stream selection.
None
Clear explicit tabstops on a line.
line (int)
None
Added in version 4.1/wxWidgets-3.1.0.
When key+modifier combination keyDefinition is pressed perform sciCommand.
The second argument should be a bit list containing one or more of the STC_KEYMOD_*
constants and the third argument should be one of the STC_CMD_*
constants.
key (int)
modifiers (int)
cmd (int)
None
When key+modifier combination keyDefinition is pressed do nothing.
The second argument should be a bit list containing one or more of the STC_KEYMOD_*
constants.
key (int)
modifiers (int)
None
Drop all key mappings.
None
Perform one of the operations defined by the STC_CMD_
constants.
cmd (int)
None
Colourise a segment of the document using the current lexing language.
start (int)
end (int)
None
Find the next line at or after lineStart that is a contracted fold header line.
Return -1 when no more lines.
lineStart (int)
int
Convert all line endings in the document to one mode.
eolMode (int)
None
Copy the selection to the clipboard.
None
Copy the selection, if selection empty copy the line with the caret.
None
Copy a range of text to the clipboard.
Positions are clipped into the document.
start (int)
end (int)
None
Copy argument text to the clipboard.
length (int)
text (string)
None
Count characters between two positions.
start (int)
end (int)
int
Create the UI elements for a STC
that was created with the default constructor.
(For 2-phase create.)
Create a new document object.
Starts with reference count of 1 and not selected into editor.
Any
Create an ILoader.
bytes (int)
Any
Cut the selection to the clipboard.
None
Delete back from the current position to the start of the line.
None
Delete forwards from the current position to the end of the line.
None
Delete the word to the left of the caret.
None
Delete the word to the right of the caret.
None
Delete the word to the right of the caret, but not the trailing non-word characters.
None
Delete the selection or if no selection, the character before the caret.
None
Delete the selection or if no selection, the character before the caret.
Will not delete the character before at the start of a line.
None
Delete a range of text in the document.
start (int)
lengthDelete (int)
None
Retrieve a ‘\n’ separated list of descriptions of the keyword sets understood by the current lexer.
str
Describe a property.
name (string)
str
Resets the internal modified flag as if the current changes had been saved.
None
Where styles are duplicated by a feature such as active/inactive code return the distance between the two types.
int
Added in version 4.1/wxWidgets-3.1.0.
Allow for simulating a DnD DragEnter.
x (int)
y (int)
defaultRes (DragResult)
Added in version 4.1/wxWidgets-3.1.0.
Allow for simulating a DnD DragLeave.
None
Added in version 4.1/wxWidgets-3.1.0.
Allow for simulating a DnD DragOver.
x (int)
y (int)
defaultRes (DragResult)
Allow for simulating a DnD DropText.
x (long)
y (long)
data (string)
bool
Find the document line of a display line taking hidden lines into account.
displayLine (int)
int
Move caret to last position in document.
None
Move caret to last position in document extending selection to new caret position.
None
Move caret to first position in document.
None
Move caret to first position in document extending selection to new caret position.
None
Drop one selection.
selection (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Switch from insert to overtype mode or the reverse.
None
Delete the undo history.
None
End a sequence of actions that is undone and redone as a unit.
None
Ensure the caret is visible.
None
Ensure a particular line is visible by expanding any header line hiding it.
line (int)
None
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.
line (int)
None
Expand a fold header and all children.
Use the level argument instead of the line’s current level.
line (int)
level (int)
None
Added in version 4.1/wxWidgets-3.1.0.
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.
line (int)
column (int)
int
Find some text in the document.
minPos (int) – The position (starting from zero) in the document at which to begin the search
maxPos (int) – The last position (starting from zero) in the document to which the search will be restricted.
text (string) – The text to search for.
flags (int) – (Optional) The search flags. This should be a bit list containing one or more of the STC_FIND_*
constants.
Tuple[int, int]
The position (starting from zero) in the document at which the text was found or wx.stc.STC_INVALID_POSITION
if the search fails.
Note
A backwards search can be performed by setting minPos to be greater than maxPos.
Expand or contract all fold headers.
The input should be one of the STC_FOLDACTION_*
constants.
action (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Expand or contract a fold header and its children.
The second argument should be one of the STC_FOLDACTION_*
constants.
line (int)
action (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set the style of fold display text.
The input should be one of the STC_FOLDDISPLAYTEXT_*
constants.
style (int)
None
Added in version 4.1/wxWidgets-3.1.1.
Expand or contract a fold header.
The second argument should be one of the STC_FOLDACTION_*
constants.
line (int)
action (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Convert all text entered into the control to upper case.
Call this method to ensure that all text entered into the control is converted on the fly to upper case. If the control is not empty, its existing contents is also converted to upper case.
None
Added in version 4.1/wxWidgets-3.1.0.
Insert a Form Feed character.
None
On Windows, will draw the document into a display context such as a printer.
Free allocated sub styles.
None
Added in version 4.1/wxWidgets-3.1.0.
Get the foreground colour of additional carets.
Whether additional carets will blink.
bool
Whether additional carets are visible.
bool
Get the alpha of the selection.
int
Whether typing can be performed into multiple selections.
bool
Are all lines visible?
bool
Returns the position of the opposite end of the selection to the caret.
int
Get automatic folding behaviours.
The return value will be a bit list containing one or more of the STC_AUTOMATICFOLD_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Does a backspace pressed when caret is within indentation unindent?
bool
Is drawing done first into a buffer or direct to the screen?
bool
Get the background alpha of the caret line.
int
Get the colour of the background of the line containing the caret.
Is the background of the line containing the caret in a different colour?
bool
Is the caret line always visible?
bool
Added in version 4.1/wxWidgets-3.1.0.
Get the time in milliseconds that the caret is on and off.
int
Can the caret preferred x position only be changed by explicit movement commands?
The return value will be one of the STC_CARETSTICKY_*
constants.
int
Returns the current style of the caret.
The return value will be one of the STC_CARETSTYLE_*
constants.
int
Returns the width of the insert mode caret.
int
Returns the character byte at the position.
pos (int)
int
Compact the document buffer and return a read-only memoryview object of the characters in the document.
Any
variant (WindowVariant)
Get the code page used to interpret the bytes of the document as characters.
int
Retrieve the column number of a position, taking tab width into account.
pos (int)
int
Get the way control characters are displayed.
int
Retrieve the text of the line containing the caret.
linePos can optionally be passed in to receive the index of the caret on the line.
Tuple[str, int]
Retrieve the text of the line containing the caret.
Returns the index of the caret on the line.
Tuple[CharBuffer, int]
Returns the line number of the line with the caret.
int
Returns the position of the caret.
int
Returns the style currently used for the new text.
See also
Retrieve a pointer to a function that processes messages for this Scintilla.
Any
Added in version 4.1/wxWidgets-3.1.1.
Retrieve a pointer value to use as the first argument when calling the function returned by GetDirectFunction.
Any
Added in version 4.1/wxWidgets-3.1.1.
Retrieve a pointer to the document object.
Any
Retrieve the current end of line mode - one of wx.stc.STC_EOL_CRLF
, wx.stc.STC_EOL_CR
, or wx.stc.STC_EOL_LF
.
int
Retrieve the column number which text should be kept within.
int
Retrieve the edge highlight mode.
The return value will be one of the STC_EDGE_*
constants.
int
Retrieve whether the maximum scroll position has the last line at the bottom of the view.
bool
Retrieve the position of the last correctly styled character.
int
Get extra ascent for each line.
int
Get extra descent for each line.
int
Retrieve the display line at the top of the display.
int
Is a header line expanded?
line (int)
bool
Retrieve the fold level of a line.
line (int)
int
Find the parent line of a child line.
line (int)
int
Retrieve the quality level for text.
The return value will be one of the STC_EFF_QUALITY_*
constants.
int
Added in version 4.1/wxWidgets-3.1.1.
Return a position which, to avoid performance costs, should not be within the range of a call to GetRangePointer.
int
Get the highlighted indentation guide column.
int
Returns the current hint string.
See SetHint
for more information about hints.
str
Added in version 2.9.0.
Get whether underlining for active hotspots.
bool
Get the HotspotSingleLine property.
bool
Is the IME
displayed in a window or inline?
The return value will be one of the STC_IME_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Get the identifier.
int
Retrieve the limits to idle styling.
The return value will be one of the STC_IDLESTYLING_*
constants.
int
Added in version 4.1/wxWidgets-3.1.1.
Retrieve indentation size.
int
Are the indentation guides visible?
The return value will be one of the STC_IV_*
constants.
int
Get the current indicator.
int
Get the current indicator value.
int
Returns the insertion point, or cursor, position.
This is defined as the zero based index of the character position to the right of the insertion point. For example, if the insertion point is at the end of the single-line text control, it is equal to GetLastPosition
.
Notice that insertion position is, in general, different from the index of the character the cursor position at in the string returned by GetValue
. While this is always the case for the single line controls, multi-line controls can use two characters "\\r\\n"
as line separator (this is notably the case under MSW) meaning that indices in the control and its string value are offset by 1 for every line.
Hence to correctly get the character at the current cursor position, taking into account that there can be none if the cursor is at the end of the string, you could do the following:
def GetCurrentChar(self, text_ctrl):
pos = text_ctrl.GetInsertionPoint()
if pos == text_ctrl.GetLastPosition():
return ''
return text_ctrl.GetRange(pos, pos + 1)
int
Find the last child line of a header line.
line (int)
level (int)
int
Can be used to prevent the EVT_CHAR
handler from adding the char.
bool
Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.
int
Retrieve the degree of caching of layout information.
The return value will be one of the STC_CACHE_*
constants.
int
Returns the number of bytes in the document.
int
Retrieve the lexing language of the document.
The return value will be one of the STC_LEX_*
constants.
int
Retrieve the lexing language of the document.
str
Added in version 4.1/wxWidgets-3.1.1.
Returns the version of the Scintilla library used by this control.
Retrieve the contents of a line.
line (int)
str
Returns the number of lines in the document.
There is always at least one.
int
Get the position after the last visible characters on a line.
line (int)
int
Get the line end types currently recognised.
May be a subset of the allowed types due to lexer limitation.
The return value will be one of the STC_LINE_END_TYPE_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Get the line end types currently allowed.
The return value will be one of the STC_LINE_END_TYPE_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Bit set of LineEndType enumertion for which line ends beyond the standard LF
, CR
, and CRLF
are supported by the lexer.
The return value will be a bit list containing one or more of the STC_LINE_END_TYPE_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
Retrieve the position before the first non indentation character on a line.
line (int)
int
Retrieve the number of columns that a line is indented.
line (int)
int
Gets the length of the specified line, not including any trailing newline character(s).
lineNo (long) – Line number (starting from zero).
int
The length of the line, or -1 if lineNo was invalid.
Retrieve the contents of a line.
line (int)
CharBuffer
Retrieve the position of the end of the selection at the given line (wx``wx.stc.STC_INVALID_POSITION`` if no selection on this line).
line (int)
int
Retrieve the position of the start of the selection at the given line (wx``wx.stc.STC_INVALID_POSITION`` if no selection on this line).
line (int)
int
Retrieve the extra styling information for a line.
line (int)
int
Returns the contents of a given line in the text control, not including any trailing newline character(s).
lineNo (long) – The line number, starting from zero.
str
The contents of the line.
Is a line visible?
line (int)
bool
Which selection is the main selection.
int
Retrieve the background colour of a margin.
margin (int)
Added in version 4.1/wxWidgets-3.1.1.
How many margins are there?.
int
Added in version 4.1/wxWidgets-3.1.1.
Retrieve the cursor shown in a margin.
The return value will be one of the STC_CURSOR*
constants.
margin (int)
int
Returns the size in pixels of the left margin.
int
Retrieve the marker mask of a margin.
margin (int)
int
Get the margin options.
The return value will be one of the STC_MARGINOPTION_*
constants.
int
Returns the size in pixels of the right margin.
int
Retrieve the mouse click sensitivity of a margin.
margin (int)
bool
Retrieve the type of a margin.
The return value will be one of the STC_MARGIN_*
constants.
margin (int)
int
Retrieve the width of a margin in pixels.
margin (int)
int
Returns the margins used by the control.
The x
field of the returned point is the horizontal margin and the y
field is the vertical one.
Added in version 2.9.1.
Note
If given margin cannot be accurately determined, its value will be set to -1. On some platforms you cannot obtain valid margin values until you have called SetMargins
.
See also
Which symbol was defined for markerNumber with MarkerDefine.
The return value will be one of the STC_MARK_*
constants.
markerNumber (int)
int
Retrieve the last line number that has line state.
int
Get which document modification events are sent to the container.
The return value will wx.stc.STC_MODEVENTMASKALL
if all changes generate events. Otherwise it will be a bit list containing one or more of the STC_MOD_*
constants, the STC_PERFORMED_*
constants, wx.stc.STC_STARTACTION
, wx.stc.STC_MULTILINEUNDOREDO
, wx.stc.STC_MULTISTEPUNDOREDO
, and wx.stc.STC_LASTSTEPINUNDOREDO
.
int
Is the document different from when it was last saved?
bool
Get whether mouse gets captured.
bool
Retrieve the time the mouse must sit still to generate a mouse dwell event.
The return value will be a time in milliseconds or wx.stc.STC_TIME_FOREVER
.
int
Whether switching to rectangular mode while selecting with the mouse is allowed.
bool
Added in version 4.1/wxWidgets-3.1.0.
Get whether mouse wheel can be active outside the window.
bool
Added in version 4.1/wxWidgets-3.1.1.
Retrieve the effect of pasting when there are multiple selections.
The return value will be one of the STC_MULTIPASTE_*
constants.
int
Whether multiple selections can be made.
bool
Find the next explicit tab stop position on a line after a position.
line (int)
x (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Returns the number of lines in the text control buffer.
The returned number is the number of logical lines, i.e. just the count of the number of newline characters in the control + 1, for wxGTK and OSX/Cocoa ports while it is the number of physical lines, i.e. the count of lines actually shown in the control, in wxMSW. Because of this discrepancy, it is not recommended to use this function.
int
Note
Note that even empty text controls have one line (where the insertion point is), so GetNumberOfLines
never returns 0.
Returns True
if overtype mode is active otherwise False
is returned.
bool
Get convert-on-paste setting.
bool
How many phases is drawing done in?
The return value will be one of the STC_PHASES_*
constants.
int
Added in version 4.1/wxWidgets-3.1.0.
How many entries are allocated to the position cache?
int
For a secondary style, return the primary style, else return the argument.
style (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Returns the print colour mode.
The return value will be one of the STC_PRINT_*
constants.
int
Returns the print magnification.
int
Is printing line wrapped?
The return value will be one of the STC_WRAP_*
constants.
int
Retrieve a “property” value previously set with SetProperty.
key (string)
str
Retrieve a “property” value previously set with SetProperty, with “$()” variable replacement on returned buffer.
key (string)
str
Retrieve a “property” value previously set with SetProperty, interpreted as an int AFTER
any “$()” variable replacement.
key (string)
defaultValue (int)
int
Get the set of characters making up punctuation characters.
str
Returns the string containing the text starting in the positions from and up to to in the control.
The positions must have been returned by another wx.TextCtrl method. Please note that the positions in a multiline wx.TextCtrl do not correspond to the indices in the string returned by GetValue
because of the different new line representations ( CR
or CR
LF
) and so this method should be used to obtain the correct results instead of extracting parts of the entire value. It may also be more efficient, especially if the control contains a lot of data.
from_ (long)
to_ (long)
str
Return a read-only pointer to a range of characters in the document. May move the gap so that the range is contiguous, but will only move up to rangeLength bytes.
Any
In read-only mode?
bool
Return the anchor position of the rectangular selection.
int
Return the virtual space of the anchor of the rectangular selection.
int
Return the caret position of the rectangular selection.
int
Return the virtual space of the caret of the rectangular selection.
int
Get the modifier key used for rectangular selection.
The return value will be a bit list containing one or more of the STC_KEYMOD_*
constants.
int
Set the way a character is drawn.
encodedCharacter (string)
str
Added in version 4.1/wxWidgets-3.1.0.
Get cursor type.
The return value will be one of the STC_CURSOR*
constants.
int
Get internal focus flag.
bool
Retrieve the document width assumed for scrolling.
int
Retrieve whether the scroll width tracks wide lines.
bool
Get the search flags used by SearchInTarget.
The return value will be a bit list containing one or more of the STC_FIND_*
constants.
int
Get the alpha of the selection.
int
Is the selection end of line filled?
bool
Retrieve the selected text.
str
Retrieve the selected text.
CharBuffer
Gets the current selection span.
If the returned values are equal, there was no selection. Please note that the indices returned may be used with the other wx.TextCtrl methods but don’t necessarily represent the correct indices into the string returned by GetValue
for multiline controls under Windows (at least,) you should use GetStringSelection
to get the selected text.
The returned first position.
The returned last position.
Tuple[int, int]
Is every selected range empty?
bool
Added in version 4.1/wxWidgets-3.1.0.
Returns the position at the end of the selection.
int
Get the mode of the current selection.
The return value will be one of the STC_SEL_*
constants.
int
Return the anchor position of the nth selection.
selection (int)
int
Return the virtual space of the anchor of the nth selection.
selection (int)
int
Return the caret position of the nth selection.
selection (int)
int
Return the virtual space of the caret of the nth selection.
selection (int)
int
Returns the position at the end of the selection.
selection (int)
int
Returns the position at the start of the selection.
selection (int)
int
Returns the position at the start of the selection.
int
How many selections are there?
int
Get error status.
The return value will be one of the STC_STATUS_*
constants.
int
Gets the text currently selected in the control.
If there is no selection, the returned string is empty.
str
This method is inherited from TextAreaBase but is not implemented in wx.stc.StyledTextCtrl.
position (long)
style (wx.TextAttr)
bool
Returns the style byte at the position.
pos (int)
int
Retrieve number of bits in style bytes used to hold the lexical state.
int
Retrieve the number of bits the current lexer needs for styling.
int
For a sub style, return the base style, else return the argument.
subStyle (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Retrieve a buffer of cells.
startPos (int)
endPos (int)
MemoryBuffer
Get the set of base styles that can be extended with sub styles.
str
Added in version 4.1/wxWidgets-3.1.0.
The number of sub styles associated with a base style.
styleBase (int)
int
Added in version 4.1/wxWidgets-3.1.0.
The starting style number for the sub styles associated with a base style.
styleBase (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Retrieve the current tab draw mode.
Returns one of STC_TD_
constants.
int
Added in version 4.1/wxWidgets-3.1.1.
Does a tab pressed when caret is within indentation indent?
bool
Retrieve the visible size of a tab.
int
Retrieve the value of a tag from a regular expression search.
tagNumber (int)
str
Get the position that ends the target.
int
Get the position that starts the target.
int
Retrieve the text in the target.
str
Added in version 4.1/wxWidgets-3.1.0.
Retrieve the target text.
CharBuffer
Added in version 4.1/wxWidgets-3.1.1.
Get the tech.
The return value will be one of the STC_TECHNOLOGY_*
constants.
int
Retrieve all the text in the document.
str
Retrieve the number of characters in the document.
int
Retrieve a range of text.
startPos (int)
endPos (int)
str
Retrieve a range of text.
startPos (int)
endPos (int)
CharBuffer
Retrieve all the text in the document.
CharBuffer
Is drawing done in two phases with backgrounds drawn before foregrounds?
bool
Is undo history being collected?
bool
Returns the current UseAntiAliasing setting.
bool
Is the horizontal scroll bar visible?
bool
Retrieve whether tabs will be used in indentation.
bool
Is the vertical scroll bar visible?
bool
Gets the contents of the control.
Notice that for a multiline text control, the lines will be separated by (Unix-style) \n
characters, even under Windows where they are separated by a \r\n
sequence in the native control.
str
Are the end of line characters visible?
bool
Are white space characters currently visible? Returns one of STC_WS_
constants.
int
Return options for virtual space behaviour.
The return value will be one of the STC_VS_*
constants.
int
Get the set of characters making up whitespace for when moving or selecting by word.
str
Get the size of the dots used to mark space characters.
int
Get the set of characters making up words for when moving or selecting by word.
str
Retrieve how wrapped sublines are placed.
Default is wx.stc.STC_WRAPINDENT_FIXED
.
The return value will be one of the STC_WRAPINDENT_*
constants.
int
Retrieve whether text is word wrapped.
The return value will be one of the STC_WRAP_*
constants.
int
Retrieve the start indent for wrapped lines.
int
Retrieve the display mode of visual flags for wrapped lines.
The return value will be a bit list containing one or more of the STC_WRAPVISUALFLAG_*
constants.
int
Retrieve the location of visual flags for wrapped lines.
The return value will be a bit list containing one or more of the STC_WRAPVISUALFLAGLOC_*
constants.
int
Get the xOffset (ie, horizontal scroll position).
int
Retrieve the zoom level.
int
Set caret to start of a line and ensure it is visible.
line (int)
None
Set caret to a position and ensure it is visible.
caret (int)
None
Make a range of lines invisible.
lineStart (int)
lineEnd (int)
None
Draw the selection in normal style or with selection highlighted.
hide (bool)
None
Finds the position of the character at the specified point.
If the return code is not TE_HT_UNKNOWN
the row and column of the character closest to this position are returned, otherwise the output parameters are not modified.
Please note that this function is currently only implemented in Univ, wxMSW and wxGTK2 ports and always returns TE_HT_UNKNOWN
in the other ports.
Finds the row and column of the character at the specified point.
If the return code is not TE_HT_UNKNOWN
the row and column of the character closest to this position are returned, otherwise the output parameters are not modified.
Please note that this function is currently only implemented in Univ, wxMSW and wxGTK2 ports and always returns TE_HT_UNKNOWN
in the other ports.
Move caret to first position on line.
None
Move caret to first position on display line.
None
Move caret to first position on display line extending selection to new caret position.
None
Move caret to first position on line extending selection to new caret position.
None
Move caret to first position on line, extending rectangular selection to new caret position.
None
Like Home but when word-wrap is enabled goes first to start of display line HomeDisplay, then to start of document line Home.
None
Like HomeExtend but when word-wrap is enabled extends first to start of display line HomeDisplayExtend, then to start of document line HomeExtend.
None
Are any indicators present at pos?
pos (int)
int
Turn an indicator off over a range.
start (int)
lengthClear (int)
None
Where does a particular indicator end?
indicator (int)
pos (int)
int
Turn an indicator on over a range.
start (int)
lengthFill (int)
None
Get the alpha fill colour of the given indicator.
indicator (int)
int
Retrieve the attributes of an indicator.
The return value will be a bit list containing one or more of the STC_INDICFLAG_*
constants.
indicator (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Retrieve the foreground colour of an indicator.
indicator (int)
Retrieve the foreground hover colour of an indicator.
indicator (int)
Added in version 4.1/wxWidgets-3.1.0.
Retrieve the hover style of an indicator.
indicator (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Get the alpha outline colour of the given indicator.
indicator (int)
int
Retrieve the style of an indicator.
The return value will be one of the STC_INDIC_*
constants.
indicator (int)
int
Retrieve whether indicator drawn under or over text.
indicator (int)
bool
Set the alpha fill colour of the given indicator.
indicator (int)
alpha (int)
None
Set the attributes of an indicator.
The second argument should be a bit list containing one or more of the STC_INDICFLAG_*
constants.
indicator (int)
flags (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set the foreground colour of an indicator.
indicator (int)
fore (wx.Colour)
None
Set the foreground hover colour of an indicator.
indicator (int)
fore (wx.Colour)
None
Added in version 4.1/wxWidgets-3.1.0.
Set a hover indicator to plain, squiggle or TT
.
indicator (int)
indicatorStyle (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set the alpha outline colour of the given indicator.
indicator (int)
alpha (int)
None
Set an indicator to plain, squiggle or TT
.
The second argument should be one of the STC_INDIC_*
constants.
indicator (int)
indicatorStyle (int)
None
Set an indicator to draw under text or over(default).
indicator (int)
under (bool)
None
Where does a particular indicator start?
indicator (int)
pos (int)
int
What value does a particular indicator have at a position?
indicator (int)
pos (int)
int
Insert string at a position.
pos (int)
text (string)
None
Insert string at a position.
pos (int)
text (int)
None
Returns True
if the controls contents may be edited by user (note that it always can be changed by the program).
In other words, this functions returns True
if the control hasn’t been put in read-only mode by a previous call to SetEditable
.
bool
Returns True
if the control is currently empty.
This is the same as GetValue
.empty() but can be much more efficient for the multiline controls containing big amounts of text.
bool
Added in version 2.7.1.
Returns True
if the text has been modified by user.
Note that calling SetValue
doesn’t make the control modified.
bool
See also
Is the range start..end considered a word?
start (int)
end (int)
bool
Added in version 4.1/wxWidgets-3.1.1.
Copy the line containing the caret.
None
Cut the line containing the caret.
None
Delete the line containing the caret.
None
Move caret down one line.
None
Move caret down one line extending selection to new caret position.
None
Move caret down one line, extending rectangular selection to new caret position.
None
Duplicate the current line.
None
Move caret to last position on line.
None
Move caret to last position on display line.
None
Move caret to last position on display line extending selection to new caret position.
None
Move caret to last position on line extending selection to new caret position.
None
Move caret to last position on line, extending rectangular selection to new caret position.
None
Like LineEnd but when word-wrap is enabled goes first to end of display line LineEndDisplay, then to start of document line LineEnd.
None
Like LineEndExtend but when word-wrap is enabled extends first to end of display line LineEndDisplayExtend, then to start of document line LineEndExtend.
None
Retrieve the line containing a position.
pos (int)
int
How many characters are on a line, including end of line characters?
line (int)
int
Scroll horizontally and vertically.
columns (int)
lines (int)
None
Scroll the document down, keeping the caret visible.
None
Scroll the document up, keeping the caret visible.
None
Switch the current line with the previous.
None
Move caret up one line.
None
Move caret up one line extending selection to new caret position.
None
Move caret up one line, extending rectangular selection to new caret position.
None
Join the lines in the target.
None
Retrieves the number of lines completely visible.
int
Split the lines in the target into lines that are less wide than pixelWidth where possible.
pixelWidth (int)
None
Load the contents of filename into the editor.
filename (string)
bool
Load a lexer library (dll / so).
path (string)
None
Added in version 4.1/wxWidgets-3.1.1.
Transform the selection to lower case.
None
Get the style number for the text margin for a line.
line (int)
int
Get the start of the range of style numbers used for margin text.
int
Get the styles in the text margin for a line.
line (int)
str
Get the text in the text margin for a line.
line (int)
str
Set the style number for the text margin for a line.
line (int)
style (int)
None
Get the start of the range of style numbers used for margin text.
style (int)
None
Set the style in the text margin for a line.
line (int)
styles (string)
None
Set the text in the text margin for a line.
line (int)
text (string)
None
Clear the margin text on all lines.
None
Mark text as modified (dirty).
None
See also
Add a marker to a line, returning an ID
which can be used to find or delete the marker.
line (int)
markerNumber (int)
int
Add a set of markers to a line.
line (int)
markerSet (int)
None
Set the symbol used for a particular marker number, and optionally the fore and background colours.
The second argument should be one of the STC_MARK_*
constants.
Define a marker with a wx.Bitmap.
markerNumber (int)
bmp (wx.Bitmap)
None
Define a marker from
RGBA
data.It has the width and height from RGBAImageSetWidth/Height. You must ensure that the buffer is at least widthheight4 bytes long.
None
Delete a marker from a line.
line (int)
markerNumber (int)
None
Delete all markers with a particular number from all lines.
markerNumber (int)
None
Delete a marker.
markerHandle (int)
None
Enable/disable highlight for current folding block (smallest one that contains the caret)
enabled (bool)
None
Get a bit mask of all the markers set on a line.
line (int)
int
Retrieve the line number at which a particular marker is located.
markerHandle (int)
int
Find the next line at or after lineStart that includes a marker in mask.
Return -1 when no more lines.
lineStart (int)
markerMask (int)
int
Find the previous line before lineStart that includes a marker in mask.
lineStart (int)
markerMask (int)
int
Set the alpha used for a marker that is drawn in the text area, not the margin.
markerNumber (int)
alpha (int)
None
Set the background colour used for a particular marker number.
markerNumber (int)
back (wx.Colour)
None
Set the background colour used for a particular marker number when its folding block is selected.
markerNumber (int)
back (wx.Colour)
None
Set the foreground colour used for a particular marker number.
markerNumber (int)
fore (wx.Colour)
None
Move the caret inside current view if it’s not there already.
None
Move the selected lines down one line, shifting the line below before the selection.
None
Move the selected lines up one line, shifting the line above after the selection.
None
Add a new vertical edge to the view.
column (int)
edgeColour (wx.Colour)
None
Added in version 4.1/wxWidgets-3.1.1.
Clear all vertical edges.
None
Added in version 4.1/wxWidgets-3.1.1.
Add each occurrence of the main selection in the target to the set of selections.
If the current selection is empty then select word around caret.
None
Added in version 4.1/wxWidgets-3.1.1.
Add the next occurrence of the main selection to the set of selections as main.
If the current selection is empty then select word around caret.
None
Added in version 4.1/wxWidgets-3.1.1.
Insert a new line, may use a CRLF
, CR
or LF
depending on EOL
mode.
None
Move caret one page down.
None
Move caret one page down extending selection to new caret position.
None
Move caret one page down, extending rectangular selection to new caret position.
None
Move caret one page up.
None
Move caret one page up extending selection to new caret position.
None
Move caret one page up, extending rectangular selection to new caret position.
None
Move caret down one paragraph (delimited by empty lines).
None
Extend selection down one paragraph (delimited by empty lines).
None
Move caret up one paragraph (delimited by empty lines).
None
Extend selection up one paragraph (delimited by empty lines).
None
Paste the contents of the clipboard into the document replacing the selection.
None
Retrieve the point in the window where a position is displayed.
pos (int)
Given a valid document position, return the next position taking code page into account.
Maximum value returned is the last position in the document.
pos (int)
int
Given a valid document position, return the previous position taking code page into account.
Returns 0 if passed 0.
pos (int)
int
Retrieve the position at the start of a line.
line (int)
int
Find the position from a point within the window.
pt (wx.Point)
int
Find the position from a point within the window but return wx.stc.STC_INVALID_POSITION
if not close to text.
x (int)
y (int)
int
Given a valid document position, return a position that differs in a number of characters.
Returned value is always between 0 and last position in document.
pos (int)
relative (int)
int
Added in version 4.1/wxWidgets-3.1.0.
Converts given text position to client coordinates in pixels.
This function allows finding where is the character at the given position displayed in the text control.
pos (long) – Text position in 0 to GetLastPosition
range (inclusive).
On success returns a wx.Point which contains client coordinates for the given position in pixels, otherwise returns wx.DefaultPosition
.
Added in version 2.9.3.
Availability
Only available for MSW, GTK . Additionally, wxGTK only implements this method for multiline controls and wx.DefaultPosition
is always returned for the single line ones.
See also
Converts given position to a zero-based column, line number pair.
pos (long) – Position.
Tuple[bool, int, int]
For private communication between an application and a known lexer.
operation (int)
pointer
Any
Retrieve a ‘\n’ separated list of properties understood by the current lexer.
str
Retrieve the type of a property.
The return value will be one of the STC_TYPE_*
constants.
name (string)
int
Set the height for future RGBA
image data.
height (int)
None
Set the scale factor in percent for future RGBA
image data.
scalePercent (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set the width for future RGBA
image data.
width (int)
None
Redoes the next action on the undo history.
None
Register an image for use in autocompletion lists.
type (int)
bmp (wx.Bitmap)
None
Register an
RGBA
image for use in autocompletion lists.It has the width and height from RGBAImageSetWidth/Height. You must ensure that the buffer is at least widthheight4 bytes long.
None
Release all extended (>255) style numbers.
None
Added in version 4.1/wxWidgets-3.1.0.
Release a reference to the document, deleting document if it fades to black.
docPointer
None
Removes the text starting at the first given position up to (but not including) the character at the last position.
This function puts the current insertion point position at to as a side effect.
from_ (long)
to_ (long)
The first position.
The last position.
None
Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.
This function puts the current insertion point position at to as a side effect.
from_ (long)
to_ (long)
value (string) – The value to replace the existing text with.
The first position.
The last position.
None
Replace the selected text with the argument text.
text (string)
None
Replace the current selection with text.
If there is no current selection, text is inserted at the current caret position.
text (int) – The null terminated string used for the replacement.
None
Added in version 4.1/wxWidgets-3.1.3.
Replace the target text with the argument text.
Text is counted so it can contain NULs. Returns the length of the replacement text.
text (string)
int
Replace the target text with the argument text after \d processing.
Text is counted so it can contain NULs. Looks for \d where d is between 1 and 9 and replaces these with the strings matched in the last search operation which were surrounded by \( and \). Returns the length of the replacement text including any change caused by processing the \d patterns.
text (string)
int
Replace the current target with text using regular expressions.
The replacement string will be formed from text with any occurrences ‘\1’ through ‘\9’ replaced by tagged matches from the most recent regular expression search. In addition, any occurrences of ‘\0’ will be replaced with all the matched text from the most recent search. After replacement, the target range refers to the replacement text.
text (int)
length (int)
int
The return value is the length of the replacement string.
Added in version 4.1/wxWidgets-3.1.3.
Note
If length=-1, text must be null terminated.
See also
Replace the current target with text.
text (int)
length (int)
int
The return value is the length of the replacement string.
Added in version 4.1/wxWidgets-3.1.3.
Note
If length=-1, text must be null terminated.
Set the main selection to the next selection.
None
Write the contents of the editor to filename.
filename (string)
bool
Scroll the argument positions and the range between them into view giving priority to the primary position then the secondary position.
This may be used to make a search match visible.
secondary (int)
primary (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Scroll enough to make the given column visible.
column (int)
None
Scroll to end of document.
None
Scroll enough to make the given line visible.
line (int)
None
Scroll to start of document.
None
Sets the current caret position to be the search anchor.
None
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.
text (string)
int
Find some text starting at the search anchor.
Does not ensure the selection is visible.
searchFlags (int)
text (string)
int
Find some text starting at the search anchor and moving backwards.
Does not ensure the selection is visible.
searchFlags (int)
text (string)
int
Select all the text in the document.
None
Deselects selected text in the control.
None
Added in version 2.9.5.
Duplicate the selection.
If selection empty duplicate the line containing the caret.
None
Is the selection rectangular? The alternative is the more common stream selection.
bool
Scintilla API call.
msg (int)
wp (wx.UIntPtr)
lp (wx.IntPtr)
wx.IntPtr
Set the foreground colour of additional carets.
fore (wx.Colour)
None
Set whether additional carets will blink.
additionalCaretsBlink (bool)
None
Set whether additional carets are visible.
additionalCaretsVisible (bool)
None
Set the alpha of the selection.
alpha (int)
None
Set the background colour of additional selections.
Must have previously called SetSelBack with non-zero first argument for this to have an effect.
back (wx.Colour)
None
Set the foreground colour of additional selections.
Must have previously called SetSelFore with non-zero first argument for this to have an effect.
fore (wx.Colour)
None
Set whether typing can be performed into multiple selections.
additionalSelectionTyping (bool)
None
Set the selection anchor to a position.
The anchor is the opposite end of the selection from the caret.
anchor (int)
None
Set automatic folding behaviours.
The input should be a bit list containing one or more of the STC_AUTOMATICFOLD_*
constants.
automaticFold (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Sets whether a backspace pressed when caret is within indentation unindents.
bsUnIndents (bool)
None
If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.
buffered (bool)
None
Set the foreground colour of the caret.
fore (wx.Colour)
None
Set background alpha of the caret line.
alpha (int)
None
Set the colour of the background of the line containing the caret.
back (wx.Colour)
None
Display the background of the line containing the caret in a different colour.
show (bool)
None
Sets the caret line to always visible.
alwaysVisible (bool)
None
Added in version 4.1/wxWidgets-3.1.0.
Get the time in milliseconds that the caret is on and off.
0 = steady on.
periodMilliseconds (int)
None
Stop the caret preferred x position changing when the user types.
The input should be one of the STC_CARETSTICKY_*
constants.
useCaretStickyBehaviour (int)
None
Set the style of the caret to be drawn.
The input should be one of the STC_CARETSTYLE_*
constants.
caretStyle (int)
None
Set the width of the insert mode caret.
pixelWidth (int)
None
Reset the set of characters for whitespace and word characters to the defaults.
None
Set the code page used to interpret the bytes of the document as characters.
codePage (int)
None
Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.
symbol (int)
None
Sets the position of the caret.
caret (int)
None
This method is inherited from TextAreaBase but is not implemented in wx.stc.StyledTextCtrl.
style (wx.TextAttr)
bool
Change the document object used.
docPointer
None
Set the current end of line mode.
The input should be one of the STC_EOL_*
constants.
eolMode (int)
None
Change the colour used in edge indication.
edgeColour (wx.Colour)
None
Set the column number of the edge.
If text goes past the edge then it is highlighted.
column (int)
None
The edge may be displayed by a line (wxSTC_EDGE_LINE/wxSTC_EDGE_MULTILINE) or by highlighting text that goes beyond it (wx``wx.stc.STC_EDGE_BACKGROUND``) or not displayed at all (wx``wx.stc.STC_EDGE_NONE``).
The input should be one of the STC_EDGE_*
constants.
edgeMode (int)
None
Makes the text item editable or read-only, overriding the wx.TE_READONLY
flag.
editable (bool) – If True
, the control is editable. If False
, the control is read-only.
None
See also
Set caret to a position, while removing any existing selection.
caret (int)
None
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.
endAtLastLine (bool)
None
Set extra ascent for each line.
extraAscent (int)
None
Set extra descent for each line.
extraDescent (int)
None
Scroll so that a display line is at the top of the display.
displayLine (int)
None
Show the children of a header line.
line (int)
expanded (bool)
None
Set some style options for folding.
The second argument should be a bit list containing one or more of the STC_FOLDFLAG_*
constants.
flags (int)
None
Set the fold level of a line.
This encodes an integer level along with flags indicating whether the line is a header and whether it is effectively white space.
line (int)
level (int)
None
Set one of the colours used as a chequerboard pattern in the fold margin.
useSetting (bool)
back (wx.Colour)
None
Set the other colour used as a chequerboard pattern in the fold margin.
useSetting (bool)
fore (wx.Colour)
None
Choose the quality level for text.
The input should be one of the STC_EFF_QUALITY_*
constants.
fontQuality (int)
None
Added in version 4.1/wxWidgets-3.1.1.
Note
This method only has any effect with the wxMSW port and when technology has been set to wx.stc.STC_TECHNOLOGY_DIRECTWRITE
.
Set the horizontal scrollbar to use instead of the one that’s built-in.
bar (wx.ScrollBar)
None
Set the highlighted indentation guide column.
0 = no highlighted guide.
column (int)
None
Sets a hint shown in an empty unfocused text control.
The hints are usually used to indicate to the user what is supposed to be entered into the given entry field, e.g. a common use of them is to show an explanation of what can be entered in a wx.SearchCtrl.
The hint is shown (usually greyed out) for an empty control until it gets focus and is shown again if the control loses it and remains empty. It won’t be shown once the control has a non-empty value, although it will be shown again if the control contents is cleared. Because of this, it generally only makes sense to use hints with the controls which are initially empty.
Notice that hints are known as cue banners under MSW or placeholder strings under macOS.
For the platforms without native hints support, the implementation has several known limitations. Notably, the hint display will not be properly updated if you change wx.TextEntry contents programmatically when the hint is displayed using methods other than SetValue
or ChangeValue
or others which use them internally (e.g. Clear
). In other words, currently you should avoid calling methods such as WriteText
or Replace
when using hints and the text control is empty. If you bind to the control’s focus and wxEVT_TEXT events, you must call wx.Event.Skip
on them so that the generic implementation works correctly.
Another limitation is that hints are ignored for the controls with TE_PASSWORD
style.
hint (string)
bool
Added in version 2.9.0.
Note
Currently implemented natively on Windows (Vista and later only), macOS and GTK+ (3.2 and later).
Note
Hints can be used for single line text controls under all platforms, but only MSW and GTK+ 2 support them for multi-line text controls, they are ignored for them under the other platforms.
Set a back colour for active hotspots.
useSetting (bool)
back (wx.Colour)
None
Set a fore colour for active hotspots.
useSetting (bool)
fore (wx.Colour)
None
Enable / Disable underlining active hotspots.
underline (bool)
None
Limit hotspots to single line so hotspots on two lines don’t merge.
singleLine (bool)
None
Choose to display the IME
in a winow or inline.
The input should be one of the STC_IME_*
constants.
imeInteraction (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set the identifier reported as idFrom in notification messages.
identifier (int)
None
Set the identifiers that are shown in a particular style.
style (int)
identifiers (string)
None
Added in version 4.1/wxWidgets-3.1.0.
Sets limits to idle styling.
The input should be one of the STC_IDLESTYLING_*
constants.
idleStyling (int)
None
Added in version 4.1/wxWidgets-3.1.1.
Set the number of spaces used for one level of indentation.
indentSize (int)
None
Show or hide indentation guides.
The input should be one of the STC_IV_*
constants.
indentView (int)
None
Set the indicator used for IndicatorFillRange and IndicatorClearRange.
indicator (int)
None
Set the value used for IndicatorFillRange.
value (int)
None
Sets the insertion point at the given position.
pos (long) – Position to set, in the range from 0 to GetLastPosition
inclusive.
None
Sets the insertion point at the end of the text control.
This is equivalent to calling wx.TextCtrl.SetInsertionPoint
with wx.TextCtrl.GetLastPosition
argument.
None
Set up the key words used by the lexer.
keyWordSet (int)
keyWords (string)
None
Returns the line number of the line with the caret.
val (bool)
None
Sets the degree of caching of layout information.
The input should be one of the STC_CACHE_*
constants.
cacheMode (int)
None
Set the lexing language of the document.
The input should be one of the STC_LEX_*
constants.
lexer (int)
None
Set the lexing language of the document based on string name.
language (string)
None
Set the line end types that the application wants to use.
May not be used if incompatible with lexer or encoding.
The input should be one of the STC_LINE_END_TYPE_*
constants.
lineEndBitSet (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Change the indentation of a line to a number of columns.
line (int)
indentation (int)
None
Used to hold extra styling information for each line.
line (int)
state (int)
None
Set the main selection.
selection (int)
None
Set the background colour of a margin.
Only visible for wx.stc.STC_MARGIN_COLOUR
.
margin (int)
back (wx.Colour)
None
Added in version 4.1/wxWidgets-3.1.1.
Allocate a non-standard number of margins.
margins (int)
None
Added in version 4.1/wxWidgets-3.1.1.
Set the cursor shown when the mouse is inside a margin.
The second argument should be one of the STC_CURSOR*
constants.
margin (int)
cursor (int)
None
Sets the size in pixels of the left margin.
pixelWidth (int)
None
Set a mask that determines which markers are displayed in a margin.
margin (int)
mask (int)
None
Set the margin options.
The input should be one of the STC_MARGINOPTION_*
constants.
marginOptions (int)
None
Sets the size in pixels of the right margin.
pixelWidth (int)
None
Make a margin sensitive or insensitive to mouse clicks.
margin (int)
sensitive (bool)
None
Set a margin to be either numeric or symbolic.
The second argument should be one of the STC_MARGIN_*
constants.
margin (int)
marginType (int)
None
Set the width of a margin to a width expressed in pixels.
margin (int)
pixelWidth (int)
None
Set the left and right margin in the edit area, measured in pixels.
left (int)
right (int)
None
This function sets the maximum number of characters the user can enter into the control.
In other words, it allows limiting the text value length to len not counting the terminating NUL
character.
If len is 0, the previously set max length limit, if any, is discarded and the user may enter as much text as the underlying native text control widget supports (typically at least 32Kb). If the user tries to enter more characters into the text control when it already is filled up to the maximal length, a wxEVT_TEXT_MAXLEN
event is sent to notify the program about it (giving it the possibility to show an explanatory message, for example) and the extra input is discarded.
Note that in wxGTK this function may only be used with single line text controls.
len (long)
None
Set which document modification events are sent to the container.
The input should be a bit list containing one or more of the STC_MOD_*
constants, the STC_PERFORMED_*
constants, wx.stc.STC_STARTACTION
, wx.stc.STC_MULTILINEUNDOREDO
, wx.stc.STC_MULTISTEPUNDOREDO
, and wx.stc.STC_LASTSTEPINUNDOREDO
. The input can also be wx.stc.STC_MODEVENTMASKALL
to indicate that all changes should generate events.
eventMask (int)
None
Marks the control as being modified by the user or not.
modified (bool)
None
See also
Set whether the mouse is captured when its button is pressed.
captures (bool)
None
Sets the time the mouse must sit still to generate a mouse dwell event.
The input should be a time in milliseconds or wx.stc.STC_TIME_FOREVER
.
periodMilliseconds (int)
None
Set whether switching to rectangular mode while selecting with the mouse is allowed.
mouseSelectionRectangularSwitch (bool)
None
Added in version 4.1/wxWidgets-3.1.0.
Set whether the mouse wheel can be active outside the window.
captures (bool)
None
Added in version 4.1/wxWidgets-3.1.1.
Change the effect of pasting when there are multiple selections.
The input should be one of the STC_MULTIPASTE_*
constants.
multiPaste (int)
None
Set whether multiple selections can be made.
multipleSelection (bool)
None
Set to overtype (True
) or insert mode.
overType (bool)
None
Enable/Disable convert-on-paste for line endings.
convert (bool)
None
In one phase draw, text is drawn in a series of rectangular blocks with no overlap.
In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. In multiple phase draw, each element is drawn over the whole drawing area, allowing text to overlap from one line to the next.
The input should be one of the STC_PHASES_*
constants.
phases (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Set number of entries in position cache.
size (int)
None
Modify colours when printing for clearer printed text.
The input should be one of the STC_PRINT_*
constants.
mode (int)
None
Sets the print magnification added to the point size of each style for printing.
magnification (int)
None
Set printing to line wrapped (wx``wx.stc.STC_WRAP_WORD``) or not line wrapped (wx``wx.stc.STC_WRAP_NONE``).
wrapMode (int)
None
Set up a value that may be used by a lexer for some optional feature.
key (string)
value (string)
None
Set the set of characters making up punctuation characters Should be called after SetWordChars.
characters (string)
None
Set to read only or read write.
readOnly (bool)
None
Set the anchor position of the rectangular selection.
anchor (int)
None
Set the virtual space of the anchor of the rectangular selection.
space (int)
None
Set the caret position of the rectangular selection.
caret (int)
None
Set the virtual space of the caret of the rectangular selection.
space (int)
None
On GTK+, allow selecting the modifier key to use for mouse-based rectangular selection.
Often the window manager requires Alt+Mouse Drag for moving windows. Valid values are wx.stc.STC_KEYMOD_CTRL
(default), wx.stc.STC_KEYMOD_ALT
, or wx.stc.STC_KEYMOD_SUPER
.
modifier (int)
None
Set the way a character is drawn.
encodedCharacter (string)
representation (string)
None
Added in version 4.1/wxWidgets-3.1.0.
Sets the cursor to one of the STC_CURSOR
values.
cursorType (int)
None
Change internal focus flag.
focus (bool)
None
Remember the current position in the undo history as the position at which the document was saved.
None
Sets the document width assumed for scrolling.
pixelWidth (int)
None
Sets whether the maximum width line displayed is used to set scroll width.
tracking (bool)
None
Set the search flags used by SearchInTarget.
The input should be a bit list containing one or more of the STC_FIND_*
constants.
searchFlags (int)
None
Set the alpha of the selection.
alpha (int)
None
Set the background colour of the main and additional selections and whether to use this setting.
useSetting (bool)
back (wx.Colour)
None
Set the selection to have its end of line filled or not.
filled (bool)
None
Set the foreground colour of the main and additional selections and whether to use this setting.
useSetting (bool)
fore (wx.Colour)
None
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 all text in the control is selected.
Notice that the insertion point will be moved to from by this function.
from_ (long)
to_ (long)
The first position.
The last position.
None
See also
Sets the position that ends the selection - this becomes the caret.
caret (int)
None
Set the selection mode to stream (wx``wx.stc.STC_SEL_STREAM``) or rectangular (wxSTC_SEL_RECTANGLE/wxSTC_SEL_THIN) or by lines (wx``wx.stc.STC_SEL_LINES``).
selectionMode (int)
None
Set the anchor position of the nth selection.
selection (int)
anchor (int)
None
Set the virtual space of the anchor of the nth selection.
selection (int)
space (int)
None
Set the caret position of the nth selection.
selection (int)
caret (int)
None
Set the virtual space of the caret of the nth selection.
selection (int)
space (int)
None
Sets the position that ends the selection - this becomes the currentPosition.
selection (int)
caret (int)
None
Sets the position that starts the selection - this becomes the anchor.
selection (int)
anchor (int)
None
Sets the position that starts the selection - this becomes the anchor.
anchor (int)
None
Change error status - 0 = wx.OK
.
The input should be one of the STC_STATUS_*
constants.
status (int)
None
This method is inherited from TextAreaBase but is not implemented in wx.stc.StyledTextCtrl.
start (long)
end (long)
style (wx.TextAttr)
bool
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.
bits (int)
None
Set the styles for a segment of the document.
length (int)
styleBytes (int)
None
Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.
length (int)
style (int)
None
Set how tabs are drawn when visible.
The input should be one of the STC_TD_*
constants.
tabDrawMode (int)
None
Added in version 4.1/wxWidgets-3.1.1.
Sets whether a tab pressed when caret is within indentation indents.
tabIndents (bool)
None
Change the visible size of a tab to be a multiple of the width of a space character.
tabWidth (int)
None
Sets the position that ends the target which is used for updating the document without affecting the scroll position.
end (int)
None
Sets both the start and end of the target in one call.
start (int)
end (int)
None
Added in version 4.1/wxWidgets-3.1.0.
Sets the position that starts the target which is used for updating the document without affecting the scroll position.
start (int)
None
Set the technology used.
technology (int)
None
Note
For the wxMSW port, the input can be either wx.stc.STC_TECHNOLOGY_DEFAULT
or wx.stc.STC_TECHNOLOGY_DIRECTWRITE
. With other ports, this method has no effect.
Replace the contents of the document with the argument text.
text (string)
None
Replace the contents of the document with the argument text.
text (int)
None
In twoPhaseDraw mode, drawing is performed in two phases, first the background and then the foreground.
This avoids chopping off characters that overlap the next run.
twoPhase (bool)
None
Choose between collecting actions into the undo history and discarding them.
collectUndo (bool)
None
Specify whether anti-aliased fonts should be used.
This will have no effect on some platforms, but on some (wxMac for example) can greatly improve performance.
useAA (bool)
None
Show or hide the horizontal scroll bar.
visible (bool)
None
Indentation will only use space characters if useTabs is False
, otherwise it will use a combination of tabs and spaces.
useTabs (bool)
None
Show or hide the vertical scroll bar.
visible (bool)
None
Set the vertical scrollbar to use instead of the one that’s built-in.
bar (wx.ScrollBar)
None
Sets the new text control value.
It also marks the control as not-modified which means that IsModified() would return False
immediately after the call to SetValue
.
The insertion point is set to the start of the control (i.e. position 0) by this function unless the control value doesn’t change at all, in which case the insertion point is left at its original position.
Note that, unlike most other functions changing the controls values, this function generates a wxEVT_TEXT
event. To avoid this you can use ChangeValue
instead.
value (string) – The new value to set. It may contain newline characters if the text control is multi-line.
None
Make the end of line characters visible or invisible.
visible (bool)
None
Make white space characters invisible, always visible or visible outside indentation.
The input should be one of the STC_WS_*
constants.
viewWS (int)
None
Set options for virtual space behaviour.
The input should be one of the STC_VS_*
constants.
virtualSpaceOptions (int)
None
Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.
The first argument should be a bit list containing one or more of the STC_VISIBLE_*
constants.
visiblePolicy (int)
visibleSlop (int)
None
Set the background colour of all whitespace and whether to use this setting.
useSetting (bool)
back (wx.Colour)
None
Set the set of characters making up whitespace for when moving or selecting by word.
Should be called after SetWordChars.
characters (string)
None
Set the foreground colour of all whitespace and whether to use this setting.
useSetting (bool)
fore (wx.Colour)
None
Set the size of the dots used to mark space characters.
size (int)
None
Set the set of characters making up words for when moving or selecting by word.
First sets defaults like SetCharsDefault.
characters (string)
None
Sets how wrapped sublines are placed.
Default is wx.stc.STC_WRAPINDENT_FIXED
.
The input should be one of the STC_WRAPINDENT_*
constants.
wrapIndentMode (int)
None
Sets whether text is word wrapped.
The input should be one of the STC_WRAP_*
constants.
wrapMode (int)
None
Set the start indent for wrapped lines.
indent (int)
None
Set the display mode of visual flags for wrapped lines.
The input should be a bit list containing one or more of the STC_WRAPVISUALFLAG_*
constants.
wrapVisualFlags (int)
None
Set the location of visual flags for wrapped lines.
The input should be a bit list containing one or more of the STC_WRAPVISUALFLAGLOC_*
constants.
wrapVisualFlagsLocation (int)
None
Set the way the caret is kept visible when going sideways.
The exclusion zone is given in pixels.
The first argument should be a bit list containing one or more of the STC_CARET_*
constants.
caretPolicy (int)
caretSlop (int)
None
Set the xOffset (ie, horizontal scroll position).
xOffset (int)
None
Set the way the line the caret is on is kept visible.
The exclusion zone is given in lines.
The first argument should be a bit list containing one or more of the STC_CARET_*
constants.
caretPolicy (int)
caretSlop (int)
None
Set the zoom level.
This number of points is added to the size of all fonts. It may be positive to magnify or negative to reduce.
zoomInPoints (int)
None
Make a range of lines visible.
lineStart (int)
lineEnd (int)
None
Makes the line containing the given position visible.
pos (long) – The position that should be visible.
None
Start notifying the container of all key presses and commands.
None
Set the current styling position to start.
start (int)
None
Stop notifying the container of all key presses and commands.
None
Move caret to bottom of page, or one page down if already at bottom of page.
None
Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
None
Move caret to top of page, or one page up if already at top of page.
None
Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
None
Clear all the styles and make equivalent to the global default style.
None
Get the background colour of a style.
style (int)
Get is a style bold or not.
style (int)
bool
Get is a style mixed case, or to force upper or lower case.
The return value will be one of the STC_CASE_*
constants.
style (int)
int
Get is a style changeable or not (read only).
Experimental feature, currently buggy.
style (int)
bool
Get the character get of the font in a style.
style (int)
int
Get is a style to have its end of line filled or not.
style (int)
bool
Get the font facename of a style.
style (int)
str
Get the font of a style.
style (int)
Get the foreground colour of a style.
style (int)
Get is a style a hotspot or not.
style (int)
bool
Get is a style italic or not.
style (int)
bool
Get the size of characters of a style.
style (int)
int
Get the size of characters of a style in points multiplied by 100.
style (int)
int
Get is a style underlined or not.
style (int)
bool
Get is a style visible or not.
style (int)
bool
Get the weight of characters of a style.
The return value will be an integer that is possibly one of the STC_WEIGHT_*
constants.
style (int)
int
Reset the default style to its state at startup.
None
Set the background colour of a style.
style (int)
back (wx.Colour)
None
Set a style to be bold or not.
style (int)
bold (bool)
None
Set a style to be mixed case, or to force upper or lower case.
The second argument should be one of the STC_CASE_*
constants.
style (int)
caseVisible (int)
None
Set a style to be changeable or not (read only).
Experimental feature, currently buggy.
style (int)
changeable (bool)
None
Set the character set of the font in a style.
Converts the Scintilla character set values to a FontEncoding.
style (int)
characterSet (int)
None
Set a style to have its end of line filled or not.
style (int)
eolFilled (bool)
None
Set the font of a style.
style (int)
fontName (string)
None
Set style size, face, bold, italic, and underline attributes from a wx.Font’s attributes.
styleNum (int)
font (wx.Font)
None
Set all font style attributes at once.
styleNum (int)
size (int)
faceName (string)
bold (bool)
italic (bool)
underline (bool)
encoding (FontEncoding)
None
Set the font encoding to be used by a style.
style (int)
encoding (FontEncoding)
None
Set the foreground colour of a style.
style (int)
fore (wx.Colour)
None
Set a style to be a hotspot or not.
style (int)
hotspot (bool)
None
Set a style to be italic or not.
style (int)
italic (bool)
None
Set the size of characters of a style.
style (int)
sizePoints (int)
None
Set the size of characters of a style.
Size is in points multiplied by 100.
style (int)
sizeHundredthPoints (int)
None
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
styleNum (int)
spec (string)
None
Set a style to be underlined or not.
style (int)
underline (bool)
None
Set a style to be visible or not.
style (int)
visible (bool)
None
Set the weight of characters of a style.
The second argument can be an integer or one of the STC_WEIGHT_*
constants.
style (int)
weight (int)
None
Swap that caret and anchor of the main selection.
None
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.
None
Make the target range start and end be the same as the selection range start and end.
None
Sets the target to the whole document.
None
Added in version 4.1/wxWidgets-3.1.1.
Retrieve the height of a particular line of text in pixels.
line (int)
int
Measure the pixel width of some text in a particular style.
Does not handle tab or control characters.
style (int)
text (string)
int
Switch between sticky and non-sticky: meant to be bound to a key.
None
Switch a header line between expanded and contracted.
line (int)
None
Switch a header line between expanded and contracted and show some text after the line.
line (int)
text (string)
None
Added in version 4.1/wxWidgets-3.1.1.
Undo one action in the undo history.
None
Transform the selection to upper case.
None
Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button on certain areas.
The input should be one of the STC_POPUP_*
constants.
popUpMode (int)
None
Note
When wx.ContextMenuEvent is used to create a custom popup menu, this function should be called with wx.stc.STC_POPUP_NEVER
. Otherwise the default menu will be shown instead of the custom one.
Display a list of strings and send notification when user chooses one.
listType (int)
itemList (string)
None
Move caret to before first visible character on line.
If already there move to first character on line.
None
Move caret to before first visible character on display line.
If already there move to first character on display line.
None
Added in version 4.1/wxWidgets-3.1.0.
Like VCHomeDisplay but extending selection to new caret position.
None
Added in version 4.1/wxWidgets-3.1.0.
Like VCHome but extending selection to new caret position.
None
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.
None
Like VCHome but when word-wrap is enabled goes first to start of display line VCHomeDisplay, then behaves like VCHome.
None
Like VCHomeExtend but when word-wrap is enabled extends first to start of display line VCHomeDisplayExtend, then behaves like VCHomeExtend.
None
Centre current line in window.
None
Find the display line of a document line taking hidden lines into account.
docLine (int)
int
Get position of end of word.
pos (int)
onlyWordCharacters (bool)
int
Move caret left one word.
None
Move caret left one word, position cursor at end of word.
None
Move caret left one word, position cursor at end of word, extending selection to new caret position.
None
Move caret left one word extending selection to new caret position.
None
Move to the previous change in capitalisation.
None
Move to the previous change in capitalisation extending selection to new caret position.
None
Move to the change next in capitalisation.
None
Move to the next change in capitalisation extending selection to new caret position.
None
Move caret right one word.
None
Move caret right one word, position cursor at end of word.
None
Move caret right one word, position cursor at end of word, extending selection to new caret position.
None
Move caret right one word extending selection to new caret position.
None
Get position of start of word.
pos (int)
onlyWordCharacters (bool)
int
The number of display lines needed to wrap a document line.
docLine (int)
int
Writes the text into the text control at the current insertion position.
text (string) – Text to write to the text control.
None
Note
Newlines in the text string are the only control characters allowed, and they will cause appropriate line breaks. See operator<<() and AppendText
for more convenient ways of writing to the window. After the write operation, the insertion point will be at the end of the inserted text, so subsequent write operations will be appended. To append text after the user may have interacted with the control, call wx.TextCtrl.SetInsertionPointEnd
before writing.
Converts the given zero based column and line number to a position.
x (long) – The column number.
y (long) – The line number.
int
The position value, or -1 if x or y was invalid.
Magnify the displayed text by increasing the sizes by 1 point.
None
Make the displayed text smaller by decreasing the sizes by 1 point.
None
NOP
, for file-like compatibility.
None
Append text to the textctrl, for file-like compatibility.
None
See GetAdditionalCaretForeground
and SetAdditionalCaretForeground
See GetAdditionalCaretsVisible
and SetAdditionalCaretsVisible
See GetAdditionalSelectionTyping
and SetAdditionalSelectionTyping
See GetAutomaticFold
and SetAutomaticFold
See GetBufferedDraw
and SetBufferedDraw
See GetCaretForeground
and SetCaretForeground
See GetCaretPeriod
and SetCaretPeriod
See GetCaretSticky
and SetCaretSticky
See GetCaretStyle
and SetCaretStyle
See GetCaretWidth
and SetCaretWidth
See GetCodePage
and SetCodePage
See GetCurLine
See GetCurLineRaw
See GetCurrentLine
See GetCurrentPos
and SetCurrentPos
See GetDefaultStyle
and SetDefaultStyle
See GetDirectPointer
See GetDocPointer
and SetDocPointer
See GetEOLMode
and SetEOLMode
See GetEdgeColour
and SetEdgeColour
See GetEdgeColumn
and SetEdgeColumn
See GetEdgeMode
and SetEdgeMode
See GetEndAtLastLine
and SetEndAtLastLine
See GetEndStyled
See GetExtraAscent
and SetExtraAscent
See GetExtraDescent
and SetExtraDescent
See GetFontQuality
and SetFontQuality
See GetGapPosition
See GetHighlightGuide
and SetHighlightGuide
See GetIMEInteraction
and SetIMEInteraction
See GetIdentifier
and SetIdentifier
See GetIdleStyling
and SetIdleStyling
See GetIndicatorValue
and SetIndicatorValue
See GetInsertionPoint
and SetInsertionPoint
See GetLastPosition
See GetLayoutCache
and SetLayoutCache
See GetLexerLanguage
and SetLexerLanguage
See GetLineCount
See GetMainSelection
and SetMainSelection
See GetMarginCount
and SetMarginCount
See GetMarginLeft
and SetMarginLeft
See GetMarginOptions
and SetMarginOptions
See GetMarginRight
and SetMarginRight
See GetMargins
See GetMaxLineState
See GetModEventMask
and SetModEventMask
See GetMouseDwellTime
and SetMouseDwellTime
See GetMouseSelectionRectangularSwitch
and SetMouseSelectionRectangularSwitch
See GetMultiPaste
and SetMultiPaste
See GetNumberOfLines
See GetOvertype
and SetOvertype
See GetPhasesDraw
and SetPhasesDraw
See GetPrintColourMode
and SetPrintColourMode
See GetPrintWrapMode
and SetPrintWrapMode
See GetRangePointer
See GetReadOnly
and SetReadOnly
See GetRectangularSelectionAnchor
and SetRectangularSelectionAnchor
See GetRectangularSelectionAnchorVirtualSpace
and SetRectangularSelectionAnchorVirtualSpace
See GetRectangularSelectionCaret
and SetRectangularSelectionCaret
See GetRectangularSelectionCaretVirtualSpace
and SetRectangularSelectionCaretVirtualSpace
See GetRectangularSelectionModifier
and SetRectangularSelectionModifier
See GetSTCCursor
and SetSTCCursor
See GetSTCFocus
and SetSTCFocus
See GetScrollWidth
and SetScrollWidth
See GetSearchFlags
and SetSearchFlags
See GetSelAlpha
and SetSelAlpha
See GetSelEOLFilled
and SetSelEOLFilled
See GetSelectedText
See GetSelectionEnd
and SetSelectionEnd
See GetSelectionMode
and SetSelectionMode
See GetSelectionStart
and SetSelectionStart
See GetSelections
See GetStyleBits
and SetStyleBits
See GetSubStyleBases
See GetTabDrawMode
and SetTabDrawMode
See GetTabIndents
and SetTabIndents
See GetTabWidth
and SetTabWidth
See GetTargetEnd
and SetTargetEnd
See GetTargetStart
and SetTargetStart
See GetTargetText
See GetTargetTextRaw
See GetTechnology
and SetTechnology
See GetTextLength
See GetTextRaw
and SetTextRaw
See GetTwoPhaseDraw
and SetTwoPhaseDraw
See GetUndoCollection
and SetUndoCollection
See GetUseAntiAliasing
and SetUseAntiAliasing
See GetUseTabs
and SetUseTabs
See GetViewEOL
and SetViewEOL
See GetViewWhiteSpace
and SetViewWhiteSpace
See GetWhitespaceChars
and SetWhitespaceChars
See GetWhitespaceSize
and SetWhitespaceSize
See GetWordChars
and SetWordChars
See GetWrapIndentMode
and SetWrapIndentMode
See GetWrapMode
and SetWrapMode
See GetWrapStartIndent
and SetWrapStartIndent
See GetWrapVisualFlags
and SetWrapVisualFlags
See GetWrapVisualFlagsLocation
and SetWrapVisualFlagsLocation
See GetXOffset
and SetXOffset