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.
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)
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 |
Since StyledTextCtrl supports so many methods, they are broken down here into groups.
add_text(String text)
Add text to the document at current position.
allocate(Integer bytes)
Enlarge the document to a particular size of text bytes.
append_text(String text)
Append a string to the end of the document without changing the selection.
clear_all()
Delete all text in the document.
Integer find_column(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.
Integer get_char_at(Integer pos)
Returns the character byte at the position.
Integer get_length()
Returns the number of characters in the document.
String get_line(Integer line)
Retrieve the contents of a line.
Integer get_line_count()
Returns the number of lines in the document. There is always at least one.
Boolean get_modify()
Is the document different from when it was last saved?
Boolean get_overtype()
Returns true if overtype mode is active otherwise false is returned.
Boolean get_read_only()
In read-only mode?
String get_text()
Retrieve all the text in the document.
Integer get_text_length()
Retrieve the number of characters in the document.
String get_text_range(Integer startPos, Integer endPos)
Retrieve a range of text.
insert_text(Integer pos, String text)
Insert string at a position.
Integer line_length(Integer line)
How many characters are on a line, not including end of line characters?
Integer position_after(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.
Integer position_before(Integer pos)
Given a valid document position, return the previous position taking code page into account. Returns 0 if passed 0.
Integer send_msg(Integer msg, Integer wp=0, Integer lp=0)
Send a message to Scintilla
set_overtype(Boolean overtype)
Set to overtype (true) or insert mode.
set_read_only(Boolean readOnly)
Set to read only or read write.
set_text(String text)
Replace the contents of the document with the argument text.
Integer get_code_page()
Get the code page used to interpret the bytes of the document as characters.
set_code_page(Integer codePage)
Set the code page used to interpret the bytes of the document as characters.
convert_eo_ls(Integer eolMode)
Convert all line endings in the document to one mode.
Integer get_eol_mode()
Retrieve the current end of line mode – one of CRLF, CR, or LF.
Boolean get_view_eol()
Are the end of line characters visible?
set_eol_mode(Integer eolMode)
Set the current end of line mode.
set_view_eol(Boolean visible)
Make the end of line characters visible or invisible.
Integer get_column(Integer pos)
Retrieve the column number of a position, taking tab width into account.
String get_cur_line(Integer linePos=NULL)
#else
Integer get_first_visible_line()
Retrieve the display line at the top of the display.
Integer get_line_end_position(Integer line)
Get the position after the last visible characters on a line.
Integer line_from_position(Integer pos)
Retrieve the line containing a position.
Integer point_from_position(Integer pos)
#endif Retrieve the point in the window where a position is displayed. wxPo
Integer position_from_line(Integer line)
Retrieve the position at the start of a line.
Integer position_from_point(Point pt)
Find the position from a point within the window.
Integer position_from_point_close(Integer x, Integer y)
Find the position from a point within the window but return INVALID_POSITION if not close to text.
goto_line(Integer line)
Set caret to start of a line and ensure it is visible.
goto_pos(Integer pos)
Set caret to a position and ensure it is visible.
line_down()
Move caret down one line.
scroll_to_column(Integer column)
Scroll enough to make the given column visible
scroll_to_line(Integer line)
Scroll enough to make the given line visible
Integer get_anchor()
Returns the position of the opposite end of the selection to the caret.
Integer get_current_line()
Returns the line number of the line with the caret.
Integer get_current_pos()
Returns the position of the caret.
Integer get_line_sel_end_position(Integer line)
Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
Integer get_line_sel_start_position(Integer line)
Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
Integer get_sel_alpha()
Get the alpha of the selection.
String get_selected_text()
Retrieve the selected text.
get_selection(Integer startPos, Integer endPos)
#else
Integer get_selection_end()
Returns the position at the end of the selection.
Integer get_selection_mode()
Get the mode of the current selection.
Integer get_selection_start()
Returns the position at the start of the selection.
Integer get_stc_cursor()
Get cursor type.
hide_selection(Boolean normal)
Draw the selection in normal style or with selection highlighted.
replace_selection(String text)
Replace the selected text with the argument text.
select_all()
Select all the text in the document.
Boolean selection_is_rectangle()
Is the selection rectangular? The alternative is the more common stream selection.
set_anchor(Integer posAnchor)
Set the selection anchor to a position. The anchor is the opposite end of the selection from the caret.
set_current_pos(Integer pos)
Sets the position of the caret.
set_sel_alpha(Integer alpha)
Set the alpha of the selection.
set_sel_background(Boolean useSetting, Colour back)
Set the background colour of the selection and whether to use this setting.
set_sel_foreground(Boolean useSetting, Colour fore)
Set the foreground colour of the selection and whether to use this setting.
set_selection(Integer start, Integer end)
Select a range of text.
set_selection_end(Integer pos)
Sets the position that ends the selection – this becomes the currentPosition.
set_selection_mode(Integer mode)
Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or by lines (SC_SEL_LINES).
set_selection_start(Integer pos)
Sets the position that starts the selection – this becomes the anchor.
set_stc_cursor(Integer cursorType)
Sets the cursor to one of the SC_CURSOR* values.
Integer get_layout_cache()
Retrieve the degree of caching of layout information.
Integer get_wrap_mode()
Retrieve whether text is word wrapped.
Integer get_wrap_start_indent()
Retrive the start indent for wrapped lines.
Integer get_wrap_visual_flags()
Retrive the display mode of visual flags for wrapped lines.
Integer get_wrap_visual_flags_location()
Retrive the location of visual flags for wrapped lines.
lines_join()
Join the lines in the target.
lines_split(Integer pixelWidth)
Split the lines in the target into lines that are less wide than pixelWidth where possible.
set_layout_cache(Integer mode)
Sets the degree of caching of layout information.
set_wrap_mode(Integer mode)
Sets whether text is word wrapped.
set_wrap_start_indent(Integer indent)
Set the start indent for wrapped lines.
set_wrap_visual_flags(Integer wrapVisualFlags)
Set the display mode of visual flags for wrapped lines.
set_wrap_visual_flags_location(Integer wrapVisualFlagsLocation)
Set the location of visual flags for wrapped lines.
Integer word_end_position(Integer pos, Boolean onlyWordCharacters)
Get position of end of word.
Integer word_start_position(Integer pos, Boolean onlyWordCharacters)
Get position of start of word.
Integer wrap_count(Integer line)
The number of display lines needed to wrap a document line
choose_caret_x()
Set the last x chosen value to be the caret x position.
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?
Integer get_xoffset()
line_scroll(Integer columns, Integer lines)
Scroll horizontally and vertically.
set_end_at_last_line(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(ScrollBar bar)
Set the horizontal scrollbar to use instead of the ont that’s built-in.
set_scroll_width(Integer pixelWidth)
Sets the document width assumed for scrolling.
set_use_horizontal_scroll_bar(Boolean show)
Show or hide the horizontal scroll bar.
set_use_vertical_scroll_bar(Boolean show)
Show or hide the vertical scroll bar.
set_visible_policy(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(ScrollBar bar)
Set the vertical scrollbar to use instead of the ont that’s built-in.
set_xcaret_policy(Integer caretPolicy, Integer caretSlop)
Set the way the caret is kept visible when going sideway. The exclusion zone is given in pixels.
set_xoffset(Integer newOffset)
Get and Set the xOffset (ie, horizonal scroll position).
set_ycaret_policy(Integer caretPolicy, Integer caretSlop)
Set the way the line the caret is on is kept visible. The exclusion zone is given in lines.
Integer text_height(Integer line)
Retrieve the height of a particular line of text in pixels.
Integer text_width(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.
Boolean can_paste()
Will a paste succeed?
clear()
Clear the selection.
copy()
Copy the selection to the clipboard.
copy_range(Integer start, Integer end)
Copy a range of text to the clipboard. Positions are clipped into the document.
copy_text(Integer length, String text)
Copy argument text to the clipboard.
cut()
Cut the selection to the clipboard.
Boolean get_paste_convert_endings()
Get convert-on-paste setting
paste()
Paste the contents of the clipboard into the document replacing the selection.
set_paste_convert_endings(Boolean convert)
Enable/Disable convert-on-paste for line endings
begin_undo_action()
Start a sequence of actions that is undone and redone as a unit. May be nested.
Boolean can_redo()
Are there any redoable actions in the undo history?
Boolean can_undo()
Are there any undoable actions in the undo history?
empty_undo_buffer()
Delete the undo history.
end_undo_action()
End a sequence of actions that is undone and redone as a unit.
Boolean get_undo_collection()
Is undo history being collected?
redo()
Redoes the next action on the undo history.
set_save_point()
Remember the current position in the undo history as the position at which the document was saved.
set_undo_collection(Boolean collectUndo)
Choose between collecting actions into the undo history and discarding them.
undo()
Undo one action in the undo history.
Integer find_text(Integer minPos, Integer maxPos, String text, Integer flags=0)
Find some text in the document.
Integer get_search_flags()
Get the search flags used by SearchInTarget.
Integer get_target_end()
Get the position that ends the target.
Integer get_target_start()
Get the position that starts the target.
Integer replace_target(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.
Integer replace_target_re(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.
search_anchor()
Sets the current caret position to be the search anchor.
Integer search_in_target(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.
Integer search_next(Integer flags, String text)
Find some text starting at the search anchor. Does not ensure the selection is visible.
Integer search_prev(Integer flags, String text)
Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible.
set_search_flags(Integer flags)
Set the search flags used by SearchInTarget.
set_target_end(Integer pos)
Sets the position that ends the target which is used for updating the document without affecting the scroll position.
set_target_start(Integer pos)
Sets the position that starts the target which is used for updating the document without affecting the scroll position.
target_from_selection()
Make the target range start and end be the same as the selection range start and end.
clear_document_style()
Set all style bytes to 0, remove all folding information.
Integer get_end_styled()
#endif Retrieve the position of the last correctly styled character.
Integer get_line_state(Integer line)
Retrieve the extra styling information for a line.
Integer get_max_line_state()
Retrieve the last line number that has line state.
Integer get_style_at(Integer pos)
Returns the style byte at the position.
Integer get_style_bits()
Retrieve number of bits in style bytes used to hold the lexical state.
set_hotspot_active_background(Boolean useSetting, Colour back)
Set a back colour for active hotspots.
set_hotspot_active_foreground(Boolean useSetting, Colour fore)
Set a fore colour for active hotspots.
set_hotspot_active_underline(Boolean underline)
Enable / Disable underlining active hotspots.
set_hotspot_single_line(Boolean singleLine)
Limit hotspots to single line so hotspots on two lines don’t merge.
set_line_state(Integer line, Integer state)
Used to hold extra styling information for each line.
set_style_bits(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.
set_style_bytes(Integer length, (arg-type) styleBytes)
Set the styles for a segment of the document.
set_styling(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.
start_styling(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.
style_clear_all()
Clear all the styles and make equivalent to the global default style.
style_reset_default()
Reset the default style to its state at startup
style_set_background(Integer style, Colour back)
Set the background colour of a style.
style_set_bold(Integer style, Boolean bold)
Set a style to be bold or not.
style_set_case(Integer style, Integer caseForce)
Set a style to be mixed case, or to force upper or lower case.
style_set_changeable(Integer style, Boolean changeable)
Set a style to be changeable or not (read only). Experimental feature, currently buggy.
style_set_character_set(Integer style, Integer characterSet)
Set the character set of the font in a style. Converts the Scintilla character set values to a wxFontEncoding.
style_set_eol_filled(Integer style, Boolean filled)
Set a style to have its end of line filled or not.
style_set_face_name(Integer style, String fontName)
Set the font of a style.
style_set_font(Integer styleNum, Font font)
Set style size, face, bold, italic, and underline attributes from a wxFont’s attributes.
style_set_font_attr(Integer styleNum, Integer size, String faceName,
Boolean bold, Boolean italic, Boolean underline,
FontEncoding encoding=wxFONTENCODING_DEFAULT)
Set all font style attributes at once.
style_set_font_encoding(Integer style, FontEncoding encoding)
Set the font encoding to be used by a style.
style_set_foreground(Integer style, Colour fore)
Set the foreground colour of a style.
style_set_hot_spot(Integer style, Boolean hotspot)
Set a style to be a hotspot or not.
style_set_italic(Integer style, Boolean italic)
Set a style to be italic or not.
style_set_size(Integer style, Integer sizePoints)
Set the size of characters of a style.
style_set_spec(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
style_set_underline(Integer style, Boolean underline)
Set a style to be underlined or not.
style_set_visible(Integer style, Boolean visible)
Set a style to be visible or not.
Colour indicator_get_foreground(Integer indic)
Retrieve the foreground colour of an indicator.
Integer indicator_get_style(Integer indic)
Retrieve the style of an indicator.
indicator_set_foreground(Integer indic, Colour fore)
Set the foreground colour of an indicator.
indicator_set_style(Integer indic, Integer style)
Set an indicator to plain, squiggle or TT.
colourise(Integer start, Integer end)
Colourise a segment of the document using the current lexing language.
Integer get_lexer()
Retrieve the lexing language of the document.
String get_property(String key)
Retrieve a ‘property’ value previously set with SetProperty.
String get_property_expanded(String key)
Retrieve a ‘property’ value previously set with SetProperty, with ’$()’ variable replacement on returned buffer.
Integer get_property_int(String key)
Retrieve a ‘property’ value previously set with SetProperty, interpreted as an int AFTER any ’$()’ variable replacement.
Integer get_style_bits_needed()
Retrieve the number of bits the current lexer needs for styling.
set_key_words(Integer keywordSet, String keyWords)
Set up the key words used by the lexer.
set_lexer(Integer lexer)
Set the lexing language of the document.
set_lexer_language(String language)
Set the lexing language of the document based on string name.
set_property(String key, String value)
Set up a value that may be used by a lexer for some optional feature.
ensure_caret_visible()
Ensure the caret is visible.
Colour get_caret_foreground()
Get the foreground colour of the caret.
Integer get_caret_line_back_alpha()
Get the background alpha of the caret line.
Colour get_caret_line_background()
Get the colour of the background of the line containing the caret.
Boolean get_caret_line_visible()
Is the background of the line containing the caret in a different colour?
Integer get_caret_period()
Get the time in milliseconds that the caret is on and off.
Boolean get_caret_sticky()
Can the caret preferred x position only be changed by explicit movement commands?
Integer get_caret_width()
Returns the width of the insert mode caret.
Integer get_control_char_symbol()
Get the way control characters are displayed.
move_caret_inside_view()
Move the caret inside current view if it’s not there already.
set_caret_foreground(Colour fore)
Set the foreground colour of the caret.
set_caret_line_back_alpha(Integer alpha)
Set background alpha of the caret line.
set_caret_line_background(Colour back)
Set the colour of the background of the line containing the caret.
set_caret_line_visible(Boolean show)
Display the background of the line containing the caret in a different colour.
set_caret_period(Integer periodMilliseconds)
Get the time in milliseconds that the caret is on and off. 0 = steady on.
set_caret_sticky(Boolean useCaretStickyBehaviour)
Stop the caret preferred x position changing when the user types.
set_caret_width(Integer pixelWidth)
Set the width of the insert mode caret.
set_control_char_symbol(Integer symbol)
Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.
toggle_caret_sticky()
Switch between sticky and non-sticky: meant to be bound to a key.
Boolean get_back_space_un_indents()
Does a backspace pressed when caret is within indentation unindent?
Integer get_highlight_guide()
Get the highlighted indentation guide column.
Integer get_indent()
Retrieve indentation size.
Boolean get_indentation_guides()
Are the indentation guides visible?
Integer get_line_indent_position(Integer line)
Retrieve the position before the first non indentation character on a line.
Integer get_line_indentation(Integer line)
Retrieve the number of columns that a line is indented.
Boolean get_tab_indents()
Does a tab pressed when caret is within indentation indent?
Integer get_tab_width()
Retrieve the visible size of a tab.
Boolean get_use_tabs()
Retrieve whether tabs will be used in indentation.
set_back_space_un_indents(Boolean bsUnIndents)
Sets whether a backspace pressed when caret is within indentation unindents.
set_highlight_guide(Integer column)
Set the highlighted indentation guide column. 0 = no highlighted guide.
set_indent(Integer indentSize)
Set the number of spaces used for one level of indentation.
set_indentation_guides(Boolean show)
Show or hide indentation guides.
set_line_indentation(Integer line, Integer indentSize)
Change the indentation of a line to a number of columns.
set_tab_indents(Boolean tabIndents)
Sets whether a tab pressed when caret is within indentation indents.
set_tab_width(Integer tabWidth)
Change the visible size of a tab to be a multiple of the width of a space character.
set_use_tabs(Boolean useTabs)
Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.
Integer marker_add(Integer line, Integer markerNumber)
Add a marker to a line, returning an ID which can be used to find or delete the marker.
marker_add_set(Integer line, Integer set)
Add a set of markers to a line.
marker_define(Integer markerNumber, Integer markerSymbol, Colour foreground, Colour background)
Set the symbol used for a particular marker number, and optionally the fore and background colours.
marker_define_bitmap(Integer markerNumber, Bitmap bmp)
Define a marker from a bitmap
marker_delete(Integer line, Integer markerNumber)
Delete a marker from a line.
marker_delete_all(Integer markerNumber)
Delete all markers with a particular number from all lines.
marker_delete_handle(Integer handle)
Delete a marker.
Integer marker_get(Integer line)
Get a bit mask of all the markers set on a line.
Integer marker_line_from_handle(Integer handle)
Retrieve the line number at which a particular marker is located.
Integer marker_next(Integer lineStart, Integer markerMask)
Find the next line after lineStart that includes a marker in mask.
Integer marker_previous(Integer lineStart, Integer markerMask)
Find the previous line before lineStart that includes a marker in mask.
marker_set_alpha(Integer markerNumber, Integer alpha)
Set the alpha used for a marker that is drawn in the text area, not the margin.
marker_set_background(Integer markerNumber, Colour back)
Set the background colour used for a particular marker number.
marker_set_foreground(Integer markerNumber, Colour fore)
Set the foreground colour used for a particular marker number.
Integer get_margin_left()
Returns the size in pixels of the left margin.
Integer get_margin_mask(Integer margin)
Retrieve the marker mask of a margin.
Integer get_margin_right()
Returns the size in pixels of the right margin.
Boolean get_margin_sensitive(Integer margin)
Retrieve the mouse click sensitivity of a margin.
Integer get_margin_type(Integer margin)
Retrieve the type of a margin.
Integer get_margin_width(Integer margin)
Retrieve the width of a margin in pixels.
set_margin_left(Integer pixelWidth)
Sets the size in pixels of the left margin.
set_margin_mask(Integer margin, Integer mask)
Set a mask that determines which markers are displayed in a margin.
set_margin_right(Integer pixelWidth)
Sets the size in pixels of the right margin.
set_margin_sensitive(Integer margin, Boolean sensitive)
Make a margin sensitive or insensitive to mouse clicks.
set_margin_type(Integer margin, Integer marginType)
Set a margin to be either numeric or symbolic.
set_margin_width(Integer margin, Integer pixelWidth)
Set the width of a margin to a width expressed in pixels.
set_margins(Integer left, Integer right)
Set the left and right margin in the edit area, measured in pixels.
Colour get_edge_colour()
Retrieve the colour used in edge indication.
Integer get_edge_column()
Retrieve the column number which text should be kept within.
Integer get_edge_mode()
Retrieve the edge highlight mode.
set_edge_colour(Colour edgeColour)
Change the colour used in edge indication.
set_edge_column(Integer column)
Set the column number of the edge. If text goes past the edge then it is highlighted.
set_edge_mode(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).
Integer doc_line_from_visible(Integer lineDisplay)
Find the document line of a display line taking hidden lines into account.
ensure_visible(Integer line)
Ensure a particular line is visible by expanding any header line hiding it.
ensure_visible_enforce_policy(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.
Boolean get_fold_expanded(Integer line)
Is a header line expanded?
Integer get_fold_level(Integer line)
Retrieve the fold level of a line.
Integer get_fold_parent(Integer line)
Find the parent line of a child line.
Integer get_last_child(Integer line, Integer level)
Find the last child line of a header line.
Boolean get_line_visible(Integer line)
Is a line visible?
hide_lines(Integer lineStart, Integer lineEnd)
Make a range of lines invisible.
set_fold_expanded(Integer line, Boolean expanded)
Show the children of a header line.
set_fold_flags(Integer flags)
Set some style options for folding.
set_fold_level(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.
set_fold_margin_colour(Boolean useSetting, Colour back)
Set the colours used as a chequerboard pattern in the fold margin
set_fold_margin_hi_colour(Boolean useSetting, Colour fore)
show_lines(Integer lineStart, Integer lineEnd)
Make a range of lines visible.
toggle_fold(Integer line)
Switch a header line between expanded and contracted.
Integer visible_from_doc_line(Integer line)
Find the display line of a document line taking hidden lines into account.
brace_bad_light(Integer pos)
Highlight the character at a position indicating there is no matching brace.
brace_highlight(Integer pos1, Integer pos2)
Highlight the characters at two positions.
Integer brace_match(Integer pos)
Find the position of a matching brace or INVALID_POSITION if no match.
Boolean auto_comp_active()
Is there an auto-completion list visible?
auto_comp_cancel()
Remove the auto-completion list from the screen.
auto_comp_complete()
User has selected an item so remove the list and insert the selection.
Boolean auto_comp_get_auto_hide()
Retrieve whether or not autocompletion is hidden automatically when nothing matches.
Boolean auto_comp_get_cancel_at_start()
Retrieve whether auto-completion cancelled by backspacing before start.
Boolean auto_comp_get_choose_single()
Retrieve whether a single item auto-completion list automatically choose the item.
Integer auto_comp_get_current()
Get currently selected item position in the auto-completion list
Boolean auto_comp_get_drop_rest_of_word()
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
Boolean auto_comp_get_ignore_case()
Retrieve state of ignore case flag.
Integer auto_comp_get_max_height()
Set the maximum height, in rows, of auto-completion and user lists.
Integer auto_comp_get_max_width()
Get the maximum width, in characters, of auto-completion and user lists.
Integer auto_comp_get_separator()
Retrieve the auto-completion list separator character.
Integer auto_comp_get_type_separator()
Retrieve the auto-completion list type-separator character.
Integer auto_comp_pos_start()
Retrieve the position of the caret when the auto-completion list was displayed.
auto_comp_select(String text)
Select the item in the auto-completion list that starts with a string.
auto_comp_set_auto_hide(Boolean autoHide)
Set whether or not autocompletion is hidden automatically when nothing matches.
auto_comp_set_cancel_at_start(Boolean cancel)
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
auto_comp_set_choose_single(Boolean chooseSingle)
Should a single item auto-completion list automatically choose the item.
auto_comp_set_drop_rest_of_word(Boolean dropRestOfWord)
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
auto_comp_set_fill_ups(String characterSet)
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
auto_comp_set_ignore_case(Boolean ignoreCase)
Set whether case is significant when performing auto-completion searches.
auto_comp_set_max_height(Integer rowCount)
Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
auto_comp_set_max_width(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.
auto_comp_set_separator(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.
auto_comp_set_type_separator(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 ’?’.
auto_comp_show(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.
auto_comp_stops(String characterSet)
Define a set of character that when typed cancel the auto-completion list.
clear_registered_images()
Clear all the registered images.
register_image(Integer type, Bitmap bmp)
Register an image for use in autocompletion lists.
user_list_show(Integer listType, String itemList)
Display a list of strings and send notification when user chooses one.
Boolean call_tip_active()
Is there an active call tip?
call_tip_cancel()
Remove the call tip from the screen.
Integer call_tip_pos_at_start()
Retrieve the position where the caret was before displaying the call tip.
call_tip_set_background(Colour back)
Set the background colour for the call tip.
call_tip_set_foreground(Colour fore)
Set the foreground colour for the call tip.
call_tip_set_foreground_highlight(Colour fore)
Set the foreground colour for the highlighted part of the call tip.
call_tip_set_highlight(Integer start, Integer end)
Highlight a segment of the definition.
call_tip_show(Integer pos, String definition)
Show a call tip containing a definition near position pos.
call_tip_use_style(Integer tabSize)
Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
Integer get_view_white_space()
Are white space characters currently visible? Returns one of SCWS_* constants.
Integer get_zoom()
Retrieve the zoom level.
Integer lines_on_screen()
Retrieves the number of lines completely visible.
set_view_white_space(Integer viewWS)
Make white space characters invisible, always visible or visible outside indentation.
set_whitespace_background(Boolean useSetting, Colour back)
Set the background colour of all whitespace and whether to use this setting.
set_whitespace_foreground(Boolean useSetting, Colour fore)
Set the foreground colour of all whitespace and whether to use this setting.
set_zoom(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.
zoom_in()
Magnify the displayed text by increasing the sizes by 1 point.
zoom_out()
Make the displayed text smaller by decreasing the sizes by 1 point.
add_ref_document((arg-type) docPointer)
Extend life of document.
create_document()
Create a new document object. Starts with reference count of 1 and not selected into editor.
get_doc_pointer()
Retrieve a pointer to the document object.
release_document((arg-type) docPointer)
Release a reference to the document, deleting document if it fades to black.
set_doc_pointer((arg-type) docPointer)
Change the document object used.
Boolean auto_comp_active()
Is there an auto-completion list visible?
auto_comp_cancel()
Remove the auto-completion list from the screen.
auto_comp_complete()
User has selected an item so remove the list and insert the selection.
Boolean auto_comp_get_auto_hide()
Retrieve whether or not autocompletion is hidden automatically when nothing matches.
Boolean auto_comp_get_cancel_at_start()
Retrieve whether auto-completion cancelled by backspacing before start.
Boolean auto_comp_get_choose_single()
Retrieve whether a single item auto-completion list automatically choose the item.
Integer auto_comp_get_current()
Get currently selected item position in the auto-completion list
Boolean auto_comp_get_drop_rest_of_word()
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
Boolean auto_comp_get_ignore_case()
Retrieve state of ignore case flag.
Integer auto_comp_get_max_height()
Set the maximum height, in rows, of auto-completion and user lists.
Integer auto_comp_get_max_width()
Get the maximum width, in characters, of auto-completion and user lists.
Integer auto_comp_get_separator()
Retrieve the auto-completion list separator character.
Integer auto_comp_get_type_separator()
Retrieve the auto-completion list type-separator character.
Integer auto_comp_pos_start()
Retrieve the position of the caret when the auto-completion list was displayed.
auto_comp_select(String text)
Select the item in the auto-completion list that starts with a string.
auto_comp_set_auto_hide(Boolean autoHide)
Set whether or not autocompletion is hidden automatically when nothing matches.
auto_comp_set_cancel_at_start(Boolean cancel)
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
auto_comp_set_choose_single(Boolean chooseSingle)
Should a single item auto-completion list automatically choose the item.
auto_comp_set_drop_rest_of_word(Boolean dropRestOfWord)
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
auto_comp_set_fill_ups(String characterSet)
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
auto_comp_set_ignore_case(Boolean ignoreCase)
Set whether case is significant when performing auto-completion searches.
auto_comp_set_max_height(Integer rowCount)
Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
auto_comp_set_max_width(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.
auto_comp_set_separator(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.
auto_comp_set_type_separator(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 ’?’.
auto_comp_show(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.
auto_comp_stops(String characterSet)
Define a set of character that when typed cancel the auto-completion list.
clear_registered_images()
Clear all the registered images.
register_image(Integer type, Bitmap bmp)
Register an image for use in autocompletion lists.
user_list_show(Integer listType, String itemList)
Display a list of strings and send notification when user chooses one.
Boolean call_tip_active()
Is there an active call tip?
call_tip_cancel()
Remove the call tip from the screen.
Integer call_tip_pos_at_start()
Retrieve the position where the caret was before displaying the call tip.
call_tip_set_background(Colour back)
Set the background colour for the call tip.
call_tip_set_foreground(Colour fore)
Set the foreground colour for the call tip.
call_tip_set_foreground_highlight(Colour fore)
Set the foreground colour f