]> git.saurik.com Git - wxWidgets.git/blob - interface/stc/stc.h
fix missing end brace
[wxWidgets.git] / interface / stc / stc.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: stc/stc.h
3 // Purpose: documentation for wxStyledTextEvent class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxStyledTextEvent
11 @headerfile stc.h wx/stc/stc.h
12
13 The type of events sent from wxStyledTextCtrl.
14
15 TODO
16
17 @library{wxbase}
18 @category{FIXME}
19 */
20 class wxStyledTextEvent : public wxCommandEvent
21 {
22 public:
23 //@{
24 /**
25
26 */
27 wxStyledTextEvent(wxEventType commandType = 0, int id = 0);
28 wxStyledTextEvent(const wxStyledTextEvent& event);
29 //@}
30
31 /**
32
33 */
34 wxEvent* Clone();
35
36 /**
37
38 */
39 bool GetAlt();
40
41 /**
42
43 */
44 bool GetControl();
45
46 /**
47
48 */
49 bool GetDragAllowMove();
50
51 /**
52
53 */
54 wxDragResult GetDragResult();
55
56 /**
57
58 */
59 wxString GetDragText();
60
61 /**
62
63 */
64 int GetFoldLevelNow();
65
66 /**
67
68 */
69 int GetFoldLevelPrev();
70
71 /**
72
73 */
74 int GetKey();
75
76 /**
77
78 */
79 int GetLParam();
80
81 /**
82
83 */
84 int GetLength();
85
86 /**
87
88 */
89 int GetLine();
90
91 /**
92
93 */
94 int GetLinesAdded();
95
96 /**
97
98 */
99 int GetListType();
100
101 /**
102
103 */
104 int GetMargin();
105
106 /**
107
108 */
109 int GetMessage();
110
111 /**
112
113 */
114 int GetModificationType();
115
116 /**
117
118 */
119 int GetModifiers();
120
121 /**
122
123 */
124 int GetPosition();
125
126 /**
127
128 */
129 bool GetShift();
130
131 /**
132
133 */
134 wxString GetText();
135
136 /**
137
138 */
139 int GetWParam();
140
141 /**
142
143 */
144 #define int GetX() /* implementation is private */
145
146 /**
147
148 */
149 #define int GetY() /* implementation is private */
150
151 /**
152
153 */
154 void SetDragAllowMove(bool val);
155
156 /**
157
158 */
159 void SetDragResult(wxDragResult val);
160
161 /**
162
163 */
164 void SetDragText(const wxString& val);
165
166 /**
167
168 */
169 void SetFoldLevelNow(int val);
170
171 /**
172
173 */
174 void SetFoldLevelPrev(int val);
175
176 /**
177
178 */
179 void SetKey(int k);
180
181 /**
182
183 */
184 void SetLParam(int val);
185
186 /**
187
188 */
189 void SetLength(int len);
190
191 /**
192
193 */
194 void SetLine(int val);
195
196 /**
197
198 */
199 void SetLinesAdded(int num);
200
201 /**
202
203 */
204 void SetListType(int val);
205
206 /**
207
208 */
209 void SetMargin(int val);
210
211 /**
212
213 */
214 void SetMessage(int val);
215
216 /**
217
218 */
219 void SetModificationType(int t);
220
221 /**
222
223 */
224 void SetModifiers(int m);
225
226 /**
227
228 */
229 void SetPosition(int pos);
230
231 /**
232
233 */
234 void SetText(const wxString& t);
235
236 /**
237
238 */
239 void SetWParam(int val);
240
241 /**
242
243 */
244 #define void SetX(int val) /* implementation is private */
245
246 /**
247
248 */
249 #define void SetY(int val) /* implementation is private */
250 };
251
252
253 /**
254 @class wxStyledTextCtrl
255 @headerfile stc.h wx/stc/stc.h
256
257 A wxWidgets implementation of the Scintilla source code editing component.
258
259 As well as features found in standard text editing components, Scintilla
260 includes
261 features especially useful when editing and debugging source code. These
262 include
263 support for syntax styling, error indicators, code completion and call tips.
264 The
265 selection margin can contain markers like those used in debuggers to indicate
266 breakpoints and the current line. Styling choices are more open than with many
267 editors, allowing the use of proportional fonts, bold and italics, multiple
268 foreground and background colours and multiple fonts.
269
270 wxStyledTextCtrl is a 1 to 1 mapping of "raw" scintilla interface, whose
271 documentation
272 can be found in the Scintilla website.
273
274 @library{wxbase}
275 @category{stc}
276
277 @seealso
278 wxStyledTextEvent
279 */
280 class wxStyledTextCtrl : public wxControl
281 {
282 public:
283 /**
284 Ctor.
285 */
286 wxStyledTextCtrl::wxStyledTextCtrl(wxWindow * parent,
287 wxWindowID id = wxID_ANY,
288 const wxPoint pos = wxDefaultPosition,
289 const wxSize size = wxDefaultSize,
290 long style = 0,
291 const wxString name = "stcwindow");
292
293 /**
294 Extend life of document.
295 */
296 void AddRefDocument(void* docPointer);
297
298 /**
299 Add array of cells to document.
300 */
301 void AddStyledText(const wxMemoryBuffer& data);
302
303 /**
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
306 and regenerate
307 Add text to the document at current position.
308 */
309 void AddText(const wxString& text);
310
311 /**
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.
318 */
319 void AddTextRaw(const char* text);
320
321 /**
322 Enlarge the document to a particular size of text bytes.
323 */
324 void Allocate(int bytes);
325
326 /**
327 Append a string to the end of the document without changing the selection.
328 */
329 void AppendText(const wxString& text);
330
331 /**
332 Append a string to the end of the document without changing the selection.
333 */
334 void AppendTextRaw(const char* text);
335
336 /**
337 Is there an auto-completion list visible?
338 */
339 bool AutoCompActive();
340
341 /**
342 Remove the auto-completion list from the screen.
343 */
344 void AutoCompCancel();
345
346 /**
347 User has selected an item so remove the list and insert the selection.
348 */
349 void AutoCompComplete();
350
351 /**
352 Retrieve whether or not autocompletion is hidden automatically when nothing
353 matches.
354 */
355 bool AutoCompGetAutoHide();
356
357 /**
358 Retrieve whether auto-completion cancelled by backspacing before start.
359 */
360 bool AutoCompGetCancelAtStart();
361
362 /**
363 Retrieve whether a single item auto-completion list automatically choose the
364 item.
365 */
366 bool AutoCompGetChooseSingle();
367
368 /**
369 Get currently selected item position in the auto-completion list
370 */
371 int AutoCompGetCurrent();
372
373 /**
374 Retrieve whether or not autocompletion deletes any word characters
375 after the inserted text upon completion.
376 */
377 bool AutoCompGetDropRestOfWord();
378
379 /**
380 Retrieve state of ignore case flag.
381 */
382 bool AutoCompGetIgnoreCase();
383
384 /**
385 Set the maximum height, in rows, of auto-completion and user lists.
386 */
387 int AutoCompGetMaxHeight();
388
389 /**
390 Get the maximum width, in characters, of auto-completion and user lists.
391 */
392 int AutoCompGetMaxWidth();
393
394 /**
395 Retrieve the auto-completion list separator character.
396 */
397 int AutoCompGetSeparator();
398
399 /**
400 Retrieve the auto-completion list type-separator character.
401 */
402 int AutoCompGetTypeSeparator();
403
404 /**
405 Retrieve the position of the caret when the auto-completion list was displayed.
406 */
407 int AutoCompPosStart();
408
409 /**
410 Select the item in the auto-completion list that starts with a string.
411 */
412 void AutoCompSelect(const wxString& text);
413
414 /**
415 Set whether or not autocompletion is hidden automatically when nothing matches.
416 */
417 void AutoCompSetAutoHide(bool autoHide);
418
419 /**
420 Should the auto-completion list be cancelled if the user backspaces to a
421 position before where the box was created.
422 */
423 void AutoCompSetCancelAtStart(bool cancel);
424
425 /**
426 Should a single item auto-completion list automatically choose the item.
427 */
428 void AutoCompSetChooseSingle(bool chooseSingle);
429
430 /**
431 Set whether or not autocompletion deletes any word characters
432 after the inserted text upon completion.
433 */
434 void AutoCompSetDropRestOfWord(bool dropRestOfWord);
435
436 /**
437 Define a set of characters that when typed will cause the autocompletion to
438 choose the selected item.
439 */
440 void AutoCompSetFillUps(const wxString& characterSet);
441
442 /**
443 Set whether case is significant when performing auto-completion searches.
444 */
445 void AutoCompSetIgnoreCase(bool ignoreCase);
446
447 /**
448 Set the maximum height, in rows, of auto-completion and user lists.
449 The default is 5 rows.
450 */
451 void AutoCompSetMaxHeight(int rowCount);
452
453 /**
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.
456 */
457 void AutoCompSetMaxWidth(int characterCount);
458
459 /**
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.
462 */
463 void AutoCompSetSeparator(int separatorCharacter);
464
465 /**
466 Change the type-separator character in the string setting up an auto-completion
467 list.
468 Default is '?' but can be changed if items contain '?'.
469 */
470 void AutoCompSetTypeSeparator(int separatorCharacter);
471
472 /**
473 Display a auto-completion list.
474 The lenEntered parameter indicates how many characters before
475 the caret should be used to provide context.
476 */
477 void AutoCompShow(int lenEntered, const wxString& itemList);
478
479 /**
480 Define a set of character that when typed cancel the auto-completion list.
481 */
482 void AutoCompStops(const wxString& characterSet);
483
484 /**
485 Dedent the selected lines.
486 */
487 void BackTab();
488
489 /**
490 Start a sequence of actions that is undone and redone as a unit.
491 May be nested.
492 */
493 void BeginUndoAction();
494
495 /**
496 Highlight the character at a position indicating there is no matching brace.
497 */
498 void BraceBadLight(int pos);
499
500 /**
501 Highlight the characters at two positions.
502 */
503 void BraceHighlight(int pos1, int pos2);
504
505 /**
506 Find the position of a matching brace or INVALID_POSITION if no match.
507 */
508 int BraceMatch(int pos);
509
510 /**
511 Is there an active call tip?
512 */
513 bool CallTipActive();
514
515 /**
516 Remove the call tip from the screen.
517 */
518 void CallTipCancel();
519
520 /**
521 Retrieve the position where the caret was before displaying the call tip.
522 */
523 int CallTipPosAtStart();
524
525 /**
526 Set the background colour for the call tip.
527 */
528 void CallTipSetBackground(const wxColour& back);
529
530 /**
531 Set the foreground colour for the call tip.
532 */
533 void CallTipSetForeground(const wxColour& fore);
534
535 /**
536 Set the foreground colour for the highlighted part of the call tip.
537 */
538 void CallTipSetForegroundHighlight(const wxColour& fore);
539
540 /**
541 Highlight a segment of the definition.
542 */
543 void CallTipSetHighlight(int start, int end);
544
545 /**
546 Show a call tip containing a definition near position pos.
547 */
548 void CallTipShow(int pos, const wxString& definition);
549
550 /**
551 Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
552 */
553 void CallTipUseStyle(int tabSize);
554
555 /**
556 Will a paste succeed?
557 */
558 bool CanPaste();
559
560 /**
561 Are there any redoable actions in the undo history?
562 */
563 bool CanRedo();
564
565 /**
566 Are there any undoable actions in the undo history?
567 */
568 bool CanUndo();
569
570 /**
571 Cancel any modes such as call tip or auto-completion list display.
572 */
573 void Cancel();
574
575 /**
576 Move caret left one character.
577 */
578 void CharLeft();
579
580 /**
581 Move caret left one character extending selection to new caret position.
582 */
583 void CharLeftExtend();
584
585 /**
586 Move caret left one character, extending rectangular selection to new caret
587 position.
588 */
589 void CharLeftRectExtend();
590
591 /**
592 Move caret right one character.
593 */
594 void CharRight();
595
596 /**
597 Move caret right one character extending selection to new caret position.
598 */
599 void CharRightExtend();
600
601 /**
602 Move caret right one character, extending rectangular selection to new caret
603 position.
604 */
605 void CharRightRectExtend();
606
607 /**
608 Set the last x chosen value to be the caret x position.
609 */
610 void ChooseCaretX();
611
612 /**
613 Clear the selection.
614 */
615 void Clear();
616
617 /**
618 Delete all text in the document.
619 */
620 void ClearAll();
621
622 /**
623 Set all style bytes to 0, remove all folding information.
624 */
625 void ClearDocumentStyle();
626
627 /**
628 Clear all the registered images.
629 */
630 void ClearRegisteredImages();
631
632 /**
633 When key+modifier combination km is pressed perform msg.
634 */
635 void CmdKeyAssign(int key, int modifiers, int cmd);
636
637 /**
638 When key+modifier combination km is pressed do nothing.
639 */
640 void CmdKeyClear(int key, int modifiers);
641
642 /**
643 Drop all key mappings.
644 */
645 void CmdKeyClearAll();
646
647 /**
648 Perform one of the operations defined by the wxSTC_CMD_* constants.
649 */
650 void CmdKeyExecute(int cmd);
651
652 /**
653 Colourise a segment of the document using the current lexing language.
654 */
655 void Colourise(int start, int end);
656
657 /**
658 Convert all line endings in the document to one mode.
659 */
660 void ConvertEOLs(int eolMode);
661
662 /**
663 Copy the selection to the clipboard.
664 */
665 void Copy();
666
667 /**
668 Copy a range of text to the clipboard. Positions are clipped into the document.
669 */
670 void CopyRange(int start, int end);
671
672 /**
673 Copy argument text to the clipboard.
674 */
675 void CopyText(int length, const wxString& text);
676
677 /**
678
679 */
680 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
681 const wxPoint& pos = wxDefaultPosition,
682 const wxSize& size = wxDefaultSize,
683 long style = 0,
684 const wxString& name = wxSTCNameStr);
685
686 /**
687 Create a new document object.
688 Starts with reference count of 1 and not selected into editor.
689 */
690 void* CreateDocument();
691
692 /**
693 Cut the selection to the clipboard.
694 */
695 #define void Cut() /* implementation is private */
696
697 /**
698 Delete back from the current position to the start of the line.
699 */
700 void DelLineLeft();
701
702 /**
703 Delete forwards from the current position to the end of the line.
704 */
705 void DelLineRight();
706
707 /**
708 Delete the word to the left of the caret.
709 */
710 void DelWordLeft();
711
712 /**
713 Delete the word to the right of the caret.
714 */
715 void DelWordRight();
716
717 /**
718 Delete the selection or if no selection, the character before the caret.
719 */
720 void DeleteBack();
721
722 /**
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.
725 */
726 void DeleteBackNotLine();
727
728 /**
729 Allow for simulating a DnD DragOver
730 */
731 wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
732
733 /**
734 Allow for simulating a DnD DropText
735 */
736 bool DoDropText(long x, long y, const wxString& data);
737
738 /**
739 Find the document line of a display line taking hidden lines into account.
740 */
741 int DocLineFromVisible(int lineDisplay);
742
743 /**
744 Move caret to last position in document.
745 */
746 void DocumentEnd();
747
748 /**
749 Move caret to last position in document extending selection to new caret
750 position.
751 */
752 void DocumentEndExtend();
753
754 /**
755 Move caret to first position in document.
756 */
757 void DocumentStart();
758
759 /**
760 Move caret to first position in document extending selection to new caret
761 position.
762 */
763 void DocumentStartExtend();
764
765 /**
766 Switch from insert to overtype mode or the reverse.
767 */
768 void EditToggleOvertype();
769
770 /**
771 Delete the undo history.
772 */
773 void EmptyUndoBuffer();
774
775 /**
776 End a sequence of actions that is undone and redone as a unit.
777 */
778 void EndUndoAction();
779
780 /**
781 Ensure the caret is visible.
782 */
783 void EnsureCaretVisible();
784
785 /**
786 Ensure a particular line is visible by expanding any header line hiding it.
787 */
788 void EnsureVisible(int line);
789
790 /**
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.
793 */
794 void EnsureVisibleEnforcePolicy(int line);
795
796 /**
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.
799 */
800 int FindColumn(int line, int column);
801
802 /**
803 Find some text in the document.
804 */
805 int FindText(int minPos, int maxPos, const wxString& text,
806 int flags = 0);
807
808 /**
809 Insert a Form Feed character.
810 */
811 void FormFeed();
812
813 /**
814 On Windows, will draw the document into a display context such as a printer.
815 */
816 int FormatRange(bool doDraw, int startPos, int endPos,
817 wxDC* draw, wxDC* target,
818 wxRect renderRect,
819 wxRect pageRect);
820
821 /**
822 Returns the position of the opposite end of the selection to the caret.
823 */
824 int GetAnchor();
825
826 /**
827 Does a backspace pressed when caret is within indentation unindent?
828 */
829 bool GetBackSpaceUnIndents();
830
831 /**
832 Is drawing done first into a buffer or direct to the screen?
833 */
834 bool GetBufferedDraw();
835
836 /**
837 Get the foreground colour of the caret.
838 */
839 wxColour GetCaretForeground();
840
841 /**
842 Get the background alpha of the caret line.
843 */
844 int GetCaretLineBackAlpha();
845
846 /**
847 Get the colour of the background of the line containing the caret.
848 */
849 wxColour GetCaretLineBackground();
850
851 /**
852 Is the background of the line containing the caret in a different colour?
853 */
854 bool GetCaretLineVisible();
855
856 /**
857 Get the time in milliseconds that the caret is on and off.
858 */
859 int GetCaretPeriod();
860
861 /**
862 Can the caret preferred x position only be changed by explicit movement
863 commands?
864 */
865 bool GetCaretSticky();
866
867 /**
868 Returns the width of the insert mode caret.
869 */
870 int GetCaretWidth();
871
872 /**
873 Returns the character byte at the position.
874 */
875 int GetCharAt(int pos);
876
877 /**
878 Get the code page used to interpret the bytes of the document as characters.
879 */
880 int GetCodePage();
881
882 /**
883 Retrieve the column number of a position, taking tab width into account.
884 */
885 int GetColumn(int pos);
886
887 /**
888 Get the way control characters are displayed.
889 */
890 int GetControlCharSymbol();
891
892 /**
893
894 */
895 wxString GetCurLine(int* OUTPUT);
896
897 /**
898
899 */
900 wxCharBuffer GetCurLineRaw(int* OUTPUT);
901
902 /**
903 END of generated section
904
905 Others...
906 Returns the line number of the line with the caret.
907 */
908 int GetCurrentLine();
909
910 /**
911 Returns the position of the caret.
912 */
913 int GetCurrentPos();
914
915 /**
916 Retrieve a pointer to the document object.
917 */
918 void* GetDocPointer();
919
920 /**
921 Retrieve the current end of line mode - one of CRLF, CR, or LF.
922 */
923 int GetEOLMode();
924
925 /**
926 Retrieve the colour used in edge indication.
927 */
928 wxColour GetEdgeColour();
929
930 /**
931 Retrieve the column number which text should be kept within.
932 */
933 int GetEdgeColumn();
934
935 /**
936 Retrieve the edge highlight mode.
937 */
938 int GetEdgeMode();
939
940 /**
941 Retrieve whether the maximum scroll position has the last
942 line at the bottom of the view.
943 */
944 bool GetEndAtLastLine();
945
946 /**
947 Retrieve the position of the last correctly styled character.
948 */
949 int GetEndStyled();
950
951 /**
952 Retrieve the display line at the top of the display.
953 */
954 int GetFirstVisibleLine();
955
956 /**
957 Is a header line expanded?
958 */
959 bool GetFoldExpanded(int line);
960
961 /**
962 Retrieve the fold level of a line.
963 */
964 int GetFoldLevel(int line);
965
966 /**
967 Find the parent line of a child line.
968 */
969 int GetFoldParent(int line);
970
971 /**
972 Get the highlighted indentation guide column.
973 */
974 int GetHighlightGuide();
975
976 /**
977 Retrieve indentation size.
978 */
979 int GetIndent();
980
981 /**
982 Are the indentation guides visible?
983 */
984 bool GetIndentationGuides();
985
986 /**
987 Find the last child line of a header line.
988 */
989 int GetLastChild(int line, int level);
990
991 /**
992 Can be used to prevent the EVT_CHAR handler from adding the char
993 */
994 bool GetLastKeydownProcessed();
995
996 /**
997 Retrieve the degree of caching of layout information.
998 */
999 int GetLayoutCache();
1000
1001 /**
1002 Returns the number of characters in the document.
1003 */
1004 int GetLength();
1005
1006 /**
1007 Retrieve the lexing language of the document.
1008 */
1009 int GetLexer();
1010
1011 /**
1012 Retrieve the contents of a line.
1013 */
1014 wxString GetLine(int line);
1015
1016 /**
1017 Returns the number of lines in the document. There is always at least one.
1018 */
1019 int GetLineCount();
1020
1021 /**
1022 Get the position after the last visible characters on a line.
1023 */
1024 int GetLineEndPosition(int line);
1025
1026 /**
1027 Retrieve the position before the first non indentation character on a line.
1028 */
1029 int GetLineIndentPosition(int line);
1030
1031 /**
1032 Retrieve the number of columns that a line is indented.
1033 */
1034 int GetLineIndentation(int line);
1035
1036 /**
1037 Retrieve the contents of a line.
1038 */
1039 wxCharBuffer GetLineRaw(int line);
1040
1041 /**
1042 Retrieve the position of the end of the selection at the given line
1043 (INVALID_POSITION if no selection on this line).
1044 */
1045 int GetLineSelEndPosition(int line);
1046
1047 /**
1048 Retrieve the position of the start of the selection at the given line
1049 (INVALID_POSITION if no selection on this line).
1050 */
1051 int GetLineSelStartPosition(int line);
1052
1053 /**
1054 Retrieve the extra styling information for a line.
1055 */
1056 int GetLineState(int line);
1057
1058 /**
1059 Is a line visible?
1060 */
1061 bool GetLineVisible(int line);
1062
1063 /**
1064 Returns the size in pixels of the left margin.
1065 */
1066 int GetMarginLeft();
1067
1068 /**
1069 Retrieve the marker mask of a margin.
1070 */
1071 int GetMarginMask(int margin);
1072
1073 /**
1074 Returns the size in pixels of the right margin.
1075 */
1076 int GetMarginRight();
1077
1078 /**
1079 Retrieve the mouse click sensitivity of a margin.
1080 */
1081 bool GetMarginSensitive(int margin);
1082
1083 /**
1084 Retrieve the type of a margin.
1085 */
1086 int GetMarginType(int margin);
1087
1088 /**
1089 Retrieve the width of a margin in pixels.
1090 */
1091 int GetMarginWidth(int margin);
1092
1093 /**
1094 Retrieve the last line number that has line state.
1095 */
1096 int GetMaxLineState();
1097
1098 /**
1099 Get which document modification events are sent to the container.
1100 */
1101 int GetModEventMask();
1102
1103 /**
1104 Is the document different from when it was last saved?
1105 */
1106 bool GetModify();
1107
1108 /**
1109 Get whether mouse gets captured.
1110 */
1111 bool GetMouseDownCaptures();
1112
1113 /**
1114 Retrieve the time the mouse must sit still to generate a mouse dwell event.
1115 */
1116 int GetMouseDwellTime();
1117
1118 /**
1119 Returns @true if overtype mode is active otherwise @false is returned.
1120 */
1121 bool GetOvertype();
1122
1123 /**
1124 Get convert-on-paste setting
1125 */
1126 bool GetPasteConvertEndings();
1127
1128 /**
1129 Returns the print colour mode.
1130 */
1131 int GetPrintColourMode();
1132
1133 /**
1134 Returns the print magnification.
1135 */
1136 int GetPrintMagnification();
1137
1138 /**
1139 Is printing line wrapped?
1140 */
1141 int GetPrintWrapMode();
1142
1143 /**
1144 Retrieve a 'property' value previously set with SetProperty.
1145 */
1146 wxString GetProperty(const wxString& key);
1147
1148 /**
1149 Retrieve a 'property' value previously set with SetProperty,
1150 with '$()' variable replacement on returned buffer.
1151 */
1152 wxString GetPropertyExpanded(const wxString& key);
1153
1154 /**
1155 Retrieve a 'property' value previously set with SetProperty,
1156 interpreted as an int AFTER any '$()' variable replacement.
1157 */
1158 int GetPropertyInt(const wxString& key);
1159
1160 /**
1161 In read-only mode?
1162 */
1163 bool GetReadOnly();
1164
1165 /**
1166 Get cursor type.
1167 */
1168 int GetSTCCursor();
1169
1170 /**
1171 Get internal focus flag.
1172 */
1173 bool GetSTCFocus();
1174
1175 /**
1176 Retrieve the document width assumed for scrolling.
1177 */
1178 int GetScrollWidth();
1179
1180 /**
1181 Get the search flags used by SearchInTarget.
1182 */
1183 int GetSearchFlags();
1184
1185 /**
1186 Get the alpha of the selection.
1187 */
1188 int GetSelAlpha();
1189
1190 /**
1191 Retrieve the selected text.
1192 */
1193 wxString GetSelectedText();
1194
1195 /**
1196 Retrieve the selected text.
1197 */
1198 wxCharBuffer GetSelectedTextRaw();
1199
1200 /**
1201
1202 */
1203 void GetSelection(int* OUTPUT, int* OUTPUT);
1204
1205 /**
1206 Returns the position at the end of the selection.
1207 */
1208 int GetSelectionEnd();
1209
1210 /**
1211 Get the mode of the current selection.
1212 */
1213 int GetSelectionMode();
1214
1215 /**
1216 Returns the position at the start of the selection.
1217 */
1218 int GetSelectionStart();
1219
1220 /**
1221 Get error status.
1222 */
1223 int GetStatus();
1224
1225 /**
1226 Returns the style byte at the position.
1227 */
1228 int GetStyleAt(int pos);
1229
1230 /**
1231 Retrieve number of bits in style bytes used to hold the lexical state.
1232 */
1233 int GetStyleBits();
1234
1235 /**
1236 Retrieve the number of bits the current lexer needs for styling.
1237 */
1238 int GetStyleBitsNeeded();
1239
1240 /**
1241 Retrieve a buffer of cells.
1242 */
1243 wxMemoryBuffer GetStyledText(int startPos, int endPos);
1244
1245 /**
1246 Does a tab pressed when caret is within indentation indent?
1247 */
1248 bool GetTabIndents();
1249
1250 /**
1251 Retrieve the visible size of a tab.
1252 */
1253 int GetTabWidth();
1254
1255 /**
1256 Get the position that ends the target.
1257 */
1258 int GetTargetEnd();
1259
1260 /**
1261 Get the position that starts the target.
1262 */
1263 int GetTargetStart();
1264
1265 /**
1266 Retrieve all the text in the document.
1267 */
1268 wxString GetText();
1269
1270 /**
1271 Retrieve the number of characters in the document.
1272 */
1273 int GetTextLength();
1274
1275 /**
1276 Retrieve a range of text.
1277 */
1278 wxString GetTextRange(int startPos, int endPos);
1279
1280 /**
1281 Retrieve a range of text.
1282 */
1283 wxCharBuffer GetTextRangeRaw(int startPos, int endPos);
1284
1285 /**
1286 Retrieve all the text in the document.
1287 */
1288 wxCharBuffer GetTextRaw();
1289
1290 /**
1291 Is drawing done in two phases with backgrounds drawn before foregrounds?
1292 */
1293 bool GetTwoPhaseDraw();
1294
1295 /**
1296 Is undo history being collected?
1297 */
1298 bool GetUndoCollection();
1299
1300 /**
1301 Returns the current UseAntiAliasing setting.
1302 */
1303 bool GetUseAntiAliasing();
1304
1305 /**
1306 Is the horizontal scroll bar visible?
1307 */
1308 bool GetUseHorizontalScrollBar();
1309
1310 /**
1311 Retrieve whether tabs will be used in indentation.
1312 */
1313 bool GetUseTabs();
1314
1315 /**
1316 Is the vertical scroll bar visible?
1317 */
1318 bool GetUseVerticalScrollBar();
1319
1320 /**
1321 Are the end of line characters visible?
1322 */
1323 bool GetViewEOL();
1324
1325 /**
1326 Are white space characters currently visible?
1327 Returns one of SCWS_* constants.
1328 */
1329 int GetViewWhiteSpace();
1330
1331 /**
1332 Retrieve whether text is word wrapped.
1333 */
1334 int GetWrapMode();
1335
1336 /**
1337 Retrive the start indent for wrapped lines.
1338 */
1339 int GetWrapStartIndent();
1340
1341 /**
1342 Retrive the display mode of visual flags for wrapped lines.
1343 */
1344 int GetWrapVisualFlags();
1345
1346 /**
1347 Retrive the location of visual flags for wrapped lines.
1348 */
1349 int GetWrapVisualFlagsLocation();
1350
1351 /**
1352
1353 */
1354 int GetXOffset();
1355
1356 /**
1357 Retrieve the zoom level.
1358 */
1359 int GetZoom();
1360
1361 /**
1362 Set caret to start of a line and ensure it is visible.
1363 */
1364 void GotoLine(int line);
1365
1366 /**
1367 Set caret to a position and ensure it is visible.
1368 */
1369 void GotoPos(int pos);
1370
1371 /**
1372 Make a range of lines invisible.
1373 */
1374 void HideLines(int lineStart, int lineEnd);
1375
1376 /**
1377 Draw the selection in normal style or with selection highlighted.
1378 */
1379 void HideSelection(bool normal);
1380
1381 /**
1382 Move caret to first position on line.
1383 */
1384 void Home();
1385
1386 /**
1387 Move caret to first position on display line.
1388 */
1389 void HomeDisplay();
1390
1391 /**
1392 Move caret to first position on display line extending selection to
1393 new caret position.
1394 */
1395 void HomeDisplayExtend();
1396
1397 /**
1398 Move caret to first position on line extending selection to new caret position.
1399 */
1400 void HomeExtend();
1401
1402 /**
1403 Move caret to first position on line, extending rectangular selection to new
1404 caret position.
1405 */
1406 void HomeRectExtend();
1407
1408 /**
1409 These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
1410 except they behave differently when word-wrap is enabled:
1411 They go first to the start / end of the display line, like (Home|LineEnd)Display
1412 The difference is that, the cursor is already at the point, it goes on to the
1413 start
1414 or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
1415 */
1416 void HomeWrap();
1417
1418 /**
1419
1420 */
1421 void HomeWrapExtend();
1422
1423 /**
1424 Retrieve the foreground colour of an indicator.
1425 */
1426 wxColour IndicatorGetForeground(int indic);
1427
1428 /**
1429 Retrieve the style of an indicator.
1430 */
1431 int IndicatorGetStyle(int indic);
1432
1433 /**
1434 Set the foreground colour of an indicator.
1435 */
1436 void IndicatorSetForeground(int indic, const wxColour& fore);
1437
1438 /**
1439 Set an indicator to plain, squiggle or TT.
1440 */
1441 void IndicatorSetStyle(int indic, int style);
1442
1443 /**
1444 Insert string at a position.
1445 */
1446 void InsertText(int pos, const wxString& text);
1447
1448 /**
1449 Insert string at a position.
1450 */
1451 void InsertTextRaw(int pos, const char* text);
1452
1453 /**
1454 Copy the line containing the caret.
1455 */
1456 void LineCopy();
1457
1458 /**
1459 Cut the line containing the caret.
1460 */
1461 void LineCut();
1462
1463 /**
1464 Delete the line containing the caret.
1465 */
1466 void LineDelete();
1467
1468 /**
1469 Move caret down one line.
1470 */
1471 void LineDown();
1472
1473 /**
1474 Move caret down one line extending selection to new caret position.
1475 */
1476 void LineDownExtend();
1477
1478 /**
1479 Move caret down one line, extending rectangular selection to new caret position.
1480 */
1481 void LineDownRectExtend();
1482
1483 /**
1484 Duplicate the current line.
1485 */
1486 void LineDuplicate();
1487
1488 /**
1489 Move caret to last position on line.
1490 */
1491 void LineEnd();
1492
1493 /**
1494 Move caret to last position on display line.
1495 */
1496 void LineEndDisplay();
1497
1498 /**
1499 Move caret to last position on display line extending selection to new
1500 caret position.
1501 */
1502 void LineEndDisplayExtend();
1503
1504 /**
1505 Move caret to last position on line extending selection to new caret position.
1506 */
1507 void LineEndExtend();
1508
1509 /**
1510 Move caret to last position on line, extending rectangular selection to new
1511 caret position.
1512 */
1513 void LineEndRectExtend();
1514
1515 /**
1516
1517 */
1518 void LineEndWrap();
1519
1520 /**
1521
1522 */
1523 void LineEndWrapExtend();
1524
1525 /**
1526 Retrieve the line containing a position.
1527 */
1528 int LineFromPosition(int pos);
1529
1530 /**
1531 How many characters are on a line, not including end of line characters?
1532 */
1533 int LineLength(int line);
1534
1535 /**
1536 Scroll horizontally and vertically.
1537 */
1538 void LineScroll(int columns, int lines);
1539
1540 /**
1541 Scroll the document down, keeping the caret visible.
1542 */
1543 void LineScrollDown();
1544
1545 /**
1546 Scroll the document up, keeping the caret visible.
1547 */
1548 void LineScrollUp();
1549
1550 /**
1551 Switch the current line with the previous.
1552 */
1553 void LineTranspose();
1554
1555 /**
1556 Move caret up one line.
1557 */
1558 void LineUp();
1559
1560 /**
1561 Move caret up one line extending selection to new caret position.
1562 */
1563 void LineUpExtend();
1564
1565 /**
1566 Move caret up one line, extending rectangular selection to new caret position.
1567 */
1568 void LineUpRectExtend();
1569
1570 /**
1571 Join the lines in the target.
1572 */
1573 void LinesJoin();
1574
1575 /**
1576 Retrieves the number of lines completely visible.
1577 */
1578 int LinesOnScreen();
1579
1580 /**
1581 Split the lines in the target into lines that are less wide than pixelWidth
1582 where possible.
1583 */
1584 void LinesSplit(int pixelWidth);
1585
1586 /**
1587 Load the contents of filename into the editor
1588 */
1589 bool LoadFile(const wxString& filename);
1590
1591 /**
1592 Transform the selection to lower case.
1593 */
1594 void LowerCase();
1595
1596 /**
1597 Add a marker to a line, returning an ID which can be used to find or delete the
1598 marker.
1599 */
1600 int MarkerAdd(int line, int markerNumber);
1601
1602 /**
1603 Add a set of markers to a line.
1604 */
1605 void MarkerAddSet(int line, int set);
1606
1607 /**
1608 Set the symbol used for a particular marker number,
1609 and optionally the fore and background colours.
1610 */
1611 void MarkerDefine(int markerNumber, int markerSymbol,
1612 const wxColour& foreground = wxNullColour,
1613 const wxColour& background = wxNullColour);
1614
1615 /**
1616 Define a marker from a bitmap
1617 */
1618 void MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp);
1619
1620 /**
1621 Delete a marker from a line.
1622 */
1623 void MarkerDelete(int line, int markerNumber);
1624
1625 /**
1626 Delete all markers with a particular number from all lines.
1627 */
1628 void MarkerDeleteAll(int markerNumber);
1629
1630 /**
1631 Delete a marker.
1632 */
1633 void MarkerDeleteHandle(int handle);
1634
1635 /**
1636 Get a bit mask of all the markers set on a line.
1637 */
1638 int MarkerGet(int line);
1639
1640 /**
1641 Retrieve the line number at which a particular marker is located.
1642 */
1643 int MarkerLineFromHandle(int handle);
1644
1645 /**
1646 Find the next line after lineStart that includes a marker in mask.
1647 */
1648 int MarkerNext(int lineStart, int markerMask);
1649
1650 /**
1651 Find the previous line before lineStart that includes a marker in mask.
1652 */
1653 int MarkerPrevious(int lineStart, int markerMask);
1654
1655 /**
1656 Set the alpha used for a marker that is drawn in the text area, not the margin.
1657 */
1658 void MarkerSetAlpha(int markerNumber, int alpha);
1659
1660 /**
1661 Set the background colour used for a particular marker number.
1662 */
1663 void MarkerSetBackground(int markerNumber, const wxColour& back);
1664
1665 /**
1666 Set the foreground colour used for a particular marker number.
1667 */
1668 void MarkerSetForeground(int markerNumber, const wxColour& fore);
1669
1670 /**
1671 Move the caret inside current view if it's not there already.
1672 */
1673 void MoveCaretInsideView();
1674
1675 /**
1676 Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
1677 */
1678 void NewLine();
1679
1680 /**
1681 Move caret one page down.
1682 */
1683 void PageDown();
1684
1685 /**
1686 Move caret one page down extending selection to new caret position.
1687 */
1688 void PageDownExtend();
1689
1690 /**
1691 Move caret one page down, extending rectangular selection to new caret position.
1692 */
1693 void PageDownRectExtend();
1694
1695 /**
1696 Move caret one page up.
1697 */
1698 void PageUp();
1699
1700 /**
1701 Move caret one page up extending selection to new caret position.
1702 */
1703 void PageUpExtend();
1704
1705 /**
1706 Move caret one page up, extending rectangular selection to new caret position.
1707 */
1708 void PageUpRectExtend();
1709
1710 /**
1711 Move caret between paragraphs (delimited by empty lines).
1712 */
1713 void ParaDown();
1714
1715 /**
1716
1717 */
1718 void ParaDownExtend();
1719
1720 /**
1721
1722 */
1723 void ParaUp();
1724
1725 /**
1726
1727 */
1728 void ParaUpExtend();
1729
1730 /**
1731 Paste the contents of the clipboard into the document replacing the selection.
1732 */
1733 void Paste();
1734
1735 /**
1736 Retrieve the point in the window where a position is displayed.
1737 */
1738 wxPoint PointFromPosition(int pos);
1739
1740 /**
1741 Given a valid document position, return the next position taking code
1742 page into account. Maximum value returned is the last position in the document.
1743 */
1744 int PositionAfter(int pos);
1745
1746 /**
1747 Given a valid document position, return the previous position taking code
1748 page into account. Returns 0 if passed 0.
1749 */
1750 int PositionBefore(int pos);
1751
1752 /**
1753 Retrieve the position at the start of a line.
1754 */
1755 int PositionFromLine(int line);
1756
1757 /**
1758 Find the position from a point within the window.
1759 */
1760 int PositionFromPoint(wxPoint pt);
1761
1762 /**
1763 Find the position from a point within the window but return
1764 INVALID_POSITION if not close to text.
1765 */
1766 int PositionFromPointClose(int x, int y);
1767
1768 /**
1769 Redoes the next action on the undo history.
1770 */
1771 void Redo();
1772
1773 /**
1774 Register an image for use in autocompletion lists.
1775 */
1776 void RegisterImage(int type, const wxBitmap& bmp);
1777
1778 /**
1779 Release a reference to the document, deleting document if it fades to black.
1780 */
1781 void ReleaseDocument(void* docPointer);
1782
1783 /**
1784 Replace the selected text with the argument text.
1785 */
1786 void ReplaceSelection(const wxString& text);
1787
1788 /**
1789 Replace the target text with the argument text.
1790 Text is counted so it can contain NULs.
1791 Returns the length of the replacement text.
1792 */
1793 int ReplaceTarget(const wxString& text);
1794
1795 /**
1796 Replace the target text with the argument text after
1797 d processing.
1798 Text is counted so it can contain NULs.
1799 Looks for
1800 d where d is between 1 and 9 and replaces these with the strings
1801 matched in the last search operation which were surrounded by
1802 ( and
1803 ).
1804 Returns the length of the replacement text including any change
1805 caused by processing the
1806 d patterns.
1807 */
1808 int ReplaceTargetRE(const wxString& text);
1809
1810 /**
1811 Write the contents of the editor to filename
1812 */
1813 bool SaveFile(const wxString& filename);
1814
1815 /**
1816 Scroll enough to make the given column visible
1817 */
1818 void ScrollToColumn(int column);
1819
1820 /**
1821 Scroll enough to make the given line visible
1822 */
1823 void ScrollToLine(int line);
1824
1825 /**
1826 Sets the current caret position to be the search anchor.
1827 */
1828 void SearchAnchor();
1829
1830 /**
1831 Search for a counted string in the target and set the target to the found
1832 range. Text is counted so it can contain NULs.
1833 Returns length of range or -1 for failure in which case target is not moved.
1834 */
1835 int SearchInTarget(const wxString& text);
1836
1837 /**
1838 Find some text starting at the search anchor.
1839 Does not ensure the selection is visible.
1840 */
1841 int SearchNext(int flags, const wxString& text);
1842
1843 /**
1844 Find some text starting at the search anchor and moving backwards.
1845 Does not ensure the selection is visible.
1846 */
1847 int SearchPrev(int flags, const wxString& text);
1848
1849 /**
1850 Select all the text in the document.
1851 */
1852 void SelectAll();
1853
1854 /**
1855 Duplicate the selection. If selection empty duplicate the line containing the
1856 caret.
1857 */
1858 void SelectionDuplicate();
1859
1860 /**
1861 Is the selection rectangular? The alternative is the more common stream
1862 selection.
1863 */
1864 bool SelectionIsRectangle();
1865
1866 /**
1867 Send a message to Scintilla
1868 */
1869 long SendMsg(int msg, long wp = 0, long lp = 0);
1870
1871 /**
1872 Set the selection anchor to a position. The anchor is the opposite
1873 end of the selection from the caret.
1874 */
1875 void SetAnchor(int posAnchor);
1876
1877 /**
1878 Sets whether a backspace pressed when caret is within indentation unindents.
1879 */
1880 void SetBackSpaceUnIndents(bool bsUnIndents);
1881
1882 /**
1883 If drawing is buffered then each line of text is drawn into a bitmap buffer
1884 before drawing it to the screen to avoid flicker.
1885 */
1886 void SetBufferedDraw(bool buffered);
1887
1888 /**
1889 Set the foreground colour of the caret.
1890 */
1891 void SetCaretForeground(const wxColour& fore);
1892
1893 /**
1894 Set background alpha of the caret line.
1895 */
1896 void SetCaretLineBackAlpha(int alpha);
1897
1898 /**
1899 Set the colour of the background of the line containing the caret.
1900 */
1901 void SetCaretLineBackground(const wxColour& back);
1902
1903 /**
1904 Display the background of the line containing the caret in a different colour.
1905 */
1906 void SetCaretLineVisible(bool show);
1907
1908 /**
1909 Get the time in milliseconds that the caret is on and off. 0 = steady on.
1910 */
1911 void SetCaretPeriod(int periodMilliseconds);
1912
1913 /**
1914 Stop the caret preferred x position changing when the user types.
1915 */
1916 void SetCaretSticky(bool useCaretStickyBehaviour);
1917
1918 /**
1919 Set the width of the insert mode caret.
1920 */
1921 void SetCaretWidth(int pixelWidth);
1922
1923 /**
1924 Reset the set of characters for whitespace and word characters to the defaults.
1925 */
1926 void SetCharsDefault();
1927
1928 /**
1929 Set the code page used to interpret the bytes of the document as characters.
1930 */
1931 void SetCodePage(int codePage);
1932
1933 /**
1934 Change the way control characters are displayed:
1935 If symbol is 32, keep the drawn way, else, use the given character.
1936 */
1937 void SetControlCharSymbol(int symbol);
1938
1939 /**
1940 Sets the position of the caret.
1941 */
1942 void SetCurrentPos(int pos);
1943
1944 /**
1945 Change the document object used.
1946 */
1947 void SetDocPointer(void* docPointer);
1948
1949 /**
1950 Set the current end of line mode.
1951 */
1952 void SetEOLMode(int eolMode);
1953
1954 /**
1955 Change the colour used in edge indication.
1956 */
1957 void SetEdgeColour(const wxColour& edgeColour);
1958
1959 /**
1960 Set the column number of the edge.
1961 If text goes past the edge then it is highlighted.
1962 */
1963 void SetEdgeColumn(int column);
1964
1965 /**
1966 The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1967 goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1968 */
1969 void SetEdgeMode(int mode);
1970
1971 /**
1972 Sets the scroll range so that maximum scroll position has
1973 the last line at the bottom of the view (default).
1974 Setting this to @false allows scrolling one page below the last line.
1975 */
1976 void SetEndAtLastLine(bool endAtLastLine);
1977
1978 /**
1979 Show the children of a header line.
1980 */
1981 void SetFoldExpanded(int line, bool expanded);
1982
1983 /**
1984 Set some style options for folding.
1985 */
1986 void SetFoldFlags(int flags);
1987
1988 /**
1989 Set the fold level of a line.
1990 This encodes an integer level along with flags indicating whether the
1991 line is a header and whether it is effectively white space.
1992 */
1993 void SetFoldLevel(int line, int level);
1994
1995 /**
1996 Set the colours used as a chequerboard pattern in the fold margin
1997 */
1998 void SetFoldMarginColour(bool useSetting, const wxColour& back);
1999
2000 /**
2001
2002 */
2003 void SetFoldMarginHiColour(bool useSetting, const wxColour& fore);
2004
2005 /**
2006 Set the horizontal scrollbar to use instead of the ont that's built-in.
2007 */
2008 void SetHScrollBar(wxScrollBar* bar);
2009
2010 /**
2011 Set the highlighted indentation guide column.
2012 0 = no highlighted guide.
2013 */
2014 void SetHighlightGuide(int column);
2015
2016 /**
2017 Set a back colour for active hotspots.
2018 */
2019 void SetHotspotActiveBackground(bool useSetting,
2020 const wxColour& back);
2021
2022 /**
2023 Set a fore colour for active hotspots.
2024 */
2025 void SetHotspotActiveForeground(bool useSetting,
2026 const wxColour& fore);
2027
2028 /**
2029 Enable / Disable underlining active hotspots.
2030 */
2031 void SetHotspotActiveUnderline(bool underline);
2032
2033 /**
2034 Limit hotspots to single line so hotspots on two lines don't merge.
2035 */
2036 void SetHotspotSingleLine(bool singleLine);
2037
2038 /**
2039 Set the number of spaces used for one level of indentation.
2040 */
2041 void SetIndent(int indentSize);
2042
2043 /**
2044 Show or hide indentation guides.
2045 */
2046 void SetIndentationGuides(bool show);
2047
2048 /**
2049 Set up the key words used by the lexer.
2050 */
2051 void SetKeyWords(int keywordSet, const wxString& keyWords);
2052
2053 /**
2054
2055 */
2056 void SetLastKeydownProcessed(bool val);
2057
2058 /**
2059 Sets the degree of caching of layout information.
2060 */
2061 void SetLayoutCache(int mode);
2062
2063 /**
2064 Set the lexing language of the document.
2065 */
2066 void SetLexer(int lexer);
2067
2068 /**
2069 Set the lexing language of the document based on string name.
2070 */
2071 void SetLexerLanguage(const wxString& language);
2072
2073 /**
2074 Change the indentation of a line to a number of columns.
2075 */
2076 void SetLineIndentation(int line, int indentSize);
2077
2078 /**
2079 Used to hold extra styling information for each line.
2080 */
2081 void SetLineState(int line, int state);
2082
2083 /**
2084 Sets the size in pixels of the left margin.
2085 */
2086 void SetMarginLeft(int pixelWidth);
2087
2088 /**
2089 Set a mask that determines which markers are displayed in a margin.
2090 */
2091 void SetMarginMask(int margin, int mask);
2092
2093 /**
2094 Sets the size in pixels of the right margin.
2095 */
2096 void SetMarginRight(int pixelWidth);
2097
2098 /**
2099 Make a margin sensitive or insensitive to mouse clicks.
2100 */
2101 void SetMarginSensitive(int margin, bool sensitive);
2102
2103 /**
2104 Set a margin to be either numeric or symbolic.
2105 */
2106 void SetMarginType(int margin, int marginType);
2107
2108 /**
2109 Set the width of a margin to a width expressed in pixels.
2110 */
2111 void SetMarginWidth(int margin, int pixelWidth);
2112
2113 /**
2114 Set the left and right margin in the edit area, measured in pixels.
2115 */
2116 void SetMargins(int left, int right);
2117
2118 /**
2119 Set which document modification events are sent to the container.
2120 */
2121 void SetModEventMask(int mask);
2122
2123 /**
2124 Set whether the mouse is captured when its button is pressed.
2125 */
2126 void SetMouseDownCaptures(bool captures);
2127
2128 /**
2129 Sets the time the mouse must sit still to generate a mouse dwell event.
2130 */
2131 void SetMouseDwellTime(int periodMilliseconds);
2132
2133 /**
2134 Set to overtype (@true) or insert mode.
2135 */
2136 void SetOvertype(bool overtype);
2137
2138 /**
2139 Enable/Disable convert-on-paste for line endings
2140 */
2141 void SetPasteConvertEndings(bool convert);
2142
2143 /**
2144 Modify colours when printing for clearer printed text.
2145 */
2146 void SetPrintColourMode(int mode);
2147
2148 /**
2149 Sets the print magnification added to the point size of each style for printing.
2150 */
2151 void SetPrintMagnification(int magnification);
2152
2153 /**
2154 Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
2155 */
2156 void SetPrintWrapMode(int mode);
2157
2158 /**
2159 Set up a value that may be used by a lexer for some optional feature.
2160 */
2161 void SetProperty(const wxString& key, const wxString& value);
2162
2163 /**
2164 Set to read only or read write.
2165 */
2166 void SetReadOnly(bool readOnly);
2167
2168 /**
2169 Sets the cursor to one of the SC_CURSOR* values.
2170 */
2171 void SetSTCCursor(int cursorType);
2172
2173 /**
2174 Change internal focus flag.
2175 */
2176 void SetSTCFocus(bool focus);
2177
2178 /**
2179 Remember the current position in the undo history as the position
2180 at which the document was saved.
2181 */
2182 void SetSavePoint();
2183
2184 /**
2185 Sets the document width assumed for scrolling.
2186 */
2187 void SetScrollWidth(int pixelWidth);
2188
2189 /**
2190 Set the search flags used by SearchInTarget.
2191 */
2192 void SetSearchFlags(int flags);
2193
2194 /**
2195 Set the alpha of the selection.
2196 */
2197 void SetSelAlpha(int alpha);
2198
2199 /**
2200 Set the background colour of the selection and whether to use this setting.
2201 */
2202 void SetSelBackground(bool useSetting, const wxColour& back);
2203
2204 /**
2205 Set the foreground colour of the selection and whether to use this setting.
2206 */
2207 void SetSelForeground(bool useSetting, const wxColour& fore);
2208
2209 /**
2210 Select a range of text.
2211 */
2212 void SetSelection(int start, int end);
2213
2214 /**
2215 Sets the position that ends the selection - this becomes the currentPosition.
2216 */
2217 void SetSelectionEnd(int pos);
2218
2219 /**
2220 Set the selection mode to stream (SC_SEL_STREAM) or rectangular
2221 (SC_SEL_RECTANGLE) or
2222 by lines (SC_SEL_LINES).
2223 */
2224 void SetSelectionMode(int mode);
2225
2226 /**
2227 Sets the position that starts the selection - this becomes the anchor.
2228 */
2229 void SetSelectionStart(int pos);
2230
2231 /**
2232 Change error status - 0 = OK.
2233 */
2234 void SetStatus(int statusCode);
2235
2236 /**
2237 Divide each styling byte into lexical class bits (default: 5) and indicator
2238 bits (default: 3). If a lexer requires more than 32 lexical states, then this
2239 is used to expand the possible states.
2240 */
2241 void SetStyleBits(int bits);
2242
2243 /**
2244 Set the styles for a segment of the document.
2245 */
2246 void SetStyleBytes(int length, char* styleBytes);
2247
2248 /**
2249 Change style from current styling position for length characters to a style
2250 and move the current styling position to after this newly styled segment.
2251 */
2252 void SetStyling(int length, int style);
2253
2254 /**
2255 Sets whether a tab pressed when caret is within indentation indents.
2256 */
2257 void SetTabIndents(bool tabIndents);
2258
2259 /**
2260 Change the visible size of a tab to be a multiple of the width of a space
2261 character.
2262 */
2263 void SetTabWidth(int tabWidth);
2264
2265 /**
2266 Sets the position that ends the target which is used for updating the
2267 document without affecting the scroll position.
2268 */
2269 void SetTargetEnd(int pos);
2270
2271 /**
2272 Sets the position that starts the target which is used for updating the
2273 document without affecting the scroll position.
2274 */
2275 void SetTargetStart(int pos);
2276
2277 /**
2278 Replace the contents of the document with the argument text.
2279 */
2280 void SetText(const wxString& text);
2281
2282 /**
2283 Replace the contents of the document with the argument text.
2284 */
2285 void SetTextRaw(const char* text);
2286
2287 /**
2288 In twoPhaseDraw mode, drawing is performed in two phases, first the background
2289 and then the foreground. This avoids chopping off characters that overlap the
2290 next run.
2291 */
2292 void SetTwoPhaseDraw(bool twoPhase);
2293
2294 /**
2295 Choose between collecting actions into the undo
2296 history and discarding them.
2297 */
2298 void SetUndoCollection(bool collectUndo);
2299
2300 /**
2301 Specify whether anti-aliased fonts should be used. Will have no effect
2302 on some platforms, but on some (wxMac for example) can greatly improve
2303 performance.
2304 */
2305 void SetUseAntiAliasing(bool useAA);
2306
2307 /**
2308 Show or hide the horizontal scroll bar.
2309 */
2310 void SetUseHorizontalScrollBar(bool show);
2311
2312 /**
2313 Indentation will only use space characters if useTabs is @false, otherwise
2314 it will use a combination of tabs and spaces.
2315 */
2316 void SetUseTabs(bool useTabs);
2317
2318 /**
2319 Show or hide the vertical scroll bar.
2320 */
2321 void SetUseVerticalScrollBar(bool show);
2322
2323 /**
2324 Set the vertical scrollbar to use instead of the ont that's built-in.
2325 */
2326 void SetVScrollBar(wxScrollBar* bar);
2327
2328 /**
2329 Make the end of line characters visible or invisible.
2330 */
2331 void SetViewEOL(bool visible);
2332
2333 /**
2334 Make white space characters invisible, always visible or visible outside
2335 indentation.
2336 */
2337 void SetViewWhiteSpace(int viewWS);
2338
2339 /**
2340 Set the way the display area is determined when a particular line
2341 is to be moved to by Find, FindNext, GotoLine, etc.
2342 */
2343 void SetVisiblePolicy(int visiblePolicy, int visibleSlop);
2344
2345 /**
2346 Set the background colour of all whitespace and whether to use this setting.
2347 */
2348 void SetWhitespaceBackground(bool useSetting,
2349 const wxColour& back);
2350
2351 /**
2352 Set the set of characters making up whitespace for when moving or selecting by
2353 word.
2354 Should be called after SetWordChars.
2355 */
2356 void SetWhitespaceChars(const wxString& characters);
2357
2358 /**
2359 Set the foreground colour of all whitespace and whether to use this setting.
2360 */
2361 void SetWhitespaceForeground(bool useSetting,
2362 const wxColour& fore);
2363
2364 /**
2365 Set the set of characters making up words for when moving or selecting by word.
2366 First sets deaults like SetCharsDefault.
2367 */
2368 void SetWordChars(const wxString& characters);
2369
2370 /**
2371 Sets whether text is word wrapped.
2372 */
2373 void SetWrapMode(int mode);
2374
2375 /**
2376 Set the start indent for wrapped lines.
2377 */
2378 void SetWrapStartIndent(int indent);
2379
2380 /**
2381 Set the display mode of visual flags for wrapped lines.
2382 */
2383 void SetWrapVisualFlags(int wrapVisualFlags);
2384
2385 /**
2386 Set the location of visual flags for wrapped lines.
2387 */
2388 void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation);
2389
2390 /**
2391 Set the way the caret is kept visible when going sideway.
2392 The exclusion zone is given in pixels.
2393 */
2394 void SetXCaretPolicy(int caretPolicy, int caretSlop);
2395
2396 /**
2397 Get and Set the xOffset (ie, horizonal scroll position).
2398 */
2399 void SetXOffset(int newOffset);
2400
2401 /**
2402 Set the way the line the caret is on is kept visible.
2403 The exclusion zone is given in lines.
2404 */
2405 void SetYCaretPolicy(int caretPolicy, int caretSlop);
2406
2407 /**
2408 Set the zoom level. This number of points is added to the size of all fonts.
2409 It may be positive to magnify or negative to reduce.
2410 */
2411 void SetZoom(int zoom);
2412
2413 /**
2414 Make a range of lines visible.
2415 */
2416 void ShowLines(int lineStart, int lineEnd);
2417
2418 /**
2419 Start notifying the container of all key presses and commands.
2420 */
2421 void StartRecord();
2422
2423 /**
2424 Set the current styling position to pos and the styling mask to mask.
2425 The styling mask can be used to protect some bits in each styling byte from
2426 modification.
2427 */
2428 void StartStyling(int pos, int mask);
2429
2430 /**
2431 Stop notifying the container of all key presses and commands.
2432 */
2433 void StopRecord();
2434
2435 /**
2436 Move caret to bottom of page, or one page down if already at bottom of page.
2437 */
2438 void StutteredPageDown();
2439
2440 /**
2441 Move caret to bottom of page, or one page down if already at bottom of page,
2442 extending selection to new caret position.
2443 */
2444 void StutteredPageDownExtend();
2445
2446 /**
2447 Move caret to top of page, or one page up if already at top of page.
2448 */
2449 void StutteredPageUp();
2450
2451 /**
2452 Move caret to top of page, or one page up if already at top of page, extending
2453 selection to new caret position.
2454 */
2455 void StutteredPageUpExtend();
2456
2457 /**
2458 Clear all the styles and make equivalent to the global default style.
2459 */
2460 void StyleClearAll();
2461
2462 /**
2463 Reset the default style to its state at startup
2464 */
2465 void StyleResetDefault();
2466
2467 /**
2468 Set the background colour of a style.
2469 */
2470 void StyleSetBackground(int style, const wxColour& back);
2471
2472 /**
2473 Set a style to be bold or not.
2474 */
2475 void StyleSetBold(int style, bool bold);
2476
2477 /**
2478 Set a style to be mixed case, or to force upper or lower case.
2479 */
2480 void StyleSetCase(int style, int caseForce);
2481
2482 /**
2483 Set a style to be changeable or not (read only).
2484 Experimental feature, currently buggy.
2485 */
2486 void StyleSetChangeable(int style, bool changeable);
2487
2488 /**
2489 Set the character set of the font in a style. Converts the Scintilla
2490 character set values to a wxFontEncoding.
2491 */
2492 void StyleSetCharacterSet(int style, int characterSet);
2493
2494 /**
2495 Set a style to have its end of line filled or not.
2496 */
2497 void StyleSetEOLFilled(int style, bool filled);
2498
2499 /**
2500 Set the font of a style.
2501 */
2502 void StyleSetFaceName(int style, const wxString& fontName);
2503
2504 /**
2505 Set style size, face, bold, italic, and underline attributes from
2506 a wxFont's attributes.
2507 */
2508 void StyleSetFont(int styleNum, wxFont& font);
2509
2510 /**
2511 Set all font style attributes at once.
2512 */
2513 void StyleSetFontAttr(int styleNum, int size,
2514 const wxString& faceName,
2515 bool bold,
2516 bool italic,
2517 bool underline,
2518 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
2519
2520 /**
2521 Set the font encoding to be used by a style.
2522 */
2523 void StyleSetFontEncoding(int style, wxFontEncoding encoding);
2524
2525 /**
2526 Set the foreground colour of a style.
2527 */
2528 void StyleSetForeground(int style, const wxColour& fore);
2529
2530 /**
2531 Set a style to be a hotspot or not.
2532 */
2533 void StyleSetHotSpot(int style, bool hotspot);
2534
2535 /**
2536 Set a style to be italic or not.
2537 */
2538 void StyleSetItalic(int style, bool italic);
2539
2540 /**
2541 Set the size of characters of a style.
2542 */
2543 void StyleSetSize(int style, int sizePoints);
2544
2545 /**
2546 Extract style settings from a spec-string which is composed of one or
2547 more of the following comma separated elements:
2548 bold turns on bold
2549 italic turns on italics
2550 fore:[name or #RRGGBB] sets the foreground colour
2551 back:[name or #RRGGBB] sets the background colour
2552 face:[facename] sets the font face name to use
2553 size:[num] sets the font size in points
2554 eol turns on eol filling
2555 underline turns on underlining
2556 */
2557 void StyleSetSpec(int styleNum, const wxString& spec);
2558
2559 /**
2560 Set a style to be underlined or not.
2561 */
2562 void StyleSetUnderline(int style, bool underline);
2563
2564 /**
2565 Set a style to be visible or not.
2566 */
2567 void StyleSetVisible(int style, bool visible);
2568
2569 /**
2570 If selection is empty or all on one line replace the selection with a tab
2571 character.
2572 If more than one line selected, indent the lines.
2573 */
2574 #define void Tab() /* implementation is private */
2575
2576 /**
2577 Make the target range start and end be the same as the selection range start
2578 and end.
2579 */
2580 void TargetFromSelection();
2581
2582 /**
2583 Retrieve the height of a particular line of text in pixels.
2584 */
2585 int TextHeight(int line);
2586
2587 /**
2588 Measure the pixel width of some text in a particular style.
2589 NUL terminated text argument.
2590 Does not handle tab or control characters.
2591 */
2592 int TextWidth(int style, const wxString& text);
2593
2594 /**
2595 Switch between sticky and non-sticky: meant to be bound to a key.
2596 */
2597 void ToggleCaretSticky();
2598
2599 /**
2600 Switch a header line between expanded and contracted.
2601 */
2602 void ToggleFold(int line);
2603
2604 /**
2605 Undo one action in the undo history.
2606 */
2607 void Undo();
2608
2609 /**
2610 Transform the selection to upper case.
2611 */
2612 void UpperCase();
2613
2614 /**
2615 Set whether a pop up menu is displayed automatically when the user presses
2616 the wrong mouse button.
2617 */
2618 void UsePopUp(bool allowPopUp);
2619
2620 /**
2621 Display a list of strings and send notification when user chooses one.
2622 */
2623 void UserListShow(int listType, const wxString& itemList);
2624
2625 /**
2626 Move caret to before first visible character on line.
2627 If already there move to first character on line.
2628 */
2629 void VCHome();
2630
2631 /**
2632 Like VCHome but extending selection to new caret position.
2633 */
2634 void VCHomeExtend();
2635
2636 /**
2637 Move caret to before first visible character on line.
2638 If already there move to first character on line.
2639 In either case, extend rectangular selection to new caret position.
2640 */
2641 void VCHomeRectExtend();
2642
2643 /**
2644
2645 */
2646 void VCHomeWrap();
2647
2648 /**
2649
2650 */
2651 void VCHomeWrapExtend();
2652
2653 /**
2654 Find the display line of a document line taking hidden lines into account.
2655 */
2656 int VisibleFromDocLine(int line);
2657
2658 /**
2659 Get position of end of word.
2660 */
2661 int WordEndPosition(int pos, bool onlyWordCharacters);
2662
2663 /**
2664 Move caret left one word.
2665 */
2666 void WordLeft();
2667
2668 /**
2669 Move caret left one word, position cursor at end of word.
2670 */
2671 void WordLeftEnd();
2672
2673 /**
2674 Move caret left one word, position cursor at end of word, extending selection
2675 to new caret position.
2676 */
2677 void WordLeftEndExtend();
2678
2679 /**
2680 Move caret left one word extending selection to new caret position.
2681 */
2682 void WordLeftExtend();
2683
2684 /**
2685 Move to the previous change in capitalisation.
2686 */
2687 void WordPartLeft();
2688
2689 /**
2690 Move to the previous change in capitalisation extending selection
2691 to new caret position.
2692 */
2693 void WordPartLeftExtend();
2694
2695 /**
2696 Move to the change next in capitalisation.
2697 */
2698 void WordPartRight();
2699
2700 /**
2701 Move to the next change in capitalisation extending selection
2702 to new caret position.
2703 */
2704 void WordPartRightExtend();
2705
2706 /**
2707 Move caret right one word.
2708 */
2709 void WordRight();
2710
2711 /**
2712 Move caret right one word, position cursor at end of word.
2713 */
2714 void WordRightEnd();
2715
2716 /**
2717 Move caret right one word, position cursor at end of word, extending selection
2718 to new caret position.
2719 */
2720 void WordRightEndExtend();
2721
2722 /**
2723 Move caret right one word extending selection to new caret position.
2724 */
2725 void WordRightExtend();
2726
2727 /**
2728 Get position of start of word.
2729 */
2730 int WordStartPosition(int pos, bool onlyWordCharacters);
2731
2732 /**
2733 The number of display lines needed to wrap a document line
2734 */
2735 int WrapCount(int line);
2736
2737 /**
2738 Magnify the displayed text by increasing the sizes by 1 point.
2739 */
2740 void ZoomIn();
2741
2742 /**
2743 Make the displayed text smaller by decreasing the sizes by 1 point.
2744 */
2745 void ZoomOut();
2746 };