]>
git.saurik.com Git - wxWidgets.git/blob - interface/stc/stc.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxStyledTextEvent
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxStyledTextEvent
11 @headerfile stc.h wx/stc/stc.h
13 The type of events sent from wxStyledTextCtrl.
20 class wxStyledTextEvent
: public wxCommandEvent
27 wxStyledTextEvent(wxEventType commandType
= 0, int id
= 0);
28 wxStyledTextEvent(const wxStyledTextEvent
& event
);
34 wxEvent
* Clone() const;
44 bool GetControl() const;
49 bool GetDragAllowMove();
54 wxDragResult
GetDragResult();
59 wxString
GetDragText();
64 int GetFoldLevelNow() const;
69 int GetFoldLevelPrev() const;
79 int GetLParam() const;
84 int GetLength() const;
94 int GetLinesAdded() const;
99 int GetListType() const;
104 int GetMargin() const;
109 int GetMessage() const;
114 int GetModificationType() const;
119 int GetModifiers() const;
124 int GetPosition() const;
129 bool GetShift() const;
134 wxString
GetText() const;
139 int GetWParam() const;
154 void SetDragAllowMove(bool val
);
159 void SetDragResult(wxDragResult val
);
164 void SetDragText(const wxString
& val
);
169 void SetFoldLevelNow(int val
);
174 void SetFoldLevelPrev(int val
);
184 void SetLParam(int val
);
189 void SetLength(int len
);
194 void SetLine(int val
);
199 void SetLinesAdded(int num
);
204 void SetListType(int val
);
209 void SetMargin(int val
);
214 void SetMessage(int val
);
219 void SetModificationType(int t
);
224 void SetModifiers(int m
);
229 void SetPosition(int pos
);
234 void SetText(const wxString
& t
);
239 void SetWParam(int val
);
255 @class wxStyledTextCtrl
256 @headerfile stc.h wx/stc/stc.h
258 A wxWidgets implementation of the Scintilla source code editing component.
260 As well as features found in standard text editing components, Scintilla
262 features especially useful when editing and debugging source code. These
264 support for syntax styling, error indicators, code completion and call tips.
266 selection margin can contain markers like those used in debuggers to indicate
267 breakpoints and the current line. Styling choices are more open than with many
268 editors, allowing the use of proportional fonts, bold and italics, multiple
269 foreground and background colours and multiple fonts.
271 wxStyledTextCtrl is a 1 to 1 mapping of "raw" scintilla interface, whose
273 can be found in the Scintilla website.
278 @see wxStyledTextEvent
280 class wxStyledTextCtrl
: public wxControl
286 wxStyledTextCtrl::wxStyledTextCtrl(wxWindow
* parent
,
287 wxWindowID id
= wxID_ANY
,
288 const wxPoint pos
= wxDefaultPosition
,
289 const wxSize size
= wxDefaultSize
,
291 const wxString name
= "stcwindow");
294 Extend life of document.
296 void AddRefDocument(void* docPointer
);
299 Add array of cells to document.
301 void AddStyledText(const wxMemoryBuffer
& data
);
304 BEGIN generated section. The following code is automatically generated
305 by gen_iface.py. Do not edit this file. Edit stc.h.in instead
307 Add text to the document at current position.
309 void AddText(const wxString
& text
);
312 The following methods are nearly equivallent to their similarly named
313 cousins above. The difference is that these methods bypass wxString
314 and always use a char* even if used in a unicode build of wxWidgets.
315 In that case the character data will be utf-8 encoded since that is
316 what is used internally by Scintilla in unicode builds.
317 Add text to the document at current position.
319 void AddTextRaw(const char* text
);
322 Enlarge the document to a particular size of text bytes.
324 void Allocate(int bytes
);
327 Append a string to the end of the document without changing the selection.
329 void AppendText(const wxString
& text
);
332 Append a string to the end of the document without changing the selection.
334 void AppendTextRaw(const char* text
);
337 Is there an auto-completion list visible?
339 bool AutoCompActive();
342 Remove the auto-completion list from the screen.
344 void AutoCompCancel();
347 User has selected an item so remove the list and insert the selection.
349 void AutoCompComplete();
352 Retrieve whether or not autocompletion is hidden automatically when nothing
355 bool AutoCompGetAutoHide();
358 Retrieve whether auto-completion cancelled by backspacing before start.
360 bool AutoCompGetCancelAtStart();
363 Retrieve whether a single item auto-completion list automatically choose the
366 bool AutoCompGetChooseSingle();
369 Get currently selected item position in the auto-completion list
371 int AutoCompGetCurrent();
374 Retrieve whether or not autocompletion deletes any word characters
375 after the inserted text upon completion.
377 bool AutoCompGetDropRestOfWord();
380 Retrieve state of ignore case flag.
382 bool AutoCompGetIgnoreCase();
385 Set the maximum height, in rows, of auto-completion and user lists.
387 int AutoCompGetMaxHeight();
390 Get the maximum width, in characters, of auto-completion and user lists.
392 int AutoCompGetMaxWidth();
395 Retrieve the auto-completion list separator character.
397 int AutoCompGetSeparator();
400 Retrieve the auto-completion list type-separator character.
402 int AutoCompGetTypeSeparator();
405 Retrieve the position of the caret when the auto-completion list was displayed.
407 int AutoCompPosStart();
410 Select the item in the auto-completion list that starts with a string.
412 void AutoCompSelect(const wxString
& text
);
415 Set whether or not autocompletion is hidden automatically when nothing matches.
417 void AutoCompSetAutoHide(bool autoHide
);
420 Should the auto-completion list be cancelled if the user backspaces to a
421 position before where the box was created.
423 void AutoCompSetCancelAtStart(bool cancel
);
426 Should a single item auto-completion list automatically choose the item.
428 void AutoCompSetChooseSingle(bool chooseSingle
);
431 Set whether or not autocompletion deletes any word characters
432 after the inserted text upon completion.
434 void AutoCompSetDropRestOfWord(bool dropRestOfWord
);
437 Define a set of characters that when typed will cause the autocompletion to
438 choose the selected item.
440 void AutoCompSetFillUps(const wxString
& characterSet
);
443 Set whether case is significant when performing auto-completion searches.
445 void AutoCompSetIgnoreCase(bool ignoreCase
);
448 Set the maximum height, in rows, of auto-completion and user lists.
449 The default is 5 rows.
451 void AutoCompSetMaxHeight(int rowCount
);
454 Set the maximum width, in characters, of auto-completion and user lists.
455 Set to 0 to autosize to fit longest item, which is the default.
457 void AutoCompSetMaxWidth(int characterCount
);
460 Change the separator character in the string setting up an auto-completion list.
461 Default is space but can be changed if items contain space.
463 void AutoCompSetSeparator(int separatorCharacter
);
466 Change the type-separator character in the string setting up an auto-completion
468 Default is '?' but can be changed if items contain '?'.
470 void AutoCompSetTypeSeparator(int separatorCharacter
);
473 Display a auto-completion list.
474 The lenEntered parameter indicates how many characters before
475 the caret should be used to provide context.
477 void AutoCompShow(int lenEntered
, const wxString
& itemList
);
480 Define a set of character that when typed cancel the auto-completion list.
482 void AutoCompStops(const wxString
& characterSet
);
485 Dedent the selected lines.
490 Start a sequence of actions that is undone and redone as a unit.
493 void BeginUndoAction();
496 Highlight the character at a position indicating there is no matching brace.
498 void BraceBadLight(int pos
);
501 Highlight the characters at two positions.
503 void BraceHighlight(int pos1
, int pos2
);
506 Find the position of a matching brace or INVALID_POSITION if no match.
508 int BraceMatch(int pos
);
511 Is there an active call tip?
513 bool CallTipActive();
516 Remove the call tip from the screen.
518 void CallTipCancel();
521 Retrieve the position where the caret was before displaying the call tip.
523 int CallTipPosAtStart();
526 Set the background colour for the call tip.
528 void CallTipSetBackground(const wxColour
& back
);
531 Set the foreground colour for the call tip.
533 void CallTipSetForeground(const wxColour
& fore
);
536 Set the foreground colour for the highlighted part of the call tip.
538 void CallTipSetForegroundHighlight(const wxColour
& fore
);
541 Highlight a segment of the definition.
543 void CallTipSetHighlight(int start
, int end
);
546 Show a call tip containing a definition near position pos.
548 void CallTipShow(int pos
, const wxString
& definition
);
551 Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
553 void CallTipUseStyle(int tabSize
);
556 Will a paste succeed?
561 Are there any redoable actions in the undo history?
566 Are there any undoable actions in the undo history?
571 Cancel any modes such as call tip or auto-completion list display.
576 Move caret left one character.
581 Move caret left one character extending selection to new caret position.
583 void CharLeftExtend();
586 Move caret left one character, extending rectangular selection to new caret
589 void CharLeftRectExtend();
592 Move caret right one character.
597 Move caret right one character extending selection to new caret position.
599 void CharRightExtend();
602 Move caret right one character, extending rectangular selection to new caret
605 void CharRightRectExtend();
608 Set the last x chosen value to be the caret x position.
618 Delete all text in the document.
623 Set all style bytes to 0, remove all folding information.
625 void ClearDocumentStyle();
628 Clear all the registered images.
630 void ClearRegisteredImages();
633 When key+modifier combination km is pressed perform msg.
635 void CmdKeyAssign(int key
, int modifiers
, int cmd
);
638 When key+modifier combination km is pressed do nothing.
640 void CmdKeyClear(int key
, int modifiers
);
643 Drop all key mappings.
645 void CmdKeyClearAll();
648 Perform one of the operations defined by the wxSTC_CMD_* constants.
650 void CmdKeyExecute(int cmd
);
653 Colourise a segment of the document using the current lexing language.
655 void Colourise(int start
, int end
);
658 Convert all line endings in the document to one mode.
660 void ConvertEOLs(int eolMode
);
663 Copy the selection to the clipboard.
668 Copy a range of text to the clipboard. Positions are clipped into the document.
670 void CopyRange(int start
, int end
);
673 Copy argument text to the clipboard.
675 void CopyText(int length
, const wxString
& text
);
680 bool Create(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
681 const wxPoint
& pos
= wxDefaultPosition
,
682 const wxSize
& size
= wxDefaultSize
,
684 const wxString
& name
= wxSTCNameStr
);
687 Create a new document object.
688 Starts with reference count of 1 and not selected into editor.
690 void* CreateDocument();
693 Cut the selection to the clipboard.
698 Delete back from the current position to the start of the line.
703 Delete forwards from the current position to the end of the line.
708 Delete the word to the left of the caret.
713 Delete the word to the right of the caret.
718 Delete the selection or if no selection, the character before the caret.
723 Delete the selection or if no selection, the character before the caret.
724 Will not delete the character before at the start of a line.
726 void DeleteBackNotLine();
729 Allow for simulating a DnD DragOver
731 wxDragResult
DoDragOver(wxCoord x
, wxCoord y
, wxDragResult def
);
734 Allow for simulating a DnD DropText
736 bool DoDropText(long x
, long y
, const wxString
& data
);
739 Find the document line of a display line taking hidden lines into account.
741 int DocLineFromVisible(int lineDisplay
);
744 Move caret to last position in document.
749 Move caret to last position in document extending selection to new caret
752 void DocumentEndExtend();
755 Move caret to first position in document.
757 void DocumentStart();
760 Move caret to first position in document extending selection to new caret
763 void DocumentStartExtend();
766 Switch from insert to overtype mode or the reverse.
768 void EditToggleOvertype();
771 Delete the undo history.
773 void EmptyUndoBuffer();
776 End a sequence of actions that is undone and redone as a unit.
778 void EndUndoAction();
781 Ensure the caret is visible.
783 void EnsureCaretVisible();
786 Ensure a particular line is visible by expanding any header line hiding it.
788 void EnsureVisible(int line
);
791 Ensure a particular line is visible by expanding any header line hiding it.
792 Use the currently set visibility policy to determine which range to display.
794 void EnsureVisibleEnforcePolicy(int line
);
797 Find the position of a column on a line taking into account tabs and
798 multi-byte characters. If beyond end of line, return line end position.
800 int FindColumn(int line
, int column
);
803 Find some text in the document.
805 int FindText(int minPos
, int maxPos
, const wxString
& text
,
809 Insert a Form Feed character.
814 On Windows, will draw the document into a display context such as a printer.
816 int FormatRange(bool doDraw
, int startPos
, int endPos
,
817 wxDC
* draw
, wxDC
* target
,
822 Returns the position of the opposite end of the selection to the caret.
827 Does a backspace pressed when caret is within indentation unindent?
829 bool GetBackSpaceUnIndents();
832 Is drawing done first into a buffer or direct to the screen?
834 bool GetBufferedDraw();
837 Get the foreground colour of the caret.
839 wxColour
GetCaretForeground();
842 Get the background alpha of the caret line.
844 int GetCaretLineBackAlpha();
847 Get the colour of the background of the line containing the caret.
849 wxColour
GetCaretLineBackground();
852 Is the background of the line containing the caret in a different colour?
854 bool GetCaretLineVisible();
857 Get the time in milliseconds that the caret is on and off.
859 int GetCaretPeriod();
862 Can the caret preferred x position only be changed by explicit movement
865 bool GetCaretSticky();
868 Returns the width of the insert mode caret.
873 Returns the character byte at the position.
875 int GetCharAt(int pos
);
878 Get the code page used to interpret the bytes of the document as characters.
883 Retrieve the column number of a position, taking tab width into account.
885 int GetColumn(int pos
);
888 Get the way control characters are displayed.
890 int GetControlCharSymbol();
895 wxString
GetCurLine(int* OUTPUT
);
900 wxCharBuffer
GetCurLineRaw(int* OUTPUT
);
903 END of generated section
905 Returns the line number of the line with the caret.
907 int GetCurrentLine();
910 Returns the position of the caret.
915 Retrieve a pointer to the document object.
917 void* GetDocPointer();
920 Retrieve the current end of line mode - one of CRLF, CR, or LF.
925 Retrieve the colour used in edge indication.
927 wxColour
GetEdgeColour();
930 Retrieve the column number which text should be kept within.
935 Retrieve the edge highlight mode.
940 Retrieve whether the maximum scroll position has the last
941 line at the bottom of the view.
943 bool GetEndAtLastLine();
946 Retrieve the position of the last correctly styled character.
951 Retrieve the display line at the top of the display.
953 int GetFirstVisibleLine();
956 Is a header line expanded?
958 bool GetFoldExpanded(int line
);
961 Retrieve the fold level of a line.
963 int GetFoldLevel(int line
);
966 Find the parent line of a child line.
968 int GetFoldParent(int line
);
971 Get the highlighted indentation guide column.
973 int GetHighlightGuide();
976 Retrieve indentation size.
981 Are the indentation guides visible?
983 bool GetIndentationGuides();
986 Find the last child line of a header line.
988 int GetLastChild(int line
, int level
);
991 Can be used to prevent the EVT_CHAR handler from adding the char
993 bool GetLastKeydownProcessed();
996 Retrieve the degree of caching of layout information.
998 int GetLayoutCache();
1001 Returns the number of characters in the document.
1006 Retrieve the lexing language of the document.
1011 Retrieve the contents of a line.
1013 wxString
GetLine(int line
);
1016 Returns the number of lines in the document. There is always at least one.
1021 Get the position after the last visible characters on a line.
1023 int GetLineEndPosition(int line
);
1026 Retrieve the position before the first non indentation character on a line.
1028 int GetLineIndentPosition(int line
);
1031 Retrieve the number of columns that a line is indented.
1033 int GetLineIndentation(int line
);
1036 Retrieve the contents of a line.
1038 wxCharBuffer
GetLineRaw(int line
);
1041 Retrieve the position of the end of the selection at the given line
1042 (INVALID_POSITION if no selection on this line).
1044 int GetLineSelEndPosition(int line
);
1047 Retrieve the position of the start of the selection at the given line
1048 (INVALID_POSITION if no selection on this line).
1050 int GetLineSelStartPosition(int line
);
1053 Retrieve the extra styling information for a line.
1055 int GetLineState(int line
);
1060 bool GetLineVisible(int line
);
1063 Returns the size in pixels of the left margin.
1065 int GetMarginLeft();
1068 Retrieve the marker mask of a margin.
1070 int GetMarginMask(int margin
);
1073 Returns the size in pixels of the right margin.
1075 int GetMarginRight();
1078 Retrieve the mouse click sensitivity of a margin.
1080 bool GetMarginSensitive(int margin
);
1083 Retrieve the type of a margin.
1085 int GetMarginType(int margin
);
1088 Retrieve the width of a margin in pixels.
1090 int GetMarginWidth(int margin
);
1093 Retrieve the last line number that has line state.
1095 int GetMaxLineState();
1098 Get which document modification events are sent to the container.
1100 int GetModEventMask();
1103 Is the document different from when it was last saved?
1108 Get whether mouse gets captured.
1110 bool GetMouseDownCaptures();
1113 Retrieve the time the mouse must sit still to generate a mouse dwell event.
1115 int GetMouseDwellTime();
1118 Returns @true if overtype mode is active otherwise @false is returned.
1123 Get convert-on-paste setting
1125 bool GetPasteConvertEndings();
1128 Returns the print colour mode.
1130 int GetPrintColourMode();
1133 Returns the print magnification.
1135 int GetPrintMagnification();
1138 Is printing line wrapped?
1140 int GetPrintWrapMode();
1143 Retrieve a 'property' value previously set with SetProperty.
1145 wxString
GetProperty(const wxString
& key
);
1148 Retrieve a 'property' value previously set with SetProperty,
1149 with '$()' variable replacement on returned buffer.
1151 wxString
GetPropertyExpanded(const wxString
& key
);
1154 Retrieve a 'property' value previously set with SetProperty,
1155 interpreted as an int AFTER any '$()' variable replacement.
1157 int GetPropertyInt(const wxString
& key
);
1170 Get internal focus flag.
1175 Retrieve the document width assumed for scrolling.
1177 int GetScrollWidth();
1180 Get the search flags used by SearchInTarget.
1182 int GetSearchFlags();
1185 Get the alpha of the selection.
1190 Retrieve the selected text.
1192 wxString
GetSelectedText();
1195 Retrieve the selected text.
1197 wxCharBuffer
GetSelectedTextRaw();
1202 void GetSelection(int* OUTPUT
, int* OUTPUT
);
1205 Returns the position at the end of the selection.
1207 int GetSelectionEnd();
1210 Get the mode of the current selection.
1212 int GetSelectionMode();
1215 Returns the position at the start of the selection.
1217 int GetSelectionStart();
1225 Returns the style byte at the position.
1227 int GetStyleAt(int pos
);
1230 Retrieve number of bits in style bytes used to hold the lexical state.
1235 Retrieve the number of bits the current lexer needs for styling.
1237 int GetStyleBitsNeeded();
1240 Retrieve a buffer of cells.
1242 wxMemoryBuffer
GetStyledText(int startPos
, int endPos
);
1245 Does a tab pressed when caret is within indentation indent?
1247 bool GetTabIndents();
1250 Retrieve the visible size of a tab.
1255 Get the position that ends the target.
1260 Get the position that starts the target.
1262 int GetTargetStart();
1265 Retrieve all the text in the document.
1270 Retrieve the number of characters in the document.
1272 int GetTextLength();
1275 Retrieve a range of text.
1277 wxString
GetTextRange(int startPos
, int endPos
);
1280 Retrieve a range of text.
1282 wxCharBuffer
GetTextRangeRaw(int startPos
, int endPos
);
1285 Retrieve all the text in the document.
1287 wxCharBuffer
GetTextRaw();
1290 Is drawing done in two phases with backgrounds drawn before foregrounds?
1292 bool GetTwoPhaseDraw();
1295 Is undo history being collected?
1297 bool GetUndoCollection();
1300 Returns the current UseAntiAliasing setting.
1302 bool GetUseAntiAliasing();
1305 Is the horizontal scroll bar visible?
1307 bool GetUseHorizontalScrollBar();
1310 Retrieve whether tabs will be used in indentation.
1315 Is the vertical scroll bar visible?
1317 bool GetUseVerticalScrollBar();
1320 Are the end of line characters visible?
1325 Are white space characters currently visible?
1326 Returns one of SCWS_* constants.
1328 int GetViewWhiteSpace();
1331 Retrieve whether text is word wrapped.
1336 Retrive the start indent for wrapped lines.
1338 int GetWrapStartIndent();
1341 Retrive the display mode of visual flags for wrapped lines.
1343 int GetWrapVisualFlags();
1346 Retrive the location of visual flags for wrapped lines.
1348 int GetWrapVisualFlagsLocation();
1356 Retrieve the zoom level.
1361 Set caret to start of a line and ensure it is visible.
1363 void GotoLine(int line
);
1366 Set caret to a position and ensure it is visible.
1368 void GotoPos(int pos
);
1371 Make a range of lines invisible.
1373 void HideLines(int lineStart
, int lineEnd
);
1376 Draw the selection in normal style or with selection highlighted.
1378 void HideSelection(bool normal
);
1381 Move caret to first position on line.
1386 Move caret to first position on display line.
1391 Move caret to first position on display line extending selection to
1394 void HomeDisplayExtend();
1397 Move caret to first position on line extending selection to new caret position.
1402 Move caret to first position on line, extending rectangular selection to new
1405 void HomeRectExtend();
1408 These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
1409 except they behave differently when word-wrap is enabled:
1410 They go first to the start / end of the display line, like (Home|LineEnd)Display
1411 The difference is that, the cursor is already at the point, it goes on to the
1413 or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
1420 void HomeWrapExtend();
1423 Retrieve the foreground colour of an indicator.
1425 wxColour
IndicatorGetForeground(int indic
);
1428 Retrieve the style of an indicator.
1430 int IndicatorGetStyle(int indic
);
1433 Set the foreground colour of an indicator.
1435 void IndicatorSetForeground(int indic
, const wxColour
& fore
);
1438 Set an indicator to plain, squiggle or TT.
1440 void IndicatorSetStyle(int indic
, int style
);
1443 Insert string at a position.
1445 void InsertText(int pos
, const wxString
& text
);
1448 Insert string at a position.
1450 void InsertTextRaw(int pos
, const char* text
);
1453 Copy the line containing the caret.
1458 Cut the line containing the caret.
1463 Delete the line containing the caret.
1468 Move caret down one line.
1473 Move caret down one line extending selection to new caret position.
1475 void LineDownExtend();
1478 Move caret down one line, extending rectangular selection to new caret position.
1480 void LineDownRectExtend();
1483 Duplicate the current line.
1485 void LineDuplicate();
1488 Move caret to last position on line.
1493 Move caret to last position on display line.
1495 void LineEndDisplay();
1498 Move caret to last position on display line extending selection to new
1501 void LineEndDisplayExtend();
1504 Move caret to last position on line extending selection to new caret position.
1506 void LineEndExtend();
1509 Move caret to last position on line, extending rectangular selection to new
1512 void LineEndRectExtend();
1522 void LineEndWrapExtend();
1525 Retrieve the line containing a position.
1527 int LineFromPosition(int pos
);
1530 How many characters are on a line, not including end of line characters?
1532 int LineLength(int line
);
1535 Scroll horizontally and vertically.
1537 void LineScroll(int columns
, int lines
);
1540 Scroll the document down, keeping the caret visible.
1542 void LineScrollDown();
1545 Scroll the document up, keeping the caret visible.
1547 void LineScrollUp();
1550 Switch the current line with the previous.
1552 void LineTranspose();
1555 Move caret up one line.
1560 Move caret up one line extending selection to new caret position.
1562 void LineUpExtend();
1565 Move caret up one line, extending rectangular selection to new caret position.
1567 void LineUpRectExtend();
1570 Join the lines in the target.
1575 Retrieves the number of lines completely visible.
1577 int LinesOnScreen();
1580 Split the lines in the target into lines that are less wide than pixelWidth
1583 void LinesSplit(int pixelWidth
);
1586 Load the contents of filename into the editor
1588 bool LoadFile(const wxString
& filename
);
1591 Transform the selection to lower case.
1596 Add a marker to a line, returning an ID which can be used to find or delete the
1599 int MarkerAdd(int line
, int markerNumber
);
1602 Add a set of markers to a line.
1604 void MarkerAddSet(int line
, int set
);
1607 Set the symbol used for a particular marker number,
1608 and optionally the fore and background colours.
1610 void MarkerDefine(int markerNumber
, int markerSymbol
,
1611 const wxColour
& foreground
= wxNullColour
,
1612 const wxColour
& background
= wxNullColour
);
1615 Define a marker from a bitmap
1617 void MarkerDefineBitmap(int markerNumber
, const wxBitmap
& bmp
);
1620 Delete a marker from a line.
1622 void MarkerDelete(int line
, int markerNumber
);
1625 Delete all markers with a particular number from all lines.
1627 void MarkerDeleteAll(int markerNumber
);
1632 void MarkerDeleteHandle(int handle
);
1635 Get a bit mask of all the markers set on a line.
1637 int MarkerGet(int line
);
1640 Retrieve the line number at which a particular marker is located.
1642 int MarkerLineFromHandle(int handle
);
1645 Find the next line after lineStart that includes a marker in mask.
1647 int MarkerNext(int lineStart
, int markerMask
);
1650 Find the previous line before lineStart that includes a marker in mask.
1652 int MarkerPrevious(int lineStart
, int markerMask
);
1655 Set the alpha used for a marker that is drawn in the text area, not the margin.
1657 void MarkerSetAlpha(int markerNumber
, int alpha
);
1660 Set the background colour used for a particular marker number.
1662 void MarkerSetBackground(int markerNumber
, const wxColour
& back
);
1665 Set the foreground colour used for a particular marker number.
1667 void MarkerSetForeground(int markerNumber
, const wxColour
& fore
);
1670 Move the caret inside current view if it's not there already.
1672 void MoveCaretInsideView();
1675 Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
1680 Move caret one page down.
1685 Move caret one page down extending selection to new caret position.
1687 void PageDownExtend();
1690 Move caret one page down, extending rectangular selection to new caret position.
1692 void PageDownRectExtend();
1695 Move caret one page up.
1700 Move caret one page up extending selection to new caret position.
1702 void PageUpExtend();
1705 Move caret one page up, extending rectangular selection to new caret position.
1707 void PageUpRectExtend();
1710 Move caret between paragraphs (delimited by empty lines).
1717 void ParaDownExtend();
1727 void ParaUpExtend();
1730 Paste the contents of the clipboard into the document replacing the selection.
1735 Retrieve the point in the window where a position is displayed.
1737 wxPoint
PointFromPosition(int pos
);
1740 Given a valid document position, return the next position taking code
1741 page into account. Maximum value returned is the last position in the document.
1743 int PositionAfter(int pos
);
1746 Given a valid document position, return the previous position taking code
1747 page into account. Returns 0 if passed 0.
1749 int PositionBefore(int pos
);
1752 Retrieve the position at the start of a line.
1754 int PositionFromLine(int line
);
1757 Find the position from a point within the window.
1759 int PositionFromPoint(wxPoint pt
);
1762 Find the position from a point within the window but return
1763 INVALID_POSITION if not close to text.
1765 int PositionFromPointClose(int x
, int y
);
1768 Redoes the next action on the undo history.
1773 Register an image for use in autocompletion lists.
1775 void RegisterImage(int type
, const wxBitmap
& bmp
);
1778 Release a reference to the document, deleting document if it fades to black.
1780 void ReleaseDocument(void* docPointer
);
1783 Replace the selected text with the argument text.
1785 void ReplaceSelection(const wxString
& text
);
1788 Replace the target text with the argument text.
1789 Text is counted so it can contain NULs.
1790 Returns the length of the replacement text.
1792 int ReplaceTarget(const wxString
& text
);
1795 Replace the target text with the argument text after
1797 Text is counted so it can contain NULs.
1799 d where d is between 1 and 9 and replaces these with the strings
1800 matched in the last search operation which were surrounded by
1803 Returns the length of the replacement text including any change
1804 caused by processing the
1807 int ReplaceTargetRE(const wxString
& text
);
1810 Write the contents of the editor to filename
1812 bool SaveFile(const wxString
& filename
);
1815 Scroll enough to make the given column visible
1817 void ScrollToColumn(int column
);
1820 Scroll enough to make the given line visible
1822 void ScrollToLine(int line
);
1825 Sets the current caret position to be the search anchor.
1827 void SearchAnchor();
1830 Search for a counted string in the target and set the target to the found
1831 range. Text is counted so it can contain NULs.
1832 Returns length of range or -1 for failure in which case target is not moved.
1834 int SearchInTarget(const wxString
& text
);
1837 Find some text starting at the search anchor.
1838 Does not ensure the selection is visible.
1840 int SearchNext(int flags
, const wxString
& text
);
1843 Find some text starting at the search anchor and moving backwards.
1844 Does not ensure the selection is visible.
1846 int SearchPrev(int flags
, const wxString
& text
);
1849 Select all the text in the document.
1854 Duplicate the selection. If selection empty duplicate the line containing the
1857 void SelectionDuplicate();
1860 Is the selection rectangular? The alternative is the more common stream
1863 bool SelectionIsRectangle();
1866 Send a message to Scintilla
1868 long SendMsg(int msg
, long wp
= 0, long lp
= 0);
1871 Set the selection anchor to a position. The anchor is the opposite
1872 end of the selection from the caret.
1874 void SetAnchor(int posAnchor
);
1877 Sets whether a backspace pressed when caret is within indentation unindents.
1879 void SetBackSpaceUnIndents(bool bsUnIndents
);
1882 If drawing is buffered then each line of text is drawn into a bitmap buffer
1883 before drawing it to the screen to avoid flicker.
1885 void SetBufferedDraw(bool buffered
);
1888 Set the foreground colour of the caret.
1890 void SetCaretForeground(const wxColour
& fore
);
1893 Set background alpha of the caret line.
1895 void SetCaretLineBackAlpha(int alpha
);
1898 Set the colour of the background of the line containing the caret.
1900 void SetCaretLineBackground(const wxColour
& back
);
1903 Display the background of the line containing the caret in a different colour.
1905 void SetCaretLineVisible(bool show
);
1908 Get the time in milliseconds that the caret is on and off. 0 = steady on.
1910 void SetCaretPeriod(int periodMilliseconds
);
1913 Stop the caret preferred x position changing when the user types.
1915 void SetCaretSticky(bool useCaretStickyBehaviour
);
1918 Set the width of the insert mode caret.
1920 void SetCaretWidth(int pixelWidth
);
1923 Reset the set of characters for whitespace and word characters to the defaults.
1925 void SetCharsDefault();
1928 Set the code page used to interpret the bytes of the document as characters.
1930 void SetCodePage(int codePage
);
1933 Change the way control characters are displayed:
1934 If symbol is 32, keep the drawn way, else, use the given character.
1936 void SetControlCharSymbol(int symbol
);
1939 Sets the position of the caret.
1941 void SetCurrentPos(int pos
);
1944 Change the document object used.
1946 void SetDocPointer(void* docPointer
);
1949 Set the current end of line mode.
1951 void SetEOLMode(int eolMode
);
1954 Change the colour used in edge indication.
1956 void SetEdgeColour(const wxColour
& edgeColour
);
1959 Set the column number of the edge.
1960 If text goes past the edge then it is highlighted.
1962 void SetEdgeColumn(int column
);
1965 The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1966 goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1968 void SetEdgeMode(int mode
);
1971 Sets the scroll range so that maximum scroll position has
1972 the last line at the bottom of the view (default).
1973 Setting this to @false allows scrolling one page below the last line.
1975 void SetEndAtLastLine(bool endAtLastLine
);
1978 Show the children of a header line.
1980 void SetFoldExpanded(int line
, bool expanded
);
1983 Set some style options for folding.
1985 void SetFoldFlags(int flags
);
1988 Set the fold level of a line.
1989 This encodes an integer level along with flags indicating whether the
1990 line is a header and whether it is effectively white space.
1992 void SetFoldLevel(int line
, int level
);
1995 Set the colours used as a chequerboard pattern in the fold margin
1997 void SetFoldMarginColour(bool useSetting
, const wxColour
& back
);
2002 void SetFoldMarginHiColour(bool useSetting
, const wxColour
& fore
);
2005 Set the horizontal scrollbar to use instead of the ont that's built-in.
2007 void SetHScrollBar(wxScrollBar
* bar
);
2010 Set the highlighted indentation guide column.
2011 0 = no highlighted guide.
2013 void SetHighlightGuide(int column
);
2016 Set a back colour for active hotspots.
2018 void SetHotspotActiveBackground(bool useSetting
,
2019 const wxColour
& back
);
2022 Set a fore colour for active hotspots.
2024 void SetHotspotActiveForeground(bool useSetting
,
2025 const wxColour
& fore
);
2028 Enable / Disable underlining active hotspots.
2030 void SetHotspotActiveUnderline(bool underline
);
2033 Limit hotspots to single line so hotspots on two lines don't merge.
2035 void SetHotspotSingleLine(bool singleLine
);
2038 Set the number of spaces used for one level of indentation.
2040 void SetIndent(int indentSize
);
2043 Show or hide indentation guides.
2045 void SetIndentationGuides(bool show
);
2048 Set up the key words used by the lexer.
2050 void SetKeyWords(int keywordSet
, const wxString
& keyWords
);
2055 void SetLastKeydownProcessed(bool val
);
2058 Sets the degree of caching of layout information.
2060 void SetLayoutCache(int mode
);
2063 Set the lexing language of the document.
2065 void SetLexer(int lexer
);
2068 Set the lexing language of the document based on string name.
2070 void SetLexerLanguage(const wxString
& language
);
2073 Change the indentation of a line to a number of columns.
2075 void SetLineIndentation(int line
, int indentSize
);
2078 Used to hold extra styling information for each line.
2080 void SetLineState(int line
, int state
);
2083 Sets the size in pixels of the left margin.
2085 void SetMarginLeft(int pixelWidth
);
2088 Set a mask that determines which markers are displayed in a margin.
2090 void SetMarginMask(int margin
, int mask
);
2093 Sets the size in pixels of the right margin.
2095 void SetMarginRight(int pixelWidth
);
2098 Make a margin sensitive or insensitive to mouse clicks.
2100 void SetMarginSensitive(int margin
, bool sensitive
);
2103 Set a margin to be either numeric or symbolic.
2105 void SetMarginType(int margin
, int marginType
);
2108 Set the width of a margin to a width expressed in pixels.
2110 void SetMarginWidth(int margin
, int pixelWidth
);
2113 Set the left and right margin in the edit area, measured in pixels.
2115 void SetMargins(int left
, int right
);
2118 Set which document modification events are sent to the container.
2120 void SetModEventMask(int mask
);
2123 Set whether the mouse is captured when its button is pressed.
2125 void SetMouseDownCaptures(bool captures
);
2128 Sets the time the mouse must sit still to generate a mouse dwell event.
2130 void SetMouseDwellTime(int periodMilliseconds
);
2133 Set to overtype (@true) or insert mode.
2135 void SetOvertype(bool overtype
);
2138 Enable/Disable convert-on-paste for line endings
2140 void SetPasteConvertEndings(bool convert
);
2143 Modify colours when printing for clearer printed text.
2145 void SetPrintColourMode(int mode
);
2148 Sets the print magnification added to the point size of each style for printing.
2150 void SetPrintMagnification(int magnification
);
2153 Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
2155 void SetPrintWrapMode(int mode
);
2158 Set up a value that may be used by a lexer for some optional feature.
2160 void SetProperty(const wxString
& key
, const wxString
& value
);
2163 Set to read only or read write.
2165 void SetReadOnly(bool readOnly
);
2168 Sets the cursor to one of the SC_CURSOR* values.
2170 void SetSTCCursor(int cursorType
);
2173 Change internal focus flag.
2175 void SetSTCFocus(bool focus
);
2178 Remember the current position in the undo history as the position
2179 at which the document was saved.
2181 void SetSavePoint();
2184 Sets the document width assumed for scrolling.
2186 void SetScrollWidth(int pixelWidth
);
2189 Set the search flags used by SearchInTarget.
2191 void SetSearchFlags(int flags
);
2194 Set the alpha of the selection.
2196 void SetSelAlpha(int alpha
);
2199 Set the background colour of the selection and whether to use this setting.
2201 void SetSelBackground(bool useSetting
, const wxColour
& back
);
2204 Set the foreground colour of the selection and whether to use this setting.
2206 void SetSelForeground(bool useSetting
, const wxColour
& fore
);
2209 Select a range of text.
2211 void SetSelection(int start
, int end
);
2214 Sets the position that ends the selection - this becomes the currentPosition.
2216 void SetSelectionEnd(int pos
);
2219 Set the selection mode to stream (SC_SEL_STREAM) or rectangular
2220 (SC_SEL_RECTANGLE) or
2221 by lines (SC_SEL_LINES).
2223 void SetSelectionMode(int mode
);
2226 Sets the position that starts the selection - this becomes the anchor.
2228 void SetSelectionStart(int pos
);
2231 Change error status - 0 = OK.
2233 void SetStatus(int statusCode
);
2236 Divide each styling byte into lexical class bits (default: 5) and indicator
2237 bits (default: 3). If a lexer requires more than 32 lexical states, then this
2238 is used to expand the possible states.
2240 void SetStyleBits(int bits
);
2243 Set the styles for a segment of the document.
2245 void SetStyleBytes(int length
, char* styleBytes
);
2248 Change style from current styling position for length characters to a style
2249 and move the current styling position to after this newly styled segment.
2251 void SetStyling(int length
, int style
);
2254 Sets whether a tab pressed when caret is within indentation indents.
2256 void SetTabIndents(bool tabIndents
);
2259 Change the visible size of a tab to be a multiple of the width of a space
2262 void SetTabWidth(int tabWidth
);
2265 Sets the position that ends the target which is used for updating the
2266 document without affecting the scroll position.
2268 void SetTargetEnd(int pos
);
2271 Sets the position that starts the target which is used for updating the
2272 document without affecting the scroll position.
2274 void SetTargetStart(int pos
);
2277 Replace the contents of the document with the argument text.
2279 void SetText(const wxString
& text
);
2282 Replace the contents of the document with the argument text.
2284 void SetTextRaw(const char* text
);
2287 In twoPhaseDraw mode, drawing is performed in two phases, first the background
2288 and then the foreground. This avoids chopping off characters that overlap the
2291 void SetTwoPhaseDraw(bool twoPhase
);
2294 Choose between collecting actions into the undo
2295 history and discarding them.
2297 void SetUndoCollection(bool collectUndo
);
2300 Specify whether anti-aliased fonts should be used. Will have no effect
2301 on some platforms, but on some (wxMac for example) can greatly improve
2304 void SetUseAntiAliasing(bool useAA
);
2307 Show or hide the horizontal scroll bar.
2309 void SetUseHorizontalScrollBar(bool show
);
2312 Indentation will only use space characters if useTabs is @false, otherwise
2313 it will use a combination of tabs and spaces.
2315 void SetUseTabs(bool useTabs
);
2318 Show or hide the vertical scroll bar.
2320 void SetUseVerticalScrollBar(bool show
);
2323 Set the vertical scrollbar to use instead of the ont that's built-in.
2325 void SetVScrollBar(wxScrollBar
* bar
);
2328 Make the end of line characters visible or invisible.
2330 void SetViewEOL(bool visible
);
2333 Make white space characters invisible, always visible or visible outside
2336 void SetViewWhiteSpace(int viewWS
);
2339 Set the way the display area is determined when a particular line
2340 is to be moved to by Find, FindNext, GotoLine, etc.
2342 void SetVisiblePolicy(int visiblePolicy
, int visibleSlop
);
2345 Set the background colour of all whitespace and whether to use this setting.
2347 void SetWhitespaceBackground(bool useSetting
,
2348 const wxColour
& back
);
2351 Set the set of characters making up whitespace for when moving or selecting by
2353 Should be called after SetWordChars.
2355 void SetWhitespaceChars(const wxString
& characters
);
2358 Set the foreground colour of all whitespace and whether to use this setting.
2360 void SetWhitespaceForeground(bool useSetting
,
2361 const wxColour
& fore
);
2364 Set the set of characters making up words for when moving or selecting by word.
2365 First sets deaults like SetCharsDefault.
2367 void SetWordChars(const wxString
& characters
);
2370 Sets whether text is word wrapped.
2372 void SetWrapMode(int mode
);
2375 Set the start indent for wrapped lines.
2377 void SetWrapStartIndent(int indent
);
2380 Set the display mode of visual flags for wrapped lines.
2382 void SetWrapVisualFlags(int wrapVisualFlags
);
2385 Set the location of visual flags for wrapped lines.
2387 void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation
);
2390 Set the way the caret is kept visible when going sideway.
2391 The exclusion zone is given in pixels.
2393 void SetXCaretPolicy(int caretPolicy
, int caretSlop
);
2396 Get and Set the xOffset (ie, horizonal scroll position).
2398 void SetXOffset(int newOffset
);
2401 Set the way the line the caret is on is kept visible.
2402 The exclusion zone is given in lines.
2404 void SetYCaretPolicy(int caretPolicy
, int caretSlop
);
2407 Set the zoom level. This number of points is added to the size of all fonts.
2408 It may be positive to magnify or negative to reduce.
2410 void SetZoom(int zoom
);
2413 Make a range of lines visible.
2415 void ShowLines(int lineStart
, int lineEnd
);
2418 Start notifying the container of all key presses and commands.
2423 Set the current styling position to pos and the styling mask to mask.
2424 The styling mask can be used to protect some bits in each styling byte from
2427 void StartStyling(int pos
, int mask
);
2430 Stop notifying the container of all key presses and commands.
2435 Move caret to bottom of page, or one page down if already at bottom of page.
2437 void StutteredPageDown();
2440 Move caret to bottom of page, or one page down if already at bottom of page,
2441 extending selection to new caret position.
2443 void StutteredPageDownExtend();
2446 Move caret to top of page, or one page up if already at top of page.
2448 void StutteredPageUp();
2451 Move caret to top of page, or one page up if already at top of page, extending
2452 selection to new caret position.
2454 void StutteredPageUpExtend();
2457 Clear all the styles and make equivalent to the global default style.
2459 void StyleClearAll();
2462 Reset the default style to its state at startup
2464 void StyleResetDefault();
2467 Set the background colour of a style.
2469 void StyleSetBackground(int style
, const wxColour
& back
);
2472 Set a style to be bold or not.
2474 void StyleSetBold(int style
, bool bold
);
2477 Set a style to be mixed case, or to force upper or lower case.
2479 void StyleSetCase(int style
, int caseForce
);
2482 Set a style to be changeable or not (read only).
2483 Experimental feature, currently buggy.
2485 void StyleSetChangeable(int style
, bool changeable
);
2488 Set the character set of the font in a style. Converts the Scintilla
2489 character set values to a wxFontEncoding.
2491 void StyleSetCharacterSet(int style
, int characterSet
);
2494 Set a style to have its end of line filled or not.
2496 void StyleSetEOLFilled(int style
, bool filled
);
2499 Set the font of a style.
2501 void StyleSetFaceName(int style
, const wxString
& fontName
);
2504 Set style size, face, bold, italic, and underline attributes from
2505 a wxFont's attributes.
2507 void StyleSetFont(int styleNum
, wxFont
& font
);
2510 Set all font style attributes at once.
2512 void StyleSetFontAttr(int styleNum
, int size
,
2513 const wxString
& faceName
,
2517 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
2520 Set the font encoding to be used by a style.
2522 void StyleSetFontEncoding(int style
, wxFontEncoding encoding
);
2525 Set the foreground colour of a style.
2527 void StyleSetForeground(int style
, const wxColour
& fore
);
2530 Set a style to be a hotspot or not.
2532 void StyleSetHotSpot(int style
, bool hotspot
);
2535 Set a style to be italic or not.
2537 void StyleSetItalic(int style
, bool italic
);
2540 Set the size of characters of a style.
2542 void StyleSetSize(int style
, int sizePoints
);
2545 Extract style settings from a spec-string which is composed of one or
2546 more of the following comma separated elements:
2548 italic turns on italics
2549 fore:[name or #RRGGBB] sets the foreground colour
2550 back:[name or #RRGGBB] sets the background colour
2551 face:[facename] sets the font face name to use
2552 size:[num] sets the font size in points
2553 eol turns on eol filling
2554 underline turns on underlining
2556 void StyleSetSpec(int styleNum
, const wxString
& spec
);
2559 Set a style to be underlined or not.
2561 void StyleSetUnderline(int style
, bool underline
);
2564 Set a style to be visible or not.
2566 void StyleSetVisible(int style
, bool visible
);
2569 If selection is empty or all on one line replace the selection with a tab
2571 If more than one line selected, indent the lines.
2576 Make the target range start and end be the same as the selection range start
2579 void TargetFromSelection();
2582 Retrieve the height of a particular line of text in pixels.
2584 int TextHeight(int line
);
2587 Measure the pixel width of some text in a particular style.
2588 NUL terminated text argument.
2589 Does not handle tab or control characters.
2591 int TextWidth(int style
, const wxString
& text
);
2594 Switch between sticky and non-sticky: meant to be bound to a key.
2596 void ToggleCaretSticky();
2599 Switch a header line between expanded and contracted.
2601 void ToggleFold(int line
);
2604 Undo one action in the undo history.
2609 Transform the selection to upper case.
2614 Set whether a pop up menu is displayed automatically when the user presses
2615 the wrong mouse button.
2617 void UsePopUp(bool allowPopUp
);
2620 Display a list of strings and send notification when user chooses one.
2622 void UserListShow(int listType
, const wxString
& itemList
);
2625 Move caret to before first visible character on line.
2626 If already there move to first character on line.
2631 Like VCHome but extending selection to new caret position.
2633 void VCHomeExtend();
2636 Move caret to before first visible character on line.
2637 If already there move to first character on line.
2638 In either case, extend rectangular selection to new caret position.
2640 void VCHomeRectExtend();
2650 void VCHomeWrapExtend();
2653 Find the display line of a document line taking hidden lines into account.
2655 int VisibleFromDocLine(int line
);
2658 Get position of end of word.
2660 int WordEndPosition(int pos
, bool onlyWordCharacters
);
2663 Move caret left one word.
2668 Move caret left one word, position cursor at end of word.
2673 Move caret left one word, position cursor at end of word, extending selection
2674 to new caret position.
2676 void WordLeftEndExtend();
2679 Move caret left one word extending selection to new caret position.
2681 void WordLeftExtend();
2684 Move to the previous change in capitalisation.
2686 void WordPartLeft();
2689 Move to the previous change in capitalisation extending selection
2690 to new caret position.
2692 void WordPartLeftExtend();
2695 Move to the change next in capitalisation.
2697 void WordPartRight();
2700 Move to the next change in capitalisation extending selection
2701 to new caret position.
2703 void WordPartRightExtend();
2706 Move caret right one word.
2711 Move caret right one word, position cursor at end of word.
2713 void WordRightEnd();
2716 Move caret right one word, position cursor at end of word, extending selection
2717 to new caret position.
2719 void WordRightEndExtend();
2722 Move caret right one word extending selection to new caret position.
2724 void WordRightExtend();
2727 Get position of start of word.
2729 int WordStartPosition(int pos
, bool onlyWordCharacters
);
2732 The number of display lines needed to wrap a document line
2734 int WrapCount(int line
);
2737 Magnify the displayed text by increasing the sizes by 1 point.
2742 Make the displayed text smaller by decreasing the sizes by 1 point.