wxRuby Documentation Home
Wx::StyledTextCtrl
Wx::StyledTextCtrl is a sophisticated text editing control. It is
based on the open-source Scintilla component,
wrapped to form part of the wxWidgets and wxRuby APIs.
It is particularly suited for editing source code of a variety of
programming languages. It has built-in support in the form of
Lexers for many common languages,
including Ruby, Python, HTML, C/C++ and SQL. As well as customisable
syntax highlighting, it also supports
code-folding, autocompletion and indentation.
However, its use is not restricted to source-code editing. It has a wide
set of features for text navigation, editing, viewing and printing. For
complex uses, it can be a useful alternative to using
TextCtrl with the TE_RICH flag; it has a richer set of
features, which are implemented more consistently across platforms than
the native-based control.
Derived from
Control
Window
EvtHandler
Object
Documentation
The methods listed here are a complete listing of all the methods
supported by StyledTextCtrl in wxRuby. However, at present only a stub
description of each method is available. For much more thorough
discussion of the capabilities of StyledTextCtrl, please consult the
Scintilla documentation
.
Many methods listed as accepting Integer require a specific flag; for
example, Markers are selected by a set of
special constants. At the moment, the names can be got from the
Scintilla documentation. They then need to be converted to wxRuby
constant names by changing the prefix from SC_ (Scintilla) to STC_
(StyledTextCtrl)
Event Handling
A StyledTextCtrl has a number of event handlers, each of which will be
passed a StyledTextEvent
| evt_stc_calltip_click(id) { | event | … } |
A calltip was clicked |
| evt_stc_change(id) { | event | … } |
The text contents was changed |
| evt_stc_charadded(id) { | event | … } |
A character was added |
| evt_stc_doubleclick(id) { | event | … } |
Double-click on the control |
| evt_stc_do_drop(id) { | event | … } |
Drag and drop ended on the control |
| evt_stc_drag_over(id) { | event | … } |
The cursor was moved over the control while dragging |
| evt_stc_dwellend(id) { | event | … } |
THe mouse ceased to dwell over a point |
| evt_stc_dwellstart(id) { | event | … } |
The cursor was dwelling over a point for the user-defined dwell period |
| evt_stc_hotspot_click(id) { | event | … } |
A hotspot was clicked |
| evt_stc_hotspot_dclick(id) { | event | … } |
A hotspot was double-clicked |
| evt_stc_key(id) { | event | … } |
A command key was pressed |
| evt_stc_macrorecord(id) { | event | … } |
A recordable action took place while macro recording |
| evt_stc_marginclick(id) { | event | … } |
A margin was clicked |
| evt_stc_modified(id) { | event | … } |
The contents was modified |
| evt_stc_savepointleft(id) { | event | … } |
The control was changed from it’s last-saved state |
| evt_stc_savepointreached(id) { | event | … } |
The last-saved state was reached in an undo/redo chain |
| evt_stc_start_drag(id) { | event | … } |
Dragging started in the control |
| evt_stc_styleneeded(id) { | event | … } |
A language lexer requested a style |
| evt_stc_updateui(id) { | event | … } |
An update UI event |
| evt_stc_uridropped(id) { | event | … } |
A URL was dropped in the control started in the control |
| evt_stc_userlistselection(id) { | event | … } |
An user-defined auto-completion entry was chosen |
| evt_stc_zoom(id) { | event | … } |
The control view was zoomed by keyboard or set_zoom |
Methods
Since StyledTextCtrl supports so many methods, they are broken down here
into groups.
Text retrieval and modification
StyledTextCtrl#add_text
add_text(%(arg-type)String% text)
Add text to the document at current position.
StyledTextCtrl#allocate
allocate(%(arg-type)Integer% bytes)
Enlarge the document to a particular size of text bytes.
StyledTextCtrl#append_text
append_text(%(arg-type)String% text)
Append a string to the end of the document without changing the selection.
StyledTextCtrl#clear_all
clear_all()
Delete all text in the document.
StyledTextCtrl#find_column
Integer find_column(%(arg-type)Integer% line, Integer column)
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.
StyledTextCtrl#get_char_at
Integer get_char_at(%(arg-type)Integer% pos)
Returns the character byte at the position.
StyledTextCtrl#get_length
Integer get_length()
Returns the number of characters in the document.
StyledTextCtrl#get_line
String get_line(%(arg-type)Integer% line)
Retrieve the contents of a line.
StyledTextCtrl#get_line_count
Integer get_line_count()
Returns the number of lines in the document. There is always at least one.
StyledTextCtrl#get_modify
Boolean get_modify()
Is the document different from when it was last saved?
StyledTextCtrl#get_overtype
Boolean get_overtype()
Returns true if overtype mode is active otherwise false is returned.
StyledTextCtrl#get_read_only
Boolean get_read_only()
In read-only mode?
StyledTextCtrl#get_text
String get_text()
Retrieve all the text in the document.
StyledTextCtrl#get_text_length
Integer get_text_length()
Retrieve the number of characters in the document.
String get_text_range(%(arg-type)Integer% startPos, Integer endPos)
Retrieve a range of text.
StyledTextCtrl#insert_text
insert_text(%(arg-type)Integer% pos, String text)
Insert string at a position.
StyledTextCtrl#line_length
Integer line_length(%(arg-type)Integer% line)
How many characters are on a line, not including end of line characters?
StyledTextCtrl#position_after
Integer position_after(%(arg-type)Integer% pos)
Given a valid document position, return the next position taking code page into account. Maximum value returned is the last position in the document.
StyledTextCtrl#position_before
Integer position_before(%(arg-type)Integer% pos)
Given a valid document position, return the previous position taking code page into account. Returns 0 if passed 0.
StyledTextCtrl#send_msg
Integer send_msg(%(arg-type)Integer% msg, Integer wp=0, Integer lp=0)
Send a message to Scintilla
StyledTextCtrl#set_overtype
set_overtype(%(arg-type)Boolean% overtype)
Set to overtype (true) or insert mode.
StyledTextCtrl#set_read_only
set_read_only(%(arg-type)Boolean% readOnly)
Set to read only or read write.
StyledTextCtrl#set_text
set_text(%(arg-type)String% text)
Replace the contents of the document with the argument text.
Text encoding
StyledTextCtrl#get_code_page
Integer get_code_page()
Get the code page used to interpret the bytes of the document as characters.
StyledTextCtrl#set_code_page
set_code_page(%(arg-type)Integer% codePage)
Set the code page used to interpret the bytes of the document as characters.
Line endings
StyledTextCtrl#convert_eo_ls
convert_eo_ls(%(arg-type)Integer% eolMode)
Convert all line endings in the document to one mode.
StyledTextCtrl#get_eol_mode
Integer get_eol_mode()
Retrieve the current end of line mode – one of CRLF, CR, or LF.
StyledTextCtrl#get_view_eol
Boolean get_view_eol()
Are the end of line characters visible?
StyledTextCtrl#set_eol_mode
set_eol_mode(%(arg-type)Integer% eolMode)
Set the current end of line mode.
StyledTextCtrl#set_view_eol
set_view_eol(%(arg-type)Boolean% visible)
Make the end of line characters visible or invisible.
Text coordinates
StyledTextCtrl#get_column
Integer get_column(%(arg-type)Integer% pos)
Retrieve the column number of a position, taking tab width into account.
StyledTextCtrl#get_cur_line
String get_cur_line(%(arg-type)Integer% linePos=NULL)
#else
StyledTextCtrl#get_first_visible_line
Integer get_first_visible_line()
Retrieve the display line at the top of the display.
StyledTextCtrl#get_line_end_position
Integer get_line_end_position(%(arg-type)Integer% line)
Get the position after the last visible characters on a line.
StyledTextCtrl#line_from_position
Integer line_from_position(%(arg-type)Integer% pos)
Retrieve the line containing a position.
StyledTextCtrl#point_from_position
Integer point_from_position(%(arg-type)Integer% pos)
#endif Retrieve the point in the window where a position is displayed. wxPo
StyledTextCtrl#position_from_line
Integer position_from_line(%(arg-type)Integer% line)
Retrieve the position at the start of a line.
StyledTextCtrl#position_from_point
Integer position_from_point(%(arg-type)Point% pt)
Find the position from a point within the window.
StyledTextCtrl#position_from_point_close
Integer position_from_point_close(%(arg-type)Integer% x, Integer y)
Find the position from a point within the window but return INVALID_POSITION if not close to text.
Basic movement
StyledTextCtrl#goto_line
goto_line(%(arg-type)Integer% line)
Set caret to start of a line and ensure it is visible.
StyledTextCtrl#goto_pos
goto_pos(%(arg-type)Integer% pos)
Set caret to a position and ensure it is visible.
StyledTextCtrl#line_down
line_down()
Move caret down one line.
scroll_to_column(%(arg-type)Integer% column)
Scroll enough to make the given column visible
scroll_to_line(%(arg-type)Integer% line)
Scroll enough to make the given line visible
Anchor, selection and cursor
StyledTextCtrl#get_anchor
Integer get_anchor()
Returns the position of the opposite end of the selection to the caret.
StyledTextCtrl#get_current_line
Integer get_current_line()
Returns the line number of the line with the caret.
StyledTextCtrl#get_current_pos
Integer get_current_pos()
Returns the position of the caret.
StyledTextCtrl#get_line_sel_end_position
Integer get_line_sel_end_position(%(arg-type)Integer% line)
Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
StyledTextCtrl#get_line_sel_start_position
Integer get_line_sel_start_position(%(arg-type)Integer% line)
Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
StyledTextCtrl#get_sel_alpha
Integer get_sel_alpha()
Get the alpha of the selection.
StyledTextCtrl#get_selected_text
String get_selected_text()
Retrieve the selected text.
StyledTextCtrl#get_selection
get_selection(%(arg-type)Integer% startPos, Integer endPos)
#else
StyledTextCtrl#get_selection_end
Integer get_selection_end()
Returns the position at the end of the selection.
StyledTextCtrl#get_selection_mode
Integer get_selection_mode()
Get the mode of the current selection.
StyledTextCtrl#get_selection_start
Integer get_selection_start()
Returns the position at the start of the selection.
StyledTextCtrl#get_stc_cursor
Integer get_stc_cursor()
Get cursor type.
StyledTextCtrl#hide_selection
hide_selection(%(arg-type)Boolean% normal)
Draw the selection in normal style or with selection highlighted.
StyledTextCtrl#replace_selection
replace_selection(%(arg-type)String% text)
Replace the selected text with the argument text.
StyledTextCtrl#select_all
select_all()
Select all the text in the document.
StyledTextCtrl#selection_is_rectangle
Boolean selection_is_rectangle()
Is the selection rectangular? The alternative is the more common stream selection.
StyledTextCtrl#set_anchor
set_anchor(%(arg-type)Integer% posAnchor)
Set the selection anchor to a position. The anchor is the opposite end of the selection from the caret.
StyledTextCtrl#set_current_pos
set_current_pos(%(arg-type)Integer% pos)
Sets the position of the caret.
StyledTextCtrl#set_sel_alpha
set_sel_alpha(%(arg-type)Integer% alpha)
Set the alpha of the selection.
StyledTextCtrl#set_sel_background
set_sel_background(%(arg-type)Boolean% useSetting, Colour back)
Set the background colour of the selection and whether to use this setting.
StyledTextCtrl#set_sel_foreground
set_sel_foreground(%(arg-type)Boolean% useSetting, Colour fore)
Set the foreground colour of the selection and whether to use this setting.
StyledTextCtrl#set_selection
set_selection(%(arg-type)Integer% start, Integer end)
Select a range of text.
StyledTextCtrl#set_selection_end
set_selection_end(%(arg-type)Integer% pos)
Sets the position that ends the selection – this becomes the currentPosition.
StyledTextCtrl#set_selection_mode
set_selection_mode(%(arg-type)Integer% mode)
Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or by lines (SC_SEL_LINES).
StyledTextCtrl#set_selection_start
set_selection_start(%(arg-type)Integer% pos)
Sets the position that starts the selection – this becomes the anchor.
StyledTextCtrl#set_stc_cursor
set_stc_cursor(%(arg-type)Integer% cursorType)
Sets the cursor to one of the SC_CURSOR* values.
Wrapping lines
StyledTextCtrl#get_layout_cache
Integer get_layout_cache()
Retrieve the degree of caching of layout information.
StyledTextCtrl#get_wrap_mode
Integer get_wrap_mode()
Retrieve whether text is word wrapped.
StyledTextCtrl#get_wrap_start_indent
Integer get_wrap_start_indent()
Retrive the start indent for wrapped lines.
StyledTextCtrl#get_wrap_visual_flags
Integer get_wrap_visual_flags()
Retrive the display mode of visual flags for wrapped lines.
StyledTextCtrl#get_wrap_visual_flags_location
Integer get_wrap_visual_flags_location()
Retrive the location of visual flags for wrapped lines.
StyledTextCtrl#lines_join
lines_join()
Join the lines in the target.
StyledTextCtrl#lines_split
lines_split(%(arg-type)Integer% pixelWidth)
Split the lines in the target into lines that are less wide than pixelWidth where possible.
StyledTextCtrl#set_layout_cache
set_layout_cache(%(arg-type)Integer% mode)
Sets the degree of caching of layout information.
StyledTextCtrl#set_wrap_mode
set_wrap_mode(%(arg-type)Integer% mode)
Sets whether text is word wrapped.
StyledTextCtrl#set_wrap_start_indent
set_wrap_start_indent(%(arg-type)Integer% indent)
Set the start indent for wrapped lines.
StyledTextCtrl#set_wrap_visual_flags
set_wrap_visual_flags(%(arg-type)Integer% wrapVisualFlags)
Set the display mode of visual flags for wrapped lines.
StyledTextCtrl#set_wrap_visual_flags_location
set_wrap_visual_flags_location(%(arg-type)Integer% wrapVisualFlagsLocation)
Set the location of visual flags for wrapped lines.
StyledTextCtrl#word_end_position
Integer word_end_position(%(arg-type)Integer% pos, Boolean onlyWordCharacters)
Get position of end of word.
StyledTextCtrl#word_start_position
Integer word_start_position(%(arg-type)Integer% pos, Boolean onlyWordCharacters)
Get position of start of word.
StyledTextCtrl#wrap_count
Integer wrap_count(%(arg-type)Integer% line)
The number of display lines needed to wrap a document line
StyledTextCtrl#choose_caret_x
choose_caret_x()
Set the last x chosen value to be the caret x position.
StyledTextCtrl#get_end_at_last_line
Boolean get_end_at_last_line()
Retrieve whether the maximum scroll position has the last line at the bottom of the view.
Integer get_scroll_width()
Retrieve the document width assumed for scrolling.
Boolean get_use_horizontal_scroll_bar()
Is the horizontal scroll bar visible?
Boolean get_use_vertical_scroll_bar()
Is the vertical scroll bar visible?
StyledTextCtrl#get_xoffset
Integer get_xoffset()
line_scroll(%(arg-type)Integer% columns, Integer lines)
Scroll horizontally and vertically.
StyledTextCtrl#set_end_at_last_line
set_end_at_last_line(%(arg-type)Boolean% endAtLastLine)
Sets the scroll range so that maximum scroll position has the last line at the bottom of the view (default). Setting this to false allows scrolling one page below the last line.
set_hscroll_bar(%(arg-type)ScrollBar% bar)
Set the horizontal scrollbar to use instead of the ont that’s built-in.
set_scroll_width(%(arg-type)Integer% pixelWidth)
Sets the document width assumed for scrolling.
set_use_horizontal_scroll_bar(%(arg-type)Boolean% show)
Show or hide the horizontal scroll bar.
set_use_vertical_scroll_bar(%(arg-type)Boolean% show)
Show or hide the vertical scroll bar.
StyledTextCtrl#set_visible_policy
set_visible_policy(%(arg-type)Integer% visiblePolicy, Integer visibleSlop)
Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.
set_vscroll_bar(%(arg-type)ScrollBar% bar)
Set the vertical scrollbar to use instead of the ont that’s built-in.
StyledTextCtrl#set_xcaret_policy
set_xcaret_policy(%(arg-type)Integer% caretPolicy, Integer caretSlop)
Set the way the caret is kept visible when going sideway. The exclusion zone is given in pixels.
StyledTextCtrl#set_xoffset
set_xoffset(%(arg-type)Integer% newOffset)
Get and Set the xOffset (ie, horizonal scroll position).
StyledTextCtrl#set_ycaret_policy
set_ycaret_policy(%(arg-type)Integer% caretPolicy, Integer caretSlop)
Set the way the line the caret is on is kept visible. The exclusion zone is given in lines.
StyledTextCtrl#text_height
Integer text_height(%(arg-type)Integer% line)
Retrieve the height of a particular line of text in pixels.
StyledTextCtrl#text_width
Integer text_width(%(arg-type)Integer% style, String text)
Measure the pixel width of some text in a particular style. NUL terminated text argument. Does not handle tab or control characters.
Cut, copy and paste
StyledTextCtrl#can_paste
Boolean can_paste()
Will a paste succeed?
StyledTextCtrl#clear
clear()
Clear the selection.
StyledTextCtrl#copy
copy()
Copy the selection to the clipboard.
StyledTextCtrl#copy_range
copy_range(%(arg-type)Integer% start, Integer end)
Copy a range of text to the clipboard. Positions are clipped into the document.
StyledTextCtrl#copy_text
copy_text(%(arg-type)Integer% length, String text)
Copy argument text to the clipboard.
StyledTextCtrl#cut
cut()
Cut the selection to the clipboard.
StyledTextCtrl#get_paste_convert_endings
Boolean get_paste_convert_endings()
Get convert-on-paste setting
StyledTextCtrl#paste
paste()
Paste the contents of the clipboard into the document replacing the selection.
StyledTextCtrl#set_paste_convert_endings
set_paste_convert_endings(%(arg-type)Boolean% convert)
Enable/Disable convert-on-paste for line endings
Undo and redo
StyledTextCtrl#begin_undo_action
begin_undo_action()
Start a sequence of actions that is undone and redone as a unit. May be nested.
StyledTextCtrl#can_redo
Boolean can_redo()
Are there any redoable actions in the undo history?
StyledTextCtrl#can_undo
Boolean can_undo()
Are there any undoable actions in the undo history?
StyledTextCtrl#empty_undo_buffer
empty_undo_buffer()
Delete the undo history.
StyledTextCtrl#end_undo_action
end_undo_action()
End a sequence of actions that is undone and redone as a unit.
StyledTextCtrl#get_undo_collection
Boolean get_undo_collection()
Is undo history being collected?
StyledTextCtrl#redo
redo()
Redoes the next action on the undo history.
StyledTextCtrl#set_save_point
set_save_point()
Remember the current position in the undo history as the position at which the document was saved.
StyledTextCtrl#set_undo_collection
set_undo_collection(%(arg-type)Boolean% collectUndo)
Choose between collecting actions into the undo history and discarding them.
StyledTextCtrl#undo
undo()
Undo one action in the undo history.
Search and replace
StyledTextCtrl#find_text
Integer find_text(%(arg-type)Integer% minPos, Integer maxPos, String text, Integer flags=0)
Find some text in the document.
StyledTextCtrl#get_search_flags
Integer get_search_flags()
Get the search flags used by SearchInTarget.
StyledTextCtrl#get_target_end
Integer get_target_end()
Get the position that ends the target.
StyledTextCtrl#get_target_start
Integer get_target_start()
Get the position that starts the target.
StyledTextCtrl#replace_target
Integer replace_target(%(arg-type)String% text)
Replace the target text with the argument text. Text is counted so it can contain NULs. Returns the length of the replacement text.
StyledTextCtrl#replace_target_re
Integer replace_target_re(%(arg-type)String% text)
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.
StyledTextCtrl#search_anchor
search_anchor()
Sets the current caret position to be the search anchor.
StyledTextCtrl#search_in_target
Integer search_in_target(%(arg-type)String% text)
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.
StyledTextCtrl#search_next
Integer search_next(%(arg-type)Integer% flags, String text)
Find some text starting at the search anchor. Does not ensure the selection is visible.
StyledTextCtrl#search_prev
Integer search_prev(%(arg-type)Integer% flags, String text)
Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible.
StyledTextCtrl#set_search_flags
set_search_flags(%(arg-type)Integer% flags)
Set the search flags used by SearchInTarget.
StyledTextCtrl#set_target_end
set_target_end(%(arg-type)Integer% pos)
Sets the position that ends the target which is used for updating the document without affecting the scroll position.
StyledTextCtrl#set_target_start
set_target_start(%(arg-type)Integer% pos)
Sets the position that starts the target which is used for updating the document without affecting the scroll position.
StyledTextCtrl#target_from_selection
target_from_selection()
Make the target range start and end be the same as the selection range start and end.
Styling text
StyledTextCtrl#clear_document_style
clear_document_style()
Set all style bytes to 0, remove all folding information.
StyledTextCtrl#get_end_styled
Integer get_end_styled()
#endif Retrieve the position of the last correctly styled character.
StyledTextCtrl#get_line_state
Integer get_line_state(%(arg-type)Integer% line)
Retrieve the extra styling information for a line.
StyledTextCtrl#get_max_line_state
Integer get_max_line_state()
Retrieve the last line number that has line state.
StyledTextCtrl#get_style_at
Integer get_style_at(%(arg-type)Integer% pos)
Returns the style byte at the position.
StyledTextCtrl#get_style_bits
Integer get_style_bits()
Retrieve number of bits in style bytes used to hold the lexical state.
StyledTextCtrl#set_hotspot_active_background
set_hotspot_active_background(%(arg-type)Boolean% useSetting, Colour back)
Set a back colour for active hotspots.
StyledTextCtrl#set_hotspot_active_foreground
set_hotspot_active_foreground(%(arg-type)Boolean% useSetting, Colour fore)
Set a fore colour for active hotspots.
StyledTextCtrl#set_hotspot_active_underline
set_hotspot_active_underline(%(arg-type)Boolean% underline)
Enable / Disable underlining active hotspots.
StyledTextCtrl#set_hotspot_single_line
set_hotspot_single_line(%(arg-type)Boolean% singleLine)
Limit hotspots to single line so hotspots on two lines don’t merge.
StyledTextCtrl#set_line_state
set_line_state(%(arg-type)Integer% line, Integer state)
Used to hold extra styling information for each line.
StyledTextCtrl#set_style_bits
set_style_bits(%(arg-type)Integer% bits)
Divide each styling byte into lexical class bits (default: 5) and indicator bits (default: 3). If a lexer requires more than 32 lexical states, then this is used to expand the possible states.
StyledTextCtrl#set_style_bytes
set_style_bytes(%(arg-type)Integer% length, (arg-type) styleBytes)
Set the styles for a segment of the document.
StyledTextCtrl#set_styling
set_styling(%(arg-type)Integer% length, Integer style)
Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.
StyledTextCtrl#start_styling
start_styling(%(arg-type)Integer% pos, Integer mask)
Set the current styling position to pos and the styling mask to mask. The styling mask can be used to protect some bits in each styling byte from modification.
StyledTextCtrl#style_clear_all
style_clear_all()
Clear all the styles and make equivalent to the global default style.
StyledTextCtrl#style_reset_default
style_reset_default()
Reset the default style to its state at startup
StyledTextCtrl#style_set_background
style_set_background(%(arg-type)Integer% style, Colour back)
Set the background colour of a style.
StyledTextCtrl#style_set_bold
style_set_bold(%(arg-type)Integer% style, Boolean bold)
Set a style to be bold or not.
StyledTextCtrl#style_set_case
style_set_case(%(arg-type)Integer% style, Integer caseForce)
Set a style to be mixed case, or to force upper or lower case.
StyledTextCtrl#style_set_changeable
style_set_changeable(%(arg-type)Integer% style, Boolean changeable)
Set a style to be changeable or not (read only). Experimental feature, currently buggy.
StyledTextCtrl#style_set_character_set
style_set_character_set(%(arg-type)Integer% style, Integer characterSet)
Set the character set of the font in a style. Converts the Scintilla character set values to a wxFontEncoding.
StyledTextCtrl#style_set_eol_filled
style_set_eol_filled(%(arg-type)Integer% style, Boolean filled)
Set a style to have its end of line filled or not.
StyledTextCtrl#style_set_face_name
style_set_face_name(%(arg-type)Integer% style, String fontName)
Set the font of a style.
StyledTextCtrl#style_set_font
style_set_font(%(arg-type)Integer% styleNum, Font font)
Set style size, face, bold, italic, and underline attributes from a wxFont’s attributes.
StyledTextCtrl#style_set_font_attr
style_set_font_attr(%(arg-type)Integer% styleNum, Integer size, String faceName,
Boolean bold, Boolean italic, Boolean underline,
FontEncoding encoding=wxFONTENCODING_DEFAULT)
Set all font style attributes at once.
StyledTextCtrl#style_set_font_encoding
style_set_font_encoding(%(arg-type)Integer% style, FontEncoding encoding)
Set the font encoding to be used by a style.
StyledTextCtrl#style_set_foreground
style_set_foreground(%(arg-type)Integer% style, Colour fore)
Set the foreground colour of a style.
StyledTextCtrl#style_set_hot_spot
style_set_hot_spot(%(arg-type)Integer% style, Boolean hotspot)
Set a style to be a hotspot or not.
StyledTextCtrl#style_set_italic
style_set_italic(%(arg-type)Integer% style, Boolean italic)
Set a style to be italic or not.
StyledTextCtrl#style_set_size
style_set_size(%(arg-type)Integer% style, Integer sizePoints)
Set the size of characters of a style.
StyledTextCtrl#style_set_spec
style_set_spec(%(arg-type)Integer% styleNum, String spec)
Extract style settings from a spec-string which is composed of one or more of the following comma separated elements: bold turns on bold italic turns on italics fore:[name or #RRGGBB] sets the foreground colour back:[name or #RRGGBB] sets the background colour face:[facename] sets the font face name to use size:[num] sets the font size in points eol turns on eol filling underline turns on underlining
StyledTextCtrl#style_set_underline
style_set_underline(%(arg-type)Integer% style, Boolean underline)
Set a style to be underlined or not.
StyledTextCtrl#style_set_visible
style_set_visible(%(arg-type)Integer% style, Boolean visible)
Set a style to be visible or not.
Indicators
StyledTextCtrl#indicator_get_foreground
Colour indicator_get_foreground(%(arg-type)Integer% indic)
Retrieve the foreground colour of an indicator.
StyledTextCtrl#indicator_get_style
Integer indicator_get_style(%(arg-type)Integer% indic)
Retrieve the style of an indicator.
StyledTextCtrl#indicator_set_foreground
indicator_set_foreground(%(arg-type)Integer% indic, Colour fore)
Set the foreground colour of an indicator.
StyledTextCtrl#indicator_set_style
indicator_set_style(%(arg-type)Integer% indic, Integer style)
Set an indicator to plain, squiggle or TT.
Styling for programming languages
StyledTextCtrl#colourise
colourise(%(arg-type)Integer% start, Integer end)
Colourise a segment of the document using the current lexing language.
StyledTextCtrl#get_lexer
Integer get_lexer()
Retrieve the lexing language of the document.
StyledTextCtrl#get_property
String get_property(%(arg-type)String% key)
Retrieve a ‘property’ value previously set with SetProperty.
StyledTextCtrl#get_property_expanded
String get_property_expanded(%(arg-type)String% key)
Retrieve a ‘property’ value previously set with SetProperty, with ‘$()’ variable replacement on returned buffer.
StyledTextCtrl#get_property_int
Integer get_property_int(%(arg-type)String% key)
Retrieve a ‘property’ value previously set with SetProperty, interpreted as an int AFTER any ‘$()’ variable replacement.
StyledTextCtrl#get_style_bits_needed
Integer get_style_bits_needed()
Retrieve the number of bits the current lexer needs for styling.
StyledTextCtrl#set_key_words
set_key_words(%(arg-type)Integer% keywordSet, String keyWords)
Set up the key words used by the lexer.
StyledTextCtrl#set_lexer
set_lexer(%(arg-type)Integer% lexer)
Set the lexing language of the document.
StyledTextCtrl#set_lexer_language
set_lexer_language(%(arg-type)String% language)
Set the lexing language of the document based on string name.
StyledTextCtrl#set_property
set_property(%(arg-type)String% key, String value)
Set up a value that may be used by a lexer for some optional feature.
Caret features
StyledTextCtrl#ensure_caret_visible
ensure_caret_visible()
Ensure the caret is visible.
StyledTextCtrl#get_caret_foreground
Colour get_caret_foreground()
Get the foreground colour of the caret.
StyledTextCtrl#get_caret_line_back_alpha
Integer get_caret_line_back_alpha()
Get the background alpha of the caret line.
StyledTextCtrl#get_caret_line_background
Colour get_caret_line_background()
Get the colour of the background of the line containing the caret.
StyledTextCtrl#get_caret_line_visible
Boolean get_caret_line_visible()
Is the background of the line containing the caret in a different colour?
StyledTextCtrl#get_caret_period
Integer get_caret_period()
Get the time in milliseconds that the caret is on and off.
StyledTextCtrl#get_caret_sticky
Boolean get_caret_sticky()
Can the caret preferred x position only be changed by explicit movement commands?
StyledTextCtrl#get_caret_width
Integer get_caret_width()
Returns the width of the insert mode caret.
StyledTextCtrl#get_control_char_symbol
Integer get_control_char_symbol()
Get the way control characters are displayed.
StyledTextCtrl#move_caret_inside_view
move_caret_inside_view()
Move the caret inside current view if it’s not there already.
StyledTextCtrl#set_caret_foreground
set_caret_foreground(%(arg-type)Colour% fore)
Set the foreground colour of the caret.
StyledTextCtrl#set_caret_line_back_alpha
set_caret_line_back_alpha(%(arg-type)Integer% alpha)
Set background alpha of the caret line.
StyledTextCtrl#set_caret_line_background
set_caret_line_background(%(arg-type)Colour% back)
Set the colour of the background of the line containing the caret.
StyledTextCtrl#set_caret_line_visible
set_caret_line_visible(%(arg-type)Boolean% show)
Display the background of the line containing the caret in a different colour.
StyledTextCtrl#set_caret_period
set_caret_period(%(arg-type)Integer% periodMilliseconds)
Get the time in milliseconds that the caret is on and off. 0 = steady on.
StyledTextCtrl#set_caret_sticky
set_caret_sticky(%(arg-type)Boolean% useCaretStickyBehaviour)
Stop the caret preferred x position changing when the user types.
StyledTextCtrl#set_caret_width
set_caret_width(%(arg-type)Integer% pixelWidth)
Set the width of the insert mode caret.
StyledTextCtrl#set_control_char_symbol
set_control_char_symbol(%(arg-type)Integer% symbol)
Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.
StyledTextCtrl#toggle_caret_sticky
toggle_caret_sticky()
Switch between sticky and non-sticky: meant to be bound to a key.
Indentation and Tabs
StyledTextCtrl#get_back_space_un_indents
Boolean get_back_space_un_indents()
Does a backspace pressed when caret is within indentation unindent?
StyledTextCtrl#get_highlight_guide
Integer get_highlight_guide()
Get the highlighted indentation guide column.
StyledTextCtrl#get_indent
Integer get_indent()
Retrieve indentation size.
StyledTextCtrl#get_indentation_guides
Boolean get_indentation_guides()
Are the indentation guides visible?
StyledTextCtrl#get_line_indent_position
Integer get_line_indent_position(%(arg-type)Integer% line)
Retrieve the position before the first non indentation character on a line.
StyledTextCtrl#get_line_indentation
Integer get_line_indentation(%(arg-type)Integer% line)
Retrieve the number of columns that a line is indented.
StyledTextCtrl#get_tab_indents
Boolean get_tab_indents()
Does a tab pressed when caret is within indentation indent?
StyledTextCtrl#get_tab_width
Integer get_tab_width()
Retrieve the visible size of a tab.
StyledTextCtrl#get_use_tabs
Boolean get_use_tabs()
Retrieve whether tabs will be used in indentation.
StyledTextCtrl#set_back_space_un_indents
set_back_space_un_indents(%(arg-type)Boolean% bsUnIndents)
Sets whether a backspace pressed when caret is within indentation unindents.
StyledTextCtrl#set_highlight_guide
set_highlight_guide(%(arg-type)Integer% column)
Set the highlighted indentation guide column. 0 = no highlighted guide.
StyledTextCtrl#set_indent
set_indent(%(arg-type)Integer% indentSize)
Set the number of spaces used for one level of indentation.
StyledTextCtrl#set_indentation_guides
set_indentation_guides(%(arg-type)Boolean% show)
Show or hide indentation guides.
StyledTextCtrl#set_line_indentation
set_line_indentation(%(arg-type)Integer% line, Integer indentSize)
Change the indentation of a line to a number of columns.
StyledTextCtrl#set_tab_indents
set_tab_indents(%(arg-type)Boolean% tabIndents)
Sets whether a tab pressed when caret is within indentation indents.
StyledTextCtrl#set_tab_width
set_tab_width(%(arg-type)Integer% tabWidth)
Change the visible size of a tab to be a multiple of the width of a space character.
StyledTextCtrl#set_use_tabs
set_use_tabs(%(arg-type)Boolean% useTabs)
Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.
Markers
StyledTextCtrl#marker_add
Integer marker_add(%(arg-type)Integer% line, Integer markerNumber)
Add a marker to a line, returning an ID which can be used to find or delete the marker.
StyledTextCtrl#marker_add_set
marker_add_set(%(arg-type)Integer% line, Integer set)
Add a set of markers to a line.
StyledTextCtrl#marker_define
marker_define(%(arg-type)Integer% markerNumber, Integer markerSymbol, Colour foreground, Colour background)
Set the symbol used for a particular marker number, and optionally the fore and background colours.
StyledTextCtrl#marker_define_bitmap
marker_define_bitmap(%(arg-type)Integer% markerNumber, Bitmap bmp)
Define a marker from a bitmap
StyledTextCtrl#marker_delete
marker_delete(%(arg-type)Integer% line, Integer markerNumber)
Delete a marker from a line.
StyledTextCtrl#marker_delete_all
marker_delete_all(%(arg-type)Integer% markerNumber)
Delete all markers with a particular number from all lines.
StyledTextCtrl#marker_delete_handle
marker_delete_handle(%(arg-type)Integer% handle)
Delete a marker.
StyledTextCtrl#marker_get
Integer marker_get(%(arg-type)Integer% line)
Get a bit mask of all the markers set on a line.
StyledTextCtrl#marker_line_from_handle
Integer marker_line_from_handle(%(arg-type)Integer% handle)
Retrieve the line number at which a particular marker is located.
StyledTextCtrl#marker_next
Integer marker_next(%(arg-type)Integer% lineStart, Integer markerMask)
Find the next line after lineStart that includes a marker in mask.
StyledTextCtrl#marker_previous
Integer marker_previous(%(arg-type)Integer% lineStart, Integer markerMask)
Find the previous line before lineStart that includes a marker in mask.
StyledTextCtrl#marker_set_alpha
marker_set_alpha(%(arg-type)Integer% markerNumber, Integer alpha)
Set the alpha used for a marker that is drawn in the text area, not the margin.
StyledTextCtrl#marker_set_background
marker_set_background(%(arg-type)Integer% markerNumber, Colour back)
Set the background colour used for a particular marker number.
StyledTextCtrl#marker_set_foreground
marker_set_foreground(%(arg-type)Integer% markerNumber, Colour fore)
Set the foreground colour used for a particular marker number.
Margins
StyledTextCtrl#get_margin_left
Integer get_margin_left()
Returns the size in pixels of the left margin.
StyledTextCtrl#get_margin_mask
Integer get_margin_mask(%(arg-type)Integer% margin)
Retrieve the marker mask of a margin.
StyledTextCtrl#get_margin_right
Integer get_margin_right()
Returns the size in pixels of the right margin.
StyledTextCtrl#get_margin_sensitive
Boolean get_margin_sensitive(%(arg-type)Integer% margin)
Retrieve the mouse click sensitivity of a margin.
StyledTextCtrl#get_margin_type
Integer get_margin_type(%(arg-type)Integer% margin)
Retrieve the type of a margin.
StyledTextCtrl#get_margin_width
Integer get_margin_width(%(arg-type)Integer% margin)
Retrieve the width of a margin in pixels.
StyledTextCtrl#set_margin_left
set_margin_left(%(arg-type)Integer% pixelWidth)
Sets the size in pixels of the left margin.
StyledTextCtrl#set_margin_mask
set_margin_mask(%(arg-type)Integer% margin, Integer mask)
Set a mask that determines which markers are displayed in a margin.
StyledTextCtrl#set_margin_right
set_margin_right(%(arg-type)Integer% pixelWidth)
Sets the size in pixels of the right margin.
StyledTextCtrl#set_margin_sensitive
set_margin_sensitive(%(arg-type)Integer% margin, Boolean sensitive)
Make a margin sensitive or insensitive to mouse clicks.
StyledTextCtrl#set_margin_type
set_margin_type(%(arg-type)Integer% margin, Integer marginType)
Set a margin to be either numeric or symbolic.
StyledTextCtrl#set_margin_width
set_margin_width(%(arg-type)Integer% margin, Integer pixelWidth)
Set the width of a margin to a width expressed in pixels.
StyledTextCtrl#set_margins
set_margins(%(arg-type)Integer% left, Integer right)
Set the left and right margin in the edit area, measured in pixels.
Long line markers
StyledTextCtrl#get_edge_colour
Colour get_edge_colour()
Retrieve the colour used in edge indication.
StyledTextCtrl#get_edge_column
Integer get_edge_column()
Retrieve the column number which text should be kept within.
StyledTextCtrl#get_edge_mode
Integer get_edge_mode()
Retrieve the edge highlight mode.
StyledTextCtrl#set_edge_colour
set_edge_colour(%(arg-type)Colour% edgeColour)
Change the colour used in edge indication.
StyledTextCtrl#set_edge_column
set_edge_column(%(arg-type)Integer% column)
Set the column number of the edge. If text goes past the edge then it is highlighted.
StyledTextCtrl#set_edge_mode
set_edge_mode(%(arg-type)Integer% mode)
The edge may be displayed by a line (EDGE_LINE) or by highlighting text that goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
Folding
StyledTextCtrl#doc_line_from_visible
Integer doc_line_from_visible(%(arg-type)Integer% lineDisplay)
Find the document line of a display line taking hidden lines into account.
StyledTextCtrl#ensure_visible
ensure_visible(%(arg-type)Integer% line)
Ensure a particular line is visible by expanding any header line hiding it.
StyledTextCtrl#ensure_visible_enforce_policy
ensure_visible_enforce_policy(%(arg-type)Integer% line)
Ensure a particular line is visible by expanding any header line hiding it. Use the currently set visibility policy to determine which range to display.
StyledTextCtrl#get_fold_expanded
Boolean get_fold_expanded(%(arg-type)Integer% line)
Is a header line expanded?
StyledTextCtrl#get_fold_level
Integer get_fold_level(%(arg-type)Integer% line)
Retrieve the fold level of a line.
StyledTextCtrl#get_fold_parent
Integer get_fold_parent(%(arg-type)Integer% line)
Find the parent line of a child line.
StyledTextCtrl#get_last_child
Integer get_last_child(%(arg-type)Integer% line, Integer level)
Find the last child line of a header line.
StyledTextCtrl#get_line_visible
Boolean get_line_visible(%(arg-type)Integer% line)
Is a line visible?
StyledTextCtrl#hide_lines
hide_lines(%(arg-type)Integer% lineStart, Integer lineEnd)
Make a range of lines invisible.
StyledTextCtrl#set_fold_expanded
set_fold_expanded(%(arg-type)Integer% line, Boolean expanded)
Show the children of a header line.
StyledTextCtrl#set_fold_flags
set_fold_flags(%(arg-type)Integer% flags)
Set some style options for folding.
StyledTextCtrl#set_fold_level
set_fold_level(%(arg-type)Integer% line, Integer level)
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.
StyledTextCtrl#set_fold_margin_colour
set_fold_margin_colour(%(arg-type)Boolean% useSetting, Colour back)
Set the colours used as a chequerboard pattern in the fold margin
StyledTextCtrl#set_fold_margin_hi_colour
set_fold_margin_hi_colour(%(arg-type)Boolean% useSetting, Colour fore)
StyledTextCtrl#show_lines
show_lines(%(arg-type)Integer% lineStart, Integer lineEnd)
Make a range of lines visible.
StyledTextCtrl#toggle_fold
toggle_fold(%(arg-type)Integer% line)
Switch a header line between expanded and contracted.
StyledTextCtrl#visible_from_doc_line
Integer visible_from_doc_line(%(arg-type)Integer% line)
Find the display line of a document line taking hidden lines into account.
Brace matching and highlighting
StyledTextCtrl#brace_bad_light
brace_bad_light(%(arg-type)Integer% pos)
Highlight the character at a position indicating there is no matching brace.
StyledTextCtrl#brace_highlight
brace_highlight(%(arg-type)Integer% pos1, Integer pos2)
Highlight the characters at two positions.
StyledTextCtrl#brace_match
Integer brace_match(%(arg-type)Integer% pos)
Find the position of a matching brace or INVALID_POSITION if no match.
Autocompletion
StyledTextCtrl#auto_comp_active
Boolean auto_comp_active()
Is there an auto-completion list visible?
StyledTextCtrl#auto_comp_cancel
auto_comp_cancel()
Remove the auto-completion list from the screen.
StyledTextCtrl#auto_comp_complete
auto_comp_complete()
User has selected an item so remove the list and insert the selection.
StyledTextCtrl#auto_comp_get_auto_hide
Boolean auto_comp_get_auto_hide()
Retrieve whether or not autocompletion is hidden automatically when nothing matches.
StyledTextCtrl#auto_comp_get_cancel_at_start
Boolean auto_comp_get_cancel_at_start()
Retrieve whether auto-completion cancelled by backspacing before start.
StyledTextCtrl#auto_comp_get_choose_single
Boolean auto_comp_get_choose_single()
Retrieve whether a single item auto-completion list automatically choose the item.
StyledTextCtrl#auto_comp_get_current
Integer auto_comp_get_current()
Get currently selected item position in the auto-completion list
StyledTextCtrl#auto_comp_get_drop_rest_of_word
Boolean auto_comp_get_drop_rest_of_word()
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
StyledTextCtrl#auto_comp_get_ignore_case
Boolean auto_comp_get_ignore_case()
Retrieve state of ignore case flag.
StyledTextCtrl#auto_comp_get_max_height
Integer auto_comp_get_max_height()
Set the maximum height, in rows, of auto-completion and user lists.
StyledTextCtrl#auto_comp_get_max_width
Integer auto_comp_get_max_width()
Get the maximum width, in characters, of auto-completion and user lists.
StyledTextCtrl#auto_comp_get_separator
Integer auto_comp_get_separator()
Retrieve the auto-completion list separator character.
StyledTextCtrl#auto_comp_get_type_separator
Integer auto_comp_get_type_separator()
Retrieve the auto-completion list type-separator character.
StyledTextCtrl#auto_comp_pos_start
Integer auto_comp_pos_start()
Retrieve the position of the caret when the auto-completion list was displayed.
StyledTextCtrl#auto_comp_select
auto_comp_select(%(arg-type)String% text)
Select the item in the auto-completion list that starts with a string.
StyledTextCtrl#auto_comp_set_auto_hide
auto_comp_set_auto_hide(%(arg-type)Boolean% autoHide)
Set whether or not autocompletion is hidden automatically when nothing matches.
StyledTextCtrl#auto_comp_set_cancel_at_start
auto_comp_set_cancel_at_start(%(arg-type)Boolean% cancel)
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
StyledTextCtrl#auto_comp_set_choose_single
auto_comp_set_choose_single(%(arg-type)Boolean% chooseSingle)
Should a single item auto-completion list automatically choose the item.
StyledTextCtrl#auto_comp_set_drop_rest_of_word
auto_comp_set_drop_rest_of_word(%(arg-type)Boolean% dropRestOfWord)
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
StyledTextCtrl#auto_comp_set_fill_ups
auto_comp_set_fill_ups(%(arg-type)String% characterSet)
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
StyledTextCtrl#auto_comp_set_ignore_case
auto_comp_set_ignore_case(%(arg-type)Boolean% ignoreCase)
Set whether case is significant when performing auto-completion searches.
StyledTextCtrl#auto_comp_set_max_height
auto_comp_set_max_height(%(arg-type)Integer% rowCount)
Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
StyledTextCtrl#auto_comp_set_max_width
auto_comp_set_max_width(%(arg-type)Integer% characterCount)
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.
StyledTextCtrl#auto_comp_set_separator
auto_comp_set_separator(%(arg-type)Integer% separatorCharacter)
Change the separator character in the string setting up an auto-completion list. Default is space but can be changed if items contain space.
StyledTextCtrl#auto_comp_set_type_separator
auto_comp_set_type_separator(%(arg-type)Integer% separatorCharacter)
Change the type-separator character in the string setting up an auto-completion list. Default is ‘?’ but can be changed if items contain ‘?’.
StyledTextCtrl#auto_comp_show
auto_comp_show(%(arg-type)Integer% lenEntered, String itemList)
Display a auto-completion list. The lenEntered parameter indicates how many characters before the caret should be used to provide context.
StyledTextCtrl#auto_comp_stops
auto_comp_stops(%(arg-type)String% characterSet)
Define a set of character that when typed cancel the auto-completion list.
StyledTextCtrl#clear_registered_images
clear_registered_images()
Clear all the registered images.
StyledTextCtrl#register_image
register_image(%(arg-type)Integer% type, Bitmap bmp)
Register an image for use in autocompletion lists.
StyledTextCtrl#user_list_show
user_list_show(%(arg-type)Integer% listType, String itemList)
Display a list of strings and send notification when user chooses one.
StyledTextCtrl#call_tip_active
Boolean call_tip_active()
Is there an active call tip?
StyledTextCtrl#call_tip_cancel
call_tip_cancel()
Remove the call tip from the screen.
StyledTextCtrl#call_tip_pos_at_start
Integer call_tip_pos_at_start()
Retrieve the position where the caret was before displaying the call tip.
StyledTextCtrl#call_tip_set_background
call_tip_set_background(%(arg-type)Colour% back)
Set the background colour for the call tip.
StyledTextCtrl#call_tip_set_foreground
call_tip_set_foreground(%(arg-type)Colour% fore)
Set the foreground colour for the call tip.
StyledTextCtrl#call_tip_set_foreground_highlight
call_tip_set_foreground_highlight(%(arg-type)Colour% fore)
Set the foreground colour for the highlighted part of the call tip.
StyledTextCtrl#call_tip_set_highlight
call_tip_set_highlight(%(arg-type)Integer% start, Integer end)
Highlight a segment of the definition.
StyledTextCtrl#call_tip_show
call_tip_show(%(arg-type)Integer% pos, String definition)
Show a call tip containing a definition near position pos.
StyledTextCtrl#call_tip_use_style
call_tip_use_style(%(arg-type)Integer% tabSize)
Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
White space, zoom and other view options
StyledTextCtrl#get_view_white_space
Integer get_view_white_space()
Are white space characters currently visible? Returns one of SCWS_* constants.
StyledTextCtrl#get_zoom
Integer get_zoom()
Retrieve the zoom level.
StyledTextCtrl#lines_on_screen
Integer lines_on_screen()
Retrieves the number of lines completely visible.
StyledTextCtrl#set_view_white_space
set_view_white_space(%(arg-type)Integer% viewWS)
Make white space characters invisible, always visible or visible outside indentation.
StyledTextCtrl#set_whitespace_background
set_whitespace_background(%(arg-type)Boolean% useSetting, Colour back)
Set the background colour of all whitespace and whether to use this setting.
StyledTextCtrl#set_whitespace_foreground
set_whitespace_foreground(%(arg-type)Boolean% useSetting, Colour fore)
Set the foreground colour of all whitespace and whether to use this setting.
StyledTextCtrl#set_zoom
set_zoom(%(arg-type)Integer% zoom)
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.
StyledTextCtrl#zoom_in
zoom_in()
Magnify the displayed text by increasing the sizes by 1 point.
StyledTextCtrl#zoom_out
zoom_out()
Make the displayed text smaller by decreasing the sizes by 1 point.
Multiple views of one document
StyledTextCtrl#add_ref_document
add_ref_document(%(arg-type)% docPointer)
Extend life of document.
StyledTextCtrl#create_document
create_document()
Create a new document object. Starts with reference count of 1 and not selected into editor.
StyledTextCtrl#get_doc_pointer
get_doc_pointer()
Retrieve a pointer to the document object.
StyledTextCtrl#release_document
release_document(%(arg-type)% docPointer)
Release a reference to the document, deleting document if it fades to black.
StyledTextCtrl#set_doc_pointer
set_doc_pointer(%(arg-type)% docPointer)
Change the document object used.
Autocompletion
StyledTextCtrl#auto_comp_active
Boolean auto_comp_active()
Is there an auto-completion list visible?
StyledTextCtrl#auto_comp_cancel
auto_comp_cancel()
Remove the auto-completion list from the screen.
StyledTextCtrl#auto_comp_complete
auto_comp_complete()
User has selected an item so remove the list and insert the selection.
StyledTextCtrl#auto_comp_get_auto_hide
Boolean auto_comp_get_auto_hide()
Retrieve whether or not autocompletion is hidden automatically when nothing matches.
StyledTextCtrl#auto_comp_get_cancel_at_start
Boolean auto_comp_get_cancel_at_start()
Retrieve whether auto-completion cancelled by backspacing before start.
StyledTextCtrl#auto_comp_get_choose_single
Boolean auto_comp_get_choose_single()
Retrieve whether a single item auto-completion list automatically choose the item.
StyledTextCtrl#auto_comp_get_current
Integer auto_comp_get_current()
Get currently selected item position in the auto-completion list
StyledTextCtrl#auto_comp_get_drop_rest_of_word
Boolean auto_comp_get_drop_rest_of_word()
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
StyledTextCtrl#auto_comp_get_ignore_case
Boolean auto_comp_get_ignore_case()
Retrieve state of ignore case flag.
StyledTextCtrl#auto_comp_get_max_height
Integer auto_comp_get_max_height()
Set the maximum height, in rows, of auto-completion and user lists.
StyledTextCtrl#auto_comp_get_max_width
Integer auto_comp_get_max_width()
Get the maximum width, in characters, of auto-completion and user lists.
StyledTextCtrl#auto_comp_get_separator
Integer auto_comp_get_separator()
Retrieve the auto-completion list separator character.
StyledTextCtrl#auto_comp_get_type_separator
Integer auto_comp_get_type_separator()
Retrieve the auto-completion list type-separator character.
StyledTextCtrl#auto_comp_pos_start
Integer auto_comp_pos_start()
Retrieve the position of the caret when the auto-completion list was displayed.
StyledTextCtrl#auto_comp_select
auto_comp_select(%(arg-type)String% text)
Select the item in the auto-completion list that starts with a string.
StyledTextCtrl#auto_comp_set_auto_hide
auto_comp_set_auto_hide(%(arg-type)Boolean% autoHide)
Set whether or not autocompletion is hidden automatically when nothing matches.
StyledTextCtrl#auto_comp_set_cancel_at_start
auto_comp_set_cancel_at_start(%(arg-type)Boolean% cancel)
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
StyledTextCtrl#auto_comp_set_choose_single
auto_comp_set_choose_single(%(arg-type)Boolean% chooseSingle)
Should a single item auto-completion list automatically choose the item.
StyledTextCtrl#auto_comp_set_drop_rest_of_word
auto_comp_set_drop_rest_of_word(%(arg-type)Boolean% dropRestOfWord)
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
StyledTextCtrl#auto_comp_set_fill_ups
auto_comp_set_fill_ups(%(arg-type)String% characterSet)
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
StyledTextCtrl#auto_comp_set_ignore_case
auto_comp_set_ignore_case(%(arg-type)Boolean% ignoreCase)
Set whether case is significant when performing auto-completion searches.
StyledTextCtrl#auto_comp_set_max_height
auto_comp_set_max_height(%(arg-type)Integer% rowCount)
Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
StyledTextCtrl#auto_comp_set_max_width
auto_comp_set_max_width(%(arg-type)Integer% characterCount)
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.
StyledTextCtrl#auto_comp_set_separator
auto_comp_set_separator(%(arg-type)Integer% separatorCharacter)
Change the separator character in the string setting up an auto-completion list. Default is space but can be changed if items contain space.
StyledTextCtrl#auto_comp_set_type_separator
auto_comp_set_type_separator(%(arg-type)Integer% separatorCharacter)
Change the type-separator character in the string setting up an auto-completion list. Default is ‘?’ but can be changed if items contain ‘?’.
StyledTextCtrl#auto_comp_show
auto_comp_show(%(arg-type)Integer% lenEntered, String itemList)
Display a auto-completion list. The lenEntered parameter indicates how many characters before the caret should be used to provide context.
StyledTextCtrl#auto_comp_stops
auto_comp_stops(%(arg-type)String% characterSet)
Define a set of character that when typed cancel the auto-completion list.
StyledTextCtrl#clear_registered_images
clear_registered_images()
Clear all the registered images.
StyledTextCtrl#register_image
register_image(%(arg-type)Integer% type, Bitmap bmp)
Register an image for use in autocompletion lists.
StyledTextCtrl#user_list_show
user_list_show(%(arg-type)Integer% listType, String itemList)
Display a list of strings and send notification when user chooses one.
StyledTextCtrl#call_tip_active
Boolean call_tip_active()
Is there an active call tip?
StyledTextCtrl#call_tip_cancel
call_tip_cancel()
Remove the call tip from the screen.
StyledTextCtrl#call_tip_pos_at_start
Integer call_tip_pos_at_start()
Retrieve the position where the caret was before displaying the call tip.
StyledTextCtrl#call_tip_set_background
call_tip_set_background(%(arg-type)Colour% back)
Set the background colour for the call tip.
StyledTextCtrl#call_tip_set_foreground
call_tip_set_foreground(%(arg-type)Colour% fore)
Set the foreground colour for the call tip.
StyledTextCtrl#call_tip_set_foreground_highlight
call_tip_set_foreground_highlight(%(arg-type)Colour% fore)
Set the foreground colour for the highlighted part of the call tip.
StyledTextCtrl#call_tip_set_highlight
call_tip_set_highlight(%(arg-type)Integer% start, Integer end)
Highlight a segment of the definition.
StyledTextCtrl#call_tip_show
call_tip_show(%(arg-type)Integer% pos, String definition)
Show a call tip containing a definition near position pos.
StyledTextCtrl#call_tip_use_style
call_tip_use_style(%(arg-type)Integer% tabSize)
Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
Key Bindings
StyledTextCtrl#cmd_key_assign
cmd_key_assign(%(arg-type)Integer% key, Integer modifiers, Integer cmd)
When key+modifier combination km is pressed perform msg.
StyledTextCtrl#cmd_key_clear
cmd_key_clear(%(arg-type)Integer% key, Integer modifiers)
When key+modifier combination km is pressed do nothing.
StyledTextCtrl#cmd_key_clear_all
cmd_key_clear_all()
Drop all key mappings.
StyledTextCtrl#cmd_key_execute
cmd_key_execute(%(arg-type)Integer% cmd)
Perform one of the operations defined by the wxSTC_CMD_* constants.
Keyboard Commands Functions
StyledTextCtrl#back_tab
back_tab()
Dedent the selected lines.
StyledTextCtrl#cancel
cancel()
Cancel any modes such as call tip or auto-completion list display.
StyledTextCtrl#char_left
char_left()
Move caret left one character.
StyledTextCtrl#char_left_extend
char_left_extend()
Move caret left one character extending selection to new caret position.
StyledTextCtrl#char_left_rect_extend
char_left_rect_extend()
Move caret left one character, extending rectangular selection to new caret position.
StyledTextCtrl#char_right
char_right()
Move caret right one character.
StyledTextCtrl#char_right_extend
char_right_extend()
Move caret right one character extending selection to new caret position.
StyledTextCtrl#char_right_rect_extend
char_right_rect_extend()
Move caret right one character, extending rectangular selection to new caret position.
StyledTextCtrl#del_line_left
del_line_left()
Delete back from the current position to the start of the line.
StyledTextCtrl#del_line_right
del_line_right()
Delete forwards from the current position to the end of the line.
StyledTextCtrl#del_word_left
del_word_left()
Delete the word to the left of the caret.
StyledTextCtrl#del_word_right
del_word_right()
Delete the word to the right of the caret.
StyledTextCtrl#delete_back
delete_back()
Delete the selection or if no selection, the character before the caret.
StyledTextCtrl#delete_back_not_line
delete_back_not_line()
Delete the selection or if no selection, the character before the caret. Will not delete the character before at the start of a line.
StyledTextCtrl#document_end
document_end()
Move caret to last position in document.
StyledTextCtrl#document_end_extend
document_end_extend()
Move caret to last position in document extending selection to new caret position.
StyledTextCtrl#document_start
document_start()
Move caret to first position in document.
StyledTextCtrl#document_start_extend
document_start_extend()
Move caret to first position in document extending selection to new caret position.
StyledTextCtrl#edit_toggle_overtype
edit_toggle_overtype()
Switch from insert to overtype mode or the reverse.
form_feed()
Insert a Form Feed character.
StyledTextCtrl#home
home()
Move caret to first position on line.
StyledTextCtrl#home_display
home_display()
Move caret to first position on display line.
StyledTextCtrl#home_display_extend
home_display_extend()
Move caret to first position on display line extending selection to new caret position.
StyledTextCtrl#home_extend
home_extend()
Move caret to first position on line extending selection to new caret position.
StyledTextCtrl#home_rect_extend
home_rect_extend()
Move caret to first position on line, extending rectangular selection to new caret position.
StyledTextCtrl#home_wrap
home_wrap()
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
StyledTextCtrl#home_wrap_extend
home_wrap_extend()
StyledTextCtrl#line_copy
line_copy()
Copy the line containing the caret.
StyledTextCtrl#line_cut
line_cut()
Cut the line containing the caret.
StyledTextCtrl#line_delete
line_delete()
Delete the line containing the caret.
StyledTextCtrl#line_down_extend
line_down_extend()
Move caret down one line extending selection to new caret position.
StyledTextCtrl#line_down_rect_extend
line_down_rect_extend()
Move caret down one line, extending rectangular selection to new caret position.
StyledTextCtrl#line_duplicate
line_duplicate()
Duplicate the current line.
StyledTextCtrl#line_end
line_end()
Move caret to last position on line.
StyledTextCtrl#line_end_display
line_end_display()
Move caret to last position on display line.
StyledTextCtrl#line_end_display_extend
line_end_display_extend()
Move caret to last position on display line extending selection to new caret position.
StyledTextCtrl#line_end_extend
line_end_extend()
Move caret to last position on line extending selection to new caret position.
StyledTextCtrl#line_end_rect_extend
line_end_rect_extend()
Move caret to last position on line, extending rectangular selection to new caret position.
StyledTextCtrl#line_end_wrap
line_end_wrap()
StyledTextCtrl#line_end_wrap_extend
line_end_wrap_extend()
line_scroll_down()
Scroll the document down, keeping the caret visible.
line_scroll_up()
Scroll the document up, keeping the caret visible.
StyledTextCtrl#line_transpose
line_transpose()
Switch the current line with the previous.
StyledTextCtrl#line_up
line_up()
Move caret up one line.
StyledTextCtrl#line_up_extend
line_up_extend()
Move caret up one line extending selection to new caret position.
StyledTextCtrl#line_up_rect_extend
line_up_rect_extend()
Move caret up one line, extending rectangular selection to new caret position.
StyledTextCtrl#lower_case
lower_case()
Transform the selection to lower case.
StyledTextCtrl#new_line
new_line()
Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
StyledTextCtrl#page_down
page_down()
Move caret one page down.
StyledTextCtrl#page_down_extend
page_down_extend()
Move caret one page down extending selection to new caret position.
StyledTextCtrl#page_down_rect_extend
page_down_rect_extend()
Move caret one page down, extending rectangular selection to new caret position.
StyledTextCtrl#page_up
page_up()
Move caret one page up.
StyledTextCtrl#page_up_extend
page_up_extend()
Move caret one page up extending selection to new caret position.
StyledTextCtrl#page_up_rect_extend
page_up_rect_extend()
Move caret one page up, extending rectangular selection to new caret position.
StyledTextCtrl#para_down
para_down()
Move caret between paragraphs (delimited by empty lines).
StyledTextCtrl#para_down_extend
para_down_extend()
StyledTextCtrl#para_up
para_up()
StyledTextCtrl#para_up_extend
para_up_extend()
StyledTextCtrl#selection_duplicate
selection_duplicate()
Duplicate the selection. If selection empty duplicate the line containing the caret.
StyledTextCtrl#stuttered_page_down
stuttered_page_down()
Move caret to bottom of page, or one page down if already at bottom of page.
StyledTextCtrl#stuttered_page_down_extend
stuttered_page_down_extend()
Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
StyledTextCtrl#stuttered_page_up
stuttered_page_up()
Move caret to top of page, or one page up if already at top of page.
StyledTextCtrl#stuttered_page_up_extend
stuttered_page_up_extend()
Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
StyledTextCtrl#tab
tab()
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.
StyledTextCtrl#upper_case
upper_case()
Transform the selection to upper case.
StyledTextCtrl#vc_home
vc_home()
Move caret to before first visible character on line. If already there move to first character on line.
StyledTextCtrl#vc_home_extend
vc_home_extend()
Like VCHome but extending selection to new caret position.
StyledTextCtrl#vc_home_rect_extend
vc_home_rect_extend()
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.
StyledTextCtrl#vc_home_wrap
vc_home_wrap()
StyledTextCtrl#vc_home_wrap_extend
vc_home_wrap_extend()
StyledTextCtrl#word_left
word_left()
Move caret left one word.
StyledTextCtrl#word_left_end
word_left_end()
Move caret left one word, position cursor at end of word.
StyledTextCtrl#word_left_end_extend
word_left_end_extend()
Move caret left one word, position cursor at end of word, extending selection to new caret position.
StyledTextCtrl#word_left_extend
word_left_extend()
Move caret left one word extending selection to new caret position.
StyledTextCtrl#word_part_left
word_part_left()
Move to the previous change in capitalisation.
StyledTextCtrl#word_part_left_extend
word_part_left_extend()
Move to the previous change in capitalisation extending selection to new caret position.
StyledTextCtrl#word_part_right
word_part_right()
Move to the change next in capitalisation.
StyledTextCtrl#word_part_right_extend
word_part_right_extend()
Move to the next change in capitalisation extending selection to new caret position.
StyledTextCtrl#word_right
word_right()
Move caret right one word.
StyledTextCtrl#word_right_end
word_right_end()
Move caret right one word, position cursor at end of word.
StyledTextCtrl#word_right_end_extend
word_right_end_extend()
Move caret right one word, position cursor at end of word, extending selection to new caret position.
StyledTextCtrl#word_right_extend
word_right_extend()
Move caret right one word extending selection to new caret position.
Macro recording
StyledTextCtrl#start_record
start_record()
Start notifying the container of all key presses and commands.
StyledTextCtrl#stop_record
stop_record()
Stop notifying the container of all key presses and commands.
Load and save to file
StyledTextCtrl#load_file
Boolean load_file(%(arg-type)String% filename)
Load the contents of filename into the editor
StyledTextCtrl#save_file
Boolean save_file(%(arg-type)String% filename)
} Write the contents of the editor to filename
Printing
Integer format_range(%(arg-type)Boolean% doDraw, Integer startPos, Integer endPos, DC draw, DC target, Rect renderRect, Rect pageRect)
On Windows, will draw the document into a display context such as a printer.
StyledTextCtrl#get_print_colour_mode
Integer get_print_colour_mode()
Returns the print colour mode.
StyledTextCtrl#get_print_magnification
Integer get_print_magnification()
Returns the print magnification.
StyledTextCtrl#get_print_wrap_mode
Integer get_print_wrap_mode()
Is printing line wrapped?
StyledTextCtrl#set_print_colour_mode
set_print_colour_mode(%(arg-type)Integer% mode)
Modify colours when printing for clearer printed text.
StyledTextCtrl#set_print_magnification
set_print_magnification(%(arg-type)Integer% magnification)
Sets the print magnification added to the point size of each style for printing.
StyledTextCtrl#set_print_wrap_mode
set_print_wrap_mode(%(arg-type)Integer% mode)
Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
Drag and drop
StyledTextCtrl#do_drag_over
DragResult do_drag_over(%(arg-type)Integer% x, Integer y, DragResult def)
#ifdef STC_USE_DND Allow for simulating a DnD DragOver
StyledTextCtrl#do_drop_text
Boolean do_drop_text(%(arg-type)Integer% x, Integer y, String data)
Allow for simulating a DnD DropText
Wxruby interaction
StyledTextCtrl#get_mouse_down_captures
Boolean get_mouse_down_captures()
Get whether mouse gets captured.
StyledTextCtrl#get_status
Integer get_status()
Get error status.
StyledTextCtrl#get_stc_focus
Boolean get_stc_focus()
Get internal focus flag.
StyledTextCtrl#set_mouse_down_captures
set_mouse_down_captures(%(arg-type)Boolean% captures)
Set whether the mouse is captured when its button is pressed.
StyledTextCtrl#set_status
set_status(%(arg-type)Integer% statusCode)
Change error status – 0 = OK.
StyledTextCtrl#set_stc_focus
set_stc_focus(%(arg-type)Boolean% focus)
Change internal focus flag.
Event handling
StyledTextCtrl#get_last_keydown_processed
Boolean get_last_keydown_processed()
Can be used to prevent the EVT_CHAR handler from adding the char
StyledTextCtrl#get_mod_event_mask
Integer get_mod_event_mask()
Get which document modification events are sent to the container.
StyledTextCtrl#get_mouse_dwell_time
Integer get_mouse_dwell_time()
Retrieve the time the mouse must sit still to generate a mouse dwell event.
StyledTextCtrl#set_last_keydown_processed
set_last_keydown_processed(%(arg-type)Boolean% val)
}
StyledTextCtrl#set_mod_event_mask
set_mod_event_mask(%(arg-type)Integer% mask)
Set which document modification events are sent to the container.
StyledTextCtrl#set_mouse_dwell_time
set_mouse_dwell_time(%(arg-type)Integer% periodMilliseconds)
Sets the time the mouse must sit still to generate a mouse dwell event.
Miscellaneous other settings
StyledTextCtrl#get_buffered_draw
Boolean get_buffered_draw()
Is drawing done first into a buffer or direct to the screen?
StyledTextCtrl#get_two_phase_draw
Boolean get_two_phase_draw()
Is drawing done in two phases with backgrounds drawn before foregrounds?
StyledTextCtrl#get_use_anti_aliasing
Boolean get_use_anti_aliasing()
Returns the current UseAntiAliasing setting.
StyledTextCtrl#set_buffered_draw
set_buffered_draw(%(arg-type)Boolean% buffered)
If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.
StyledTextCtrl#set_chars_default
set_chars_default()
Reset the set of characters for whitespace and word characters to the defaults.
StyledTextCtrl#set_two_phase_draw
set_two_phase_draw(%(arg-type)Boolean% twoPhase)
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.
StyledTextCtrl#set_use_anti_aliasing
set_use_anti_aliasing(%(arg-type)Boolean% useAA)
#endif Specify whether anti-aliased fonts should be used. Will have no effect on some platforms, but on some (wxMac for example) can greatly improve performance.
StyledTextCtrl#set_whitespace_chars
set_whitespace_chars(%(arg-type)String% characters)
Set the set of characters making up whitespace for when moving or selecting by word. Should be called after SetWordChars.
StyledTextCtrl#set_word_chars
set_word_chars(%(arg-type)String% characters)
Set the set of characters making up words for when moving or selecting by word. First sets deaults like SetCharsDefault.
use_pop_up(%(arg-type)Boolean% allowPopUp)
Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button.
[This page automatically generated from the Textile source at 2023-06-13 21:31:39 +0000]