Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# This file is automatically generated from Scintilla.iface
# DO NOT MODIFY
module Fox
class FXScintilla
#
# Basics
INVALID_POSITION = -1
# Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages
# as many EM_ messages can be used although that use is deprecated.
SCI_START = 2000
SCI_OPTIONAL_START = 3000
SCI_LEXER_START = 4000
# Add text to the document at current position.
def addText(length, text)
sendMessage(2001, length, text)
end
# Add array of cells to document.
def addStyledText(length, c)
sendMessage(2002, length, c)
end
# Insert string at a position.
def insertText(pos, text)
sendMessage(2003, pos, text)
end
# Delete all text in the document.
def clearAll
sendMessage(2004, 0, 0)
end
# Set all style bytes to 0, remove all folding information.
def clearDocumentStyle
sendMessage(2005, 0, 0)
end
# Returns the number of characters in the document.
def getLength
sendMessage(2006, 0, 0)
end
# Returns the character byte at the position.
def getCharAt(pos)
sendMessage(2007, pos, 0)
end
# Returns the position of the caret.
def getCurrentPos
sendMessage(2008, 0, 0)
end
# Returns the position of the opposite end of the selection to the caret.
def getAnchor
sendMessage(2009, 0, 0)
end
# Returns the style byte at the position.
def getStyleAt(pos)
sendMessage(2010, pos, 0)
end
# Redoes the next action on the undo history.
def redo
sendMessage(2011, 0, 0)
end
# Choose between collecting actions into the undo
# history and discarding them.
def setUndoCollection(collectUndo)
sendMessage(2012, collectUndo, 0)
end
# Select all the text in the document.
def selectAll
sendMessage(2013, 0, 0)
end
# Remember the current position in the undo history as the position
# at which the document was saved.
def setSavePoint
sendMessage(2014, 0, 0)
end
# Retrieve a buffer of cells.
# Returns the number of bytes in the buffer not including terminating NULs.
def getStyledText(tr)
sendMessage(2015, 0, tr)
end
# Are there any redoable actions in the undo history?
def canRedo
sendMessage(2016, 0, 0) == 1 ? true : false
end
# Retrieve the line number at which a particular marker is located.
def markerLineFromHandle(handle)
sendMessage(2017, handle, 0)
end
# Delete a marker.
def markerDeleteHandle(handle)
sendMessage(2018, handle, 0)
end
# Is undo history being collected?
def getUndoCollection
sendMessage(2019, 0, 0) == 1 ? true : false
end
SCWS_INVISIBLE = 0
SCWS_VISIBLEALWAYS = 1
SCWS_VISIBLEAFTERINDENT = 2
# Are white space characters currently visible?
# Returns one of SCWS_* constants.
def getViewWS
sendMessage(2020, 0, 0)
end
# Make white space characters invisible, always visible or visible outside indentation.
def setViewWS(viewWS)
sendMessage(2021, viewWS, 0)
end
# Find the position from a point within the window.
def positionFromPoint(x, y)
sendMessage(2022, x, y)
end
# Find the position from a point within the window but return
# INVALID_POSITION if not close to text.
def positionFromPointClose(x, y)
sendMessage(2023, x, y)
end
# Set caret to start of a line and ensure it is visible.
def gotoLine(line)
sendMessage(2024, line, 0)
end
# Set caret to a position and ensure it is visible.
def gotoPos(pos)
sendMessage(2025, pos, 0)
end
# Set the selection anchor to a position. The anchor is the opposite
# end of the selection from the caret.
def setAnchor(posAnchor)
sendMessage(2026, posAnchor, 0)
end
# Retrieve the text of the line containing the caret.
# Returns the index of the caret on the line.
def getCurLine(length)
buffer = "".ljust(length)
sendMessage(2027, length, buffer)
buffer
end
# Retrieve the position of the last correctly styled character.
def getEndStyled
sendMessage(2028, 0, 0)
end
SC_EOL_CRLF = 0
SC_EOL_CR = 1
SC_EOL_LF = 2
# Convert all line endings in the document to one mode.
def convertEOLs(eolMode)
sendMessage(2029, eolMode, 0)
end
# Retrieve the current end of line mode - one of CRLF, CR, or LF.
def getEOLMode
sendMessage(2030, 0, 0)
end
# Set the current end of line mode.
def setEOLMode(eolMode)
sendMessage(2031, eolMode, 0)
end
# Set the current styling position to pos and the styling mask to mask.
# The styling mask can be used to protect some bits in each styling byte from modification.
def startStyling(pos, mask)
sendMessage(2032, pos, mask)
end
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# Change style from current styling position for length characters to a style
# and move the current styling position to after this newly styled segment.
def setStyling(length, style)
sendMessage(2033, length, style)
end
# Is drawing done first into a buffer or direct to the screen?
def getBufferedDraw
sendMessage(2034, 0, 0) == 1 ? true : false
end
# If drawing is buffered then each line of text is drawn into a bitmap buffer
# before drawing it to the screen to avoid flicker.
def setBufferedDraw(buffered)
sendMessage(2035, buffered, 0)
end
# Change the visible size of a tab to be a multiple of the width of a space character.
def setTabWidth(tabWidth)
sendMessage(2036, tabWidth, 0)
end
# Retrieve the visible size of a tab.
def getTabWidth
sendMessage(2121, 0, 0)
end
# The SC_CP_UTF8 value can be used to enter Unicode mode.
# This is the same value as CP_UTF8 in Windows
SC_CP_UTF8 = 65001
# The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+.
SC_CP_DBCS = 1
# Set the code page used to interpret the bytes of the document as characters.
# The SC_CP_UTF8 value can be used to enter Unicode mode.
def setCodePage(codePage)
sendMessage(2037, codePage, 0)
end
# In palette mode, Scintilla uses the environment's palette calls to display
# more colours. This may lead to ugly displays.
def setUsePalette(usePalette)
sendMessage(2039, usePalette, 0)
end
MARKER_MAX = 31
SC_MARK_CIRCLE = 0
SC_MARK_ROUNDRECT = 1
SC_MARK_ARROW = 2
SC_MARK_SMALLRECT = 3
SC_MARK_SHORTARROW = 4
SC_MARK_EMPTY = 5
SC_MARK_ARROWDOWN = 6
SC_MARK_MINUS = 7
SC_MARK_PLUS = 8
# Shapes used for outlining column.
SC_MARK_VLINE = 9
SC_MARK_LCORNER = 10
SC_MARK_TCORNER = 11
SC_MARK_BOXPLUS = 12
SC_MARK_BOXPLUSCONNECTED = 13
SC_MARK_BOXMINUS = 14
SC_MARK_BOXMINUSCONNECTED = 15
SC_MARK_LCORNERCURVE = 16
SC_MARK_TCORNERCURVE = 17
SC_MARK_CIRCLEPLUS = 18
SC_MARK_CIRCLEPLUSCONNECTED = 19
SC_MARK_CIRCLEMINUS = 20
SC_MARK_CIRCLEMINUSCONNECTED = 21
# Invisible mark that only sets the line background color.
SC_MARK_BACKGROUND = 22
SC_MARK_DOTDOTDOT = 23
SC_MARK_ARROWS = 24
SC_MARK_PIXMAP = 25
SC_MARK_FULLRECT = 26
SC_MARK_CHARACTER = 10000
# Markers used for outlining column.
SC_MARKNUM_FOLDEREND = 25
SC_MARKNUM_FOLDEROPENMID = 26
SC_MARKNUM_FOLDERMIDTAIL = 27
SC_MARKNUM_FOLDERTAIL = 28
SC_MARKNUM_FOLDERSUB = 29
SC_MARKNUM_FOLDER = 30
SC_MARKNUM_FOLDEROPEN = 31
SC_MASK_FOLDERS = 0xFE000000
# Set the symbol used for a particular marker number.
def markerDefine(markerNumber, markerSymbol)
sendMessage(2040, markerNumber, markerSymbol)
end
# Set the foreground colour used for a particular marker number.
def markerSetFore(markerNumber, fore)
sendMessage(2041, markerNumber, fore & 0xffffff)
end
# Set the background colour used for a particular marker number.
def markerSetBack(markerNumber, back)
sendMessage(2042, markerNumber, back & 0xffffff)
end
# Add a marker to a line, returning an ID which can be used to find or delete the marker.
def markerAdd(line, markerNumber)
sendMessage(2043, line, markerNumber)
end
# Delete a marker from a line.
def markerDelete(line, markerNumber)
sendMessage(2044, line, markerNumber)
end
# Delete all markers with a particular number from all lines.
def markerDeleteAll(markerNumber)
sendMessage(2045, markerNumber, 0)
end
# Get a bit mask of all the markers set on a line.
def markerGet(line)
sendMessage(2046, line, 0)
end
# Find the next line after lineStart that includes a marker in mask.
def markerNext(lineStart, markerMask)
sendMessage(2047, lineStart, markerMask)
end
# Find the previous line before lineStart that includes a marker in mask.
def markerPrevious(lineStart, markerMask)
sendMessage(2048, lineStart, markerMask)
end
# Define a marker from a pixmap.
def markerDefinePixmap(markerNumber, pixmap)
sendMessage(2049, markerNumber, pixmap)
end
# Add a set of markers to a line.
def markerAddSet(line, set)
sendMessage(2466, line, set)
end
# Set the alpha used for a marker that is drawn in the text area, not the margin.
def markerSetAlpha(markerNumber, alpha)
sendMessage(2476, markerNumber, alpha)
end
SC_MARGIN_SYMBOL = 0
SC_MARGIN_NUMBER = 1
SC_MARGIN_BACK = 2
SC_MARGIN_FORE = 3
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# Set a margin to be either numeric or symbolic.
def setMarginTypeN(margin, marginType)
sendMessage(2240, margin, marginType)
end
# Retrieve the type of a margin.
def getMarginTypeN(margin)
sendMessage(2241, margin, 0)
end
# Set the width of a margin to a width expressed in pixels.
def setMarginWidthN(margin, pixelWidth)
sendMessage(2242, margin, pixelWidth)
end
# Retrieve the width of a margin in pixels.
def getMarginWidthN(margin)
sendMessage(2243, margin, 0)
end
# Set a mask that determines which markers are displayed in a margin.
def setMarginMaskN(margin, mask)
sendMessage(2244, margin, mask)
end
# Retrieve the marker mask of a margin.
def getMarginMaskN(margin)
sendMessage(2245, margin, 0)
end
# Make a margin sensitive or insensitive to mouse clicks.
def setMarginSensitiveN(margin, sensitive)
sendMessage(2246, margin, sensitive)
end
# Retrieve the mouse click sensitivity of a margin.
def getMarginSensitiveN(margin)
sendMessage(2247, margin, 0) == 1 ? true : false
end
# Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
# Style 39 is for future use.
STYLE_DEFAULT = 32
STYLE_LINENUMBER = 33
STYLE_BRACELIGHT = 34
STYLE_BRACEBAD = 35
STYLE_CONTROLCHAR = 36
STYLE_INDENTGUIDE = 37
STYLE_CALLTIP = 38
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
STYLE_LASTPREDEFINED = 39
STYLE_MAX = 127
# Character set identifiers are used in StyleSetCharacterSet.
# The values are the same as the Windows *_CHARSET values.
SC_CHARSET_ANSI = 0
SC_CHARSET_DEFAULT = 1
SC_CHARSET_BALTIC = 186
SC_CHARSET_CHINESEBIG5 = 136
SC_CHARSET_EASTEUROPE = 238
SC_CHARSET_GB2312 = 134
SC_CHARSET_GREEK = 161
SC_CHARSET_HANGUL = 129
SC_CHARSET_MAC = 77
SC_CHARSET_OEM = 255
SC_CHARSET_RUSSIAN = 204
SC_CHARSET_CYRILLIC = 1251
SC_CHARSET_SHIFTJIS = 128
SC_CHARSET_SYMBOL = 2
SC_CHARSET_TURKISH = 162
SC_CHARSET_JOHAB = 130
SC_CHARSET_HEBREW = 177
SC_CHARSET_ARABIC = 178
SC_CHARSET_VIETNAMESE = 163
SC_CHARSET_THAI = 222
SC_CHARSET_8859_15 = 1000
# Clear all the styles and make equivalent to the global default style.
def styleClearAll
sendMessage(2050, 0, 0)
end
# Set the foreground colour of a style.
def styleSetFore(style, fore)
sendMessage(2051, style, fore & 0xffffff)
end
# Set the background colour of a style.
def styleSetBack(style, back)
sendMessage(2052, style, back & 0xffffff)
end
# Set a style to be bold or not.
def styleSetBold(style, bold)
sendMessage(2053, style, bold)
end
# Set a style to be italic or not.
def styleSetItalic(style, italic)
sendMessage(2054, style, italic)
end
# Set the size of characters of a style.
def styleSetSize(style, sizePoints)
sendMessage(2055, style, sizePoints)
end
# Set the font of a style.
def styleSetFont(style, fontName)
sendMessage(2056, style, fontName)
end
# Set a style to have its end of line filled or not.
def styleSetEOLFilled(style, filled)
sendMessage(2057, style, filled)
end
# Reset the default style to its state at startup
def styleResetDefault
sendMessage(2058, 0, 0)
end
# Set a style to be underlined or not.
def styleSetUnderline(style, underline)
sendMessage(2059, style, underline)
end
SC_CASE_MIXED = 0
SC_CASE_UPPER = 1
SC_CASE_LOWER = 2
# Set a style to be mixed case, or to force upper or lower case.
def styleSetCase(style, caseForce)
sendMessage(2060, style, caseForce)
end
# Set the character set of the font in a style.
def styleSetCharacterSet(style, characterSet)
sendMessage(2066, style, characterSet)
end
# Set a style to be a hotspot or not.
def styleSetHotSpot(style, hotspot)
sendMessage(2409, style, hotspot)
end
# Set the foreground colour of the selection and whether to use this setting.
def setSelFore(useSetting, fore)
sendMessage(2067, useSetting, fore & 0xffffff)
end
# Set the background colour of the selection and whether to use this setting.
def setSelBack(useSetting, back)
sendMessage(2068, useSetting, back & 0xffffff)
end
# Get the alpha of the selection.
def getSelAlpha
sendMessage(2477, 0, 0)
end
# Set the alpha of the selection.
def setSelAlpha(alpha)
sendMessage(2478, alpha, 0)
end
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# Set the foreground colour of the caret.
def setCaretFore(fore)
sendMessage(2069, fore & 0xffffff, 0)
end
# When key+modifier combination km is pressed perform msg.
def assignCmdKey(km, msg)
sendMessage(2070, km, msg)
end
# When key+modifier combination km is pressed do nothing.
def clearCmdKey(km)
sendMessage(2071, km, 0)
end
# Drop all key mappings.
def clearAllCmdKeys
sendMessage(2072, 0, 0)
end
# Set the styles for a segment of the document.
def setStylingEx(length, styles)
sendMessage(2073, length, styles)
end
# Set a style to be visible or not.
def styleSetVisible(style, visible)
sendMessage(2074, style, visible)
end
# Get the time in milliseconds that the caret is on and off.
def getCaretPeriod
sendMessage(2075, 0, 0)
end
# Get the time in milliseconds that the caret is on and off. 0 = steady on.
def setCaretPeriod(periodMilliseconds)
sendMessage(2076, periodMilliseconds, 0)
end
# Set the set of characters making up words for when moving or selecting by word.
# First sets deaults like SetCharsDefault.
def setWordChars(characters)
sendMessage(2077, 0, characters)
end
# Start a sequence of actions that is undone and redone as a unit.
# May be nested.
def beginUndoAction
sendMessage(2078, 0, 0)
end
# End a sequence of actions that is undone and redone as a unit.
def endUndoAction
sendMessage(2079, 0, 0)
end
INDIC_MAX = 7
INDIC_PLAIN = 0
INDIC_SQUIGGLE = 1
INDIC_TT = 2
INDIC_DIAGONAL = 3
INDIC_STRIKE = 4
INDIC_HIDDEN = 5
INDIC_BOX = 6
INDIC_ROUNDBOX = 7
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
INDIC0_MASK = 0x20
INDIC1_MASK = 0x40
INDIC2_MASK = 0x80
INDICS_MASK = 0xE0
# Set an indicator to plain, squiggle or TT.
def indicSetStyle(indic, style)
sendMessage(2080, indic, style)
end
# Retrieve the style of an indicator.
def indicGetStyle(indic)
sendMessage(2081, indic, 0)
end
# Set the foreground colour of an indicator.
def indicSetFore(indic, fore)
sendMessage(2082, indic, fore & 0xffffff)
end
# Retrieve the foreground colour of an indicator.
def indicGetFore(indic)
sendMessage(2083, indic, 0)
end
# Set the foreground colour of all whitespace and whether to use this setting.
def setWhitespaceFore(useSetting, fore)
sendMessage(2084, useSetting, fore & 0xffffff)
end
# Set the background colour of all whitespace and whether to use this setting.
def setWhitespaceBack(useSetting, back)
sendMessage(2085, useSetting, back & 0xffffff)
end
# Divide each styling byte into lexical class bits (default: 5) and indicator
# bits (default: 3). If a lexer requires more than 32 lexical states, then this
# is used to expand the possible states.
def setStyleBits(bits)
sendMessage(2090, bits, 0)
end
# Retrieve number of bits in style bytes used to hold the lexical state.
def getStyleBits
sendMessage(2091, 0, 0)
end
# Used to hold extra styling information for each line.
def setLineState(line, state)
sendMessage(2092, line, state)
end
# Retrieve the extra styling information for a line.
def getLineState(line)
sendMessage(2093, line, 0)
end
# Retrieve the last line number that has line state.
def getMaxLineState
sendMessage(2094, 0, 0)
end
# Is the background of the line containing the caret in a different colour?
def getCaretLineVisible
sendMessage(2095, 0, 0) == 1 ? true : false
end
# Display the background of the line containing the caret in a different colour.
def setCaretLineVisible(show)
sendMessage(2096, show, 0)
end
# Get the colour of the background of the line containing the caret.
def getCaretLineBack
sendMessage(2097, 0, 0)
end
# Set the colour of the background of the line containing the caret.
def setCaretLineBack(back)
sendMessage(2098, back & 0xffffff, 0)
end
# Set a style to be changeable or not (read only).
# Experimental feature, currently buggy.
def styleSetChangeable(style, changeable)
sendMessage(2099, style, changeable)
end
# Display a auto-completion list.
# The lenEntered parameter indicates how many characters before
# the caret should be used to provide context.
def autoCShow(lenEntered, itemList)
sendMessage(2100, lenEntered, itemList)
end
# Remove the auto-completion list from the screen.
def autoCCancel
sendMessage(2101, 0, 0)
end
# Is there an auto-completion list visible?
def autoCActive
sendMessage(2102, 0, 0) == 1 ? true : false
end
# Retrieve the position of the caret when the auto-completion list was displayed.
def autoCPosStart
sendMessage(2103, 0, 0)
end
# User has selected an item so remove the list and insert the selection.
def autoCComplete
sendMessage(2104, 0, 0)
end
# Define a set of character that when typed cancel the auto-completion list.
def autoCStops(characterSet)
sendMessage(2105, 0, characterSet)
end
# Change the separator character in the string setting up an auto-completion list.
# Default is space but can be changed if items contain space.
def autoCSetSeparator(separatorCharacter)
sendMessage(2106, separatorCharacter, 0)
end
# Retrieve the auto-completion list separator character.
def autoCGetSeparator
sendMessage(2107, 0, 0)
end
# Select the item in the auto-completion list that starts with a string.
def autoCSelect(text)
sendMessage(2108, 0, text)
end
# Should the auto-completion list be cancelled if the user backspaces to a
# position before where the box was created.
def autoCSetCancelAtStart(cancel)
sendMessage(2110, cancel, 0)
end
# Retrieve whether auto-completion cancelled by backspacing before start.
def autoCGetCancelAtStart
sendMessage(2111, 0, 0) == 1 ? true : false
end
# Define a set of characters that when typed will cause the autocompletion to
# choose the selected item.
def autoCSetFillUps(characterSet)
sendMessage(2112, 0, characterSet)
end
# Should a single item auto-completion list automatically choose the item.
def autoCSetChooseSingle(chooseSingle)
sendMessage(2113, chooseSingle, 0)
end
# Retrieve whether a single item auto-completion list automatically choose the item.
def autoCGetChooseSingle
sendMessage(2114, 0, 0) == 1 ? true : false
end
# Set whether case is significant when performing auto-completion searches.
def autoCSetIgnoreCase(ignoreCase)
sendMessage(2115, ignoreCase, 0)
end
# Retrieve state of ignore case flag.
def autoCGetIgnoreCase
sendMessage(2116, 0, 0) == 1 ? true : false
end
# Display a list of strings and send notification when user chooses one.
def userListShow(listType, itemList)
sendMessage(2117, listType, itemList)
end
# Set whether or not autocompletion is hidden automatically when nothing matches.
def autoCSetAutoHide(autoHide)
sendMessage(2118, autoHide, 0)
end
# Retrieve whether or not autocompletion is hidden automatically when nothing matches.
def autoCGetAutoHide
sendMessage(2119, 0, 0) == 1 ? true : false
end
# Set whether or not autocompletion deletes any word characters
# after the inserted text upon completion.
def autoCSetDropRestOfWord(dropRestOfWord)
sendMessage(2270, dropRestOfWord, 0)
end
# Retrieve whether or not autocompletion deletes any word characters
# after the inserted text upon completion.
def autoCGetDropRestOfWord
sendMessage(2271, 0, 0) == 1 ? true : false
end
# Register an XPM image for use in autocompletion lists.
def registerImage(type, xpmData)
sendMessage(2405, type, xpmData)
end
# Clear all the registered XPM images.
def clearRegisteredImages
sendMessage(2408, 0, 0)
end
# Retrieve the auto-completion list type-separator character.
def autoCGetTypeSeparator
sendMessage(2285, 0, 0)
end
# Change the type-separator character in the string setting up an auto-completion list.
# Default is '?' but can be changed if items contain '?'.
def autoCSetTypeSeparator(separatorCharacter)
sendMessage(2286, separatorCharacter, 0)
end
# Set the maximum width, in characters, of auto-completion and user lists.
# Set to 0 to autosize to fit longest item, which is the default.
def autoCSetMaxWidth(characterCount)
sendMessage(2208, characterCount, 0)
end
# Get the maximum width, in characters, of auto-completion and user lists.
def autoCGetMaxWidth
sendMessage(2209, 0, 0)
end
# Set the maximum height, in rows, of auto-completion and user lists.
# The default is 5 rows.
def autoCSetMaxHeight(rowCount)
sendMessage(2210, rowCount, 0)
end
# Set the maximum height, in rows, of auto-completion and user lists.
def autoCGetMaxHeight
sendMessage(2211, 0, 0)
end
# Set the number of spaces used for one level of indentation.
def setIndent(indentSize)
sendMessage(2122, indentSize, 0)
end
# Retrieve indentation size.
def getIndent
sendMessage(2123, 0, 0)
end
# Indentation will only use space characters if useTabs is false, otherwise
# it will use a combination of tabs and spaces.
def setUseTabs(useTabs)
sendMessage(2124, useTabs, 0)
end
# Retrieve whether tabs will be used in indentation.
def getUseTabs
sendMessage(2125, 0, 0) == 1 ? true : false
end
# Change the indentation of a line to a number of columns.
def setLineIndentation(line, indentSize)
sendMessage(2126, line, indentSize)
end
# Retrieve the number of columns that a line is indented.
def getLineIndentation(line)
sendMessage(2127, line, 0)
end
# Retrieve the position before the first non indentation character on a line.
def getLineIndentPosition(line)
sendMessage(2128, line, 0)
end
# Retrieve the column number of a position, taking tab width into account.
def getColumn(pos)
sendMessage(2129, pos, 0)
end
# Show or hide the horizontal scroll bar.
def setHScrollBar(show)
sendMessage(2130, show, 0)
end
# Is the horizontal scroll bar visible?
def getHScrollBar
sendMessage(2131, 0, 0) == 1 ? true : false
end
# Show or hide indentation guides.
def setIndentationGuides(show)
sendMessage(2132, show, 0)
end
# Are the indentation guides visible?
def getIndentationGuides
sendMessage(2133, 0, 0) == 1 ? true : false
end
# Set the highlighted indentation guide column.
# 0 = no highlighted guide.
def setHighlightGuide(column)
sendMessage(2134, column, 0)
end
# Get the highlighted indentation guide column.
def getHighlightGuide
sendMessage(2135, 0, 0)
end
# Get the position after the last visible characters on a line.
def getLineEndPosition(line)
sendMessage(2136, line, 0)
end
# Get the code page used to interpret the bytes of the document as characters.
def getCodePage
sendMessage(2137, 0, 0)
end
# Get the foreground colour of the caret.
def getCaretFore
sendMessage(2138, 0, 0)
end
# In palette mode?
def getUsePalette
sendMessage(2139, 0, 0) == 1 ? true : false
end
# In read-only mode?
def getReadOnly
sendMessage(2140, 0, 0) == 1 ? true : false
end
# Sets the position of the caret.
def setCurrentPos(pos)
sendMessage(2141, pos, 0)
end
# Sets the position that starts the selection - this becomes the anchor.
def setSelectionStart(pos)
sendMessage(2142, pos, 0)
end
# Returns the position at the start of the selection.
def getSelectionStart
sendMessage(2143, 0, 0)
end
# Sets the position that ends the selection - this becomes the currentPosition.
def setSelectionEnd(pos)
sendMessage(2144, pos, 0)
end
# Returns the position at the end of the selection.
def getSelectionEnd
sendMessage(2145, 0, 0)
end
# Sets the print magnification added to the point size of each style for printing.
def setPrintMagnification(magnification)
sendMessage(2146, magnification, 0)
end
# Returns the print magnification.
def getPrintMagnification
sendMessage(2147, 0, 0)
end
# PrintColourMode - use same colours as screen.
SC_PRINT_NORMAL = 0
# PrintColourMode - invert the light value of each style for printing.
SC_PRINT_INVERTLIGHT = 1
# PrintColourMode - force black text on white background for printing.
SC_PRINT_BLACKONWHITE = 2
# PrintColourMode - text stays coloured, but all background is forced to be white for printing.
SC_PRINT_COLOURONWHITE = 3
# PrintColourMode - only the default-background is forced to be white for printing.
SC_PRINT_COLOURONWHITEDEFAULTBG = 4
# Modify colours when printing for clearer printed text.
def setPrintColourMode(mode)
sendMessage(2148, mode, 0)
end
# Returns the print colour mode.
def getPrintColourMode
sendMessage(2149, 0, 0)
end
SCFIND_WHOLEWORD = 2
SCFIND_MATCHCASE = 4
SCFIND_WORDSTART = 0x00100000
SCFIND_REGEXP = 0x00200000
SCFIND_POSIX = 0x00400000
# Find some text in the document.
def findText(flags, ft)
sendMessage(2150, flags, ft)
end
# On Windows, will draw the document into a display context such as a printer.
def formatRange(draw, fr)
sendMessage(2151, draw, fr)
end
# Retrieve the display line at the top of the display.
def getFirstVisibleLine
sendMessage(2152, 0, 0)
end
# Retrieve the contents of a line.
# Returns the length of the line.
def getLine(line)
buffer = "".ljust(line)
sendMessage(2153, line, buffer)
buffer
end
# Returns the number of lines in the document. There is always at least one.
def getLineCount
sendMessage(2154, 0, 0)
end
# Sets the size in pixels of the left margin.
def setMarginLeft(pixelWidth)
sendMessage(2155, 0, pixelWidth)
end
# Returns the size in pixels of the left margin.
def getMarginLeft
sendMessage(2156, 0, 0)
end
# Sets the size in pixels of the right margin.
def setMarginRight(pixelWidth)
sendMessage(2157, 0, pixelWidth)
end
# Returns the size in pixels of the right margin.
def getMarginRight
sendMessage(2158, 0, 0)
end
# Is the document different from when it was last saved?
def getModify
sendMessage(2159, 0, 0) == 1 ? true : false
end
# Select a range of text.
def setSel(start, last)
sendMessage(2160, start, last)
end
# Retrieve the selected text.
# Return the length of the text.
def getSelText
sendMessage(2161, 0, text)
end
# Retrieve a range of text.
# Return the length of the text.
def getTextRange(tr)
sendMessage(2162, 0, tr)
end
# Draw the selection in normal style or with selection highlighted.
def hideSelection(normal)
sendMessage(2163, normal, 0)
end
# Retrieve the x value of the point in the window where a position is displayed.
def pointXFromPosition(pos)
sendMessage(2164, 0, pos)
end
# Retrieve the y value of the point in the window where a position is displayed.
def pointYFromPosition(pos)
sendMessage(2165, 0, pos)
end
# Retrieve the line containing a position.
def lineFromPosition(pos)
sendMessage(2166, pos, 0)
end
# Retrieve the position at the start of a line.
def positionFromLine(line)
sendMessage(2167, line, 0)
end
# Scroll horizontally and vertically.
def lineScroll(columns, lines)
sendMessage(2168, columns, lines)
end
# Ensure the caret is visible.
def scrollCaret
sendMessage(2169, 0, 0)
end
# Replace the selected text with the argument text.
def replaceSel(text)
sendMessage(2170, 0, text)
end
# Set to read only or read write.
def setReadOnly(readOnly)
sendMessage(2171, readOnly, 0)
end
# Null operation.
def null
sendMessage(2172, 0, 0)
end
# Will a paste succeed?
def canPaste
sendMessage(2173, 0, 0) == 1 ? true : false
end
# Are there any undoable actions in the undo history?
def canUndo
sendMessage(2174, 0, 0) == 1 ? true : false
end
# Delete the undo history.
def emptyUndoBuffer
sendMessage(2175, 0, 0)
end
# Undo one action in the undo history.
def undo
sendMessage(2176, 0, 0)
end
# Cut the selection to the clipboard.
def cut
sendMessage(2177, 0, 0)
end
# Copy the selection to the clipboard.
def copy
sendMessage(2178, 0, 0)
end
# Paste the contents of the clipboard into the document replacing the selection.
def paste
sendMessage(2179, 0, 0)
end
# Clear the selection.
def clear
sendMessage(2180, 0, 0)
end
# Replace the contents of the document with the argument text.
def setText(text)
sendMessage(2181, 0, text)
end
# Retrieve all the text in the document.
# Returns number of characters retrieved.
def getText(length)
buffer = "".ljust(length)
sendMessage(2182, length, buffer)
buffer
end
# Retrieve the number of characters in the document.
def getTextLength
sendMessage(2183, 0, 0)
end
# Retrieve a pointer to a function that processes messages for this Scintilla.
def getDirectFunction
sendMessage(2184, 0, 0)
end
# Retrieve a pointer value to use as the first argument when calling
# the function returned by GetDirectFunction.
def getDirectPointer
sendMessage(2185, 0, 0)
end
# Set to overtype (true) or insert mode.
def setOvertype(overtype)
sendMessage(2186, overtype, 0)
end
# Returns true if overtype mode is active otherwise false is returned.
def getOvertype
sendMessage(2187, 0, 0) == 1 ? true : false
end
# Set the width of the insert mode caret.
def setCaretWidth(pixelWidth)
sendMessage(2188, pixelWidth, 0)
end
# Returns the width of the insert mode caret.
def getCaretWidth
sendMessage(2189, 0, 0)
end
# Sets the position that starts the target which is used for updating the
# document without affecting the scroll position.
def setTargetStart(pos)
sendMessage(2190, pos, 0)
end
# Get the position that starts the target.
def getTargetStart
sendMessage(2191, 0, 0)
end
# Sets the position that ends the target which is used for updating the
# document without affecting the scroll position.
def setTargetEnd(pos)
sendMessage(2192, pos, 0)
end
# Get the position that ends the target.
def getTargetEnd
sendMessage(2193, 0, 0)
end
# Replace the target text with the argument text.
# Text is counted so it can contain NULs.
# Returns the length of the replacement text.
def replaceTarget(length, text)
sendMessage(2194, length, text)
end
# Replace the target text with the argument text after \d processing.
# Text is counted so it can contain NULs.
# Looks for \d where d is between 1 and 9 and replaces these with the strings
# matched in the last search operation which were surrounded by \( and \).
# Returns the length of the replacement text including any change
# caused by processing the \d patterns.
def replaceTargetRE(length, text)
sendMessage(2195, length, text)
end
# Search for a counted string in the target and set the target to the found
# range. Text is counted so it can contain NULs.
# Returns length of range or -1 for failure in which case target is not moved.
def searchInTarget(length, text)
sendMessage(2197, length, text)
end
# Set the search flags used by SearchInTarget.
def setSearchFlags(flags)
sendMessage(2198, flags, 0)
end
# Get the search flags used by SearchInTarget.
def getSearchFlags
sendMessage(2199, 0, 0)
end
# Show a call tip containing a definition near position pos.
def callTipShow(pos, definition)
sendMessage(2200, pos, definition)
end
# Remove the call tip from the screen.
def callTipCancel
sendMessage(2201, 0, 0)
end
# Is there an active call tip?
def callTipActive
sendMessage(2202, 0, 0) == 1 ? true : false
end
# Retrieve the position where the caret was before displaying the call tip.
def callTipPosStart
sendMessage(2203, 0, 0)
end
# Highlight a segment of the definition.
def callTipSetHlt(start, last)
sendMessage(2204, start, last)
end
# Set the background colour for the call tip.
def callTipSetBack(back)
sendMessage(2205, back & 0xffffff, 0)
end
# Set the foreground colour for the call tip.
def callTipSetFore(fore)
sendMessage(2206, fore & 0xffffff, 0)
end
# Set the foreground colour for the highlighted part of the call tip.
def callTipSetForeHlt(fore)
sendMessage(2207, fore & 0xffffff, 0)
end
# Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
def callTipUseStyle(tabSize)
sendMessage(2212, tabSize, 0)
end
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
# Find the display line of a document line taking hidden lines into account.
def visibleFromDocLine(line)
sendMessage(2220, line, 0)
end
# Find the document line of a display line taking hidden lines into account.
def docLineFromVisible(lineDisplay)
sendMessage(2221, lineDisplay, 0)
end
# The number of display lines needed to wrap a document line
def wrapCount(line)
sendMessage(2235, line, 0)
end
SC_FOLDLEVELBASE = 0x400
SC_FOLDLEVELWHITEFLAG = 0x1000
SC_FOLDLEVELHEADERFLAG = 0x2000
SC_FOLDLEVELBOXHEADERFLAG = 0x4000
SC_FOLDLEVELBOXFOOTERFLAG = 0x8000
SC_FOLDLEVELCONTRACTED = 0x10000
SC_FOLDLEVELUNINDENT = 0x20000
SC_FOLDLEVELNUMBERMASK = 0x0FFF
# Set the fold level of a line.
# This encodes an integer level along with flags indicating whether the
# line is a header and whether it is effectively white space.
def setFoldLevel(line, level)
sendMessage(2222, line, level)
end
# Retrieve the fold level of a line.
def getFoldLevel(line)
sendMessage(2223, line, 0)
end
# Find the last child line of a header line.
def getLastChild(line, level)
sendMessage(2224, line, level)
end
# Find the parent line of a child line.
def getFoldParent(line)
sendMessage(2225, line, 0)
end
# Make a range of lines visible.
def showLines(lineStart, lineEnd)
sendMessage(2226, lineStart, lineEnd)
end
# Make a range of lines invisible.
def hideLines(lineStart, lineEnd)
sendMessage(2227, lineStart, lineEnd)
end
# Is a line visible?
def getLineVisible(line)
sendMessage(2228, line, 0) == 1 ? true : false
end
# Show the children of a header line.
def setFoldExpanded(line, expanded)
sendMessage(2229, line, expanded)
end
# Is a header line expanded?
def getFoldExpanded(line)
sendMessage(2230, line, 0) == 1 ? true : false
end
# Switch a header line between expanded and contracted.
def toggleFold(line)
sendMessage(2231, line, 0)
end
# Ensure a particular line is visible by expanding any header line hiding it.
def ensureVisible(line)
sendMessage(2232, line, 0)
end
SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002
SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004
SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008
SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010
SC_FOLDFLAG_LEVELNUMBERS = 0x0040
SC_FOLDFLAG_BOX = 0x0001
# Set some style options for folding.
def setFoldFlags(flags)
sendMessage(2233, flags, 0)
end
# Ensure a particular line is visible by expanding any header line hiding it.
# Use the currently set visibility policy to determine which range to display.
def ensureVisibleEnforcePolicy(line)
sendMessage(2234, line, 0)
end
# Sets whether a tab pressed when caret is within indentation indents.
def setTabIndents(tabIndents)
sendMessage(2260, tabIndents, 0)
end
# Does a tab pressed when caret is within indentation indent?
def getTabIndents
sendMessage(2261, 0, 0) == 1 ? true : false
end
# Sets whether a backspace pressed when caret is within indentation unindents.
def setBackSpaceUnIndents(bsUnIndents)
sendMessage(2262, bsUnIndents, 0)
end
# Does a backspace pressed when caret is within indentation unindent?
def getBackSpaceUnIndents
sendMessage(2263, 0, 0) == 1 ? true : false
end
SC_TIME_FOREVER = 10000000
# Sets the time the mouse must sit still to generate a mouse dwell event.
def setMouseDwellTime(periodMilliseconds)
sendMessage(2264, periodMilliseconds, 0)
end
# Retrieve the time the mouse must sit still to generate a mouse dwell event.
def getMouseDwellTime
sendMessage(2265, 0, 0)
end
# Get position of start of word.
def wordStartPosition(pos, onlyWordCharacters)
sendMessage(2266, pos, onlyWordCharacters)
end
# Get position of end of word.
def wordEndPosition(pos, onlyWordCharacters)
sendMessage(2267, pos, onlyWordCharacters)
end
SC_WRAP_NONE = 0
SC_WRAP_WORD = 1
SC_WRAP_CHAR = 2
# Sets whether text is word wrapped.
def setWrapMode(mode)
sendMessage(2268, mode, 0)
end
# Retrieve whether text is word wrapped.
def getWrapMode
sendMessage(2269, 0, 0)
end
SC_WRAPVISUALFLAG_NONE = 0x0000
SC_WRAPVISUALFLAG_END = 0x0001
SC_WRAPVISUALFLAG_START = 0x0002
# Set the display mode of visual flags for wrapped lines.
def setWrapVisualFlags(wrapVisualFlags)
sendMessage(2460, wrapVisualFlags, 0)
end
# Retrive the display mode of visual flags for wrapped lines.
def getWrapVisualFlags
sendMessage(2461, 0, 0)
end
SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000
SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001
SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002
# Set the location of visual flags for wrapped lines.
def setWrapVisualFlagsLocation(wrapVisualFlagsLocation)
sendMessage(2462, wrapVisualFlagsLocation, 0)
end
# Retrive the location of visual flags for wrapped lines.
def getWrapVisualFlagsLocation
sendMessage(2463, 0, 0)
end
# Set the start indent for wrapped lines.
def setWrapStartIndent(indent)
sendMessage(2464, indent, 0)
end
# Retrive the start indent for wrapped lines.
def getWrapStartIndent
sendMessage(2465, 0, 0)
end
SC_CACHE_NONE = 0
SC_CACHE_CARET = 1
SC_CACHE_PAGE = 2
SC_CACHE_DOCUMENT = 3
# Sets the degree of caching of layout information.
def setLayoutCache(mode)
sendMessage(2272, mode, 0)
end
# Retrieve the degree of caching of layout information.
def getLayoutCache
sendMessage(2273, 0, 0)
end
# Sets the document width assumed for scrolling.
def setScrollWidth(pixelWidth)
sendMessage(2274, pixelWidth, 0)
end
# Retrieve the document width assumed for scrolling.
def getScrollWidth
sendMessage(2275, 0, 0)
end
# Measure the pixel width of some text in a particular style.
# NUL terminated text argument.
# Does not handle tab or control characters.
def textWidth(style, text)
sendMessage(2276, style, text)
end
# Sets the scroll range so that maximum scroll position has
# the last line at the bottom of the view (default).
# Setting this to false allows scrolling one page below the last line.
def setEndAtLastLine(endAtLastLine)
sendMessage(2277, endAtLastLine, 0)
end
# Retrieve whether the maximum scroll position has the last
# line at the bottom of the view.
def getEndAtLastLine
sendMessage(2278, 0, 0) == 1 ? true : false
end
# Retrieve the height of a particular line of text in pixels.
def textHeight(line)
sendMessage(2279, line, 0)
end
# Show or hide the vertical scroll bar.
def setVScrollBar(show)
sendMessage(2280, show, 0)
end
# Is the vertical scroll bar visible?
def getVScrollBar
sendMessage(2281, 0, 0) == 1 ? true : false
end
# Append a string to the end of the document without changing the selection.
def appendText(length, text)
sendMessage(2282, length, text)
end
# Is drawing done in two phases with backgrounds drawn before faoregrounds?
def getTwoPhaseDraw
sendMessage(2283, 0, 0) == 1 ? true : false
end
# In twoPhaseDraw mode, drawing is performed in two phases, first the background
# and then the foreground. This avoids chopping off characters that overlap the next run.
def setTwoPhaseDraw(twoPhase)
sendMessage(2284, twoPhase, 0)
end
# Make the target range start and end be the same as the selection range start and end.
def targetFromSelection
sendMessage(2287, 0, 0)
end
# Join the lines in the target.
def linesJoin
sendMessage(2288, 0, 0)
end
# Split the lines in the target into lines that are less wide than pixelWidth
# where possible.
def linesSplit(pixelWidth)
sendMessage(2289, pixelWidth, 0)
end
# Set the colours used as a chequerboard pattern in the fold margin
def setFoldMarginColour(useSetting, back)
sendMessage(2290, useSetting, back & 0xffffff)
end
def setFoldMarginHiColour(useSetting, fore)
sendMessage(2291, useSetting, fore & 0xffffff)
end
# Move caret down one line.
def lineDown
sendMessage(2300, 0, 0)
end
# Move caret down one line extending selection to new caret position.
def lineDownExtend
sendMessage(2301, 0, 0)
end
# Move caret up one line.
def lineUp
sendMessage(2302, 0, 0)
end
# Move caret up one line extending selection to new caret position.
def lineUpExtend
sendMessage(2303, 0, 0)
end
# Move caret left one character.
def charLeft
sendMessage(2304, 0, 0)
end
# Move caret left one character extending selection to new caret position.
def charLeftExtend
sendMessage(2305, 0, 0)
end
# Move caret right one character.
def charRight
sendMessage(2306, 0, 0)
end
# Move caret right one character extending selection to new caret position.
def charRightExtend
sendMessage(2307, 0, 0)
end
# Move caret left one word.
def wordLeft
sendMessage(2308, 0, 0)
end
# Move caret left one word extending selection to new caret position.
def wordLeftExtend
sendMessage(2309, 0, 0)
end
# Move caret right one word.
def wordRight
sendMessage(2310, 0, 0)
end
# Move caret right one word extending selection to new caret position.
def wordRightExtend
sendMessage(2311, 0, 0)
end
# Move caret to first position on line.
def home
sendMessage(2312, 0, 0)
end
# Move caret to first position on line extending selection to new caret position.
def homeExtend
sendMessage(2313, 0, 0)
end
# Move caret to last position on line.
def lineEnd
sendMessage(2314, 0, 0)
end
# Move caret to last position on line extending selection to new caret position.
def lineEndExtend
sendMessage(2315, 0, 0)
end
# Move caret to first position in document.
def documentStart
sendMessage(2316, 0, 0)
end
# Move caret to first position in document extending selection to new caret position.
def documentStartExtend
sendMessage(2317, 0, 0)
end
# Move caret to last position in document.
def documentEnd
sendMessage(2318, 0, 0)
end
# Move caret to last position in document extending selection to new caret position.
def documentEndExtend
sendMessage(2319, 0, 0)
end
# Move caret one page up.
def pageUp
sendMessage(2320, 0, 0)
end
# Move caret one page up extending selection to new caret position.
def pageUpExtend
sendMessage(2321, 0, 0)
end
# Move caret one page down.
def pageDown
sendMessage(2322, 0, 0)
end
# Move caret one page down extending selection to new caret position.
def pageDownExtend
sendMessage(2323, 0, 0)
end
# Switch from insert to overtype mode or the reverse.
def editToggleOvertype
sendMessage(2324, 0, 0)
end
# Cancel any modes such as call tip or auto-completion list display.
def cancel
sendMessage(2325, 0, 0)
end
# Delete the selection or if no selection, the character before the caret.
def deleteBack
sendMessage(2326, 0, 0)
end
# If selection is empty or all on one line replace the selection with a tab character.
# If more than one line selected, indent the lines.
def tab
sendMessage(2327, 0, 0)
end
# Dedent the selected lines.
def backTab
sendMessage(2328, 0, 0)
end
# Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
def newLine
sendMessage(2329, 0, 0)
end
# Insert a Form Feed character.
def formFeed
sendMessage(2330, 0, 0)
end
# Move caret to before first visible character on line.
# If already there move to first character on line.
def vCHome
sendMessage(2331, 0, 0)
end
# Like VCHome but extending selection to new caret position.
def vCHomeExtend
sendMessage(2332, 0, 0)
end
# Magnify the displayed text by increasing the sizes by 1 point.
def zoomIn
sendMessage(2333, 0, 0)
end
# Make the displayed text smaller by decreasing the sizes by 1 point.
def zoomOut
sendMessage(2334, 0, 0)
end
# Delete the word to the left of the caret.
def delWordLeft
sendMessage(2335, 0, 0)
end
# Delete the word to the right of the caret.
def delWordRight
sendMessage(2336, 0, 0)
end
# Cut the line containing the caret.
def lineCut
sendMessage(2337, 0, 0)
end
# Delete the line containing the caret.
def lineDelete
sendMessage(2338, 0, 0)
end
# Switch the current line with the previous.
def lineTranspose
sendMessage(2339, 0, 0)
end
# Duplicate the current line.
def lineDuplicate
sendMessage(2404, 0, 0)
end
# Transform the selection to lower case.
def lowerCase
sendMessage(2340, 0, 0)
end
# Transform the selection to upper case.
def upperCase
sendMessage(2341, 0, 0)
end
# Scroll the document down, keeping the caret visible.
def lineScrollDown
sendMessage(2342, 0, 0)
end
# Scroll the document up, keeping the caret visible.
def lineScrollUp
sendMessage(2343, 0, 0)
end
# Delete the selection or if no selection, the character before the caret.
# Will not delete the character before at the start of a line.
def deleteBackNotLine
sendMessage(2344, 0, 0)
end
# Move caret to first position on display line.
def homeDisplay
sendMessage(2345, 0, 0)
end
# Move caret to first position on display line extending selection to
# new caret position.
def homeDisplayExtend
sendMessage(2346, 0, 0)
end
# Move caret to last position on display line.
def lineEndDisplay
sendMessage(2347, 0, 0)
end
# Move caret to last position on display line extending selection to new
# caret position.
def lineEndDisplayExtend
sendMessage(2348, 0, 0)
end
# These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
# except they behave differently when word-wrap is enabled:
# They go first to the start / end of the display line, like (Home|LineEnd)Display
# The difference is that, the cursor is already at the point, it goes on to the start
# or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
def homeWrap
sendMessage(2349, 0, 0)
end
def homeWrapExtend
sendMessage(2450, 0, 0)
end
def lineEndWrap
sendMessage(2451, 0, 0)
end
def lineEndWrapExtend
sendMessage(2452, 0, 0)
end
def vCHomeWrap
sendMessage(2453, 0, 0)
end
def vCHomeWrapExtend
sendMessage(2454, 0, 0)
end
# Copy the line containing the caret.
def lineCopy
sendMessage(2455, 0, 0)
end
# Move the caret inside current view if it's not there already.
def moveCaretInsideView
sendMessage(2401, 0, 0)
end
# How many characters are on a line, not including end of line characters?
def lineLength(line)
sendMessage(2350, line, 0)
end
# Highlight the characters at two positions.
def braceHighlight(pos1, pos2)
sendMessage(2351, pos1, pos2)
end
# Highlight the character at a position indicating there is no matching brace.
def braceBadLight(pos)
sendMessage(2352, pos, 0)
end
# Find the position of a matching brace or INVALID_POSITION if no match.
def braceMatch(pos)
sendMessage(2353, pos, 0)
end
# Are the end of line characters visible?
def getViewEOL
sendMessage(2355, 0, 0) == 1 ? true : false
end
# Make the end of line characters visible or invisible.
def setViewEOL(visible)
sendMessage(2356, visible, 0)
end
# Retrieve a pointer to the document object.
def getDocPointer
sendMessage(2357, 0, 0)
end
# Change the document object used.
def setDocPointer(pointer)
sendMessage(2358, 0, pointer)
end
# Set which document modification events are sent to the container.
def setModEventMask(mask)
sendMessage(2359, mask, 0)
end
EDGE_NONE = 0
EDGE_LINE = 1
EDGE_BACKGROUND = 2
# Retrieve the column number which text should be kept within.
def getEdgeColumn
sendMessage(2360, 0, 0)
end
# Set the column number of the edge.
# If text goes past the edge then it is highlighted.
def setEdgeColumn(column)
sendMessage(2361, column, 0)
end
# Retrieve the edge highlight mode.
def getEdgeMode
sendMessage(2362, 0, 0)
end
# The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
# goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
def setEdgeMode(mode)
sendMessage(2363, mode, 0)
end
# Retrieve the colour used in edge indication.
def getEdgeColour
sendMessage(2364, 0, 0)
end
# Change the colour used in edge indication.
def setEdgeColour(edgeColour)
sendMessage(2365, edgeColour & 0xffffff, 0)
end
# Sets the current caret position to be the search anchor.
def searchAnchor
sendMessage(2366, 0, 0)
end
# Find some text starting at the search anchor.
# Does not ensure the selection is visible.
def searchNext(flags, text)
sendMessage(2367, flags, text)
end
# Find some text starting at the search anchor and moving backwards.
# Does not ensure the selection is visible.
def searchPrev(flags, text)
sendMessage(2368, flags, text)
end
# Retrieves the number of lines completely visible.
def linesOnScreen
sendMessage(2370, 0, 0)
end
# Set whether a pop up menu is displayed automatically when the user presses
# the wrong mouse button.
def usePopUp(allowPopUp)
sendMessage(2371, allowPopUp, 0)
end
# Is the selection rectangular? The alternative is the more common stream selection.
def selectionIsRectangle
sendMessage(2372, 0, 0) == 1 ? true : false
end
# Set the zoom level. This number of points is added to the size of all fonts.
# It may be positive to magnify or negative to reduce.
def setZoom(zoom)
sendMessage(2373, zoom, 0)
end
# Retrieve the zoom level.
def getZoom
sendMessage(2374, 0, 0)
end
# Create a new document object.
# Starts with reference count of 1 and not selected into editor.
def createDocument
sendMessage(2375, 0, 0)
end
# Extend life of document.
def addRefDocument(doc)
sendMessage(2376, 0, doc)
end
# Release a reference to the document, deleting document if it fades to black.
def releaseDocument(doc)
sendMessage(2377, 0, doc)
end
# Get which document modification events are sent to the container.
def getModEventMask
sendMessage(2378, 0, 0)
end
# Change internal focus flag.
def setFocusFlag(focus)
sendMessage(2380, focus, 0)
end
# Get internal focus flag.
def getFocus
sendMessage(2381, 0, 0) == 1 ? true : false
end
# Change error status - 0 = OK.
def setStatus(statusCode)
sendMessage(2382, statusCode, 0)
end
# Get error status.
def getStatus
sendMessage(2383, 0, 0)
end
# Set whether the mouse is captured when its button is pressed.
def setMouseDownCaptures(captures)
sendMessage(2384, captures, 0)
end
# Get whether mouse gets captured.
def getMouseDownCaptures
sendMessage(2385, 0, 0) == 1 ? true : false
end
SC_CURSORNORMAL = -1
SC_CURSORWAIT = 4
# Sets the cursor to one of the SC_CURSOR* values.
def setCursor(cursorType)
sendMessage(2386, cursorType, 0)
end
# Get cursor type.
def getCursor
sendMessage(2387, 0, 0)
end
# Change the way control characters are displayed:
# If symbol is < 32, keep the drawn way, else, use the given character.
def setControlCharSymbol(symbol)
sendMessage(2388, symbol, 0)
end
# Get the way control characters are displayed.
def getControlCharSymbol
sendMessage(2389, 0, 0)
end
# Move to the previous change in capitalisation.
def wordPartLeft
sendMessage(2390, 0, 0)
end
# Move to the previous change in capitalisation extending selection
# to new caret position.
def wordPartLeftExtend
sendMessage(2391, 0, 0)
end
# Move to the change next in capitalisation.
def wordPartRight
sendMessage(2392, 0, 0)
end
# Move to the next change in capitalisation extending selection
# to new caret position.
def wordPartRightExtend
sendMessage(2393, 0, 0)
end
# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
VISIBLE_SLOP = 0x01
VISIBLE_STRICT = 0x04
# Set the way the display area is determined when a particular line
# is to be moved to by Find, FindNext, GotoLine, etc.
def setVisiblePolicy(visiblePolicy, visibleSlop)
sendMessage(2394, visiblePolicy, visibleSlop)
end
# Delete back from the current position to the start of the line.
def delLineLeft
sendMessage(2395, 0, 0)
end
# Delete forwards from the current position to the end of the line.
def delLineRight
sendMessage(2396, 0, 0)
end
# Get and Set the xOffset (ie, horizonal scroll position).
def setXOffset(newOffset)
sendMessage(2397, newOffset, 0)
end
def getXOffset
sendMessage(2398, 0, 0)
end
# Set the last x chosen value to be the caret x position.
def chooseCaretX
sendMessage(2399, 0, 0)
end
# Set the focus to this Scintilla widget.
def grabFocus
sendMessage(2400, 0, 0)
end
# Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
# If CARET_SLOP is set, we can define a slop value: caretSlop.
# This value defines an unwanted zone (UZ) where the caret is... unwanted.
# This zone is defined as a number of pixels near the vertical margins,
# and as a number of lines near the horizontal margins.
# By keeping the caret away from the edges, it is seen within its context,
# so it is likely that the identifier that the caret is on can be completely seen,
# and that the current line is seen with some of the lines following it which are
# often dependent on that line.
CARET_SLOP = 0x01
# If CARET_STRICT is set, the policy is enforced... strictly.
# The caret is centred on the display if slop is not set,
# and cannot go in the UZ if slop is set.
CARET_STRICT = 0x04
# If CARET_JUMPS is set, the display is moved more energetically
# so the caret can move in the same direction longer before the policy is applied again.
CARET_JUMPS = 0x10
# If CARET_EVEN is not set, instead of having symmetrical UZs,
# the left and bottom UZs are extended up to right and top UZs respectively.
# This way, we favour the displaying of useful information: the begining of lines,
# where most code reside, and the lines after the caret, eg. the body of a function.
CARET_EVEN = 0x08
# Set the way the caret is kept visible when going sideway.
# The exclusion zone is given in pixels.
def setXCaretPolicy(caretPolicy, caretSlop)
sendMessage(2402, caretPolicy, caretSlop)
end
# Set the way the line the caret is on is kept visible.
# The exclusion zone is given in lines.
def setYCaretPolicy(caretPolicy, caretSlop)
sendMessage(2403, caretPolicy, caretSlop)
end
# Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
def setPrintWrapMode(mode)
sendMessage(2406, mode, 0)
end
# Is printing line wrapped?
def getPrintWrapMode
sendMessage(2407, 0, 0)
end
# Set a fore colour for active hotspots.
def setHotspotActiveFore(useSetting, fore)
sendMessage(2410, useSetting, fore & 0xffffff)
end
# Set a back colour for active hotspots.
def setHotspotActiveBack(useSetting, back)
sendMessage(2411, useSetting, back & 0xffffff)
end
# Enable / Disable underlining active hotspots.
def setHotspotActiveUnderline(underline)
sendMessage(2412, underline, 0)
end
# Limit hotspots to single line so hotspots on two lines don't merge.
def setHotspotSingleLine(singleLine)
sendMessage(2421, singleLine, 0)
end
# Move caret between paragraphs (delimited by empty lines).
def paraDown
sendMessage(2413, 0, 0)
end
def paraDownExtend
Loading
Loading full blame...