OSDN Git Service

Commit DialogBox compile Okay
[tortoisegit/TortoiseGitJp.git] / ext / scintilla / doc / ScintillaDoc.html
1 <?xml version="1.0"?>\r
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
3     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
4 \r
5 <html xmlns="http://www.w3.org/1999/xhtml">\r
6   <head>\r
7     <meta name="generator"\r
8     content="HTML Tidy for Windows (vers 1st August 2002), see www.w3.org" />\r
9     <meta name="generator" content="SciTE" />\r
10     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\r
11 \r
12     <title>Scintilla and SciTE</title>\r
13 \r
14     <style type="text/css">\r
15 <!--\r
16 /*<![CDATA[*/\r
17     CODE { font-family: "Courier New", monospace; }\r
18     A:visited { color: blue; }\r
19     A:hover { text-decoration: underline ! important; }\r
20     A.message { text-decoration: none; font-family: "Courier New", monospace; }\r
21     A.toc { text-decoration: none; }\r
22     A.jump { text-decoration: none; }\r
23 /*]]>*/\r
24 -->\r
25     </style>\r
26   </head>\r
27 \r
28   <body bgcolor="#FFFFFF" text="#000000">\r
29     <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0"\r
30     summary="Banner">\r
31       <tr>\r
32         <td><img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" /></td>\r
33 \r
34         <td><a href="index.html"\r
35         style="color:white;text-decoration:none;font-size:200%">Scintilla</a></td>\r
36       </tr>\r
37     </table>\r
38 \r
39     <h1>Scintilla Documentation</h1>\r
40 \r
41     <p>Last edited 20/June/2007 NH</p>\r
42 \r
43     <p>There is <a class="jump" href="Design.html">an overview of the internal design of\r
44     Scintilla</a>.<br />\r
45      <a class="jump" href="ScintillaUsage.html">Some notes on using Scintilla</a>.<br />\r
46      <a class="jump" href="Steps.html">How to use the Scintilla Edit Control on Windows</a>.<br />\r
47      <a class="jump" href="http://www.scintilla.org/dmapp.zip">A simple sample using Scintilla from\r
48     C++ on Windows</a>.<br />\r
49      <a class="jump" href="http://www.scintilla.org/SciTry.vb">A simple sample using Scintilla from\r
50     Visual Basic</a>.<br />\r
51      <a class="jump" href="http://www.scintilla.org/bait.zip">Bait is a tiny sample using Scintilla\r
52      on GTK+</a>.<br />\r
53      <a class="jump" href="Lexer.txt">A detailed description of how to write a lexer, including a\r
54     discussion of folding</a>.<br />\r
55      <a class="jump" href="http://sphere.sourceforge.net/flik/docs/scintilla-container_lexer.html">\r
56      How to implement a lexer in the container</a>.<br />\r
57      <a class="jump" href="http://sphere.sourceforge.net/flik/docs/scintilla-folding.html">\r
58      How to implement folding</a>.<br />\r
59      The <a class="jump" href="SciCoding.html">coding style</a> used in Scintilla and SciTE is\r
60     worth following if you want to contribute code to Scintilla but is not compulsory.</p>\r
61 \r
62     <h2>Introduction</h2>\r
63 \r
64     <p>The Windows version of Scintilla is a Windows Control. As such, its primary programming\r
65     interface is through Windows messages. Early versions of Scintilla emulated much of the API\r
66     defined by the standard Windows Edit and RichEdit controls but those APIs are now deprecated in\r
67     favour of Scintilla's own, more consistent API. In addition to messages performing the actions\r
68     of a normal Edit control, Scintilla allows control of syntax styling, folding, markers, autocompletion\r
69     and call tips.</p>\r
70 \r
71     <p>The GTK+ version also uses messages in a similar way to the Windows version. This is\r
72     different to normal GTK+ practice but made it easier to implement rapidly.</p>\r
73 \r
74     <p>This documentation describes the individual messages and notifications used by Scintilla. It\r
75     does not describe how to link them together to form a useful editor. For now, the best way to\r
76     work out how to develop using Scintilla is to see how SciTE uses it. SciTE exercises most of\r
77     Scintilla's facilities.</p>\r
78 \r
79     <p>In the descriptions that follow, the messages are described as function calls with zero, one\r
80     or two arguments. These two arguments are the standard <code>wParam</code> and\r
81     <code>lParam</code> familiar to Windows programmers. These parameters are integers that\r
82     are large enough to hold pointers, and the return value is also an integer large enough to contain a\r
83     pointer.\r
84     Although the commands only use the\r
85     arguments described, because all messages have two arguments whether Scintilla uses them or\r
86     not, it is strongly recommended that any unused arguments are set to 0. This allows future\r
87     enhancement of messages without the risk of breaking existing code. Common argument types\r
88     are:</p>\r
89 \r
90     <table cellpadding="1" cellspacing="2" border="0" summary="Common argument types">\r
91       <tbody valign="top">\r
92         <tr>\r
93           <th align="left">bool</th>\r
94 \r
95           <td>Arguments expect the values 0 for <code>false</code> and 1 for\r
96           <code>true</code>.</td>\r
97         </tr>\r
98 \r
99         <tr>\r
100           <th align="left">int</th>\r
101 \r
102           <td>Arguments are 32-bit signed integers.</td>\r
103         </tr>\r
104 \r
105         <tr>\r
106           <th align="left">const&nbsp;char&nbsp;*</th>\r
107 \r
108           <td>Arguments point at text that is being passed to Scintilla but not modified. The text\r
109           may be zero terminated or another argument may specify the character count, the\r
110           description will make this clear.</td>\r
111         </tr>\r
112 \r
113         <tr>\r
114           <th align="left">char *</th>\r
115 \r
116           <td>Arguments point at text buffers that Scintilla will fill with text. In some cases,\r
117           another argument will tell Scintilla the buffer size. In others, you must make sure that\r
118           the buffer is big enough to hold the requested text. If a NULL pointer (0) is passed\r
119           then, for SCI_* calls, the length that should be allocated is returned.</td>\r
120         </tr>\r
121 \r
122         <tr>\r
123           <th align="left" id="colour">colour</th>\r
124 \r
125           <td>Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour\r
126           is set in the range 0 to 255. If you have three such intensities, they are combined as:\r
127           red | (green &lt;&lt; 8) | (blue &lt;&lt; 16). If you set all intensities to 255, the\r
128           colour is white. If you set all intensities to 0, the colour is black. When you set a\r
129           colour, you are making a request. What you will get depends on the capabilities of the\r
130           system and the current screen mode.</td>\r
131         </tr>\r
132 \r
133         <tr>\r
134           <th align="left" id="alpha">alpha</th>\r
135 \r
136           <td>Translucency is set using an alpha value.\r
137                         Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to\r
138                                255 (SC_ALPHA_OPAQUE) which is opaque. The value 256 (SC_ALPHA_NOALPHA)\r
139                                is opaque and uses code that is not alpha-aware and may be faster. Not all platforms support\r
140                                translucency and only some Scintilla features implement translucency.\r
141                                The default alpha value for most features is SC_ALPHA_NOALPHA.</td>\r
142         </tr>\r
143 \r
144         <tr>\r
145           <th align="left">&lt;unused&gt;</th>\r
146 \r
147           <td>This is an unused argument. Setting it to 0 will ensure compatibility with future\r
148           enhancements.</td>\r
149         </tr>\r
150       </tbody>\r
151     </table>\r
152 \r
153     <h2 id="MessageCategories">Contents</h2>\r
154 \r
155     <table cellpadding="4" cellspacing="2" border="0" summary="Message categories">\r
156       <tbody>\r
157         <tr>\r
158           <td>o <a class="toc" href="#TextRetrievalAndModification">Text retrieval and\r
159           modification</a></td>\r
160 \r
161           <td>o <a class="toc" href="#Searching">Searching and replacing</a></td>\r
162 \r
163           <td>o <a class="toc" href="#Overtype">Overtype</a></td>\r
164         </tr>\r
165 \r
166         <tr>\r
167           <td>o <a class="toc" href="#CutCopyAndPaste">Cut, copy and paste</a></td>\r
168 \r
169           <td>o <a class="toc" href="#ErrorHandling">Error handling</a></td>\r
170 \r
171           <td>o <a class="toc" href="#UndoAndRedo">Undo and Redo</a></td>\r
172         </tr>\r
173 \r
174         <tr>\r
175           <td>o <a class="toc" href="#SelectionAndInformation">Selection and information</a></td>\r
176 \r
177           <td>o <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic\r
178           scrolling</a></td>\r
179 \r
180           <td>o <a class="toc" href="#WhiteSpace">White space</a></td>\r
181         </tr>\r
182 \r
183         <tr>\r
184           <td>o <a class="toc" href="#Cursor">Cursor</a></td>\r
185 \r
186           <td>o <a class="toc" href="#MouseCapture">Mouse capture</a></td>\r
187 \r
188           <td>o <a class="toc" href="#LineEndings">Line endings</a></td>\r
189         </tr>\r
190 \r
191         <tr>\r
192           <td>o <a class="toc" href="#Styling">Styling</a></td>\r
193 \r
194           <td>o <a class="toc" href="#StyleDefinition">Style definition</a></td>\r
195 \r
196           <td>o <a class="toc" href="#CaretAndSelectionStyles">Caret, selection, and hotspot styles</a></td>\r
197         </tr>\r
198 \r
199         <tr>\r
200           <td>o <a class="toc" href="#Margins">Margins</a></td>\r
201 \r
202           <td>o <a class="toc" href="#OtherSettings">Other settings</a></td>\r
203 \r
204           <td>o <a class="toc" href="#BraceHighlighting">Brace highlighting</a></td>\r
205         </tr>\r
206 \r
207         <tr>\r
208           <td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation\r
209           Guides</a></td>\r
210 \r
211           <td>o <a class="toc" href="#Markers">Markers</a></td>\r
212 \r
213           <td>o <a class="toc" href="#Indicators">Indicators</a></td>\r
214         </tr>\r
215 \r
216         <tr>\r
217           <td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td>\r
218 \r
219           <td>o <a class="toc" href="#UserLists">User lists</a></td>\r
220 \r
221           <td>o <a class="toc" href="#CallTips">Call tips</a></td>\r
222         </tr>\r
223 \r
224         <tr>\r
225           <td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td>\r
226 \r
227           <td>o <a class="toc" href="#KeyBindings">Key bindings</a></td>\r
228 \r
229           <td>o <a class="toc" href="#PopupEditMenu">Popup edit menu</a></td>\r
230         </tr>\r
231 \r
232         <tr>\r
233           <td>o <a class="toc" href="#MacroRecording">Macro recording</a></td>\r
234 \r
235           <td>o <a class="toc" href="#Printing">Printing</a></td>\r
236 \r
237           <td>o <a class="toc" href="#DirectAccess">Direct access</a></td>\r
238         </tr>\r
239 \r
240         <tr>\r
241           <td>o <a class="toc" href="#MultipleViews">Multiple views</a></td>\r
242 \r
243           <td>o <a class="toc" href="#Folding">Folding</a></td>\r
244 \r
245           <td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td>\r
246         </tr>\r
247 \r
248         <tr>\r
249           <td>o <a class="toc" href="#Zooming">Zooming</a></td>\r
250 \r
251           <td>o <a class="toc" href="#LongLines">Long lines</a></td>\r
252 \r
253           <td>o <a class="toc" href="#Lexer">Lexer</a></td>\r
254         </tr>\r
255 \r
256         <tr>\r
257           <td>o <a class="toc" href="#Notifications">Notifications</a></td>\r
258 \r
259           <td>o <a class="toc" href="#GTK">GTK+</a></td>\r
260 \r
261           <td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td>\r
262         </tr>\r
263 \r
264         <tr>\r
265           <td>o <a class="toc" href="#EditMessagesNeverSupportedByScintilla">Edit messages never\r
266           supported by Scintilla</a></td>\r
267 \r
268           <td>o <a class="toc" href="#BuildingScintilla">Building Scintilla</a></td>\r
269         </tr>\r
270       </tbody>\r
271     </table>\r
272 \r
273     <p>Messages with names of the form <code>SCI_SETxxxxx</code> often have a companion\r
274     <code>SCI_GETxxxxx</code>. To save tedious repetition, if the <code>SCI_GETxxxxx</code> message\r
275     returns the value set by the <code>SCI_SETxxxxx</code> message, the <code>SET</code> routine is\r
276     described and the <code>GET</code> routine is left to your imagination.</p>\r
277 \r
278     <h2 id="TextRetrievalAndModification">Text retrieval and modification</h2>\r
279 \r
280     <p>Each character in a Scintilla document is followed by an associated byte of styling\r
281     information. The combination of a character byte and a style byte is called a cell. Style bytes\r
282     are interpreted an index into an array of styles.\r
283     Style bytes may be split into an index and a set of indicator bits\r
284     but this use is discouraged and indicators should now use\r
285     <a class="message" href ="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a>\r
286     and related calls.\r
287     The default split is with the index in the low 5 bits and 3 high bits as <a class="jump"\r
288     href="#Indicators">indicators</a>. This allows 32 fundamental styles, which is enough for most\r
289     languages, and three independent indicators so that, for example, syntax errors, deprecated\r
290     names and bad indentation could all be displayed at once. The number of bits used for styles\r
291     can be altered with <a class="message"\r
292     href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> up to a maximum of 7 bits.\r
293     The remaining bits can be used for indicators.</p>\r
294 \r
295     <p>Positions within the Scintilla document refer to a character or the gap before that\r
296     character. The first character in a document is 0, the second 1 and so on. If a document\r
297     contains <code>nLen</code> characters, the last character is numbered <code>nLen</code>-1.\r
298     The caret exists between character positions and can be located from before the first character (0)\r
299     to after the last character (<code>nLen</code>).</p>\r
300 \r
301     <p>There are places where the caret can not go where two character bytes make up one character.\r
302     This occurs when a DBCS character from a language like Japanese is included in the document or\r
303     when line ends are marked with the CP/M standard of a carriage return followed by a line feed.\r
304     The <code>INVALID_POSITION</code> constant (-1) represents an invalid position within the\r
305     document.</p>\r
306 \r
307     <p>All lines of text in Scintilla are the same height, and this height is calculated from the\r
308     largest font in any current style. This restriction is for performance; if lines differed in\r
309     height then calculations involving positioning of text would require the text to be styled\r
310     first.</p>\r
311     <code><a class="message" href="#SCI_GETTEXT">SCI_GETTEXT(int length, char *text)</a><br />\r
312      <a class="message" href="#SCI_SETTEXT">SCI_SETTEXT(&lt;unused&gt;, const char *text)</a><br />\r
313      <a class="message" href="#SCI_SETSAVEPOINT">SCI_SETSAVEPOINT</a><br />\r
314      <a class="message" href="#SCI_GETLINE">SCI_GETLINE(int line, char *text)</a><br />\r
315      <a class="message" href="#SCI_REPLACESEL">SCI_REPLACESEL(&lt;unused&gt;, const char\r
316     *text)</a><br />\r
317      <a class="message" href="#SCI_SETREADONLY">SCI_SETREADONLY(bool readOnly)</a><br />\r
318      <a class="message" href="#SCI_GETREADONLY">SCI_GETREADONLY</a><br />\r
319      <a class="message" href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE(&lt;unused&gt;, TextRange\r
320     *tr)</a><br />\r
321      <a class="message" href="#SCI_ALLOCATE">SCI_ALLOCATE(int bytes, &lt;unused&gt;)</a><br />\r
322      <a class="message" href="#SCI_ADDTEXT">SCI_ADDTEXT(int length, const char *s)</a><br />\r
323      <a class="message" href="#SCI_ADDSTYLEDTEXT">SCI_ADDSTYLEDTEXT(int length, cell *s)</a><br />\r
324      <a class="message" href="#SCI_APPENDTEXT">SCI_APPENDTEXT(int length, const char *s)</a><br />\r
325      <a class="message" href="#SCI_INSERTTEXT">SCI_INSERTTEXT(int pos, const char *text)</a><br />\r
326      <a class="message" href="#SCI_CLEARALL">SCI_CLEARALL</a><br />\r
327      <a class="message" href="#SCI_CLEARDOCUMENTSTYLE">SCI_CLEARDOCUMENTSTYLE</a><br />\r
328      <a class="message" href="#SCI_GETCHARAT">SCI_GETCHARAT(int position)</a><br />\r
329      <a class="message" href="#SCI_GETSTYLEAT">SCI_GETSTYLEAT(int position)</a><br />\r
330      <a class="message" href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(&lt;unused&gt;, TextRange\r
331     *tr)</a><br />\r
332      <a class="message" href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</a><br />\r
333      <a class="message" href="#SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</a><br />\r
334      <a class="message" href="#SCI_TARGETASUTF8">SCI_TARGETASUTF8(&lt;unused&gt;, char *s)</a><br />\r
335      <a class="message" href="#SCI_ENCODEDFROMUTF8">SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)</a><br />\r
336      <a class="message" href="#SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</a><br />\r
337     </code>\r
338 \r
339     <p><b id="SCI_GETTEXT">SCI_GETTEXT(int length, char *text)</b><br />\r
340      This returns <code>length</code>-1 characters of text from the start of the document plus one\r
341     terminating 0 character. To collect all the text in a document, use <code>SCI_GETLENGTH</code>\r
342     to get the number of characters in the document (<code>nLen</code>), allocate a character\r
343     buffer of length <code>nLen+1</code> bytes, then call <code>SCI_GETTEXT(nLen+1, char\r
344     *text)</code>. If the text argument is 0 then the length that should be allocated to store the\r
345     entire document is returned.\r
346     If you then save the text, you should use <code>SCI_SETSAVEPOINT</code> to mark\r
347     the text as unmodified.</p>\r
348 \r
349     <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
350     class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"\r
351     href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
352     href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
353     href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>\r
354 \r
355     <p><b id="SCI_SETTEXT">SCI_SETTEXT(&lt;unused&gt;, const char *text)</b><br />\r
356      This replaces all the text in the document with the zero terminated text string you pass\r
357     in.</p>\r
358 \r
359     <p><b id="SCI_SETSAVEPOINT">SCI_SETSAVEPOINT</b><br />\r
360      This message tells Scintilla that the current state of the document is unmodified. This is\r
361     usually done when the file is saved or loaded, hence the name "save point". As Scintilla\r
362     performs undo and redo operations, it notifies the container that it has entered or left the\r
363     save point with <code><a class="message"\r
364     href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a></code> and <code><a class="message"\r
365     href="#SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</a></code> <a class="jump"\r
366     href="#Notifications">notification messages</a>, allowing the container to know if the file\r
367     should be considered dirty or not.</p>\r
368 \r
369     <p>See also: <code><a class="message" href="#SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</a>, <a\r
370     class="message" href="#SCI_GETMODIFY">SCI_GETMODIFY</a></code></p>\r
371 \r
372     <p><b id="SCI_GETLINE">SCI_GETLINE(int line, char *text)</b><br />\r
373      This fills the buffer defined by text with the contents of the nominated line (lines start at\r
374     0). The buffer is not terminated by a 0 character. It is up to you to make sure that the buffer\r
375     is long enough for the text, use <a class="message"\r
376     href="#SCI_LINELENGTH"><code>SCI_LINELENGTH(int line)</code></a>. The returned value is the\r
377     number of characters copied to the buffer. The returned text includes any end of line\r
378     characters. If you ask for a line number outside the range of lines in the document, 0\r
379     characters are copied. If the text argument is 0 then the length that should be allocated\r
380     to store the entire line is returned.</p>\r
381 \r
382     <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a\r
383     class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a class="message"\r
384     href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>, <a class="message"\r
385     href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
386     href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>\r
387 \r
388     <p><b id="SCI_REPLACESEL">SCI_REPLACESEL(&lt;unused&gt;, const char *text)</b><br />\r
389      The currently selected text between the <a class="jump" href="#SelectionAndInformation">anchor\r
390     and the current position</a> is replaced by the 0 terminated text string. If the anchor and\r
391     current position are the same, the text is inserted at the caret position. The caret is\r
392     positioned after the inserted text and the caret is scrolled into view.</p>\r
393 \r
394     <p><b id="SCI_SETREADONLY">SCI_SETREADONLY(bool readOnly)</b><br />\r
395      <b id="SCI_GETREADONLY">SCI_GETREADONLY</b><br />\r
396      These messages set and get the read-only flag for the document. If you mark a document as read\r
397     only, attempts to modify the text cause the <a class="message"\r
398     href="#SCN_MODIFYATTEMPTRO"><code>SCN_MODIFYATTEMPTRO</code></a> notification.</p>\r
399 \r
400     <p><b id="SCI_GETTEXTRANGE">SCI_GETTEXTRANGE(&lt;unused&gt;, <a class="jump"\r
401     href="#TextRange">TextRange</a> *tr)</b><br />\r
402      This collects the text between the positions <code>cpMin</code> and <code>cpMax</code> and\r
403     copies it to <code>lpstrText</code> (see <code>struct TextRange</code> in\r
404     <code>Scintilla.h</code>). If <code>cpMax</code> is -1, text is returned to the end of the\r
405     document. The text is 0 terminated, so you must supply a buffer that is at least 1 character\r
406     longer than the number of characters you wish to read. The return value is the length of the\r
407     returned text not including the terminating 0.</p>\r
408 \r
409     <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
410     class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
411     href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"\r
412     href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
413     href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>\r
414 \r
415     <p><b id="SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(&lt;unused&gt;, <a class="jump"\r
416     href="#TextRange">TextRange</a> *tr)</b><br />\r
417      This collects styled text into a buffer using two bytes for each cell, with the character at\r
418     the lower address of each pair and the style byte at the upper address. Characters between the\r
419     positions <code>cpMin</code> and <code>cpMax</code> are copied to <code>lpstrText</code> (see\r
420     <code>struct TextRange</code> in <code>Scintilla.h</code>). Two 0 bytes are added to the end of\r
421     the text, so the buffer that <code>lpstrText</code> points at must be at least\r
422     <code>2*(cpMax-cpMin)+2</code> bytes long. No check is made for sensible values of\r
423     <code>cpMin</code> or <code>cpMax</code>. Positions outside the document return character codes\r
424     and style bytes of 0.</p>\r
425 \r
426     <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
427     class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
428     href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"\r
429     href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>, <a class="message"\r
430     href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>\r
431 \r
432     <p><b id="SCI_ALLOCATE">SCI_ALLOCATE(int bytes, &lt;unused&gt;)</b><br />\r
433      Allocate a document buffer large enough to store a given number of bytes.\r
434      The document will not be made smaller than its current contents.</p>\r
435 \r
436     <p><b id="SCI_ADDTEXT">SCI_ADDTEXT(int length, const char *s)</b><br />\r
437      This inserts the first <code>length</code> characters from the string <code>s</code>\r
438     at the current position. This will include any 0's in the string that you might have expected\r
439     to stop the insert operation. The current position is set at the end of the inserted text,\r
440     but it is not scrolled into view.</p>\r
441 \r
442     <p><b id="SCI_ADDSTYLEDTEXT">SCI_ADDSTYLEDTEXT(int length, cell *s)</b><br />\r
443      This behaves just like <code>SCI_ADDTEXT</code>, but inserts styled text.</p>\r
444 \r
445     <p><b id="SCI_APPENDTEXT">SCI_APPENDTEXT(int length, const char *s)</b><br />\r
446      This adds the first <code>length</code> characters from the string <code>s</code> to the end\r
447     of the document. This will include any 0's in the string that you might have expected to stop\r
448     the operation. The current selection is not changed and the new text is not scrolled into\r
449     view.</p>\r
450 \r
451     <p><b id="SCI_INSERTTEXT">SCI_INSERTTEXT(int pos, const char *text)</b><br />\r
452      This inserts the zero terminated <code>text</code> string at position <code>pos</code> or at\r
453     the current position if <code>pos</code> is -1. If the current position is after the insertion point\r
454     then it is moved along with its surrounding text but no scrolling is performed.</p>\r
455 \r
456     <p><b id="SCI_CLEARALL">SCI_CLEARALL</b><br />\r
457      Unless the document is read-only, this deletes all the text.</p>\r
458 \r
459     <p><b id="SCI_CLEARDOCUMENTSTYLE">SCI_CLEARDOCUMENTSTYLE</b><br />\r
460      When wanting to completely restyle the document, for example after choosing a lexer, the\r
461     <code>SCI_CLEARDOCUMENTSTYLE</code> can be used to clear all styling information and reset the\r
462     folding state.</p>\r
463 \r
464     <p><b id="SCI_GETCHARAT">SCI_GETCHARAT(int pos)</b><br />\r
465      This returns the character at <code>pos</code> in the document or 0 if <code>pos</code> is\r
466     negative or past the end of the document.</p>\r
467 \r
468     <p><b id="SCI_GETSTYLEAT">SCI_GETSTYLEAT(int pos)</b><br />\r
469      This returns the style at <code>pos</code> in the document, or 0 if <code>pos</code> is\r
470     negative or past the end of the document.</p>\r
471 \r
472     <p><b id="SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</b><br />\r
473      <b id="SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</b><br />\r
474      This pair of routines sets and reads back the number of bits in each cell to use for styling,\r
475     to a maximum of 7 style bits. The remaining bits can be used as indicators. The standard\r
476     setting is <code>SCI_SETSTYLEBITS(5)</code>.\r
477     The number of styling bits needed by the current lexer can be found with\r
478     <a class="message" href="#SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</a>.</p>\r
479 \r
480     <p><b id="TextRange">TextRange</b> and <b id="CharacterRange">CharacterRange</b><br />\r
481      These structures are defined to be exactly the same shape as the Win32 <code>TEXTRANGE</code>\r
482     and <code>CHARRANGE</code>, so that older code that treats Scintilla as a RichEdit will\r
483     work.</p>\r
484 <pre>\r
485 struct CharacterRange {\r
486     long cpMin;\r
487     long cpMax;\r
488 };\r
489 \r
490 struct TextRange {\r
491     struct CharacterRange chrg;\r
492     char *lpstrText;\r
493 };\r
494 </pre>\r
495 \r
496     <h3 id="EncodedAccess">GTK+-specific: Access to encoded text</h3>\r
497 \r
498     <p><b id="SCI_TARGETASUTF8">SCI_TARGETASUTF8(&lt;unused&gt;, char *s)</b><br />\r
499      This method retrieves the value of the target encoded as UTF-8 which is the default\r
500      encoding of GTK+ so is useful for retrieving text for use in other parts of the user interface,\r
501      such as find and replace dialogs. The length of the encoded text in bytes is returned.\r
502     </p>\r
503 \r
504     <p><b id="SCI_ENCODEDFROMUTF8">SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)</b><br />\r
505      <b id="SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</b><br />\r
506      <code>SCI_ENCODEDFROMUTF8</code> converts a UTF-8 string into the document's\r
507      encoding which is useful for taking the results of a find dialog, for example, and receiving\r
508      a string of bytes that can be searched for in the document. Since the text can contain nul bytes,\r
509      the <code>SCI_SETLENGTHFORENCODE</code> method can be used to set the\r
510      length that will be converted. If set to -1, the length is determined by finding a nul byte.\r
511      The length of the converted string is returned.\r
512     </p>\r
513 \r
514 \r
515     <h2 id="Searching">Searching</h2>\r
516     <p>\r
517     There are methods to search for text and for regular expressions. The regular expression support\r
518     is limited and should only be used for simple cases and initial development. A different regular expression\r
519     library can be <a class="jump" href="#AlternativeRegEx">integrated into Scintilla</a>\r
520     or can be called from the container using direct access to the buffer contents through\r
521     <a class="jump" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a>.\r
522     </p>\r
523     <code><a class="message" href="#SCI_FINDTEXT">SCI_FINDTEXT(int flags, TextToFind\r
524     *ttf)</a><br />\r
525      <a class="message" href="#SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</a><br />\r
526      <a class="message" href="#SCI_SEARCHNEXT">SCI_SEARCHNEXT(int searchFlags, const char\r
527     *text)</a><br />\r
528      <a class="message" href="#SCI_SEARCHPREV">SCI_SEARCHPREV(int searchFlags, const char\r
529     *text)</a><br />\r
530      <a class="jump" href="#SearchAndReplaceUsingTheTarget">Search and replace using the\r
531     target</a><br />\r
532     </code>\r
533 \r
534     <p><b id="searchFlags"><code>searchFlags</code></b><br />\r
535      Several of the search routines use flag options, which include a simple regular expression\r
536     search. Combine the flag options by adding them:</p>\r
537 \r
538     <table border="0" summary="Search flags">\r
539       <tbody>\r
540         <tr>\r
541           <td><code>SCFIND_MATCHCASE</code></td>\r
542 \r
543           <td>A match only occurs with text that matches the case of the search string.</td>\r
544         </tr>\r
545 \r
546         <tr>\r
547           <td><code>SCFIND_WHOLEWORD</code></td>\r
548 \r
549           <td>A match only occurs if the characters before and after are not word characters.</td>\r
550         </tr>\r
551 \r
552         <tr>\r
553           <td><code>SCFIND_WORDSTART</code></td>\r
554 \r
555           <td>A match only occurs if the character before is not a word character.</td>\r
556         </tr>\r
557 \r
558         <tr>\r
559           <td><code>SCFIND_REGEXP</code></td>\r
560 \r
561           <td>The search string should be interpreted as a regular expression.</td>\r
562         </tr>\r
563         <tr>\r
564           <td><code>SCFIND_POSIX</code></td>\r
565 \r
566           <td>Treat regular expression in a more POSIX compatible manner\r
567             by interpreting bare ( and ) for tagged sections rather than \( and \).</td>\r
568         </tr>\r
569       </tbody>\r
570     </table>\r
571 \r
572     <p>If <code>SCFIND_REGEXP</code> is not included in the <code>searchFlags</code>, you can\r
573     search backwards to find the previous occurrence of a search string by setting the end of the\r
574     search range before the start. If <code>SCFIND_REGEXP</code> is included, searches are always\r
575     from a lower position to a higher position, even if the search range is backwards.</p>\r
576 \r
577     <p>In a regular expression, special characters interpreted are:</p>\r
578 \r
579     <table border="0" summary="Regular expression synopsis">\r
580       <tbody>\r
581         <tr>\r
582           <td><code>.</code></td>\r
583 \r
584           <td>Matches any character</td>\r
585         </tr>\r
586 \r
587         <tr>\r
588           <td><code>\(</code></td>\r
589 \r
590           <td>This marks the start of a region for tagging a match.</td>\r
591         </tr>\r
592 \r
593         <tr>\r
594           <td><code>\)</code></td>\r
595 \r
596           <td>This marks the end of a tagged region.</td>\r
597         </tr>\r
598 \r
599         <tr>\r
600           <td><code>\n</code></td>\r
601 \r
602           <td>Where <code>n</code> is 1 through 9 refers to the first through ninth tagged region\r
603           when replacing. For example, if the search string was <code>Fred\([1-9]\)XXX</code> and\r
604           the replace string was <code>Sam\1YYY</code>, when applied to <code>Fred2XXX</code> this\r
605           would generate <code>Sam2YYY</code>.</td>\r
606         </tr>\r
607 \r
608         <tr>\r
609           <td><code>\&lt;</code></td>\r
610 \r
611           <td>This matches the start of a word using Scintilla's definitions of words.</td>\r
612         </tr>\r
613 \r
614         <tr>\r
615           <td><code>\&gt;</code></td>\r
616 \r
617           <td>This matches the end of a word using Scintilla's definition of words.</td>\r
618         </tr>\r
619 \r
620         <tr>\r
621           <td><code>\x</code></td>\r
622 \r
623           <td>This allows you to use a character x that would otherwise have a special meaning. For\r
624           example, \[ would be interpreted as [ and not as the start of a character set.</td>\r
625         </tr>\r
626 \r
627         <tr>\r
628           <td><code>[...]</code></td>\r
629 \r
630           <td>This indicates a set of characters, for example, [abc] means any of the characters a,\r
631           b or c. You can also use ranges, for example [a-z] for any lower case character.</td>\r
632         </tr>\r
633 \r
634         <tr>\r
635           <td><code>[^...]</code></td>\r
636 \r
637           <td>The complement of the characters in the set. For example, [^A-Za-z] means any\r
638           character except an alphabetic character.</td>\r
639         </tr>\r
640 \r
641         <tr>\r
642           <td><code>^</code></td>\r
643 \r
644           <td>This matches the start of a line (unless used inside a set, see above).</td>\r
645         </tr>\r
646 \r
647         <tr>\r
648           <td><code>$</code></td>\r
649 \r
650           <td>This matches the end of a line.</td>\r
651         </tr>\r
652 \r
653         <tr>\r
654           <td><code>*</code></td>\r
655 \r
656           <td>This matches 0 or more times. For example, <code>Sa*m</code> matches <code>Sm</code>,\r
657           <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td>\r
658         </tr>\r
659 \r
660         <tr>\r
661           <td><code>+</code></td>\r
662 \r
663           <td>This matches 1 or more times. For example, <code>Sa+m</code> matches\r
664           <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td>\r
665         </tr>\r
666       </tbody>\r
667     </table>\r
668 \r
669     <p><b id="SCI_FINDTEXT">SCI_FINDTEXT(int searchFlags, <a class="jump"\r
670     href="#TextToFind">TextToFind</a> *ttf)</b><br />\r
671      This message searches for text in the document. It does not use or move the current selection.\r
672     The <a class="jump" href="#searchFlags"><code>searchFlags</code></a> argument controls the\r
673     search type, which includes regular expression searches.</p>\r
674 \r
675     <p>The <code>TextToFind</code> structure is defined in <code>Scintilla.h</code>; set\r
676     <code>chrg.cpMin</code> and <code>chrg.cpMax</code> with the range of positions in the document\r
677     to search. If <code>SCFIND_REGEXP</code> is not included in the flags, you can search backwards by\r
678     setting <code>chrg.cpMax</code> less than <code>chrg.cpMin</code>. If <code>SCFIND_REGEXP</code>\r
679     is included, the search is always forwards (even if <code>chrg.cpMax</code> is less than <code>chrg.cpMin</code>).\r
680     Set the <code>lpstrText</code> member of <code>TextToFind</code> to point at a zero terminated\r
681     text string holding the search pattern. If your language makes the use of <code>TextToFind</code>\r
682     difficult, you should consider using <code>SCI_SEARCHINTARGET</code> instead.</p>\r
683 \r
684     <p>The return value is -1 if the search fails or the position of the start of the found text if\r
685     it succeeds. The <code>chrgText.cpMin</code> and <code>chrgText.cpMax</code> members of\r
686     <code>TextToFind</code> are filled in with the start and end positions of the found text.</p>\r
687 \r
688     <p>See also: <code><a class="message"\r
689     href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET</a></code></p>\r
690 \r
691     <p><b id="TextToFind">TextToFind</b><br />\r
692      This structure is defined to have exactly the same shape as the Win32 structure\r
693     <code>FINDTEXTEX</code> for old code that treated Scintilla as a RichEdit control.</p>\r
694 <pre>\r
695 struct TextToFind {\r
696     struct <a class="jump" href="#CharacterRange">CharacterRange</a> chrg;     // range to search\r
697     char *lpstrText;                // the search pattern (zero terminated)\r
698     struct CharacterRange chrgText; // returned as position of matching text\r
699 };\r
700 </pre>\r
701 \r
702     <p><b id="SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</b><br />\r
703      <b id="SCI_SEARCHNEXT">SCI_SEARCHNEXT(int searchFlags, const char *text)</b><br />\r
704      <b id="SCI_SEARCHPREV">SCI_SEARCHPREV(int searchFlags, const char *text)</b><br />\r
705      These messages provide relocatable search support. This allows multiple incremental\r
706     interactive searches to be macro recorded while still setting the selection to found text so\r
707     the find/select operation is self-contained. These three messages send <a class="message"\r
708     href="#SCN_MACRORECORD"><code>SCN_MACRORECORD</code></a> <a class="jump"\r
709     href="#Notifications">notifications</a> if macro recording is enabled.</p>\r
710 \r
711     <p><code>SCI_SEARCHANCHOR</code> sets the search start point used by\r
712     <code>SCI_SEARCHNEXT</code> and <code>SCI_SEARCHPREV</code> to the start of the current\r
713     selection, that is, the end of the selection that is nearer to the start of the document. You\r
714     should always call this before calling either of <code>SCI_SEARCHNEXT</code> or\r
715     <code>SCI_SEARCHPREV</code>.</p>\r
716 \r
717     <p><code>SCI_SEARCHNEXT</code> and <code>SCI_SEARCHPREV</code> search for the next and previous\r
718     occurrence of the zero terminated search string pointed at by text. The search is modified by\r
719     the <a class="jump" href="#searchFlags"><code>searchFlags</code></a>. If you request a regular\r
720     expression, <code>SCI_SEARCHPREV</code> finds the first occurrence of the search string in the\r
721     document, not the previous one before the anchor point.</p>\r
722 \r
723     <p>The return value is -1 if nothing is found, otherwise the return value is the start position\r
724     of the matching text. The selection is updated to show the matched text, but is not scrolled\r
725     into view.</p>\r
726 \r
727     <p>See also: <a class="message" href="#SCI_SEARCHINTARGET"><code>SCI_SEARCHINTARGET</code></a>,\r
728     <a class="message" href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a></p>\r
729 \r
730     <h3 id="SearchAndReplaceUsingTheTarget">Search and replace using the target</h3>\r
731 \r
732     <p>Using <a class="message" href="#SCI_REPLACESEL"><code>SCI_REPLACESEL</code></a>,\r
733     modifications cause scrolling and other visible changes, which may take some time and cause\r
734     unwanted display updates. If performing many changes, such as a replace all command, the target\r
735     can be used instead. First, set the target, ie. the range to be replaced. Then call\r
736     <code>SCI_REPLACETARGET</code> or <code>SCI_REPLACETARGETRE</code>.</p>\r
737 \r
738     <p>Searching can be performed within the target range with <code>SCI_SEARCHINTARGET</code>,\r
739     which uses a counted string to allow searching for null characters. It returns the length of\r
740     range or -1 for failure, in which case the target is not moved. The flags used by\r
741     <code>SCI_SEARCHINTARGET</code> such as <code>SCFIND_MATCHCASE</code>,\r
742     <code>SCFIND_WHOLEWORD</code>, <code>SCFIND_WORDSTART</code>, and <code>SCFIND_REGEXP</code>\r
743     can be set with <code>SCI_SETSEARCHFLAGS</code>. <code>SCI_SEARCHINTARGET</code> may be simpler\r
744     for some clients to use than <a class="message"\r
745     href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a>, as that requires using a pointer to a\r
746     structure.</p>\r
747     <code><a class="message" href="#SCI_SETTARGETSTART">SCI_SETTARGETSTART(int pos)</a><br />\r
748      <a class="message" href="#SCI_GETTARGETSTART">SCI_GETTARGETSTART</a><br />\r
749      <a class="message" href="#SCI_SETTARGETEND">SCI_SETTARGETEND(int pos)</a><br />\r
750      <a class="message" href="#SCI_GETTARGETEND">SCI_GETTARGETEND</a><br />\r
751      <a class="message" href="#SCI_TARGETFROMSELECTION">SCI_TARGETFROMSELECTION</a><br />\r
752      <a class="message" href="#SCI_SETSEARCHFLAGS">SCI_SETSEARCHFLAGS(int searchFlags)</a><br />\r
753      <a class="message" href="#SCI_GETSEARCHFLAGS">SCI_GETSEARCHFLAGS</a><br />\r
754      <a class="message" href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET(int length, const char\r
755     *text)</a><br />\r
756      <a class="message" href="#SCI_REPLACETARGET">SCI_REPLACETARGET(int length, const char\r
757     *text)</a><br />\r
758      <a class="message" href="#SCI_REPLACETARGETRE">SCI_REPLACETARGETRE(int length, const char\r
759     *text)</a><br />\r
760     </code>\r
761 \r
762     <p><b id="SCI_SETTARGETSTART">SCI_SETTARGETSTART(int pos)</b><br />\r
763      <b id="SCI_GETTARGETSTART">SCI_GETTARGETSTART</b><br />\r
764      <b id="SCI_SETTARGETEND">SCI_SETTARGETEND(int pos)</b><br />\r
765      <b id="SCI_GETTARGETEND">SCI_GETTARGETEND</b><br />\r
766      These functions set and return the start and end of the target. When searching in non-regular\r
767     expression mode, you can set start greater than end to find the last matching text in the\r
768     target rather than the first matching text. The target is also set by a successful\r
769     <code>SCI_SEARCHINTARGET</code>.</p>\r
770 \r
771      <p><b id="SCI_TARGETFROMSELECTION">SCI_TARGETFROMSELECTION</b><br />\r
772      Set the target start and end to the start and end positions of the selection.</p>\r
773 \r
774     <p><b id="SCI_SETSEARCHFLAGS">SCI_SETSEARCHFLAGS(int searchFlags)</b><br />\r
775      <b id="SCI_GETSEARCHFLAGS">SCI_GETSEARCHFLAGS</b><br />\r
776      These get and set the <a class="jump" href="#searchFlags"><code>searchFlags</code></a> used by\r
777     <code>SCI_SEARCHINTARGET</code>. There are several option flags including a simple regular\r
778     expression search.</p>\r
779 \r
780     <p><b id="SCI_SEARCHINTARGET">SCI_SEARCHINTARGET(int length, const char *text)</b><br />\r
781      This searches for the first occurrence of a text string in the target defined by\r
782     <code>SCI_SETTARGETSTART</code> and <code>SCI_SETTARGETEND</code>. The text string is not zero\r
783     terminated; the size is set by <code>length</code>. The search is modified by the search flags\r
784     set by <code>SCI_SETSEARCHFLAGS</code>. If the search succeeds, the target is set to the found\r
785     text and the return value is the position of the start of the matching text. If the search\r
786     fails, the result is -1.</p>\r
787 \r
788     <p><b id="SCI_REPLACETARGET">SCI_REPLACETARGET(int length, const char *text)</b><br />\r
789      If <code>length</code> is -1, <code>text</code> is a zero terminated string, otherwise\r
790     <code>length</code> sets the number of character to replace the target with.\r
791            After replacement, the target range refers to the replacement text.\r
792            The return value\r
793     is the length of the replacement string.<br />\r
794     Note that the recommended way to delete text in the document is to set the target to the text to be removed,\r
795     and to perform a replace target with an empty string.</p>\r
796 \r
797     <p><b id="SCI_REPLACETARGETRE">SCI_REPLACETARGETRE(int length, const char *text)</b><br />\r
798      This replaces the target using regular expressions. If <code>length</code> is -1,\r
799     <code>text</code> is a zero terminated string, otherwise <code>length</code> is the number of\r
800     characters to use. The replacement string is formed from the text string with any sequences of\r
801     <code>\1</code> through <code>\9</code> replaced by tagged matches from the most recent regular\r
802     expression search.\r
803            After replacement, the target range refers to the replacement text.\r
804            The return value is the length of the replacement string.</p>\r
805 \r
806     <p>See also: <a class="message" href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a></p>\r
807 \r
808     <h2 id="Overtype">Overtype</h2>\r
809 \r
810     <p><b id="SCI_SETOVERTYPE">SCI_SETOVERTYPE(bool overType)</b><br />\r
811      <b id="SCI_GETOVERTYPE">SCI_GETOVERTYPE</b><br />\r
812      When overtype is enabled, each typed character replaces the character to the right of the text\r
813     caret. When overtype is disabled, characters are inserted at the caret.\r
814     <code>SCI_GETOVERTYPE</code> returns <code>TRUE</code> (1) if overtyping is active, otherwise\r
815     <code>FALSE</code> (0) will be returned. Use <code>SCI_SETOVERTYPE</code> to set the overtype\r
816     mode.</p>\r
817 \r
818     <h2 id="CutCopyAndPaste">Cut, copy and paste</h2>\r
819 \r
820     <code><a class="message" href="#SCI_CUT">SCI_CUT</a><br />\r
821      <a class="message" href="#SCI_COPY">SCI_COPY</a><br />\r
822      <a class="message" href="#SCI_PASTE">SCI_PASTE</a><br />\r
823      <a class="message" href="#SCI_CLEAR">SCI_CLEAR</a><br />\r
824      <a class="message" href="#SCI_CANPASTE">SCI_CANPASTE</a><br />\r
825      <a class="message" href="#SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</a><br />\r
826      <a class="message" href="#SCI_COPYTEXT">SCI_COPYTEXT(int length,\r
827      const char *text)</a><br />\r
828      <a class="message" href="#SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</a><br />\r
829      <a class="message" href="#SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</a><br />\r
830      <a class="message" href="#SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</a><br />\r
831     </code>\r
832 \r
833     <p><b id="SCI_CUT">SCI_CUT</b><br />\r
834      <b id="SCI_COPY">SCI_COPY</b><br />\r
835      <b id="SCI_PASTE">SCI_PASTE</b><br />\r
836      <b id="SCI_CLEAR">SCI_CLEAR</b><br />\r
837      <b id="SCI_CANPASTE">SCI_CANPASTE</b><br />\r
838      <b id="SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</b><br />\r
839      These commands perform the standard tasks of cutting and copying data to the clipboard,\r
840     pasting from the clipboard into the document, and clearing the document.\r
841     <code>SCI_CANPASTE</code> returns non-zero if the document isn't read-only and if the selection\r
842     doesn't contain protected text. If you need a "can copy" or "can cut", use\r
843     <code>SCI_GETSELECTIONSTART()-SCI_GETSELECTIONEND()</code>, which will be non-zero if you can\r
844     copy or cut to the clipboard.</p>\r
845 \r
846     <p>GTK+ does not really support <code>SCI_CANPASTE</code> and always returns <code>TRUE</code>\r
847     unless the document is read-only.</p>\r
848 \r
849     <p>On X, the clipboard is asynchronous and may require several messages between\r
850     the destination and source applications. Data from SCI_PASTE will not arrive in the\r
851     document immediately.</p>\r
852 \r
853     <p><code>SCI_COPYALLOWLINE</code> works the same as SCI_COPY except that if the\r
854     selection is empty then the current line is copied. On Windows, an extra "MSDEVLineSelect" marker\r
855     is added to the clipboard which is then used in <code>SCI_PASTE</code> to paste\r
856     the whole line before the current line.</p>\r
857 \r
858      <b id="SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</b><br />\r
859      <b id="SCI_COPYTEXT">SCI_COPYTEXT(int length, const char *text)</b><br />\r
860     <p><code>SCI_COPYRANGE</code> copies a range of text from the document to\r
861     the system clipboard and <code>SCI_COPYTEXT</code> copies a supplied piece of\r
862     text to the system clipboard.</p>\r
863 \r
864     <p><b id="SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</b><br />\r
865      <b id="SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</b><br />\r
866      If this property is set then when text is pasted any line ends are converted to match the document's\r
867      end of line mode as set with\r
868      <a class="message" href="#SCI_SETEOLMODE">SCI_SETEOLMODE</a>.\r
869      Currently only changeable on Windows. On GTK+ pasted text is always converted.</p>\r
870 \r
871     <h2 id="ErrorHandling">Error handling</h2>\r
872 \r
873     <p><b id="SCI_SETSTATUS">SCI_SETSTATUS(int status)</b><br />\r
874      <b id="SCI_GETSTATUS">SCI_GETSTATUS</b><br />\r
875      If an error occurs, Scintilla may set an internal error number that can be retrieved with\r
876     <code>SCI_GETSTATUS</code>. Not currently used but will be in the future. To clear the error\r
877     status call <code>SCI_SETSTATUS(0)</code>.</p>\r
878 \r
879     <h2 id="UndoAndRedo">Undo and Redo</h2>\r
880 \r
881     <p>Scintilla has multiple level undo and redo. It will continue to collect undoable actions\r
882     until memory runs out. Scintilla saves actions that change the document. Scintilla does not\r
883     save caret and selection movements, view scrolling and the like. Sequences of typing or\r
884     deleting are compressed into single transactions to make it easier to undo and redo at a sensible\r
885     level of detail. Sequences of actions can be combined into transactions that are undone as a unit.\r
886     These sequences occur between <code>SCI_BEGINUNDOACTION</code> and\r
887     <code>SCI_ENDUNDOACTION</code> messages. These transactions can be nested and only the top-level\r
888     sequences are undone as units.</p>\r
889     <code><a class="message" href="#SCI_UNDO">SCI_UNDO</a><br />\r
890      <a class="message" href="#SCI_CANUNDO">SCI_CANUNDO</a><br />\r
891      <a class="message" href="#SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</a><br />\r
892      <a class="message" href="#SCI_REDO">SCI_REDO</a><br />\r
893      <a class="message" href="#SCI_CANREDO">SCI_CANREDO</a><br />\r
894      <a class="message" href="#SCI_SETUNDOCOLLECTION">SCI_SETUNDOCOLLECTION(bool\r
895     collectUndo)</a><br />\r
896      <a class="message" href="#SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION</a><br />\r
897      <a class="message" href="#SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</a><br />\r
898      <a class="message" href="#SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</a><br />\r
899     </code>\r
900 \r
901     <p><b id="SCI_UNDO">SCI_UNDO</b><br />\r
902      <b id="SCI_CANUNDO">SCI_CANUNDO</b><br />\r
903      <code>SCI_UNDO</code> undoes one action, or if the undo buffer has reached a\r
904     <code>SCI_ENDUNDOACTION</code> point, all the actions back to the corresponding\r
905     <code>SCI_BEGINUNDOACTION</code>.</p>\r
906 \r
907     <p><code>SCI_CANUNDO</code> returns 0 if there is nothing to undo, and 1 if there is. You would\r
908     typically use the result of this message to enable/disable the Edit menu Undo command.</p>\r
909 \r
910     <p><b id="SCI_REDO">SCI_REDO</b><br />\r
911      <b id="SCI_CANREDO">SCI_CANREDO</b><br />\r
912      <code>SCI_REDO</code> undoes the effect of the last <code>SCI_UNDO</code> operation.</p>\r
913 \r
914     <p><code>SCI_CANREDO</code> returns 0 if there is no action to redo and 1 if there are undo\r
915     actions to redo. You could typically use the result of this message to enable/disable the Edit\r
916     menu Redo command.</p>\r
917 \r
918     <p><b id="SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</b><br />\r
919      This command tells Scintilla to forget any saved undo or redo history. It also sets the save\r
920     point to the start of the undo buffer, so the document will appear to be unmodified. This does\r
921     not cause the <code><a class="message"\r
922     href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a></code> notification to be sent to the\r
923     container.</p>\r
924 \r
925     <p>See also: <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a></p>\r
926 \r
927     <p><b id="SCI_SETUNDOCOLLECTION">SCI_SETUNDOCOLLECTION(bool collectUndo)</b><br />\r
928      <b id="SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION</b><br />\r
929      You can control whether Scintilla collects undo information with\r
930     <code>SCI_SETUNDOCOLLECTION</code>. Pass in <code>true</code> (1) to collect information and\r
931     <code>false</code> (0) to stop collecting. If you stop collection, you should also use\r
932     <code>SCI_EMPTYUNDOBUFFER</code> to avoid the undo buffer being unsynchronized with the data in\r
933     the buffer.</p>\r
934 \r
935     <p>You might wish to turn off saving undo information if you use the Scintilla to store text\r
936     generated by a program (a Log view) or in a display window where text is often deleted and\r
937     regenerated.</p>\r
938 \r
939     <p><b id="SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</b><br />\r
940      <b id="SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</b><br />\r
941      Send these two messages to Scintilla to mark the beginning and end of a set of operations that\r
942     you want to undo all as one operation but that you have to generate as several operations.\r
943     Alternatively, you can use these to mark a set of operations that you do not want to have\r
944     combined with the preceding or following operations if they are undone.</p>\r
945 \r
946     <h2 id="SelectionAndInformation">Selection and information</h2>\r
947 \r
948     <p>Scintilla maintains a selection that stretches between two points, the anchor and the\r
949     current position. If the anchor and the current position are the same, there is no selected\r
950     text. Positions in the document range from 0 (before the first character), to the document size\r
951     (after the last character). If you use messages, there is nothing to stop you setting a\r
952     position that is in the middle of a CRLF pair, or in the middle of a 2 byte character. However,\r
953     keyboard commands will not move the caret into such positions.</p>\r
954     <code><a class="message" href="#SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</a><br />\r
955      <a class="message" href="#SCI_GETLENGTH">SCI_GETLENGTH</a><br />\r
956      <a class="message" href="#SCI_GETLINECOUNT">SCI_GETLINECOUNT</a><br />\r
957      <a class="message" href="#SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</a><br />\r
958      <a class="message" href="#SCI_LINESONSCREEN">SCI_LINESONSCREEN</a><br />\r
959      <a class="message" href="#SCI_GETMODIFY">SCI_GETMODIFY</a><br />\r
960      <a class="message" href="#SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</a><br />\r
961      <a class="message" href="#SCI_GOTOPOS">SCI_GOTOPOS(int position)</a><br />\r
962      <a class="message" href="#SCI_GOTOLINE">SCI_GOTOLINE(int line)</a><br />\r
963      <a class="message" href="#SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int position)</a><br />\r
964      <a class="message" href="#SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</a><br />\r
965      <a class="message" href="#SCI_SETANCHOR">SCI_SETANCHOR(int position)</a><br />\r
966      <a class="message" href="#SCI_GETANCHOR">SCI_GETANCHOR</a><br />\r
967      <a class="message" href="#SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int position)</a><br />\r
968      <a class="message" href="#SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</a><br />\r
969      <a class="message" href="#SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int position)</a><br />\r
970      <a class="message" href="#SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</a><br />\r
971      <a class="message" href="#SCI_SELECTALL">SCI_SELECTALL</a><br />\r
972      <a class="message" href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int position)</a><br />\r
973      <a class="message" href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</a><br />\r
974      <a class="message" href="#SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</a><br />\r
975      <a class="message" href="#SCI_LINELENGTH">SCI_LINELENGTH(int line)</a><br />\r
976      <a class="message" href="#SCI_GETCOLUMN">SCI_GETCOLUMN(int position)</a><br />\r
977      <a class="message" href="#SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</a><br />\r
978      <a class="message" href="#SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</a><br />\r
979      <a class="message" href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int\r
980     y)</a><br />\r
981      <a class="message" href="#SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int\r
982     position)</a><br />\r
983      <a class="message" href="#SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(&lt;unused&gt;, int\r
984     position)</a><br />\r
985      <a class="message" href="#SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</a><br />\r
986      <a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT(&lt;unused&gt;, char *text)</a><br />\r
987      <a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</a><br />\r
988      <a class="message" href="#SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</a><br />\r
989      <a class="message" href="#SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</a><br />\r
990      <a class="message" href="#SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</a><br />\r
991      <a class="message" href="#SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</a><br />\r
992      <a class="message" href="#SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</a><br />\r
993      <a class="message" href="#SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</a><br />\r
994      <a class="message" href="#SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool\r
995     onlyWordCharacters)</a><br />\r
996      <a class="message" href="#SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool\r
997     onlyWordCharacters)</a><br />\r
998      <a class="message" href="#SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</a><br />\r
999      <a class="message" href="#SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</a><br />\r
1000      <a class="message" href="#SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</a><br />\r
1001      <a class="message" href="#SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</a><br />\r
1002      <a class="message" href="#SCI_CHOOSECARETX">SCI_CHOOSECARETX</a><br />\r
1003     </code>\r
1004 \r
1005     <p><b id="SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</b><br />\r
1006      <b id="SCI_GETLENGTH">SCI_GETLENGTH</b><br />\r
1007      Both these messages return the length of the document in characters.</p>\r
1008 \r
1009     <p><b id="SCI_GETLINECOUNT">SCI_GETLINECOUNT</b><br />\r
1010      This returns the number of lines in the document. An empty document contains 1 line. A\r
1011     document holding only an end of line sequence has 2 lines.</p>\r
1012 \r
1013     <p><b id="SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</b><br />\r
1014      This returns the line number of the first visible line in the Scintilla view. The first line\r
1015     in the document is numbered 0. The value is a visible line rather than a document line.</p>\r
1016 \r
1017     <p><b id="SCI_LINESONSCREEN">SCI_LINESONSCREEN</b><br />\r
1018      This returns the number of complete lines visible on the screen. With a constant line height,\r
1019     this is the vertical space available divided by the line separation. Unless you arrange to size\r
1020     your window to an integral number of lines, there may be a partial line visible at the bottom\r
1021     of the view.</p>\r
1022 \r
1023     <p><b id="SCI_GETMODIFY">SCI_GETMODIFY</b><br />\r
1024      This returns non-zero if the document is modified and 0 if it is unmodified. The modified\r
1025     status of a document is determined by the undo position relative to the save point. The save\r
1026     point is set by <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>,\r
1027     usually when you have saved data to a file.</p>\r
1028 \r
1029     <p>If you need to be notified when the document becomes modified, Scintilla notifies the\r
1030     container that it has entered or left the save point with the <a class="message"\r
1031     href="#SCN_SAVEPOINTREACHED"><code>SCN_SAVEPOINTREACHED</code></a> and <a class="message"\r
1032     href="#SCN_SAVEPOINTLEFT"><code>SCN_SAVEPOINTLEFT</code></a> <a class="jump"\r
1033     href="#Notifications">notification messages</a>.</p>\r
1034 \r
1035     <p><b id="SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</b><br />\r
1036      This message sets both the anchor and the current position. If <code>currentPos</code> is\r
1037     negative, it means the end of the document. If <code>anchorPos</code> is negative, it means\r
1038     remove any selection (i.e. set the anchor to the same position as <code>currentPos</code>). The\r
1039     caret is scrolled into view after this operation.</p>\r
1040 \r
1041     <p><b id="SCI_GOTOPOS">SCI_GOTOPOS(int pos)</b><br />\r
1042      This removes any selection, sets the caret at <code>pos</code> and scrolls the view to make\r
1043     the caret visible, if necessary. It is equivalent to\r
1044     <code>SCI_SETSEL(pos, pos)</code>. The anchor position is set the same as the current\r
1045     position.</p>\r
1046 \r
1047     <p><b id="SCI_GOTOLINE">SCI_GOTOLINE(int line)</b><br />\r
1048      This removes any selection and sets the caret at the start of line number <code>line</code>\r
1049     and scrolls the view (if needed) to make it visible. The anchor position is set the same as the\r
1050     current position. If <code>line</code> is outside the lines in the document (first line is 0),\r
1051     the line set is the first or last.</p>\r
1052 \r
1053     <p><b id="SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int pos)</b><br />\r
1054      This sets the current position and creates a selection between the anchor and the current\r
1055     position. The caret is not scrolled into view.</p>\r
1056 \r
1057     <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>\r
1058 \r
1059     <p><b id="SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</b><br />\r
1060      This returns the current position.</p>\r
1061 \r
1062     <p><b id="SCI_SETANCHOR">SCI_SETANCHOR(int pos)</b><br />\r
1063      This sets the anchor position and creates a selection between the anchor position and the\r
1064     current position. The caret is not scrolled into view.</p>\r
1065 \r
1066     <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>\r
1067 \r
1068     <p><b id="SCI_GETANCHOR">SCI_GETANCHOR</b><br />\r
1069      This returns the current anchor position.</p>\r
1070 \r
1071     <p><b id="SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int pos)</b><br />\r
1072      <b id="SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int pos)</b><br />\r
1073      These set the selection based on the assumption that the anchor position is less than the\r
1074     current position. They do not make the caret visible. The table shows the positions of the\r
1075     anchor and the current position after using these messages.</p>\r
1076 \r
1077     <table cellpadding="3" cellspacing="0" border="1" summary="SetSelection caret positioning">\r
1078       <thead align="center">\r
1079         <tr>\r
1080           <th>\r
1081           </th>\r
1082 \r
1083           <th>anchor</th>\r
1084 \r
1085           <th>current</th>\r
1086         </tr>\r
1087       </thead>\r
1088 \r
1089       <tbody align="center">\r
1090         <tr>\r
1091           <th><code>SCI_SETSELECTIONSTART</code></th>\r
1092 \r
1093           <td><code>pos</code></td>\r
1094 \r
1095           <td><code>Max(pos, current)</code></td>\r
1096         </tr>\r
1097 \r
1098         <tr>\r
1099           <th><code>SCI_SETSELECTIONEND</code></th>\r
1100 \r
1101           <td><code>Min(anchor, pos)</code></td>\r
1102 \r
1103           <td><code>pos</code></td>\r
1104         </tr>\r
1105       </tbody>\r
1106     </table>\r
1107 \r
1108     <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>\r
1109 \r
1110     <p><b id="SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</b><br />\r
1111      <b id="SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</b><br />\r
1112      These return the start and end of the selection without regard to which end is the current\r
1113     position and which is the anchor. <code>SCI_GETSELECTIONSTART</code> returns the smaller of the\r
1114     current position or the anchor position. <code>SCI_GETSELECTIONEND</code> returns the larger of\r
1115     the two values.</p>\r
1116 \r
1117     <p><b id="SCI_SELECTALL">SCI_SELECTALL</b><br />\r
1118      This selects all the text in the document. The current position is not scrolled into view.</p>\r
1119 \r
1120     <p><b id="SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int pos)</b><br />\r
1121      This message returns the line that contains the position <code>pos</code> in the document. The\r
1122     return value is 0 if <code>pos</code> &lt;= 0. The return value is the last line if\r
1123     <code>pos</code> is beyond the end of the document.</p>\r
1124 \r
1125     <p><b id="SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</b><br />\r
1126      This returns the document position that corresponds with the start of the line. If\r
1127     <code>line</code> is negative, the position of the line holding the start of the selection is\r
1128     returned. If <code>line</code> is greater than the lines in the document, the return value is\r
1129     -1. If <code>line</code> is equal to the number of lines in the document (i.e. 1 line past the\r
1130     last line), the return value is the end of the document.</p>\r
1131 \r
1132     <p><b id="SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</b><br />\r
1133      This returns the position at the end of the line, before any line end characters. If <code>line</code>\r
1134     is the last line in the document (which does not have any end of line characters), the result is the size of the\r
1135     document. If <code>line</code> is negative or <code>line</code> &gt;= <a class="message"\r
1136     href="#SCI_GETLINECOUNT"><code>SCI_GETLINECOUNT()</code></a>, the result is undefined.</p>\r
1137 \r
1138     <p><b id="SCI_LINELENGTH">SCI_LINELENGTH(int line)</b><br />\r
1139      This returns the length of the line, including any line end characters. If <code>line</code>\r
1140     is negative or beyond the last line in the document, the result is 0. If you want the length of\r
1141     the line not including any end of line characters, use <a class="message"\r
1142     href="#SCI_GETLINEENDPOSITION"><code>SCI_GETLINEENDPOSITION(line)</code></a> - <a class="message"\r
1143     href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p>\r
1144     <b id="SCI_GETSELTEXT">SCI_GETSELTEXT(&lt;unused&gt;, char *text)</b><br />\r
1145      This copies the currently selected text and a terminating 0 byte to the <code>text</code>\r
1146     buffer. The buffer must be at least\r
1147     <code>SCI_GETSELECTIONEND()-SCI_GETSELECTIONSTART()+1</code> bytes long. <br />\r
1148     If the text argument is 0 then the length that should be allocated\r
1149     to store the entire selection is returned.<br />\r
1150 \r
1151     <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a\r
1152     class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
1153     href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"\r
1154     href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
1155     href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>\r
1156 \r
1157     <p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</b><br />\r
1158      This retrieves the text of the line containing the caret and returns the position within the\r
1159     line of the caret. Pass in <code>char* text</code> pointing at a buffer large enough to hold\r
1160     the text you wish to retrieve and a terminating 0 character.\r
1161     Set <code>textLen</code> to the\r
1162     length of the buffer which must be at least 1 to hold the terminating 0 character.\r
1163     If the text argument is 0 then the length that should be allocated\r
1164     to store the entire current line is returned.</p>\r
1165 \r
1166     <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
1167     class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
1168     href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"\r
1169     href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
1170     href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>\r
1171 \r
1172     <p><b id="SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</b><br />\r
1173      This returns 1 if the current selection is in rectangle mode, 0 if not.</p>\r
1174 \r
1175     <p><b id="SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</b><br />\r
1176     <b id="SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</b><br />\r
1177     The two functions set and get the selection mode, which can be\r
1178      stream (<code>SC_SEL_STREAM</code>=0) or\r
1179      rectangular (<code>SC_SEL_RECTANGLE</code>=1)\r
1180      or by lines (<code>SC_SEL_LINES</code>=2).\r
1181      When set in these modes, regular caret moves will extend or reduce the selection,\r
1182      until the mode is cancelled by a call with same value or with <code>SCI_CANCEL</code>.\r
1183      The get function returns the current mode even if the selection was made by mouse\r
1184      or with regular extended moves.</p>\r
1185 \r
1186     <p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</b><br />\r
1187     <b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</b><br />\r
1188     Retrieve the position of the start and end of the selection at the given line with\r
1189     INVALID_POSITION returned if no selection on this line.</p>\r
1190 \r
1191     <p><b id="SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</b><br />\r
1192      If the caret is off the top or bottom of the view, it is moved to the nearest line that is\r
1193     visible to its current position. Any selection is lost.</p>\r
1194 \r
1195     <p><b id="SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool\r
1196     onlyWordCharacters)</b><br />\r
1197      <b id="SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool\r
1198     onlyWordCharacters)</b><br />\r
1199      These messages return the start and end of words using the same definition of words as used\r
1200     internally within Scintilla. You can set your own list of characters that count as words with\r
1201     <a class="message" href="#SCI_SETWORDCHARS"><code>SCI_SETWORDCHARS</code></a>. The position\r
1202     sets the start or the search, which is forwards when searching for the end and backwards when\r
1203     searching for the start.</p>\r
1204 \r
1205     <p>Set <code>onlyWordCharacters</code> to <code>true</code> (1) to stop searching at the first\r
1206     non-word character in the search direction. If <code>onlyWordCharacters</code> is\r
1207     <code>false</code> (0), the first character in the search direction sets the type of the search\r
1208     as word or non-word and the search stops at the first non-matching character. Searches are also\r
1209     terminated by the start or end of the document.</p>\r
1210 \r
1211     <p>If "w" represents word characters and "." represents non-word characters and "|" represents\r
1212     the position and <code>true</code> or <code>false</code> is the state of\r
1213     <code>onlyWordCharacters</code>:</p>\r
1214 \r
1215     <table cellpadding="3" cellspacing="0" border="1" summary="Word start and end positions">\r
1216       <thead align="center">\r
1217         <tr>\r
1218           <th>Initial state</th>\r
1219 \r
1220           <th>end, true</th>\r
1221 \r
1222           <th>end, false</th>\r
1223 \r
1224           <th>start, true</th>\r
1225 \r
1226           <th>start, false</th>\r
1227         </tr>\r
1228       </thead>\r
1229 \r
1230       <tbody align="center">\r
1231         <tr>\r
1232           <td>..ww..|..ww..</td>\r
1233 \r
1234           <td>..ww..|..ww..</td>\r
1235 \r
1236           <td>..ww....|ww..</td>\r
1237 \r
1238           <td>..ww..|..ww..</td>\r
1239 \r
1240           <td>..ww|....ww..</td>\r
1241         </tr>\r
1242 \r
1243         <tr>\r
1244           <td>....ww|ww....</td>\r
1245 \r
1246           <td>....wwww|....</td>\r
1247 \r
1248           <td>....wwww|....</td>\r
1249 \r
1250           <td>....|wwww....</td>\r
1251 \r
1252           <td>....|wwww....</td>\r
1253         </tr>\r
1254 \r
1255         <tr>\r
1256           <td>..ww|....ww..</td>\r
1257 \r
1258           <td>..ww|....ww..</td>\r
1259 \r
1260           <td>..ww....|ww..</td>\r
1261 \r
1262           <td>..|ww....ww..</td>\r
1263 \r
1264           <td>..|ww....ww..</td>\r
1265         </tr>\r
1266 \r
1267         <tr>\r
1268           <td>..ww....|ww..</td>\r
1269 \r
1270           <td>..ww....ww|..</td>\r
1271 \r
1272           <td>..ww....ww|..</td>\r
1273 \r
1274           <td>..ww....|ww..</td>\r
1275 \r
1276           <td>..ww|....ww..</td>\r
1277         </tr>\r
1278       </tbody>\r
1279     </table>\r
1280 \r
1281     <p><b id="SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</b><br />\r
1282      <b id="SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</b><br />\r
1283      These messages return the position before and after another position\r
1284      in the document taking into account the current code page. The minimum\r
1285      position returned is 0 and the maximum is the last position in the document.\r
1286      If called with a position within a multi byte character will return the position\r
1287      of the start/end of that character.</p>\r
1288 \r
1289     <p><b id="SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</b><br />\r
1290      This returns the pixel width of a string drawn in the given <code>styleNumber</code> which can\r
1291     be used, for example, to decide how wide to make the line number margin in order to display a\r
1292     given number of numerals.</p>\r
1293 \r
1294     <p><b id="SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</b><br />\r
1295      This returns the height in pixels of a particular line. Currently all lines are the same\r
1296     height.</p>\r
1297 \r
1298     <p><b id="SCI_GETCOLUMN">SCI_GETCOLUMN(int pos)</b><br />\r
1299      This message returns the column number of a position <code>pos</code> within the document\r
1300     taking the width of tabs into account. This returns the column number of the last tab on the\r
1301     line before <code>pos</code>, plus the number of characters between the last tab and\r
1302     <code>pos</code>. If there are no tab characters on the line, the return value is the number of\r
1303     characters up to the position on the line. In both cases, double byte characters count as a\r
1304     single character. This is probably only useful with monospaced fonts.</p>\r
1305 \r
1306     <p><b id="SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</b><br />\r
1307      This message returns the position of a <code>column</code> on a <code>line</code>\r
1308     taking the width of tabs into account. It treats a multi-byte character as a single column.\r
1309     Column numbers, like lines start at 0.</p>\r
1310 \r
1311     <p><b id="SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</b><br />\r
1312      <b id="SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int y)</b><br />\r
1313      <code>SCI_POSITIONFROMPOINT</code> finds the closest character position to a point and\r
1314     <code>SCI_POSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the\r
1315     window or not close to any characters.</p>\r
1316 \r
1317     <p><b id="SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(&lt;unused&gt;, int pos)</b><br />\r
1318      <b id="SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(&lt;unused&gt;, int pos)</b><br />\r
1319      These messages return the x and y display pixel location of text at position <code>pos</code>\r
1320     in the document.</p>\r
1321 \r
1322     <p><b id="SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</b><br />\r
1323      The normal state is to make the selection visible by drawing it as set by <a class="message"\r
1324     href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a> and <a class="message"\r
1325     href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a>. However, if you hide the selection, it\r
1326     is drawn as normal text.</p>\r
1327 \r
1328     <p><b id="SCI_CHOOSECARETX">SCI_CHOOSECARETX</b><br />\r
1329      Scintilla remembers the x value of the last position horizontally moved to explicitly by the\r
1330     user and this value is then used when moving vertically such as by using the up and down keys.\r
1331     This message sets the current x position of the caret as the remembered value.</p>\r
1332 \r
1333     <h2 id="ScrollingAndAutomaticScrolling">Scrolling and automatic scrolling</h2>\r
1334     <code><a class="message" href="#SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</a><br />\r
1335      <a class="message" href="#SCI_SCROLLCARET">SCI_SCROLLCARET</a><br />\r
1336      <a class="message" href="#SCI_SETXCARETPOLICY">SCI_SETXCARETPOLICY(int caretPolicy, int\r
1337     caretSlop)</a><br />\r
1338      <a class="message" href="#SCI_SETYCARETPOLICY">SCI_SETYCARETPOLICY(int caretPolicy, int\r
1339     caretSlop)</a><br />\r
1340      <a class="message" href="#SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY(int caretPolicy, int\r
1341     caretSlop)</a><br />\r
1342      <a class="message" href="#SCI_SETHSCROLLBAR">SCI_SETHSCROLLBAR(bool visible)</a><br />\r
1343      <a class="message" href="#SCI_GETHSCROLLBAR">SCI_GETHSCROLLBAR</a><br />\r
1344      <a class="message" href="#SCI_SETVSCROLLBAR">SCI_SETVSCROLLBAR(bool visible)</a><br />\r
1345      <a class="message" href="#SCI_GETVSCROLLBAR">SCI_GETVSCROLLBAR</a><br />\r
1346      <a class="message" href="#SCI_GETXOFFSET">SCI_GETXOFFSET</a><br />\r
1347      <a class="message" href="#SCI_SETXOFFSET">SCI_SETXOFFSET(int xOffset)</a><br />\r
1348      <a class="message" href="#SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH(int pixelWidth)</a><br />\r
1349      <a class="message" href="#SCI_GETSCROLLWIDTH">SCI_GETSCROLLWIDTH</a><br />\r
1350      <a class="message" href="#SCI_SETSCROLLWIDTHTRACKING">SCI_SETSCROLLWIDTHTRACKING(bool tracking)</a><br />\r
1351      <a class="message" href="#SCI_GETSCROLLWIDTHTRACKING">SCI_GETSCROLLWIDTHTRACKING</a><br />\r
1352      <a class="message" href="#SCI_SETENDATLASTLINE">SCI_SETENDATLASTLINE(bool\r
1353     endAtLastLine)</a><br />\r
1354      <a class="message" href="#SCI_GETENDATLASTLINE">SCI_GETENDATLASTLINE</a><br />\r
1355     </code>\r
1356 \r
1357     <p><b id="SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</b><br />\r
1358      This will attempt to scroll the display by the number of columns and lines that you specify.\r
1359     Positive line values increase the line number at the top of the screen (i.e. they move the text\r
1360     upwards as far as the user is concerned), Negative line values do the reverse.</p>\r
1361 \r
1362     <p>The column measure is the width of a space in the default style. Positive values increase\r
1363     the column at the left edge of the view (i.e. they move the text leftwards as far as the user\r
1364     is concerned). Negative values do the reverse.</p>\r
1365 \r
1366     <p>See also: <a class="message" href="#SCI_SETXOFFSET"><code>SCI_SETXOFFSET</code></a></p>\r
1367 \r
1368     <p><b id="SCI_SCROLLCARET">SCI_SCROLLCARET</b><br />\r
1369      If the current position (this is the caret if there is no selection) is not visible, the view\r
1370     is scrolled to make it visible according to the current caret policy.</p>\r
1371 \r
1372     <p><b id="SCI_SETXCARETPOLICY">SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)</b><br />\r
1373      <b id="SCI_SETYCARETPOLICY">SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)</b><br />\r
1374      These set the caret policy. The value of <code>caretPolicy</code> is a combination of\r
1375     <code>CARET_SLOP</code>, <code>CARET_STRICT</code>, <code>CARET_JUMPS</code> and\r
1376     <code>CARET_EVEN</code>.</p>\r
1377 \r
1378     <table cellpadding="1" cellspacing="2" border="0" summary="Caret policy">\r
1379       <tbody valign="top">\r
1380         <tr>\r
1381           <th align="left"><code>CARET_SLOP</code></th>\r
1382 \r
1383           <td>If set, we can define a slop value: <code>caretSlop</code>. This value defines an\r
1384           unwanted zone (UZ) where the caret is... unwanted. This zone is defined as a number of\r
1385           pixels near the vertical margins, and as a number of lines near the horizontal margins.\r
1386           By keeping the caret away from the edges, it is seen within its context. This makes it\r
1387           likely that the identifier that the caret is on can be completely seen, and that the\r
1388           current line is seen with some of the lines following it, which are often dependent on\r
1389           that line.</td>\r
1390         </tr>\r
1391 \r
1392         <tr>\r
1393           <th align="left"><code>CARET_STRICT</code></th>\r
1394 \r
1395           <td>If set, the policy set by <code>CARET_SLOP</code> is enforced... strictly. The caret\r
1396           is centred on the display if <code>caretSlop</code> is not set, and cannot go in the UZ\r
1397           if <code>caretSlop</code> is set.</td>\r
1398         </tr>\r
1399 \r
1400         <tr>\r
1401           <th align="left"><code>CARET_JUMPS</code></th>\r
1402 \r
1403           <td>If set, the display is moved more energetically so the caret can move in the same\r
1404           direction longer before the policy is applied again. '3UZ' notation is used to indicate\r
1405           three time the size of the UZ as a distance to the margin.</td>\r
1406         </tr>\r
1407 \r
1408         <tr>\r
1409           <th align="left"><code>CARET_EVEN</code></th>\r
1410 \r
1411           <td>If not set, instead of having symmetrical UZs, the left and bottom UZs are extended\r
1412           up to right and top UZs respectively. This way, we favour the displaying of useful\r
1413           information: the beginning of lines, where most code reside, and the lines after the\r
1414           caret, for example, the body of a function.</td>\r
1415         </tr>\r
1416       </tbody>\r
1417     </table>\r
1418 \r
1419     <table cellpadding="3" cellspacing="0" border="1" summary="Caret positioning">\r
1420       <thead align="center">\r
1421         <tr>\r
1422           <th>slop</th>\r
1423 \r
1424           <th>strict</th>\r
1425 \r
1426           <th>jumps</th>\r
1427 \r
1428           <th>even</th>\r
1429 \r
1430           <th>Caret can go to the margin</th>\r
1431 \r
1432           <th>On reaching limit (going out of visibility<br />\r
1433            or going into the UZ) display is...</th>\r
1434         </tr>\r
1435       </thead>\r
1436 \r
1437       <tbody align="center">\r
1438         <tr>\r
1439           <td>0</td>\r
1440 \r
1441           <td>0</td>\r
1442 \r
1443           <td>0</td>\r
1444 \r
1445           <td>0</td>\r
1446 \r
1447           <td>Yes</td>\r
1448 \r
1449           <td>moved to put caret on top/on right</td>\r
1450         </tr>\r
1451 \r
1452         <tr>\r
1453           <td>0</td>\r
1454 \r
1455           <td>0</td>\r
1456 \r
1457           <td>0</td>\r
1458 \r
1459           <td>1</td>\r
1460 \r
1461           <td>Yes</td>\r
1462 \r
1463           <td>moved by one position</td>\r
1464         </tr>\r
1465 \r
1466         <tr>\r
1467           <td>0</td>\r
1468 \r
1469           <td>0</td>\r
1470 \r
1471           <td>1</td>\r
1472 \r
1473           <td>0</td>\r
1474 \r
1475           <td>Yes</td>\r
1476 \r
1477           <td>moved to put caret on top/on right</td>\r
1478         </tr>\r
1479 \r
1480         <tr>\r
1481           <td>0</td>\r
1482 \r
1483           <td>0</td>\r
1484 \r
1485           <td>1</td>\r
1486 \r
1487           <td>1</td>\r
1488 \r
1489           <td>Yes</td>\r
1490 \r
1491           <td>centred on the caret</td>\r
1492         </tr>\r
1493 \r
1494         <tr>\r
1495           <td>0</td>\r
1496 \r
1497           <td>1</td>\r
1498 \r
1499           <td>-</td>\r
1500 \r
1501           <td>0</td>\r
1502 \r
1503           <td>Caret is always on top/on right of display</td>\r
1504 \r
1505           <td>-</td>\r
1506         </tr>\r
1507 \r
1508         <tr>\r
1509           <td>0</td>\r
1510 \r
1511           <td>1</td>\r
1512 \r
1513           <td>-</td>\r
1514 \r
1515           <td>1</td>\r
1516 \r
1517           <td>No, caret is always centred</td>\r
1518 \r
1519           <td>-</td>\r
1520         </tr>\r
1521 \r
1522         <tr>\r
1523           <td>1</td>\r
1524 \r
1525           <td>0</td>\r
1526 \r
1527           <td>0</td>\r
1528 \r
1529           <td>0</td>\r
1530 \r
1531           <td>Yes</td>\r
1532 \r
1533           <td>moved to put caret out of the asymmetrical UZ</td>\r
1534         </tr>\r
1535 \r
1536         <tr>\r
1537           <td>1</td>\r
1538 \r
1539           <td>0</td>\r
1540 \r
1541           <td>0</td>\r
1542 \r
1543           <td>1</td>\r
1544 \r
1545           <td>Yes</td>\r
1546 \r
1547           <td>moved to put caret out of the UZ</td>\r
1548         </tr>\r
1549 \r
1550         <tr>\r
1551           <td>1</td>\r
1552 \r
1553           <td>0</td>\r
1554 \r
1555           <td>1</td>\r
1556 \r
1557           <td>0</td>\r
1558 \r
1559           <td>Yes</td>\r
1560 \r
1561           <td>moved to put caret at 3UZ of the top or right margin</td>\r
1562         </tr>\r
1563 \r
1564         <tr>\r
1565           <td>1</td>\r
1566 \r
1567           <td>0</td>\r
1568 \r
1569           <td>1</td>\r
1570 \r
1571           <td>1</td>\r
1572 \r
1573           <td>Yes</td>\r
1574 \r
1575           <td>moved to put caret at 3UZ of the margin</td>\r
1576         </tr>\r
1577 \r
1578         <tr>\r
1579           <td>1</td>\r
1580 \r
1581           <td>1</td>\r
1582 \r
1583           <td>-</td>\r
1584 \r
1585           <td>0</td>\r
1586 \r
1587           <td>Caret is always at UZ of top/right margin</td>\r
1588 \r
1589           <td>-</td>\r
1590         </tr>\r
1591 \r
1592         <tr>\r
1593           <td>1</td>\r
1594 \r
1595           <td>1</td>\r
1596 \r
1597           <td>0</td>\r
1598 \r
1599           <td>1</td>\r
1600 \r
1601           <td>No, kept out of UZ</td>\r
1602 \r
1603           <td>moved by one position</td>\r
1604         </tr>\r
1605 \r
1606         <tr>\r
1607           <td>1</td>\r
1608 \r
1609           <td>1</td>\r
1610 \r
1611           <td>1</td>\r
1612 \r
1613           <td>0</td>\r
1614 \r
1615           <td>No, kept out of UZ</td>\r
1616 \r
1617           <td>moved to put caret at 3UZ of the margin</td>\r
1618         </tr>\r
1619       </tbody>\r
1620     </table>\r
1621 \r
1622     <p><b id="SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)</b><br />\r
1623      This determines how the vertical positioning is determined when <a class="message"\r
1624     href="#SCI_ENSUREVISIBLEENFORCEPOLICY"><code>SCI_ENSUREVISIBLEENFORCEPOLICY</code></a> is\r
1625     called. It takes <code>VISIBLE_SLOP</code> and <code>VISIBLE_STRICT</code> flags for the policy\r
1626     parameter. It is similar in operation to <a class="message"\r
1627     href="#SCI_SETYCARETPOLICY"><code>SCI_SETYCARETPOLICY(int caretPolicy, int\r
1628     caretSlop)</code></a>.</p>\r
1629 \r
1630     <p><b id="SCI_SETHSCROLLBAR">SCI_SETHSCROLLBAR(bool visible)</b><br />\r
1631      <b id="SCI_GETHSCROLLBAR">SCI_GETHSCROLLBAR</b><br />\r
1632      The horizontal scroll bar is only displayed if it is needed for the assumed width.\r
1633      If you never wish to see it, call\r
1634     <code>SCI_SETHSCROLLBAR(0)</code>. Use <code>SCI_SETHSCROLLBAR(1)</code> to enable it again.\r
1635     <code>SCI_GETHSCROLLBAR</code> returns the current state. The default state is to display it\r
1636     when needed.</p>\r
1637     <p>See also: <a class="message" href="#SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH</a>.</p>\r
1638 \r
1639     <p><b id="SCI_SETVSCROLLBAR">SCI_SETVSCROLLBAR(bool visible)</b><br />\r
1640      <b id="SCI_GETVSCROLLBAR">SCI_GETVSCROLLBAR</b><br />\r
1641      By default, the vertical scroll bar is always displayed when required. You can choose to hide\r
1642     or show it with <code>SCI_SETVSCROLLBAR</code> and get the current state with\r
1643     <code>SCI_GETVSCROLLBAR</code>.</p>\r
1644 \r
1645     <p><b id="SCI_SETXOFFSET">SCI_SETXOFFSET(int xOffset)</b><br />\r
1646      <b id="SCI_GETXOFFSET">SCI_GETXOFFSET</b><br />\r
1647      The <code>xOffset</code> is the horizontal scroll position in pixels of the start of the text\r
1648     view. A value of 0 is the normal position with the first text column visible at the left of the\r
1649     view.</p>\r
1650 \r
1651     <p>See also: <a class="message" href="#SCI_LINESCROLL"><code>SCI_LINESCROLL</code></a></p>\r
1652 \r
1653     <p><b id="SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH(int pixelWidth)</b><br />\r
1654      <b id="SCI_GETSCROLLWIDTH">SCI_GETSCROLLWIDTH</b><br />\r
1655      For performance, Scintilla does not measure the display width of the document to determine\r
1656      the properties of the horizontal scroll bar. Instead, an assumed width is used.\r
1657      These messages set and get the document width in pixels assumed by Scintilla.\r
1658      The default value is 2000.\r
1659      To ensure the width of the currently visible lines can be scrolled use\r
1660      <a class="message" href="#SCI_SETSCROLLWIDTHTRACKING"><code>SCI_SETSCROLLWIDTHTRACKING</code></a></p>\r
1661 \r
1662     <p><b id="SCI_SETSCROLLWIDTHTRACKING">SCI_SETSCROLLWIDTHTRACKING(bool tracking)</b><br />\r
1663      <b id="SCI_GETSCROLLWIDTHTRACKING">SCI_GETSCROLLWIDTHTRACKING</b><br />\r
1664      If scroll width tracking is enabled then the scroll width is adjusted to ensure that all of the lines currently\r
1665      displayed can be completely scrolled. This mode never adjusts the scroll width to be narrower.</p>\r
1666 \r
1667     <p><b id="SCI_SETENDATLASTLINE">SCI_SETENDATLASTLINE(bool endAtLastLine)</b><br />\r
1668      <b id="SCI_GETENDATLASTLINE">SCI_GETENDATLASTLINE</b><br />\r
1669      <code>SCI_SETENDATLASTLINE</code> sets the scroll range so that maximum scroll position has\r
1670     the last line at the bottom of the view (default). Setting this to <code>false</code> allows\r
1671     scrolling one page below the last line.</p>\r
1672 \r
1673     <h2 id="WhiteSpace">White space</h2>\r
1674     <code><a class="message" href="#SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</a><br />\r
1675      <a class="message" href="#SCI_GETVIEWWS">SCI_GETVIEWWS</a><br />\r
1676      <a class="message" href="#SCI_SETWHITESPACEFORE">SCI_SETWHITESPACEFORE(bool\r
1677     useWhitespaceForeColour, int colour)</a><br />\r
1678      <a class="message" href="#SCI_SETWHITESPACEBACK">SCI_SETWHITESPACEBACK(bool\r
1679     useWhitespaceBackColour, int colour)</a><br />\r
1680     </code>\r
1681 \r
1682     <p><b id="SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</b><br />\r
1683      <b id="SCI_GETVIEWWS">SCI_GETVIEWWS</b><br />\r
1684      White space can be made visible which may useful for languages in which white space is\r
1685     significant, such as Python. Space characters appear as small centred dots and tab characters\r
1686     as light arrows pointing to the right. There are also ways to control the display of <a\r
1687     class="jump" href="#LineEndings">end of line characters</a>. The two messages set and get the\r
1688     white space display mode. The <code>wsMode</code> argument can be one of:</p>\r
1689 \r
1690     <table cellpadding="1" cellspacing="2" border="0" summary="White space policy">\r
1691       <tbody valign="top">\r
1692         <tr>\r
1693           <th align="left"><code>SCWS_INVISIBLE</code></th>\r
1694 \r
1695           <td>0</td>\r
1696 \r
1697           <td>The normal display mode with white space displayed as an empty background\r
1698           colour.</td>\r
1699         </tr>\r
1700 \r
1701         <tr>\r
1702           <th align="left"><code>SCWS_VISIBLEALWAYS</code></th>\r
1703 \r
1704           <td>1</td>\r
1705 \r
1706           <td>White space characters are drawn as dots and arrows,</td>\r
1707         </tr>\r
1708 \r
1709         <tr>\r
1710           <th align="left"><code>SCWS_VISIBLEAFTERINDENT</code></th>\r
1711 \r
1712           <td>2</td>\r
1713 \r
1714           <td>White space used for indentation is displayed normally but after the first visible\r
1715           character, it is shown as dots and arrows.</td>\r
1716         </tr>\r
1717       </tbody>\r
1718     </table>\r
1719 \r
1720     <p>The effect of using any other <code>wsMode</code> value is undefined.</p>\r
1721 \r
1722     <p><b id="SCI_SETWHITESPACEFORE">SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int <a\r
1723     class="jump" href="#colour">colour</a>)</b><br />\r
1724      <b id="SCI_SETWHITESPACEBACK">SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int <a\r
1725     class="jump" href="#colour">colour</a>)</b><br />\r
1726      By default, the colour of visible white space is determined by the lexer in use. The\r
1727     foreground and/or background colour of all visible white space can be set globally, overriding\r
1728     the lexer's colours with <code>SCI_SETWHITESPACEFORE</code> and\r
1729     <code>SCI_SETWHITESPACEBACK</code>.</p>\r
1730 \r
1731     <h2 id="Cursor">Cursor</h2>\r
1732 \r
1733     <p><b id="SCI_SETCURSOR">SCI_SETCURSOR(int curType)</b><br />\r
1734      <b id="SCI_GETCURSOR">SCI_GETCURSOR</b><br />\r
1735      The cursor is normally chosen in a context sensitive way, so it will be different over the\r
1736     margin than when over the text. When performing a slow action, you may wish to change to a wait\r
1737     cursor. You set the cursor type with <code>SCI_SETCURSOR</code>. The <code>curType</code>\r
1738     argument can be:</p>\r
1739 \r
1740     <table cellpadding="1" cellspacing="2" border="0" summary="Mouse cursors">\r
1741       <tbody valign="top">\r
1742         <tr>\r
1743           <th align="left"><code>SC_CURSORNORMAL</code></th>\r
1744 \r
1745           <td>-1</td>\r
1746 \r
1747           <td>The normal cursor is displayed.</td>\r
1748         </tr>\r
1749 \r
1750         <tr>\r
1751           <th align="left"><code>SC_CURSORWAIT</code></th>\r
1752 \r
1753           <td>&nbsp;4</td>\r
1754 \r
1755           <td>The wait cursor is displayed when the mouse is over or owned by the Scintilla\r
1756           window.</td>\r
1757         </tr>\r
1758       </tbody>\r
1759     </table>\r
1760 \r
1761     <p>Cursor values 1 through 7 have defined cursors, but only <code>SC_CURSORWAIT</code> is\r
1762     usefully controllable. Other values of <code>curType</code> cause a pointer to be displayed.\r
1763     The <code>SCI_GETCURSOR</code> message returns the last cursor type you set, or\r
1764     <code>SC_CURSORNORMAL</code> (-1) if you have not set a cursor type.</p>\r
1765 \r
1766     <h2 id="MouseCapture">Mouse capture</h2>\r
1767 \r
1768     <p><b id="SCI_SETMOUSEDOWNCAPTURES">SCI_SETMOUSEDOWNCAPTURES(bool captures)</b><br />\r
1769      <b id="SCI_GETMOUSEDOWNCAPTURES">SCI_GETMOUSEDOWNCAPTURES</b><br />\r
1770      When the mouse is pressed inside Scintilla, it is captured so future mouse movement events are\r
1771     sent to Scintilla. This behavior may be turned off with\r
1772     <code>SCI_SETMOUSEDOWNCAPTURES(0)</code>.</p>\r
1773 \r
1774     <h2 id="LineEndings">Line endings</h2>\r
1775 \r
1776     <p>Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix\r
1777     (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line\r
1778     end strings is inserted into the buffer. The default is \r\n in Windows and \n in Unix, but\r
1779     this can be changed with the <code>SCI_SETEOLMODE</code> message. You can also convert the\r
1780     entire document to one of these line endings with <code>SCI_CONVERTEOLS</code>. Finally, you\r
1781     can choose to display the line endings with <code>SCI_SETVIEWEOL</code>.</p>\r
1782     <code><a class="message" href="#SCI_SETEOLMODE">SCI_SETEOLMODE(int eolMode)</a><br />\r
1783      <a class="message" href="#SCI_GETEOLMODE">SCI_GETEOLMODE</a><br />\r
1784      <a class="message" href="#SCI_CONVERTEOLS">SCI_CONVERTEOLS(int eolMode)</a><br />\r
1785      <a class="message" href="#SCI_SETVIEWEOL">SCI_SETVIEWEOL(bool visible)</a><br />\r
1786      <a class="message" href="#SCI_GETVIEWEOL">SCI_GETVIEWEOL</a><br />\r
1787     </code>\r
1788 \r
1789     <p><b id="SCI_SETEOLMODE">SCI_SETEOLMODE(int eolMode)</b><br />\r
1790      <b id="SCI_GETEOLMODE">SCI_GETEOLMODE</b><br />\r
1791      <code>SCI_SETEOLMODE</code> sets the characters that are added into the document when the user\r
1792     presses the Enter key. You can set <code>eolMode</code> to one of <code>SC_EOL_CRLF</code> (0),\r
1793     <code>SC_EOL_CR</code> (1), or <code>SC_EOL_LF</code> (2). The <code>SCI_GETEOLMODE</code>\r
1794     message retrieves the current state.</p>\r
1795 \r
1796     <p><b id="SCI_CONVERTEOLS">SCI_CONVERTEOLS(int eolMode)</b><br />\r
1797      This message changes all the end of line characters in the document to match\r
1798     <code>eolMode</code>. Valid values are: <code>SC_EOL_CRLF</code> (0), <code>SC_EOL_CR</code>\r
1799     (1), or <code>SC_EOL_LF</code> (2).</p>\r
1800 \r
1801     <p><b id="SCI_SETVIEWEOL">SCI_SETVIEWEOL(bool visible)</b><br />\r
1802      <b id="SCI_GETVIEWEOL">SCI_GETVIEWEOL</b><br />\r
1803      Normally, the end of line characters are hidden, but <code>SCI_SETVIEWEOL</code> allows you to\r
1804     display (or hide) them by setting <code>visible</code> <code>true</code> (or\r
1805     <code>false</code>). The visible rendering of the end of line characters is similar to\r
1806     <code>(CR)</code>, <code>(LF)</code>, or <code>(CR)(LF)</code>. <code>SCI_GETVIEWEOL</code>\r
1807     returns the current state.</p>\r
1808 \r
1809     <h2 id="Styling">Styling</h2>\r
1810 \r
1811     <p>The styling messages allow you to assign styles to text. The standard Scintilla settings\r
1812     divide the 8 style bits available for each character into 5 bits (0 to 4 = <a class="jump"\r
1813     href="#StyleDefinition">styles 0 to 31</a>) that set a style and three bits (5 to 7) that\r
1814     define <a class="jump" href="#Indicators">indicators</a>. You can change the balance between\r
1815     styles and indicators with <a class="message"\r
1816     href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a>. If your styling needs can be met by\r
1817     one of the standard lexers, or if you can write your own, then a lexer is probably the easiest\r
1818     way to style your document. If you choose to use the container to do the styling you can use\r
1819     the <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a> command to select\r
1820     <code>SCLEX_CONTAINER</code>, in which case the container is sent a <a class="message"\r
1821     href="#SCN_STYLENEEDED"><code>SCN_STYLENEEDED</code></a> <a class="jump"\r
1822     href="#Notifications">notification</a> each time text needs styling for display. As another\r
1823     alternative, you might use idle time to style the document. Even if you use a lexer, you might\r
1824     use the styling commands to mark errors detected by a compiler. The following commands can be\r
1825     used.</p>\r
1826     <code><a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a><br />\r
1827      <a class="message" href="#SCI_STARTSTYLING">SCI_STARTSTYLING(int position, int mask)</a><br />\r
1828      <a class="message" href="#SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</a><br />\r
1829      <a class="message" href="#SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char\r
1830     *styles)</a><br />\r
1831      <a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</a><br />\r
1832      <a class="message" href="#SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</a><br />\r
1833      <a class="message" href="#SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</a><br />\r
1834     </code>\r
1835 \r
1836     <p><b id="SCI_GETENDSTYLED">SCI_GETENDSTYLED</b><br />\r
1837      Scintilla keeps a record of the last character that is likely to be styled correctly. This is\r
1838     moved forwards when characters after it are styled and moved backwards if changes are made to\r
1839     the text of the document before it. Before drawing text, this position is checked to see if any\r
1840     styling is needed and, if so, a <code><a class="message"\r
1841     href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a></code> notification message is sent to the\r
1842     container. The container can send <code>SCI_GETENDSTYLED</code> to work out where it needs to\r
1843     start styling. Scintilla will always ask to style whole lines.</p>\r
1844 \r
1845     <p><b id="SCI_STARTSTYLING">SCI_STARTSTYLING(int pos, int mask)</b><br />\r
1846      This prepares for styling by setting the styling position <code>pos</code> to start at and a\r
1847     <code>mask</code> indicating which bits of the style bytes can be set. The mask allows styling\r
1848     to occur over several passes, with, for example, basic styling done on an initial pass to\r
1849     ensure that the text of the code is seen quickly and correctly, and then a second slower pass,\r
1850     detecting syntax errors and using indicators to show where these are. For example, with the\r
1851     standard settings of 5 style bits and 3 indicator bits, you would use a <code>mask</code> value\r
1852     of 31 (0x1f) if you were setting text styles and did not want to change the indicators. After\r
1853     <code>SCI_STARTSTYLING</code>, send multiple <code>SCI_SETSTYLING</code> messages for each\r
1854     lexical entity to style.</p>\r
1855 \r
1856     <p><b id="SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</b><br />\r
1857      This message sets the style of <code>length</code> characters starting at the styling position\r
1858     and then increases the styling position by <code>length</code>, ready for the next call. If\r
1859     <code>sCell</code> is the style byte, the operation is:<br />\r
1860      <code>if ((sCell &amp; mask) != style) sCell = (sCell &amp; ~mask) | (style &amp;\r
1861     mask);</code><br />\r
1862     </p>\r
1863 \r
1864     <p><b id="SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char *styles)</b><br />\r
1865      As an alternative to <code>SCI_SETSTYLING</code>, which applies the same style to each byte,\r
1866     you can use this message which specifies the styles for each of <code>length</code> bytes from\r
1867     the styling position and then increases the styling position by <code>length</code>, ready for\r
1868     the next call. The <code>length</code> styling bytes pointed at by <code>styles</code> should\r
1869     not contain any bits not set in mask.</p>\r
1870 \r
1871     <p><b id="SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</b><br />\r
1872      <b id="SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</b><br />\r
1873      As well as the 8 bits of lexical state stored for each character there is also an integer\r
1874     stored for each line. This can be used for longer lived parse states such as what the current\r
1875     scripting language is in an ASP page. Use <code>SCI_SETLINESTATE</code> to set the integer\r
1876     value and <code>SCI_GETLINESTATE</code> to get the value.\r
1877     Changing the value produces a <a class="message" href="#SC_MOD_CHANGELINESTATE">SC_MOD_CHANGELINESTATE</a> notification.\r
1878     </p>\r
1879 \r
1880     <p><b id="SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</b><br />\r
1881      This returns the last line that has any line state.</p>\r
1882 \r
1883     <h2 id="StyleDefinition">Style definition</h2>\r
1884 \r
1885     <p>While the style setting messages mentioned above change the style numbers associated with\r
1886     text, these messages define how those style numbers are interpreted visually. There are 256\r
1887     lexer styles that can be set, numbered 0 to <code>STYLE_MAX</code> (255). Unless you use <a\r
1888     class="message" href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> to change the number\r
1889     of style bits, styles 0 to 31 are used to set the text attributes. There are also some\r
1890     predefined numbered styles starting at 32, The following <code>STYLE_</code>* constants are\r
1891     defined.</p>\r
1892 \r
1893     <table cellpadding="1" cellspacing="2" border="0" summary="Preset styles">\r
1894       <tbody valign="top">\r
1895         <tr>\r
1896           <th align="left"><code>STYLE_DEFAULT</code></th>\r
1897 \r
1898           <td>32</td>\r
1899 \r
1900           <td>This style defines the attributes that all styles receive when the\r
1901           <code>SCI_STYLECLEARALL</code> message is used.</td>\r
1902         </tr>\r
1903 \r
1904         <tr>\r
1905           <th align="left"><code>STYLE_LINENUMBER</code></th>\r
1906 \r
1907           <td>33</td>\r
1908 \r
1909           <td>This style sets the attributes of the text used to display line numbers in a line\r
1910           number margin. The background colour set for this style also sets the background colour\r
1911           for all margins that do not have any folding mask bits set. That is, any margin for which\r
1912           <code>mask &amp; SC_MASK_FOLDERS</code> is 0. See <a class="message"\r
1913           href="#SCI_SETMARGINMASKN"><code>SCI_SETMARGINMASKN</code></a> for more about masks.</td>\r
1914         </tr>\r
1915 \r
1916         <tr>\r
1917           <th align="left"><code>STYLE_BRACELIGHT</code></th>\r
1918 \r
1919           <td>34</td>\r
1920 \r
1921           <td>This style sets the attributes used when highlighting braces with the <a\r
1922           class="message" href="#BraceHighlighting"><code>SCI_BRACEHIGHLIGHT</code></a> message and\r
1923           when highlighting the corresponding indentation with <a class="message"\r
1924           href="#SCI_SETHIGHLIGHTGUIDE"><code>SCI_SETHIGHLIGHTGUIDE</code></a>.</td>\r
1925         </tr>\r
1926 \r
1927         <tr>\r
1928           <th align="left"><code>STYLE_BRACEBAD</code></th>\r
1929 \r
1930           <td>35</td>\r
1931 \r
1932           <td>This style sets the display attributes used when marking an unmatched brace with the\r
1933           <a class="message" href="#BraceHighlighting"><code>SCI_BRACEBADLIGHT</code></a>\r
1934           message.</td>\r
1935         </tr>\r
1936 \r
1937         <tr>\r
1938           <th align="left"><code>STYLE_CONTROLCHAR</code></th>\r
1939 \r
1940           <td>36</td>\r
1941 \r
1942           <td>This style sets the font used when drawing control characters.\r
1943             Only the font, size, bold, italics, and character set attributes are used and not\r
1944             the colour attributes. See\r
1945           also: <a class="message"\r
1946           href="#SCI_SETCONTROLCHARSYMBOL"><code>SCI_SETCONTROLCHARSYMBOL</code></a>.</td>\r
1947         </tr>\r
1948 \r
1949         <tr>\r
1950           <th align="left"><code>STYLE_INDENTGUIDE</code></th>\r
1951 \r
1952           <td>37</td>\r
1953 \r
1954           <td>This style sets the foreground and background colours used when drawing the\r
1955           indentation guides.</td>\r
1956         </tr>\r
1957 \r
1958         <tr>\r
1959           <th align="left"><code>STYLE_CALLTIP</code></th>\r
1960 \r
1961           <td>38</td>\r
1962 \r
1963           <td> Call tips normally use the font attributes defined by <code>STYLE_DEFAULT</code>.\r
1964           Use of <a class="message" href="#SCI_CALLTIPUSESTYLE"><code>SCI_CALLTIPUSESTYLE</code></a>\r
1965             causes call tips to use this style instead. Only the font face name, font size,\r
1966           foreground and background colours and character set attributes are used.</td>\r
1967         </tr>\r
1968 \r
1969         <tr>\r
1970           <th align="left"><code>STYLE_LASTPREDEFINED</code></th>\r
1971 \r
1972           <td>39</td>\r
1973 \r
1974           <td>To make it easier for client code to discover the range of styles that are\r
1975           predefined, this is set to the style number of the last predefined style. This is\r
1976           currently set to 39 and the last style with an identifier is 38, which reserves space\r
1977           for one future predefined style.</td>\r
1978         </tr>\r
1979 \r
1980         <tr>\r
1981           <th align="left"><code>STYLE_MAX</code></th>\r
1982 \r
1983           <td>255</td>\r
1984 \r
1985           <td>This is not a style but is the number of the maximum style that can be set. Styles\r
1986           between <code>STYLE_LASTPREDEFINED</code> and <code>STYLE_MAX</code> would be appropriate\r
1987           if you used <a class="message" href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a>\r
1988           to set more than 5 style bits.</td>\r
1989         </tr>\r
1990       </tbody>\r
1991     </table>\r
1992 \r
1993     <p>For each style you can set the font name, size and use of bold, italic and underline,\r
1994     foreground and background colour and the character set. You can also choose to hide text with a\r
1995     given style, display all characters as upper or lower case and fill from the last character on\r
1996     a line to the end of the line (for embedded languages). There is also an experimental attribute\r
1997     to make text read-only.</p>\r
1998 \r
1999     <p>It is entirely up to you how you use styles. If you want to use syntax colouring you might\r
2000     use style 0 for white space, style 1 for numbers, style 2 for keywords, style 3 for strings,\r
2001     style 4 for preprocessor, style 5 for operators, and so on.</p>\r
2002     <code><a class="message" href="#SCI_STYLERESETDEFAULT">SCI_STYLERESETDEFAULT</a><br />\r
2003     <a class="message" href="#SCI_STYLECLEARALL">SCI_STYLECLEARALL</a><br />\r
2004     <a class="message" href="#SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, char\r
2005     *fontName)</a><br />\r
2006     <a class="message" href="#SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName)</a><br />\r
2007     <a class="message" href="#SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int\r
2008     sizeInPoints)</a><br />\r
2009     <a class="message" href="#SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</a><br />\r
2010     <a class="message" href="#SCI_STYLESETBOLD">SCI_STYLESETBOLD(int styleNumber, bool\r
2011     bold)</a><br />\r
2012     <a class="message" href="#SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int styleNumber)</a><br />\r
2013     <a class="message" href="#SCI_STYLESETITALIC">SCI_STYLESETITALIC(int styleNumber, bool\r
2014     italic)</a><br />\r
2015     <a class="message" href="#SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int styleNumber)</a><br />\r
2016     <a class="message" href="#SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int styleNumber, bool\r
2017     underline)</a><br />\r
2018     <a class="message" href="#SCI_STYLEGETUNDERLINE">SCI_STYLEGETUNDERLINE(int styleNumber)</a><br />\r
2019     <a class="message" href="#SCI_STYLESETFORE">SCI_STYLESETFORE(int styleNumber, int\r
2020     colour)</a><br />\r
2021     <a class="message" href="#SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</a><br />\r
2022     <a class="message" href="#SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int\r
2023     colour)</a><br />\r
2024     <a class="message" href="#SCI_STYLEGETBACK">SCI_STYLESETBACK(int styleNumber)</a><br />\r
2025     <a class="message" href="#SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool\r
2026     eolFilled)</a><br />\r
2027     <a class="message" href="#SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</a><br />\r
2028     <a class="message" href="#SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET(int styleNumber,\r
2029     int charSet)</a><br />\r
2030     <a class="message" href="#SCI_STYLEGETCHARACTERSET">SCI_STYLEGETCHARACTERSET(int styleNumber)</a><br />\r
2031     <a class="message" href="#SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int\r
2032     caseMode)</a><br />\r
2033     <a class="message" href="#SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</a><br />\r
2034     <a class="message" href="#SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool\r
2035     visible)</a><br />\r
2036     <a class="message" href="#SCI_STYLEGETVISIBLE">SCI_STYLEGETVISIBLE(int styleNumber)</a><br />\r
2037     <a class="message" href="#SCI_STYLESETCHANGEABLE">SCI_STYLESETCHANGEABLE(int styleNumber, bool\r
2038     changeable)</a><br />\r
2039     <a class="message" href="#SCI_STYLEGETCHANGEABLE">SCI_STYLEGETCHANGEABLE(int styleNumber)</a><br />\r
2040      <a class="message" href="#SCI_STYLESETHOTSPOT">SCI_STYLESETHOTSPOT(int styleNumber, bool\r
2041     hotspot)</a><br />\r
2042     <a class="message" href="#SCI_STYLEGETHOTSPOT">SCI_STYLEGETHOTSPOT(int styleNumber)</a><br />\r
2043     </code>\r
2044 \r
2045     <p><b id="SCI_STYLERESETDEFAULT">SCI_STYLERESETDEFAULT</b><br />\r
2046      This message resets <code>STYLE_DEFAULT</code> to its state when Scintilla was\r
2047     initialised.</p>\r
2048 \r
2049     <p><b id="SCI_STYLECLEARALL">SCI_STYLECLEARALL</b><br />\r
2050      This message sets all styles to have the same attributes as <code>STYLE_DEFAULT</code>. If you\r
2051     are setting up Scintilla for syntax colouring, it is likely that the lexical styles you set\r
2052     will be very similar. One way to set the styles is to:<br />\r
2053      1. Set <code>STYLE_DEFAULT</code> to the common features of all styles.<br />\r
2054      2. Use <code>SCI_STYLECLEARALL</code> to copy this to all styles.<br />\r
2055      3. Set the style attributes that make your lexical styles different.</p>\r
2056 \r
2057     <p><b id="SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, const char *fontName)</b><br />\r
2058     <b id="SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName)</b><br />\r
2059     <b id="SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)</b><br />\r
2060     <b id="SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</b><br />\r
2061     <b id="SCI_STYLESETBOLD">SCI_STYLESETBOLD(int styleNumber, bool bold)</b><br />\r
2062     <b id="SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int styleNumber)</b><br />\r
2063     <b id="SCI_STYLESETITALIC">SCI_STYLESETITALIC(int styleNumber, bool italic)</b><br />\r
2064     <b id="SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int styleNumber)</b><br />\r
2065      These messages (plus <a class="message"\r
2066     href="#SCI_STYLESETCHARACTERSET"><code>SCI_STYLESETCHARACTERSET</code></a>) set the font\r
2067     attributes that are used to match the fonts you request to those available. The\r
2068     <code>fontName</code> is a zero terminated string holding the name of a font. Under Windows,\r
2069     only the first 32 characters of the name are used and the name is not case sensitive. For\r
2070     internal caching, Scintilla tracks fonts by name and does care about the casing of font names,\r
2071     so please be consistent. On GTK+ 2.x, either GDK or Pango can be used to display text.\r
2072     Pango antialiases text, works well with Unicode and is better supported in recent versions of GTK+\r
2073     but GDK is faster.\r
2074     Prepend a '!' character to the font name to use Pango.</p>\r
2075 \r
2076     <p><b id="SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int styleNumber, bool\r
2077     underline)</b><br />\r
2078     <b id="SCI_STYLEGETUNDERLINE">SCI_STYLEGETUNDERLINE(int styleNumber)</b><br />\r
2079     You can set a style to be underlined. The underline is drawn in the foreground colour. All\r
2080     characters with a style that includes the underline attribute are underlined, even if they are\r
2081     white space.</p>\r
2082 \r
2083     <p><b id="SCI_STYLESETFORE">SCI_STYLESETFORE(int styleNumber, int <a class="jump"\r
2084     href="#colour">colour</a>)</b><br />\r
2085     <b id="SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</b><br />\r
2086     <b id="SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int <a class="jump"\r
2087     href="#colour">colour</a>)</b><br />\r
2088     <b id="SCI_STYLEGETBACK">SCI_STYLEGETBACK(int styleNumber)</b><br />\r
2089     Text is drawn in the foreground colour. The space in each character cell that is not occupied\r
2090     by the character is drawn in the background colour.</p>\r
2091 \r
2092     <p><b id="SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool\r
2093     eolFilled)</b><br />\r
2094     <b id="SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</b><br />\r
2095     If the last character in the line has a style with this attribute set, the remainder of the\r
2096     line up to the right edge of the window is filled with the background colour set for the last\r
2097     character. This is useful when a document contains embedded sections in another language such\r
2098     as HTML pages with embedded JavaScript. By setting <code>eolFilled</code> to <code>true</code>\r
2099     and a consistent background colour (different from the background colour set for the HTML\r
2100     styles) to all JavaScript styles then JavaScript sections will be easily distinguished from\r
2101     HTML.</p>\r
2102 \r
2103     <p><b id="SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET(int styleNumber, int\r
2104     charSet)</b><br />\r
2105     <b id="SCI_STYLEGETCHARACTERSET">SCI_STYLEGETCHARACTERSET(int styleNumber)</b><br />\r
2106     You can set a style to use a different character set than the default. The places where such\r
2107     characters sets are likely to be useful are comments and literal strings. For example,\r
2108     <code>SCI_STYLESETCHARACTERSET(SCE_C_STRING, SC_CHARSET_RUSSIAN)</code> would ensure that\r
2109     strings in Russian would display correctly in C and C++ (<code>SCE_C_STRING</code> is the style\r
2110     number used by the C and C++ lexer to display literal strings; it has the value 6). This\r
2111     feature works differently on Windows and GTK+.</p>\r
2112 \r
2113     <p>The character sets supported on Windows are:<br />\r
2114      <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_ARABIC</code>, <code>SC_CHARSET_BALTIC</code>,\r
2115     <code>SC_CHARSET_CHINESEBIG5</code>, <code>SC_CHARSET_DEFAULT</code>,\r
2116     <code>SC_CHARSET_EASTEUROPE</code>, <code>SC_CHARSET_GB2312</code>,\r
2117     <code>SC_CHARSET_GREEK</code>, <code>SC_CHARSET_HANGUL</code>, <code>SC_CHARSET_HEBREW</code>,\r
2118     <code>SC_CHARSET_JOHAB</code>, <code>SC_CHARSET_MAC</code>, <code>SC_CHARSET_OEM</code>,\r
2119     <code>SC_CHARSET_RUSSIAN</code> (code page 1251),\r
2120     <code>SC_CHARSET_SHIFTJIS</code>, <code>SC_CHARSET_SYMBOL</code>, <code>SC_CHARSET_THAI</code>,\r
2121     <code>SC_CHARSET_TURKISH</code>, and <code>SC_CHARSET_VIETNAMESE</code>.</p>\r
2122 \r
2123     <p>The character sets supported on GTK+ are:<br />\r
2124      <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_CYRILLIC</code> (code page 1251),\r
2125      <code>SC_CHARSET_EASTEUROPE</code>,\r
2126     <code>SC_CHARSET_GB2312</code>, <code>SC_CHARSET_HANGUL</code>,\r
2127     <code>SC_CHARSET_RUSSIAN</code> (KOI8-R), <code>SC_CHARSET_SHIFTJIS</code>, and\r
2128     <code>SC_CHARSET_8859_15</code>.</p>\r
2129 \r
2130     <p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int caseMode)</b><br />\r
2131     <b id="SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</b><br />\r
2132     The value of caseMode determines how text is displayed. You can set upper case\r
2133     (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or display\r
2134     normally (<code>SC_CASE_MIXED</code>, 0). This does not change the stored text, only how it is\r
2135     displayed.</p>\r
2136 \r
2137     <p><b id="SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool visible)</b><br />\r
2138     <b id="SCI_STYLEGETVISIBLE">SCI_STYLEGETVISIBLE(int styleNumber)</b><br />\r
2139     Text is normally visible. However, you can completely hide it by giving it a style with the\r
2140     <code>visible</code> set to 0. This could be used to hide embedded formatting instructions or\r
2141     hypertext keywords in HTML or XML.</p>\r
2142 \r
2143     <p><b id="SCI_STYLESETCHANGEABLE">SCI_STYLESETCHANGEABLE(int styleNumber, bool\r
2144     changeable)</b><br />\r
2145     <b id="SCI_STYLEGETCHANGEABLE">SCI_STYLEGETCHANGEABLE(int styleNumber)</b><br />\r
2146     This is an experimental and incompletely implemented style attribute. The default setting is\r
2147     <code>changeable</code> set <code>true</code> but when set <code>false</code> it makes text\r
2148     read-only. Currently it only stops the caret from being within not-changeable text and does not\r
2149     yet stop deleting a range that contains not-changeable text.</p>\r
2150 \r
2151     <p><b id="SCI_STYLESETHOTSPOT">SCI_STYLESETHOTSPOT(int styleNumber, bool\r
2152     hotspot)</b><br />\r
2153     <b id="SCI_STYLEGETHOTSPOT">SCI_STYLEGETHOTSPOT(int styleNumber)</b><br />\r
2154     This style is used to mark ranges of text that can detect mouse clicks.\r
2155     The cursor changes to a hand over hotspots, and the foreground, and background colours\r
2156     may change and an underline appear to indicate that these areas are sensitive to clicking.\r
2157     This may be used to allow hyperlinks to other documents.</p>\r
2158 \r
2159     <h2 id="CaretAndSelectionStyles">Caret, selection, and hotspot styles</h2>\r
2160 \r
2161     <p>The selection is shown by changing the foreground and/or background colours. If one of these\r
2162     is not set then that attribute is not changed for the selection. The default is to show the\r
2163     selection by changing the background to light gray and leaving the foreground the same as when\r
2164     it was not selected. When there is no selection, the current insertion point is marked by the\r
2165     text caret. This is a vertical line that is normally blinking on and off to attract the users\r
2166     attention.</p>\r
2167     <code><a class="message" href="#SCI_SETSELFORE">SCI_SETSELFORE(bool useSelectionForeColour,\r
2168     int <a class="jump" href="#colour">colour<a>)</a><br />\r
2169     <a class="message" href="#SCI_SETSELBACK">SCI_SETSELBACK(bool useSelectionBackColour,\r
2170     int <a class="jump" href="#colour">colour<a>)</a><br />\r
2171     <a class="message" href="#SCI_SETSELALPHA">SCI_SETSELALPHA(int alpha)</a><br />\r
2172     <a class="message" href="#SCI_GETSELALPHA">SCI_GETSELALPHA</a><br />\r
2173     <a class="message" href="#SCI_SETSELEOLFILLED">SCI_SETSELEOLFILLED(bool filled)</a><br />\r
2174     <a class="message" href="#SCI_GETSELEOLFILLED">SCI_GETSELEOLFILLED</a><br />\r
2175     <a class="message" href="#SCI_SETCARETFORE">SCI_SETCARETFORE(int colour)</a><br />\r
2176     <a class="message" href="#SCI_GETCARETFORE">SCI_GETCARETFORE</a><br />\r
2177     <a class="message" href="#SCI_SETCARETLINEVISIBLE">SCI_SETCARETLINEVISIBLE(bool\r
2178     show)</a><br />\r
2179     <a class="message" href="#SCI_GETCARETLINEVISIBLE">SCI_GETCARETLINEVISIBLE</a><br />\r
2180     <a class="message" href="#SCI_SETCARETLINEBACK">SCI_SETCARETLINEBACK(int colour)</a><br />\r
2181     <a class="message" href="#SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</a><br />\r
2182     <a class="message" href="#SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int alpha)</a><br />\r
2183     <a class="message" href="#SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</a><br />\r
2184     <a class="message" href="#SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</a><br />\r
2185     <a class="message" href="#SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</a><br />\r
2186     <a class="message" href="#SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</a><br />\r
2187     <a class="message" href="#SCI_GETCARETSTYLE">SCI_GETCARETSTYLE</a><br />\r
2188     <a class="message" href="#SCI_SETCARETWIDTH">SCI_SETCARETWIDTH(int pixels)</a><br />\r
2189     <a class="message" href="#SCI_GETCARETWIDTH">SCI_GETCARETWIDTH</a><br />\r
2190     <a class="message" href="#SCI_SETHOTSPOTACTIVEFORE">SCI_SETHOTSPOTACTIVEFORE(bool useSetting,\r
2191     int <a class="jump" href="#colour">colour<a>)</a><br />\r
2192     <a class="message" href="#SCI_GETHOTSPOTACTIVEFORE">SCI_GETHOTSPOTACTIVEFORE</a><br />\r
2193     <a class="message" href="#SCI_SETHOTSPOTACTIVEBACK">SCI_SETHOTSPOTACTIVEBACK(bool useSetting,\r
2194     int <a class="jump" href="#colour">colour<a>)</a><br />\r
2195     <a class="message" href="#SCI_GETHOTSPOTACTIVEBACK">SCI_GETHOTSPOTACTIVEBACK</a><br />\r
2196     <a class="message" href="#SCI_SETHOTSPOTACTIVEUNDERLINE">SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)</a><br />\r
2197     <a class="message" href="#SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</a><br />\r
2198     <a class="message" href="#SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</a><br />\r
2199     <a class="message" href="#SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</a><br />\r
2200     <a class="message" href="#SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int\r
2201     symbol)</a><br />\r
2202      <a class="message" href="#SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</a><br />\r
2203      <a class="message" href="#SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(bool useCaretStickyBehaviour)</a><br />\r
2204      <a class="message" href="#SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</a><br />\r
2205      <a class="message" href="#SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</a><br />\r
2206     </code>\r
2207 \r
2208     <p><b id="SCI_SETSELFORE">SCI_SETSELFORE(bool useSelectionForeColour, int <a class="jump"\r
2209     href="#colour">colour</a>)</b><br />\r
2210      <b id="SCI_SETSELBACK">SCI_SETSELBACK(bool useSelectionBackColour, int <a class="jump"\r
2211     href="#colour">colour</a>)</b><br />\r
2212      You can choose to override the default selection colouring with these two messages. The colour\r
2213     you provide is used if you set <code>useSelection*Colour</code> to <code>true</code>. If it is\r
2214     set to <code>false</code>, the default styled colouring is used and the <code>colour</code>\r
2215     argument has no effect.</p>\r
2216      <p><b id="SCI_SETSELALPHA">SCI_SETSELALPHA(int <a class="jump" href="#alpha">alpha</a>)</b><br />\r
2217      <b id="SCI_GETSELALPHA">SCI_GETSELALPHA</b><br />\r
2218      The selection can be drawn translucently in the selection background colour by\r
2219      setting an alpha value.</p>\r
2220 \r
2221      <p><b id="SCI_SETSELEOLFILLED">SCI_SETSELEOLFILLED(bool filled)</b><br />\r
2222      <b id="SCI_GETSELEOLFILLED">SCI_GETSELEOLFILLED</b><br />\r
2223      The selection can be drawn up to the right hand border by setting this property.</p>\r
2224 \r
2225     <p><b id="SCI_SETCARETFORE">SCI_SETCARETFORE(int <a class="jump"\r
2226     href="#colour">colour</a>)</b><br />\r
2227      <b id="SCI_GETCARETFORE">SCI_GETCARETFORE</b><br />\r
2228      The colour of the caret can be set with <code>SCI_SETCARETFORE</code> and retrieved with\r
2229     <code>SCI_GETCARETFORE</code>.</p>\r
2230 \r
2231     <p><b id="SCI_SETCARETLINEVISIBLE">SCI_SETCARETLINEVISIBLE(bool show)</b><br />\r
2232      <b id="SCI_GETCARETLINEVISIBLE">SCI_GETCARETLINEVISIBLE</b><br />\r
2233      <b id="SCI_SETCARETLINEBACK">SCI_SETCARETLINEBACK(int <a class="jump"\r
2234     href="#colour">colour</a>)</b><br />\r
2235      <b id="SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</b><br />\r
2236      <b id="SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int <a class="jump" href="#alpha">alpha</a>)</b><br />\r
2237      <b id="SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</b><br />\r
2238      You can choose to make the background colour of the line containing the caret different with\r
2239     these messages. To do this, set the desired background colour with\r
2240     <code>SCI_SETCARETLINEBACK</code>, then use <code>SCI_SETCARETLINEVISIBLE(true)</code> to\r
2241     enable the effect. You can cancel the effect with <code>SCI_SETCARETLINEVISIBLE(false)</code>.\r
2242     The two <code>SCI_GETCARET*</code> functions return the state and the colour. This form of\r
2243     background colouring has highest priority when a line has markers that would otherwise change\r
2244     the background colour.\r
2245            The caret line may also be drawn translucently which allows other background colours to show\r
2246            through. This is done by setting the alpha (translucency) value by calling\r
2247            SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA,\r
2248            the caret line is drawn after all other features so will affect the colour of all other features.\r
2249           </p>\r
2250 \r
2251     <p><b id="SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</b><br />\r
2252      <b id="SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</b><br />\r
2253      The rate at which the caret blinks can be set with <code>SCI_SETCARETPERIOD</code> which\r
2254     determines the time in milliseconds that the caret is visible or invisible before changing\r
2255     state. Setting the period to 0 stops the caret blinking. The default value is 500 milliseconds.\r
2256     <code>SCI_GETCARETPERIOD</code> returns the current setting.</p>\r
2257 \r
2258     <p><b id="SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</b><br />\r
2259      <b id="SCI_GETCARETSTYLE">SCI_GETCARETSTYLE</b><br />\r
2260      The style of the caret can be set with <code>SCI_SETCARETSTYLE</code> to be a line caret\r
2261     (CARETSTYLE_LINE=1), a block caret (CARETSTYLE_BLOCK=2) or to not draw at all\r
2262     (CARETSTYLE_INVISIBLE=0). The default value is the line caret (CARETSTYLE_LINE=1).\r
2263     You can determine the current caret style setting using <code>SCI_GETCARETSTYLE</code>.</p>\r
2264 \r
2265     <p>The block character draws most combining and multibyte character sequences successfully,\r
2266     though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when\r
2267     the cursor is positioned at these characters, which may result in only drawing a part of the\r
2268     cursor character sequence. This is most notable on Windows platforms.</p>\r
2269 \r
2270     <p><b id="SCI_SETCARETWIDTH">SCI_SETCARETWIDTH(int pixels)</b><br />\r
2271      <b id="SCI_GETCARETWIDTH">SCI_GETCARETWIDTH</b><br />\r
2272      The width of the line caret can be set with <code>SCI_SETCARETWIDTH</code> to a value of\r
2273     0, 1, 2 or 3 pixels. The default width is 1 pixel. You can read back the current width with\r
2274     <code>SCI_GETCARETWIDTH</code>. A width of 0 makes the caret invisible (added at version\r
2275     1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangable).\r
2276     This setting only affects the width of the cursor when the cursor style is set to line caret\r
2277     mode, it does not affect the width for a block caret.</p>\r
2278 \r
2279     <p><b id="SCI_SETHOTSPOTACTIVEFORE">SCI_SETHOTSPOTACTIVEFORE(bool useHotSpotForeColour, int <a class="jump"\r
2280     href="#colour">colour</a>)</b><br />\r
2281     <b id="SCI_GETHOTSPOTACTIVEFORE">SCI_GETHOTSPOTACTIVEFORE</b><br />\r
2282     <b id="SCI_SETHOTSPOTACTIVEBACK">SCI_SETHOTSPOTACTIVEBACK(bool useHotSpotBackColour, int <a class="jump"\r
2283     href="#colour">colour</a>)</b><br />\r
2284     <b id="SCI_GETHOTSPOTACTIVEBACK">SCI_GETHOTSPOTACTIVEBACK</b><br />\r
2285     <b id="SCI_SETHOTSPOTACTIVEUNDERLINE">SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)</b><br />\r
2286      <b id="SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</b><br />\r
2287     <b id="SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</b><br />\r
2288      <b id="SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</b><br />\r
2289     While the cursor hovers over text in a style with the hotspot attribute set,\r
2290     the default colouring can be modified and an underline drawn with these settings.\r
2291     Single line mode stops a hotspot from wrapping onto next line.</p>\r
2292 \r
2293     <p><b id="SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</b><br />\r
2294      <b id="SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</b><br />\r
2295      By default, Scintilla displays control characters (characters with codes less than 32) in a\r
2296     rounded rectangle as ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",\r
2297     "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",\r
2298     "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US". These mnemonics come from the\r
2299     early days of signaling, though some are still used (LF = Line Feed, BS = Back Space, CR =\r
2300     Carriage Return, for example).</p>\r
2301 \r
2302     <p>You can choose to replace these mnemonics by a nominated symbol with an ASCII code in the\r
2303     range 32 to 255. If you set a symbol value less than 32, all control characters are displayed\r
2304     as mnemonics. The symbol you set is rendered in the font of the style set for the character.\r
2305     You can read back the current symbol with the <code>SCI_GETCONTROLCHARSYMBOL</code> message.\r
2306     The default symbol value is 0.</p>\r
2307 \r
2308     <p><b id="SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(bool useCaretStickyBehaviour)</b><br />\r
2309     <b id="SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</b><br />\r
2310     <b id="SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</b><br />\r
2311     These messages set, get or toggle the caretSticky flag which controls when the last position\r
2312      of the caret on the line is saved. When set to true, the position is not saved when you type\r
2313      a character, a tab, paste the clipboard content or press backspace.</p>\r
2314 \r
2315     <h2 id="Margins">Margins</h2>\r
2316 \r
2317     <p>There may be up to five margins to the left of the text display, plus a gap either side of\r
2318     the text. Each margin can be set to display either symbols or line numbers with <a\r
2319     class="message" href="#SCI_SETMARGINTYPEN"><code>SCI_SETMARGINTYPEN</code></a>. The markers\r
2320     that can be displayed in each margin are set with <a class="message"\r
2321     href="#SCI_SETMARGINMASKN"><code>SCI_SETMARGINMASKN</code></a>. Any markers not associated with\r
2322     a visible margin will be displayed as changes in background colour in the text. A width in\r
2323     pixels can be set for each margin. Margins with a zero width are ignored completely. You can\r
2324     choose if a mouse click in a margin sends a <a class="message"\r
2325     href="#SCN_MARGINCLICK"><code>SCN_MARGINCLICK</code></a> notification to the container or\r
2326     selects a line of text.</p>\r
2327 \r
2328     <p>The margins are numbered 0 to 4. Using a margin number outside the valid range has no\r
2329     effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it\r
2330     is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so\r
2331     it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it\r
2332     is hidden. Of course, you can set the margins to be whatever you wish.</p>\r
2333     <code><a class="message" href="#SCI_SETMARGINTYPEN">SCI_SETMARGINTYPEN(int margin, int\r
2334     type)</a><br />\r
2335      <a class="message" href="#SCI_GETMARGINTYPEN">SCI_GETMARGINTYPEN(int margin)</a><br />\r
2336      <a class="message" href="#SCI_SETMARGINWIDTHN">SCI_SETMARGINWIDTHN(int margin, int\r
2337     pixelWidth)</a><br />\r
2338      <a class="message" href="#SCI_GETMARGINWIDTHN">SCI_GETMARGINWIDTHN(int margin)</a><br />\r
2339      <a class="message" href="#SCI_SETMARGINMASKN">SCI_SETMARGINMASKN(int margin, int\r
2340     mask)</a><br />\r
2341      <a class="message" href="#SCI_GETMARGINMASKN">SCI_GETMARGINMASKN(int margin)</a><br />\r
2342      <a class="message" href="#SCI_SETMARGINSENSITIVEN">SCI_SETMARGINSENSITIVEN(int margin, bool\r
2343     sensitive)</a><br />\r
2344      <a class="message" href="#SCI_GETMARGINSENSITIVEN">SCI_GETMARGINSENSITIVEN(int\r
2345     margin)</a><br />\r
2346      <a class="message" href="#SCI_SETMARGINLEFT">SCI_SETMARGINLEFT(&lt;unused&gt;, int\r
2347     pixels)</a><br />\r
2348      <a class="message" href="#SCI_GETMARGINLEFT">SCI_GETMARGINLEFT</a><br />\r
2349      <a class="message" href="#SCI_SETMARGINRIGHT">SCI_SETMARGINRIGHT(&lt;unused&gt;, int\r
2350     pixels)</a><br />\r
2351      <a class="message" href="#SCI_GETMARGINRIGHT">SCI_GETMARGINRIGHT</a><br />\r
2352      <a class="message" href="#SCI_SETFOLDMARGINCOLOUR">SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)</a><br />\r
2353      <a class="message" href="#SCI_SETFOLDMARGINHICOLOUR">SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)</a><br />\r
2354     </code>\r
2355 \r
2356     <p><b id="SCI_SETMARGINTYPEN">SCI_SETMARGINTYPEN(int margin, int iType)</b><br />\r
2357      <b id="SCI_GETMARGINTYPEN">SCI_GETMARGINTYPEN(int margin)</b><br />\r
2358      These two routines set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4.\r
2359     You can use the predefined constants <code>SC_MARGIN_SYMBOL</code> (0) and\r
2360     <code>SC_MARGIN_NUMBER</code> (1) to set a margin as either a line number or a symbol margin.\r
2361     By convention, margin 0 is used for line numbers and the next two are used for symbols. You can\r
2362     also use the constants <code>SC_MARGIN_BACK</code> (2) and <code>SC_MARGIN_FORE</code> (3) for\r
2363     symbol margins that set their background colour to match the STYLE_DEFAULT background and\r
2364     foreground colours.</p>\r
2365 \r
2366     <p><b id="SCI_SETMARGINWIDTHN">SCI_SETMARGINWIDTHN(int margin, int pixelWidth)</b><br />\r
2367      <b id="SCI_GETMARGINWIDTHN">SCI_GETMARGINWIDTHN(int margin)</b><br />\r
2368      These routines set and get the width of a margin in pixels. A margin with zero width is\r
2369     invisible. By default, Scintilla sets margin 1 for symbols with a width of 16 pixels, so this\r
2370     is a reasonable guess if you are not sure what would be appropriate. Line number margins widths\r
2371     should take into account the number of lines in the document and the line number style. You\r
2372     could use something like <a class="message"\r
2373     href="#SCI_TEXTWIDTH"><code>SCI_TEXTWIDTH(STYLE_LINENUMBER, "_99999")</code></a> to get a\r
2374     suitable width.</p>\r
2375 \r
2376     <p><b id="SCI_SETMARGINMASKN">SCI_SETMARGINMASKN(int margin, int mask)</b><br />\r
2377      <b id="SCI_GETMARGINMASKN">SCI_GETMARGINMASKN(int margin)</b><br />\r
2378      The mask is a 32-bit value. Each bit corresponds to one of 32 logical symbols that can be\r
2379     displayed in a margin that is enabled for symbols. There is a useful constant,\r
2380     <code>SC_MASK_FOLDERS</code> (0xFE000000 or -33554432), that is a mask for the 7 logical\r
2381     symbols used to denote folding. You can assign a wide range of symbols and colours to each of\r
2382     the 32 logical symbols, see <a href="#Markers">Markers</a> for more information. If <code>(mask\r
2383     &amp; SC_MASK_FOLDERS)==0</code>, the margin background colour is controlled by style 33 (<a\r
2384     class="message" href="#StyleDefinition"><code>STYLE_LINENUMBER</code></a>).</p>\r
2385 \r
2386     <p>You add logical markers to a line with <a class="message"\r
2387     href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. If a line has an associated marker that\r
2388     does not appear in the mask of any margin with a non-zero width, the marker changes the\r
2389     background colour of the line. For example, suppose you decide to use logical marker 10 to mark\r
2390     lines with a syntax error and you want to show such lines by changing the background colour.\r
2391     The mask for this marker is 1 shifted left 10 times (1&lt;&lt;10) which is 0x400. If you make\r
2392     sure that no symbol margin includes 0x400 in its mask, any line with the marker gets the\r
2393     background colour changed.</p>\r
2394 \r
2395     <p>To set a non-folding margin 1 use <code>SCI_SETMARGINMASKN(1, ~SC_MASK_FOLDERS)</code>; to\r
2396     set a folding margin 2 use <code>SCI_SETMARGINMASKN(2, SC_MASK_FOLDERS)</code>. This is the\r
2397     default set by Scintilla. <code>~SC_MASK_FOLDERS</code> is 0x1FFFFFF in hexadecimal or 33554431\r
2398     decimal. Of course, you may need to display all 32 symbols in a margin, in which case use\r
2399     <code>SCI_SETMARGINMASKN(margin, -1)</code>.</p>\r
2400 \r
2401     <p><b id="SCI_SETMARGINSENSITIVEN">SCI_SETMARGINSENSITIVEN(int margin, bool\r
2402     sensitive)</b><br />\r
2403      <b id="SCI_GETMARGINSENSITIVEN">SCI_GETMARGINSENSITIVEN(int margin)</b><br />\r
2404      Each of the five margins can be set sensitive or insensitive to mouse clicks. A click in a\r
2405     sensitive margin sends a <a class="message"\r
2406     href="#SCN_MARGINCLICK"><code>SCN_MARGINCLICK</code></a> <a class="jump"\r
2407     href="#Notifications">notification</a> to the container. Margins that are not sensitive act as\r
2408     selection margins which make it easy to select ranges of lines. By default, all margins are\r
2409     insensitive.</p>\r
2410 \r
2411     <p><b id="SCI_SETMARGINLEFT">SCI_SETMARGINLEFT(&lt;unused&gt;, int pixels)</b><br />\r
2412      <b id="SCI_GETMARGINLEFT">SCI_GETMARGINLEFT</b><br />\r
2413      <b id="SCI_SETMARGINRIGHT">SCI_SETMARGINRIGHT(&lt;unused&gt;, int pixels)</b><br />\r
2414      <b id="SCI_GETMARGINRIGHT">SCI_GETMARGINRIGHT</b><br />\r
2415      These messages set and get the width of the blank margin on both sides of the text in pixels.\r
2416     The default is to one pixel on each side.</p>\r
2417 \r
2418     <p><b id="SCI_SETFOLDMARGINCOLOUR">SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)</b><br />\r
2419      <b id="SCI_SETFOLDMARGINHICOLOUR">SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)</b><br />\r
2420      These messages allow changing the colour of the fold margin and fold margin highlight.\r
2421      On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight\r
2422      colour to ::GetSysColor(COLOR_3DHIGHLIGHT).</p>\r
2423 \r
2424     <h2 id="OtherSettings">Other settings</h2>\r
2425     <code><a class="message" href="#SCI_SETUSEPALETTE">SCI_SETUSEPALETTE(bool\r
2426     allowPaletteUse)</a><br />\r
2427      <a class="message" href="#SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</a><br />\r
2428      <a class="message" href="#SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</a><br />\r
2429      <a class="message" href="#SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</a><br />\r
2430      <a class="message" href="#SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</a><br />\r
2431      <a class="message" href="#SCI_GETTWOPHASEDRAW">SCI_GETTWOPHASEDRAW</a><br />\r
2432      <a class="message" href="#SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</a><br />\r
2433      <a class="message" href="#SCI_GETCODEPAGE">SCI_GETCODEPAGE</a><br />\r
2434      <a class="message" href="#SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</a><br />\r
2435      <a class="message" href="#SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</a><br />\r
2436      <a class="message" href="#SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char\r
2437     *chars)</a><br />\r
2438      <a class="message" href="#SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char\r
2439     *chars)</a><br />\r
2440      <a class="message" href="#SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</a><br />\r
2441      <a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br />\r
2442      <a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br />\r
2443      <a class="message" href="#SCI_GETFOCUS">SCI_GETFOCUS</a><br />\r
2444     </code>\r
2445 \r
2446     <p><b id="SCI_SETUSEPALETTE">SCI_SETUSEPALETTE(bool allowPaletteUse)</b><br />\r
2447      <b id="SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</b><br />\r
2448      On 8 bit displays, which can only display a maximum of 256 colours, the graphics environment\r
2449     mediates between the colour needs of applications through the use of palettes. On GTK+,\r
2450     Scintilla always uses a palette.</p>\r
2451 \r
2452     <p>On Windows, there are some problems with visual flashing when switching between applications\r
2453     with palettes and it is also necessary for the application containing the Scintilla control to\r
2454     forward some messages to Scintilla for its palette code to work. Because of this, by default,\r
2455     the palette is not used and the application must tell Scintilla to use one. If Scintilla is not\r
2456     using a palette, it will only display in those colours already available, which are often the\r
2457     20 Windows system colours.</p>\r
2458 \r
2459     <p>To see an example of how to enable palette support in Scintilla, search the text of SciTE\r
2460     for <code>WM_PALETTECHANGED</code>, <code>WM_QUERYNEWPALETTE</code> and\r
2461     <code>SCI_SETUSEPALETTE</code>. The Windows messages to forward are:<br />\r
2462      <code>WM_SYSCOLORCHANGE</code>, <code>WM_PALETTECHANGED</code>,\r
2463     <code>WM_QUERYNEWPALETTE</code> (should return <code>TRUE</code>).</p>\r
2464 \r
2465     <p>To forward a message <code>(WM_XXXX, WPARAM, LPARAM)</code> to Scintilla, you can use\r
2466     <code>SendMessage(hScintilla, WM_XXXX, WPARAM, LPARAM)</code> where <code>hScintilla</code> is\r
2467     the handle to the Scintilla window you created as your editor.</p>\r
2468 \r
2469     <p>While we are on the subject of forwarding messages in Windows, the top level window should\r
2470     forward any <code>WM_SETTINGCHANGE</code> messages to Scintilla (this is currently used to\r
2471     collect changes to mouse settings, but could be used for other user interface items in the\r
2472     future).</p>\r
2473 \r
2474     <p><b id="SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</b><br />\r
2475      <b id="SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</b><br />\r
2476      These messages turn buffered drawing on or off and report the buffered drawing state. Buffered\r
2477     drawing draws each line into a bitmap rather than directly to the screen and then copies the\r
2478     bitmap to the screen. This avoids flickering although it does take longer. The default is for\r
2479     drawing to be buffered.</p>\r
2480 \r
2481     <p><b id="SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</b><br />\r
2482      <b id="SCI_GETTWOPHASEDRAW">SCI_GETTWOPHASEDRAW</b><br />\r
2483      Two phase drawing is a better but slower way of drawing text.\r
2484      In single phase drawing each run of characters in one style is drawn along with its background.\r
2485      If a character overhangs the end of a run, such as in "<i>V</i>_" where the\r
2486      "<i>V</i>" is in a different style from the "_", then this can cause the right hand\r
2487      side of the "<i>V</i>" to be overdrawn by the background of the "_" which\r
2488      cuts it off. Two phase drawing\r
2489      fixes this by drawing all the backgrounds first and then drawing the text in\r
2490      transparent mode. Two phase drawing may flicker more than single phase\r
2491      unless buffered drawing is on. The default is for drawing to be two phase.</p>\r
2492 \r
2493     <p><b id="SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</b><br />\r
2494      <b id="SCI_GETCODEPAGE">SCI_GETCODEPAGE</b><br />\r
2495      Scintilla has some support for Japanese, Chinese and Korean DBCS. Use this message with\r
2496     <code>codePage</code> set to the code page number to set Scintilla to use code page information\r
2497     to ensure double byte characters are treated as one character rather than two. This also stops\r
2498     the caret from moving between the two bytes in a double byte character.\r
2499     Do not use this message to choose between different single byte character sets: it doesn't do that.\r
2500     Call with\r
2501     <code>codePage</code> set to zero to disable DBCS support. The default is\r
2502     <code>SCI_SETCODEPAGE(0)</code>.</p>\r
2503 \r
2504     <p>Code page <code>SC_CP_UTF8</code> (65001) sets Scintilla into Unicode mode with the document\r
2505     treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's\r
2506     normal Unicode encoding before being drawn by the OS and thus can display Hebrew, Arabic,\r
2507     Cyrillic, and Han characters. Languages which can use two characters stacked vertically in one\r
2508     horizontal space, such as Thai, will mostly work but there are some issues where the characters\r
2509     are drawn separately leading to visual glitches. Bi-directional text is not supported. Characters outside the\r
2510     Basic Multilingual Plane are unlikely to work.</p>\r
2511 \r
2512     <p>On Windows, code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK),\r
2513     949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab)\r
2514     although these may require installation of language specific support.</p>\r
2515 \r
2516     <p>On GTK+, code page <code>SC_CP_DBCS</code> (1) sets Scintilla into\r
2517     multi byte character mode as is required for Japanese language processing with\r
2518     the EUC encoding.</p>\r
2519 \r
2520     <p>For GTK+ 1.x, the locale should be set to a Unicode locale with a call similar to\r
2521     <code>setlocale(LC_CTYPE, "en_US.UTF-8")</code>. Fonts with an <code>"iso10646"</code> registry\r
2522     should be used in a font set. Font sets are a comma separated list of partial font\r
2523     specifications where each partial font specification can be in the form:\r
2524     <code>foundry-fontface-charsetregistry-encoding</code> or\r
2525     <code>fontface-charsetregistry-encoding</code> or <code>foundry-fontface</code> or\r
2526     <code>fontface</code>. An example is <code>"misc-fixed-iso10646-1,*"</code>.\r
2527     On GTK+ 2.x, Pango fonts should be used rather than font sets.</p>\r
2528 \r
2529     <p>Setting <code>codePage</code> to a non-zero value that is not <code>SC_CP_UTF8</code> is\r
2530     operating system dependent.</p>\r
2531 \r
2532     <p><b id="SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</b><br />\r
2533      <b id="SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</b><br />\r
2534      On Windows, character keys are normally handled differently depending on whether Scintilla is a wide\r
2535      or narrow character window with character messages treated as Unicode when wide and as 8 bit otherwise.\r
2536      Set this property to always treat as Unicode. This option is needed for Delphi.</p>\r
2537 \r
2538     <p><b id="SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char *chars)</b><br />\r
2539      Scintilla has several functions that operate on words, which are defined to be contiguous\r
2540     sequences of characters from a particular set of characters. This message defines which\r
2541     characters are members of that set. The character sets are set to default values before processing this\r
2542     function.\r
2543     For example, if you don't allow '_' in your set of characters\r
2544     use:<br />\r
2545      <code>SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")</code>;</p>\r
2546 \r
2547     <p><b id="SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char *chars)</b><br />\r
2548      Similar to <code>SCI_SETWORDCHARS</code>, this message allows the user to define which chars Scintilla considers\r
2549           as whitespace.  Setting the whitespace chars allows the user to fine-tune Scintilla's behaviour doing\r
2550           such things as moving the cursor to the start or end of a word; for example, by defining punctuation chars\r
2551           as whitespace, they will be skipped over when the user presses ctrl+left or ctrl+right.\r
2552           This function should be called after <code>SCI_SETWORDCHARS</code> as it will\r
2553           reset the whitespace characters to the default set.</p>\r
2554     <p><b id="SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</b><br />\r
2555      Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other\r
2556      characters with codes less than 0x20, with word characters set to alphanumeric and '_'.\r
2557     </p>\r
2558 \r
2559 \r
2560     <p><b id="SCI_GRABFOCUS">SCI_GRABFOCUS</b><br />\r
2561      <b id="SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</b><br />\r
2562      <b id="SCI_GETFOCUS">SCI_GETFOCUS</b><br />\r
2563      Scintilla can be told to grab the focus with this message. This is needed more on GTK+ where\r
2564            focus handling is more complicated than on Windows.</p>\r
2565 \r
2566     <p>The internal focus flag can be set with <code>SCI_SETFOCUS</code>. This is used by clients\r
2567     that have complex focus requirements such as having their own window that gets the real focus\r
2568     but with the need to indicate that Scintilla has the logical focus.</p>\r
2569 \r
2570     <h2 id="BraceHighlighting">Brace highlighting</h2>\r
2571     <code><a class="message" href="#SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(int pos1, int\r
2572     pos2)</a><br />\r
2573      <a class="message" href="#SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</a><br />\r
2574      <a class="message" href="#SCI_BRACEMATCH">SCI_BRACEMATCH(int position, int\r
2575     maxReStyle)</a><br />\r
2576     </code>\r
2577 \r
2578     <p><b id="SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(int pos1, int pos2)</b><br />\r
2579      Up to two characters can be highlighted in a 'brace highlighting style', which is defined as\r
2580     style number <a class="message" href="#StyleDefinition"><code>STYLE_BRACELIGHT</code></a> (34).\r
2581     If you have enabled indent guides, you may also wish to highlight the indent that corresponds\r
2582     with the brace. You can locate the column with <a class="message"\r
2583     href="#SCI_GETCOLUMN"><code>SCI_GETCOLUMN</code></a> and highlight the indent with <a\r
2584     class="message" href="#SCI_SETHIGHLIGHTGUIDE"><code>SCI_SETHIGHLIGHTGUIDE</code></a>.</p>\r
2585 \r
2586     <p><b id="SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</b><br />\r
2587      If there is no matching brace then the <a class="jump" href="#StyleDefinition">brace\r
2588     badlighting style</a>, style <code>BRACE_BADLIGHT</code> (35), can be used to show the brace\r
2589     that is unmatched. Using a position of <code>INVALID_POSITION</code> (-1) removes the\r
2590     highlight.</p>\r
2591 \r
2592     <p><b id="SCI_BRACEMATCH">SCI_BRACEMATCH(int pos, int maxReStyle)</b><br />\r
2593      The <code>SCI_BRACEMATCH</code> message finds a corresponding matching brace given\r
2594     <code>pos</code>, the position of one brace. The brace characters handled are '(', ')', '[',\r
2595     ']', '{', '}', '&lt;', and '&gt;'. The search is forwards from an opening brace and backwards\r
2596     from a closing brace. If the character at position is not a brace character, or a matching\r
2597     brace cannot be found, the return value is -1. Otherwise, the return value is the position of\r
2598     the matching brace.</p>\r
2599 \r
2600     <p>A match only occurs if the style of the matching brace is the same as the starting brace or\r
2601     the matching brace is beyond the end of styling. Nested braces are handled correctly. The\r
2602     <code>maxReStyle</code> parameter must currently be 0 - it may be used in the future to limit\r
2603     the length of brace searches.</p>\r
2604 \r
2605     <h2 id="TabsAndIndentationGuides">Tabs and Indentation Guides</h2>\r
2606 \r
2607     <p>Indentation (the white space at the start of a line) is often used by programmers to clarify\r
2608     program structure and in some languages, for example Python, it may be part of the language\r
2609     syntax. Tabs are normally used in editors to insert a tab character or to pad text with spaces\r
2610     up to the next tab.</p>\r
2611 \r
2612     <p>Scintilla can be set to treat tab and backspace in the white space at the start of a line in\r
2613     a special way: inserting a tab indents the line to the next indent position rather than just\r
2614     inserting a tab at the current character position and backspace unindents the line rather than\r
2615     deleting a character. Scintilla can also display indentation guides (vertical lines) to help\r
2616     you to generate code.</p>\r
2617     <code><a class="message" href="#SCI_SETTABWIDTH">SCI_SETTABWIDTH(int widthInChars)</a><br />\r
2618      <a class="message" href="#SCI_GETTABWIDTH">SCI_GETTABWIDTH</a><br />\r
2619      <a class="message" href="#SCI_SETUSETABS">SCI_SETUSETABS(bool useTabs)</a><br />\r
2620      <a class="message" href="#SCI_GETUSETABS">SCI_GETUSETABS</a><br />\r
2621      <a class="message" href="#SCI_SETINDENT">SCI_SETINDENT(int widthInChars)</a><br />\r
2622      <a class="message" href="#SCI_GETINDENT">SCI_GETINDENT</a><br />\r
2623      <a class="message" href="#SCI_SETTABINDENTS">SCI_SETTABINDENTS(bool tabIndents)</a><br />\r
2624      <a class="message" href="#SCI_GETTABINDENTS">SCI_GETTABINDENTS</a><br />\r
2625      <a class="message" href="#SCI_SETBACKSPACEUNINDENTS">SCI_SETBACKSPACEUNINDENTS(bool\r
2626     bsUnIndents)</a><br />\r
2627      <a class="message" href="#SCI_GETBACKSPACEUNINDENTS">SCI_GETBACKSPACEUNINDENTS</a><br />\r
2628      <a class="message" href="#SCI_SETLINEINDENTATION">SCI_SETLINEINDENTATION(int line, int\r
2629     indentation)</a><br />\r
2630      <a class="message" href="#SCI_GETLINEINDENTATION">SCI_GETLINEINDENTATION(int line)</a><br />\r
2631      <a class="message" href="#SCI_GETLINEINDENTPOSITION">SCI_GETLINEINDENTPOSITION(int\r
2632     line)</a><br />\r
2633      <a class="message" href="#SCI_SETINDENTATIONGUIDES">SCI_SETINDENTATIONGUIDES(bool\r
2634     view)</a><br />\r
2635      <a class="message" href="#SCI_GETINDENTATIONGUIDES">SCI_GETINDENTATIONGUIDES</a><br />\r
2636      <a class="message" href="#SCI_SETHIGHLIGHTGUIDE">SCI_SETHIGHLIGHTGUIDE(int column)</a><br />\r
2637      <a class="message" href="#SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE</a><br />\r
2638     </code>\r
2639 \r
2640     <p><b id="SCI_SETTABWIDTH">SCI_SETTABWIDTH(int widthInChars)</b><br />\r
2641      <b id="SCI_GETTABWIDTH">SCI_GETTABWIDTH</b><br />\r
2642      <code>SCI_SETTABWIDTH</code> sets the size of a tab as a multiple of the size of a space\r
2643     character in <code>STYLE_DEFAULT</code>. The default tab width is 8 characters. There are no\r
2644     limits on tab sizes, but values less than 1 or large values may have undesirable effects.</p>\r
2645 \r
2646     <p><b id="SCI_SETUSETABS">SCI_SETUSETABS(bool useTabs)</b><br />\r
2647      <b id="SCI_GETUSETABS">SCI_GETUSETABS</b><br />\r
2648      <code>SCI_SETUSETABS</code> determines whether indentation should be created out of a mixture\r
2649     of tabs and spaces or be based purely on spaces. Set <code>useTabs</code> to <code>false</code>\r
2650     (0) to create all tabs and indents out of spaces. The default is <code>true</code>. You can use\r
2651     <a class="message" href="#SCI_GETCOLUMN"><code>SCI_GETCOLUMN</code></a> to get the column of a\r
2652     position taking the width of a tab into account.</p>\r
2653     <p><b id="SCI_SETINDENT">SCI_SETINDENT(int widthInChars)</b><br />\r
2654      <b id="SCI_GETINDENT">SCI_GETINDENT</b><br />\r
2655      <code>SCI_SETINDENT</code> sets the size of indentation in terms of the width of a space in <a\r
2656     class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. If you set a width of\r
2657     0, the indent size is the same as the tab size. There are no limits on indent sizes, but values\r
2658     less than 0 or large values may have undesirable effects.\r
2659     </p>\r
2660 \r
2661     <p><b id="SCI_SETTABINDENTS">SCI_SETTABINDENTS(bool tabIndents)</b><br />\r
2662      <b id="SCI_GETTABINDENTS">SCI_GETTABINDENTS</b><br />\r
2663      <b id="SCI_SETBACKSPACEUNINDENTS">SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)</b><br />\r
2664      <b id="SCI_GETBACKSPACEUNINDENTS">SCI_GETBACKSPACEUNINDENTS</b><br />\r
2665     </p>\r
2666 \r
2667     <p>Inside indentation white space, the tab and backspace keys can be made to indent and\r
2668     unindent rather than insert a tab character or delete a character with the\r
2669     <code>SCI_SETTABINDENTS</code> and <code>SCI_SETBACKSPACEUNINDENTS</code> functions.</p>\r
2670 \r
2671     <p><b id="SCI_SETLINEINDENTATION">SCI_SETLINEINDENTATION(int line, int indentation)</b><br />\r
2672      <b id="SCI_GETLINEINDENTATION">SCI_GETLINEINDENTATION(int line)</b><br />\r
2673      The amount of indentation on a line can be discovered and set with\r
2674     <code>SCI_GETLINEINDENTATION</code> and <code>SCI_SETLINEINDENTATION</code>. The indentation is\r
2675     measured in character columns, which correspond to the width of space characters.</p>\r
2676 \r
2677     <p><b id="SCI_GETLINEINDENTPOSITION">SCI_GETLINEINDENTPOSITION(int line)</b><br />\r
2678      This returns the position at the end of indentation of a line.</p>\r
2679 \r
2680     <p><b id="SCI_SETINDENTATIONGUIDES">SCI_SETINDENTATIONGUIDES(int indentView)</b><br />\r
2681      <b id="SCI_GETINDENTATIONGUIDES">SCI_GETINDENTATIONGUIDES</b><br />\r
2682      Indentation guides are dotted vertical lines that appear within indentation white space every\r
2683     indent size columns. They make it easy to see which constructs line up especially when they\r
2684     extend over multiple pages. Style <a class="message"\r
2685     href="#StyleDefinition"><code>STYLE_INDENTGUIDE</code></a> (37) is used to specify the\r
2686     foreground and background colour of the indentation guides.</p>\r
2687 \r
2688     <p>There are 4 indentation guide views.\r
2689     SC_IV_NONE turns the feature off but the other 3 states determine how far the guides appear on\r
2690     empty lines.\r
2691     <table border="0" summary="Search flags">\r
2692       <tbody>\r
2693         <tr>\r
2694           <td><code>SC_IV_NONE</code></td>\r
2695           <td>No indentation guides are shown.</td>\r
2696         </tr>\r
2697 \r
2698         <tr>\r
2699           <td><code>SC_IV_REAL</code></td>\r
2700           <td>Indentation guides are shown inside real indentation white space.</td>\r
2701         </tr>\r
2702 \r
2703         <tr>\r
2704           <td><code>SC_IV_LOOKFORWARD</code></td>\r
2705           <td>Indentation guides are shown beyond the actual indentation up to the level of the\r
2706           next non-empty line.\r
2707           If the previous non-empty line was a fold header then indentation guides are shown for\r
2708           one more level of indent than that line. This setting is good for Python.</td>\r
2709         </tr>\r
2710 \r
2711         <tr>\r
2712           <td><code>SC_IV_LOOKBOTH</code></td>\r
2713           <td>Indentation guides are shown beyond the actual indentation up to the level of the\r
2714           next non-empty line or previous non-empty line whichever is the greater.\r
2715           This setting is good for most languages.</td>\r
2716         </tr>\r
2717 \r
2718     </table>\r
2719     </p>\r
2720 \r
2721     <p><b id="SCI_SETHIGHLIGHTGUIDE">SCI_SETHIGHLIGHTGUIDE(int column)</b><br />\r
2722      <b id="SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE</b><br />\r
2723      When brace highlighting occurs, the indentation guide corresponding to the braces may be\r
2724     highlighted with the brace highlighting style, <a class="message"\r
2725     href="#StyleDefinition"><code>STYLE_BRACELIGHT</code></a> (34). Set <code>column</code> to 0 to\r
2726     cancel this highlight.</p>\r
2727 \r
2728     <h2 id="Markers">Markers</h2>\r
2729 \r
2730     <p>There are 32 markers, numbered 0 to 31, and you can assign any combination of them to each\r
2731     line in the document. Markers appear in the <a class="jump" href="#Margins">selection\r
2732     margin</a> to the left of the text. If the selection margin is set to zero width, the\r
2733     background colour of the whole line is changed instead. Marker numbers 25 to 31 are used by\r
2734     Scintilla in folding margins, and have symbolic names of the form <code>SC_MARKNUM_</code>*,\r
2735     for example <code>SC_MARKNUM_FOLDEROPEN</code>.</p>\r
2736 \r
2737     <p>Marker numbers 0 to 24 have no pre-defined function; you can use them to mark syntax errors\r
2738     or the current point of execution, break points, or whatever you need marking. If you do not\r
2739     need folding, you can use all 32 for any purpose you wish.</p>\r
2740 \r
2741     <p>Each marker number has a symbol associated with it. You can also set the foreground and\r
2742     background colour for each marker number, so you can use the same symbol more than once with\r
2743     different colouring for different uses. Scintilla has a set of symbols you can assign\r
2744     (<code>SC_MARK_</code>*) or you can use characters. By default, all 32 markers are set to\r
2745     <code>SC_MARK_CIRCLE</code> with a black foreground and a white background.</p>\r
2746 \r
2747     <p>The markers are drawn in the order of their numbers, so higher numbered markers appear on\r
2748     top of lower numbered ones. Markers try to move with their text by tracking where the start of\r
2749     their line moves. When a line is deleted, its markers are combined, by an <code>OR</code>\r
2750     operation, with the markers of the previous line.</p>\r
2751     <code><a class="message" href="#SCI_MARKERDEFINE">SCI_MARKERDEFINE(int markerNumber, int\r
2752     markerSymbols)</a><br />\r
2753      <a class="message" href="#SCI_MARKERDEFINEPIXMAP">SCI_MARKERDEFINEPIXMAP(int markerNumber,\r
2754     const char *xpm)</a><br />\r
2755      <a class="message" href="#SCI_MARKERSETFORE">SCI_MARKERSETFORE(int markerNumber, int\r
2756     colour)</a><br />\r
2757      <a class="message" href="#SCI_MARKERSETBACK">SCI_MARKERSETBACK(int markerNumber, int\r
2758     colour)</a><br />\r
2759      <a class="message" href="#SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int\r
2760     alpha)</a><br />\r
2761      <a class="message" href="#SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</a><br />\r
2762      <a class="message" href="#SCI_MARKERADDSET">SCI_MARKERADDSET(int line, int markerMask)</a><br />\r
2763      <a class="message" href="#SCI_MARKERDELETE">SCI_MARKERDELETE(int line, int\r
2764     markerNumber)</a><br />\r
2765      <a class="message" href="#SCI_MARKERDELETEALL">SCI_MARKERDELETEALL(int markerNumber)</a><br />\r
2766      <a class="message" href="#SCI_MARKERGET">SCI_MARKERGET(int line)</a><br />\r
2767      <a class="message" href="#SCI_MARKERNEXT">SCI_MARKERNEXT(int lineStart, int\r
2768     markerMask)</a><br />\r
2769      <a class="message" href="#SCI_MARKERPREVIOUS">SCI_MARKERPREVIOUS(int lineStart, int\r
2770     markerMask)</a><br />\r
2771      <a class="message" href="#SCI_MARKERLINEFROMHANDLE">SCI_MARKERLINEFROMHANDLE(int\r
2772     handle)</a><br />\r
2773      <a class="message" href="#SCI_MARKERDELETEHANDLE">SCI_MARKERDELETEHANDLE(int handle)</a><br />\r
2774     </code>\r
2775 \r
2776     <p><b id="SCI_MARKERDEFINE">SCI_MARKERDEFINE(int markerNumber, int markerSymbols)</b><br />\r
2777      This message associates a marker number in the range 0 to 31 with one of the marker symbols or\r
2778     an ASCII character. The general-purpose marker symbols currently available are:<br />\r
2779      <code>SC_MARK_CIRCLE</code>, <code>SC_MARK_ROUNDRECT</code>, <code>SC_MARK_ARROW</code>,\r
2780     <code>SC_MARK_SMALLRECT</code>, <code>SC_MARK_SHORTARROW</code>, <code>SC_MARK_EMPTY</code>,\r
2781     <code>SC_MARK_ARROWDOWN</code>, <code>SC_MARK_MINUS</code>, <code>SC_MARK_PLUS</code>,\r
2782     <code>SC_MARK_ARROWS</code>, <code>SC_MARK_DOTDOTDOT</code>, <code>SC_MARK_EMPTY</code>,\r
2783     <code>SC_MARK_BACKGROUND</code>, <code>SC_MARK_LEFTRECT</code>\r
2784     and <code>SC_MARK_FULLRECT</code>.</p>\r
2785 \r
2786     <p>The <code>SC_MARK_BACKGROUND</code> marker changes the background colour of the line only.\r
2787           The <code>SC_MARK_FULLRECT</code> symbol mirrors this, changing only the margin background colour.\r
2788     The <code>SC_MARK_EMPTY</code> symbol is invisible, allowing client code to track the movement\r
2789     of lines. You would also use it if you changed the folding style and wanted one or more of the\r
2790     <code>SC_FOLDERNUM_</code>* markers to have no associated symbol.</p>\r
2791 \r
2792     <p>There are also marker symbols designed for use in the folding margin in a flattened tree\r
2793     style.<br />\r
2794      <code>SC_MARK_BOXMINUS</code>, <code>SC_MARK_BOXMINUSCONNECTED</code>,\r
2795     <code>SC_MARK_BOXPLUS</code>, <code>SC_MARK_BOXPLUSCONNECTED</code>,\r
2796     <code>SC_MARK_CIRCLEMINUS</code>, <code>SC_MARK_CIRCLEMINUSCONNECTED</code>,\r
2797     <code>SC_MARK_CIRCLEPLUS</code>, <code>SC_MARK_CIRCLEPLUSCONNECTED</code>,\r
2798     <code>SC_MARK_LCORNER</code>, <code>SC_MARK_LCORNERCURVE</code>, <code>SC_MARK_TCORNER</code>,\r
2799     <code>SC_MARK_TCORNERCURVE</code>, and <code>SC_MARK_VLINE</code>.</p>\r
2800      Characters can be used as markers by adding the ASCII value of the character to\r
2801     <code>SC_MARK_CHARACTER</code> (10000). For example, to use 'A' (ASCII code 65) as marker\r
2802     number 1 use:<br />\r
2803      <code>SCI_MARKERDEFINE(1, SC_MARK_CHARACTER+65)</code>. <br />\r
2804 \r
2805     <p>The marker numbers <code>SC_MARKNUM_FOLDER</code> and <code>SC_MARKNUM_FOLDEROPEN</code> are\r
2806     used for showing that a fold is present and open or closed. Any symbols may be assigned for\r
2807     this purpose although the (<code>SC_MARK_PLUS</code>, <code>SC_MARK_MINUS</code>) pair or the\r
2808     (<code>SC_MARK_ARROW</code>, <code>SC_MARK_ARROWDOWN</code>) pair are good choices. As well as\r
2809     these two, more assignments are needed for the flattened tree style:\r
2810     <code>SC_MARKNUM_FOLDEREND</code>, <code>SC_MARKNUM_FOLDERMIDTAIL</code>,\r
2811     <code>SC_MARKNUM_FOLDEROPENMID</code>, <code>SC_MARKNUM_FOLDERSUB</code>, and\r
2812     <code>SC_MARKNUM_FOLDERTAIL</code>. The bits used for folding are specified by\r
2813     <code>SC_MASK_FOLDERS</code>, which is commonly used as an argument to\r
2814     <code>SCI_SETMARGINMASKN</code> when defining a margin to be used for folding.</p>\r
2815 \r
2816     <p>This table shows which <code>SC_MARK_</code>* symbols should be assigned to which\r
2817     <code>SC_MARKNUM_</code>* marker numbers to obtain four folding styles: Arrow (mimics\r
2818     Macintosh), plus/minus shows folded lines as '+' and opened folds as '-', Circle tree, Box\r
2819     tree.</p>\r
2820 \r
2821     <table cellpadding="1" cellspacing="2" border="0" summary="Markers used for folding">\r
2822       <thead align="left">\r
2823         <tr>\r
2824           <th><code>SC_MARKNUM_</code>*</th>\r
2825 \r
2826           <th>Arrow</th>\r
2827 \r
2828           <th>Plus/minus</th>\r
2829 \r
2830           <th>Circle tree</th>\r
2831 \r
2832           <th>Box tree</th>\r
2833         </tr>\r
2834       </thead>\r
2835 \r
2836       <tbody valign="top">\r
2837         <tr>\r
2838           <th align="left"><code>FOLDEROPEN</code></th>\r
2839 \r
2840           <td><code>ARROWDOWN</code></td>\r
2841 \r
2842           <td><code>MINUS</code></td>\r
2843 \r
2844           <td><code>CIRCLEMINUS</code></td>\r
2845 \r
2846           <td><code>BOXMINUS</code></td>\r
2847         </tr>\r
2848 \r
2849         <tr>\r
2850           <th align="left"><code>FOLDER</code></th>\r
2851 \r
2852           <td><code>ARROW</code></td>\r
2853 \r
2854           <td><code>PLUS</code></td>\r
2855 \r
2856           <td><code>CIRCLEPLUS</code></td>\r
2857 \r
2858           <td><code>BOXPLUS</code></td>\r
2859         </tr>\r
2860 \r
2861         <tr>\r
2862           <th align="left"><code>FOLDERSUB</code></th>\r
2863 \r
2864           <td><code>EMPTY</code></td>\r
2865 \r
2866           <td><code>EMPTY</code></td>\r
2867 \r
2868           <td><code>VLINE</code></td>\r
2869 \r
2870           <td><code>VLINE</code></td>\r
2871         </tr>\r
2872 \r
2873         <tr>\r
2874           <th align="left"><code>FOLDERTAIL</code></th>\r
2875 \r
2876           <td><code>EMPTY</code></td>\r
2877 \r
2878           <td><code>EMPTY</code></td>\r
2879 \r
2880           <td><code>LCORNERCURVE</code></td>\r
2881 \r
2882           <td><code>LCORNER</code></td>\r
2883         </tr>\r
2884 \r
2885         <tr>\r
2886           <th align="left"><code>FOLDEREND</code></th>\r
2887 \r
2888           <td><code>EMPTY</code></td>\r
2889 \r
2890           <td><code>EMPTY</code></td>\r
2891 \r
2892           <td><code>CIRCLEPLUSCONNECTED</code></td>\r
2893 \r
2894           <td><code>BOXPLUSCONNECTED</code></td>\r
2895         </tr>\r
2896 \r
2897         <tr>\r
2898           <th align="left"><code>FOLDEROPENMID</code></th>\r
2899 \r
2900           <td><code>EMPTY</code></td>\r
2901 \r
2902           <td><code>EMPTY</code></td>\r
2903 \r
2904           <td><code>CIRCLEMINUSCONNECTED</code></td>\r
2905 \r
2906           <td><code>BOXMINUSCONNECTED</code></td>\r
2907         </tr>\r
2908 \r
2909         <tr>\r
2910           <th align="left"><code>FOLDERMIDTAIL</code></th>\r
2911 \r
2912           <td><code>EMPTY</code></td>\r
2913 \r
2914           <td><code>EMPTY</code></td>\r
2915 \r
2916           <td><code>TCORNERCURVE</code></td>\r
2917 \r
2918           <td><code>TCORNER</code></td>\r
2919         </tr>\r
2920       </tbody>\r
2921     </table>\r
2922 \r
2923     <p><b id="SCI_MARKERDEFINEPIXMAP">SCI_MARKERDEFINEPIXMAP(int markerNumber, const char\r
2924     *xpm)</b><br />\r
2925      Markers can be set to pixmaps with this message. The XPM format is used for the pixmap and it\r
2926     is limited to pixmaps that use one character per pixel with no named colours.\r
2927     The transparent colour may be named 'None'.\r
2928     The data should be null terminated.\r
2929     Pixmaps use the <code>SC_MARK_PIXMAP</code> marker symbol. You can find the full description of\r
2930     the XPM format <a class="jump" href="http://koala.ilog.fr/lehors/xpm.html">here</a>.</p>\r
2931 \r
2932     <p><b id="SCI_MARKERSETFORE">SCI_MARKERSETFORE(int markerNumber, int <a class="jump"\r
2933     href="#colour">colour</a>)</b><br />\r
2934      <b id="SCI_MARKERSETBACK">SCI_MARKERSETBACK(int markerNumber, int <a class="jump"\r
2935     href="#colour">colour</a>)</b><br />\r
2936      These two messages set the foreground and background colour of a marker number.</p>\r
2937      <p><b id="SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int <a class="jump"\r
2938     href="#alpha">alpha</a>)</b><br />\r
2939      When markers are drawn in the content area, either because there is no margin for them or\r
2940      they are of SC_MARK_BACKGROUND type, they may be drawn translucently by\r
2941      setting an alpha value.</p>\r
2942 \r
2943     <p><b id="SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</b><br />\r
2944      This message adds marker number <code>markerNumber</code> to a line. The message returns -1 if\r
2945     this fails (illegal line number, out of memory) or it returns a marker handle number that\r
2946     identifies the added marker. You can use this returned handle with <a class="message"\r
2947     href="#SCI_MARKERLINEFROMHANDLE"><code>SCI_MARKERLINEFROMHANDLE</code></a> to find where a\r
2948     marker is after moving or combining lines and with <a class="message"\r
2949     href="#SCI_MARKERDELETEHANDLE"><code>SCI_MARKERDELETEHANDLE</code></a> to delete the marker\r
2950     based on its handle. The message does not check the value of markerNumber, nor does it\r
2951     check if the line already contains the marker.</p>\r
2952 \r
2953     <p><b id="SCI_MARKERADDSET">SCI_MARKERADDSET(int line, int markerMask)</b><br />\r
2954      This message can add one or more markers to a line with a single call, specified in the same "one-bit-per-marker" 32-bit integer format returned by\r
2955     <a class="message" href="#SCI_MARKERGET"><code>SCI_MARKERGET</code></a>\r
2956     (and used by the mask-based marker search functions\r
2957     <a class="message" href="#SCI_MARKERNEXT"><code>SCI_MARKERNEXT</code></a> and\r
2958     <a class="message" href="#SCI_MARKERPREVIOUS"><code>SCI_MARKERPREVIOUS</code></a>).\r
2959     As with\r
2960     <a class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>, no check is made\r
2961     to see if any of the markers are already present on the targeted line.</p>\r
2962 \r
2963     <p><b id="SCI_MARKERDELETE">SCI_MARKERDELETE(int line, int markerNumber)</b><br />\r
2964      This searches the given line number for the given marker number and deletes it if it is\r
2965     present. If you added the same marker more than once to the line, this will delete one copy\r
2966     each time it is used. If you pass in a marker number of -1, all markers are deleted from the\r
2967     line.</p>\r
2968 \r
2969     <p><b id="SCI_MARKERDELETEALL">SCI_MARKERDELETEALL(int markerNumber)</b><br />\r
2970      This removes markers of the given number from all lines. If markerNumber is -1, it deletes all\r
2971     markers from all lines.</p>\r
2972 \r
2973     <p><b id="SCI_MARKERGET">SCI_MARKERGET(int line)</b><br />\r
2974      This returns a 32-bit integer that indicates which markers were present on the line. Bit 0 is\r
2975     set if marker 0 is present, bit 1 for marker 1 and so on.</p>\r
2976 \r
2977     <p><b id="SCI_MARKERNEXT">SCI_MARKERNEXT(int lineStart, int markerMask)</b><br />\r
2978      <b id="SCI_MARKERPREVIOUS">SCI_MARKERPREVIOUS(int lineStart, int markerMask)</b><br />\r
2979      These messages search efficiently for lines that include a given set of markers. The search\r
2980     starts at line number <code>lineStart</code> and continues forwards to the end of the file\r
2981     (<code>SCI_MARKERNEXT</code>) or backwards to the start of the file\r
2982     (<code>SCI_MARKERPREVIOUS</code>). The <code>markerMask</code> argument should have one bit set\r
2983     for each marker you wish to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on. The\r
2984     message returns the line number of the first line that contains one of the markers in\r
2985     <code>markerMask</code> or -1 if no marker is found.</p>\r
2986 \r
2987     <p><b id="SCI_MARKERLINEFROMHANDLE">SCI_MARKERLINEFROMHANDLE(int markerHandle)</b><br />\r
2988      The <code>markerHandle</code> argument is an identifier for a marker returned by <a\r
2989     class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. This function searches\r
2990     the document for the marker with this handle and returns the line number that contains it or -1\r
2991     if it is not found.</p>\r
2992 \r
2993     <p><b id="SCI_MARKERDELETEHANDLE">SCI_MARKERDELETEHANDLE(int markerHandle)</b><br />\r
2994      The <code>markerHandle</code> argument is an identifier for a marker returned by <a\r
2995     class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. This function searches\r
2996     the document for the marker with this handle and deletes the marker if it is found.</p>\r
2997 \r
2998     <h2 id="Indicators">Indicators</h2>\r
2999 \r
3000     <p>Indicators are used to display additional information over the top of styling.\r
3001     They can be used to show, for example, syntax errors, deprecated names and bad indentation\r
3002     by drawing underlines under text or boxes around text. Originally, Scintilla stored indicator information in\r
3003     the style bytes but this has proved limiting, so now up to 32 separately stored indicators may be used.\r
3004     While style byte indicators currently still work, they will soon be removed so all the bits in each style\r
3005     byte can be used for lexical states.</p>\r
3006 \r
3007     <p>Indicators may be displayed as simple underlines, squiggly underlines, a\r
3008     line of small 'T' shapes, a line of diagonal hatching, a strike-out or a rectangle around the text.</p>\r
3009 \r
3010     <p>The <code>SCI_INDIC*</code> messages allow you to get and set the visual appearance of the\r
3011     indicators. They all use an <code>indicatorNumber</code> argument in the range 0 to INDIC_MAX(31)\r
3012     to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use\r
3013     by lexers (0..7) and a range for use by containers\r
3014     (8=<code>INDIC_CONTAINER</code> .. 31=<code>INDIC_MAX</code>).</p>\r
3015 \r
3016     <code><a class="message" href="#SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int\r
3017     indicatorStyle)</a><br />\r
3018      <a class="message" href="#SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</a><br />\r
3019      <a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int\r
3020     colour)</a><br />\r
3021      <a class="message" href="#SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</a><br />\r
3022     </code>\r
3023 \r
3024     <p><b id="SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int\r
3025     indicatorStyle)</b><br />\r
3026      <b id="SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</b><br />\r
3027      These two messages set and get the style for a particular indicator. The indicator styles\r
3028     currently available are:</p>\r
3029 \r
3030     <table cellpadding="1" cellspacing="2" border="0" summary="Indicators">\r
3031       <tbody>\r
3032         <tr>\r
3033           <th align="left">Symbol</th>\r
3034 \r
3035           <th>Value</th>\r
3036 \r
3037           <th align="left">Visual effect</th>\r
3038         </tr>\r
3039       </tbody>\r
3040 \r
3041       <tbody valign="top">\r
3042         <tr>\r
3043           <td align="left"><code>INDIC_PLAIN</code></td>\r
3044 \r
3045           <td align="center">0</td>\r
3046 \r
3047           <td>Underlined with a single, straight line.</td>\r
3048         </tr>\r
3049 \r
3050         <tr>\r
3051           <td align="left"><code>INDIC_SQUIGGLE</code></td>\r
3052 \r
3053           <td align="center">1</td>\r
3054 \r
3055           <td>A squiggly underline.</td>\r
3056         </tr>\r
3057 \r
3058         <tr>\r
3059           <td align="left"><code>INDIC_TT</code></td>\r
3060 \r
3061           <td align="center">2</td>\r
3062 \r
3063           <td>A line of small T shapes.</td>\r
3064         </tr>\r
3065 \r
3066         <tr>\r
3067           <td align="left"><code>INDIC_DIAGONAL</code></td>\r
3068 \r
3069           <td align="center">3</td>\r
3070 \r
3071           <td>Diagonal hatching.</td>\r
3072         </tr>\r
3073 \r
3074         <tr>\r
3075           <td align="left"><code>INDIC_STRIKE</code></td>\r
3076 \r
3077           <td align="center">4</td>\r
3078 \r
3079           <td>Strike out.</td>\r
3080         </tr>\r
3081 \r
3082         <tr>\r
3083           <td align="left"><code>INDIC_HIDDEN</code></td>\r
3084 \r
3085           <td align="center">5</td>\r
3086 \r
3087           <td>An indicator with no visual effect.</td>\r
3088         </tr>\r
3089 \r
3090         <tr>\r
3091           <td align="left"><code>INDIC_BOX</code></td>\r
3092 \r
3093           <td align="center">6</td>\r
3094 \r
3095           <td>A rectangle around the text.</td>\r
3096         </tr>\r
3097 \r
3098         <tr>\r
3099           <td align="left"><code>INDIC_ROUNDBOX</code></td>\r
3100 \r
3101           <td align="center">7</td>\r
3102 \r
3103           <td>A rectangle with rounded corners around the text using translucent drawing with the\r
3104                          interior more transparent than the border.</td>\r
3105         </tr>\r
3106       </tbody>\r
3107     </table>\r
3108 \r
3109     <p>The default indicator styles are equivalent to:<br />\r
3110      <code>SCI_INDICSETSTYLE(0, INDIC_SQUIGGLE);</code><br />\r
3111      <code>SCI_INDICSETSTYLE(1, INDIC_TT);</code><br />\r
3112      <code>SCI_INDICSETSTYLE(2, INDIC_PLAIN);</code></p>\r
3113 \r
3114     <p><b id="SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int <a class="jump"\r
3115     href="#colour">colour</a>)</b><br />\r
3116      <b id="SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</b><br />\r
3117      These two messages set and get the colour used to draw an indicator. The default indicator\r
3118     colours are equivalent to:<br />\r
3119      <code>SCI_INDICSETFORE(0, 0x007f00);</code> (dark green)<br />\r
3120      <code>SCI_INDICSETFORE(1, 0xff0000);</code> (light blue)<br />\r
3121      <code>SCI_INDICSETFORE(2, 0x0000ff);</code> (light red)</p>\r
3122 \r
3123     <p><b id="SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</b><br />\r
3124      <b id="SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</b><br />\r
3125      These two messages set and get whether an indicator is drawn under text or over(default).\r
3126      Drawing under text works only for modern indicators when <a class="message" href="#SCI_SETTWOPHASEDRAW">two phase drawing</a>\r
3127      is enabled.</p>\r
3128 \r
3129     <h3 id="Modern Indicators">Modern Indicators</h3>\r
3130 \r
3131     <p>Modern indicators are stored in a format similar to run length encoding which is efficient in both\r
3132     speed and storage for sparse information.</p>\r
3133     <p>An indicator may store different values for each range but currently all values are drawn the same.\r
3134     In the future, it may be possible to draw different values in different styles.</p>\r
3135     <p>\r
3136     <b id="SCI_SETINDICATORCURRENT">SCI_SETINDICATORCURRENT(int indicator)</b><br />\r
3137     <b id="SCI_GETINDICATORCURRENT">SCI_GETINDICATORCURRENT</b><br />\r
3138     These two messages set and get the indicator that will be affected by calls to\r
3139     <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a> and\r
3140     <a class="message" href="#SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE</a>.\r
3141     </p>\r
3142 \r
3143     <p>\r
3144     <b id="SCI_SETINDICATORVALUE">SCI_SETINDICATORVALUE(int value)</b><br />\r
3145     <b id="SCI_GETINDICATORVALUE">SCI_GETINDICATORVALUE</b><br />\r
3146     These two messages set and get the value that will be set by calls to\r
3147     <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a>.\r
3148     </p>\r
3149 \r
3150     <p>\r
3151     <b id="SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE(int position, int fillLength)</b><br />\r
3152     <b id="SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE(int position, int clearLength)</b><br />\r
3153     These two messages fill or clear a range for the current indicator.\r
3154     <code>SCI_INDICATORFILLRANGE</code> fills with the\r
3155     the current value.\r
3156     </p>\r
3157 \r
3158     <p>\r
3159     <b id="SCI_INDICATORALLONFOR">SCI_INDICATORALLONFOR(int position)</b><br />\r
3160     Retrieve a bitmap value representing which indicators are non-zero at a position.\r
3161     </p>\r
3162 \r
3163     <p>\r
3164     <b id="SCI_INDICATORVALUEAT">SCI_INDICATORVALUEAT(int indicator, int position)</b><br />\r
3165     Retrieve the value of a particular indicator at a position.\r
3166     </p>\r
3167 \r
3168     <p>\r
3169     <b id="SCI_INDICATORSTART">SCI_INDICATORSTART(int indicator, int position)</b><br />\r
3170     <b id="SCI_INDICATOREND">SCI_INDICATOREND(int indicator, int position)</b><br />\r
3171     Find the start or end of a range with one value from a position within the range.\r
3172     Can be used to iterate through the document to discover all the indicator positions.\r
3173     </p>\r
3174 \r
3175     <h3 id="Style Byte Indicators">Style Byte Indicators (deprecated)</h3>\r
3176     <p>By default, Scintilla organizes the style byte associated with each text byte as 5 bits of\r
3177     style information (for 32 styles) and 3 bits of indicator information for 3 independent\r
3178     indicators so that, for example, syntax errors, deprecated names and bad indentation could all\r
3179     be displayed at once.</p>\r
3180 \r
3181     <p>The indicators are set using <a class="message"\r
3182     href="#SCI_STARTSTYLING"><code>SCI_STARTSTYLING</code></a> with a <code>INDICS_MASK</code> mask\r
3183     and <a class="message" href="#SCI_SETSTYLING"><code>SCI_SETSTYLING</code></a> with the values\r
3184     <code>INDIC0_MASK</code>, <code>INDIC1_MASK</code> and <code>INDIC2_MASK</code>.</p>\r
3185 \r
3186           <p>If you are using indicators in a buffer that has a lexer active\r
3187           (see <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a>),\r
3188           you must save lexing state information before setting any indicators and restore it afterwards.\r
3189           Use <a class="message" href="#SCI_GETENDSTYLED"><code>SCI_GETENDSTYLED</code></a>\r
3190           to retrieve the current "styled to" position and\r
3191           <a class="message" href="#SCI_STARTSTYLING"><code>SCI_STARTSTYLING</code></a>\r
3192         to reset the styling position and mask (<code>0x1f </code> in the default layout of 5 style bits and 3 indicator bits)\r
3193         when you are done.</p>\r
3194 \r
3195     <p>The number of bits used for styles can be altered with <a class="message"\r
3196     href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> from 0 to 7 bits. The remaining bits\r
3197     can be used for indicators, so there can be from 1 to 8 indicators. However, the\r
3198     <code>INDIC*_MASK</code> constants defined in <code>Scintilla.h</code> all assume 5 bits of\r
3199     styling information and 3 indicators. If you use a different arrangement, you must define your\r
3200     own constants.</p>\r
3201 \r
3202 \r
3203     <h2 id="Autocompletion">Autocompletion</h2>\r
3204 \r
3205     <p>Autocompletion displays a list box showing likely identifiers based upon the user's typing.\r
3206     The user chooses the currently selected item by pressing the tab character or another character\r
3207     that is a member of the fillup character set defined with <code>SCI_AUTOCSETFILLUPS</code>.\r
3208     Autocompletion is triggered by your application. For example, in C if you detect that the user\r
3209     has just typed <code>fred.</code> you could look up <code>fred</code>, and if it has a known\r
3210     list of members, you could offer them in an autocompletion list. Alternatively, you could\r
3211     monitor the user's typing and offer a list of likely items once their typing has narrowed down\r
3212     the choice to a reasonable list. As yet another alternative, you could define a key code to\r
3213     activate the list.</p>\r
3214 \r
3215     <p>When the user makes a selection from the list the container is sent a <code><a class="message"\r
3216     href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code> <a class="jump"\r
3217     href="#Notifications">notification message</a>. On return from the notification Scintilla will insert\r
3218      the selected text unless the autocompletion list has been cancelled, for example by the container sending\r
3219      <code><a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a></code>.</p>\r
3220 \r
3221     <p>To make use of autocompletion you must monitor each character added to the document. See\r
3222     <code>SciTEBase::CharAdded()</code> in SciTEBase.cxx for an example of autocompletion.</p>\r
3223     <code><a class="message" href="#SCI_AUTOCSHOW">SCI_AUTOCSHOW(int lenEntered, const char\r
3224     *list)</a><br />\r
3225      <a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a><br />\r
3226      <a class="message" href="#SCI_AUTOCACTIVE">SCI_AUTOCACTIVE</a><br />\r
3227      <a class="message" href="#SCI_AUTOCPOSSTART">SCI_AUTOCPOSSTART</a><br />\r
3228      <a class="message" href="#SCI_AUTOCCOMPLETE">SCI_AUTOCCOMPLETE</a><br />\r
3229      <a class="message" href="#SCI_AUTOCSTOPS">SCI_AUTOCSTOPS(&lt;unused&gt;, const char\r
3230     *chars)</a><br />\r
3231      <a class="message" href="#SCI_AUTOCSETSEPARATOR">SCI_AUTOCSETSEPARATOR(char\r
3232     separator)</a><br />\r
3233      <a class="message" href="#SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</a><br />\r
3234      <a class="message" href="#SCI_AUTOCSELECT">SCI_AUTOCSELECT(&lt;unused&gt;, const char\r
3235     *select)</a><br />\r
3236      <a class="message" href="#SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</a><br />\r
3237      <a class="message" href="#SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool\r
3238     cancel)</a><br />\r
3239      <a class="message" href="#SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</a><br />\r
3240      <a class="message" href="#SCI_AUTOCSETFILLUPS">SCI_AUTOCSETFILLUPS(&lt;unused&gt;, const char\r
3241     *chars)</a><br />\r
3242      <a class="message" href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE(bool\r
3243     chooseSingle)</a><br />\r
3244      <a class="message" href="#SCI_AUTOCGETCHOOSESINGLE">SCI_AUTOCGETCHOOSESINGLE</a><br />\r
3245      <a class="message" href="#SCI_AUTOCSETIGNORECASE">SCI_AUTOCSETIGNORECASE(bool\r
3246     ignoreCase)</a><br />\r
3247      <a class="message" href="#SCI_AUTOCGETIGNORECASE">SCI_AUTOCGETIGNORECASE</a><br />\r
3248      <a class="message" href="#SCI_AUTOCSETAUTOHIDE">SCI_AUTOCSETAUTOHIDE(bool autoHide)</a><br />\r
3249      <a class="message" href="#SCI_AUTOCGETAUTOHIDE">SCI_AUTOCGETAUTOHIDE</a><br />\r
3250      <a class="message" href="#SCI_AUTOCSETDROPRESTOFWORD">SCI_AUTOCSETDROPRESTOFWORD(bool\r
3251     dropRestOfWord)</a><br />\r
3252      <a class="message" href="#SCI_AUTOCGETDROPRESTOFWORD">SCI_AUTOCGETDROPRESTOFWORD</a><br />\r
3253      <a class="message" href="#SCI_REGISTERIMAGE">SCI_REGISTERIMAGE</a><br />\r
3254      <a class="message" href="#SCI_CLEARREGISTEREDIMAGES">SCI_CLEARREGISTEREDIMAGES</a><br />\r
3255      <a class="message" href="#SCI_AUTOCSETTYPESEPARATOR">SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)</a><br />\r
3256      <a class="message" href="#SCI_AUTOCGETTYPESEPARATOR">SCI_AUTOCGETTYPESEPARATOR</a><br />\r
3257      <a class="message" href="#SCI_AUTOCSETMAXHEIGHT">SCI_AUTOCSETMAXHEIGHT(int rowCount)</a><br />\r
3258      <a class="message" href="#SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT</a><br />\r
3259      <a class="message" href="#SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</a><br />\r
3260      <a class="message" href="#SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH</a><br />\r
3261     </code>\r
3262 \r
3263     <p><b id="SCI_AUTOCSHOW">SCI_AUTOCSHOW(int lenEntered, const char *list)</b><br />\r
3264      This message causes a list to be displayed. <code>lenEntered</code> is the number of\r
3265     characters of the word already entered and <code>list</code> is the list of words separated by\r
3266     separator characters. The initial separator character is a space but this can be set or got\r
3267     with <a class="message" href="#SCI_AUTOCSETSEPARATOR"><code>SCI_AUTOCSETSEPARATOR</code></a>\r
3268     and <a class="message"\r
3269     href="#SCI_AUTOCGETSEPARATOR"><code>SCI_AUTOCGETSEPARATOR</code></a>.</p>\r
3270 \r
3271     <p>The list of words should be in sorted order. If set to ignore case mode with <a\r
3272     class="message" href="#SCI_AUTOCSETIGNORECASE"><code>SCI_AUTOCSETIGNORECASE</code></a>, then\r
3273     strings are matched after being converted to upper case. One result of this is that the list\r
3274     should be sorted with the punctuation characters '[', '\', ']', '^', '_', and '`' sorted after\r
3275     letters.</p>\r
3276 \r
3277     <p><b id="SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</b><br />\r
3278      This message cancels any displayed autocompletion list. When in autocompletion mode, the list\r
3279     should disappear when the user types a character that can not be part of the autocompletion,\r
3280     such as '.', '(' or '[' when typing an identifier. A set of characters that will cancel\r
3281     autocompletion can be specified with <a class="message"\r
3282     href="#SCI_AUTOCSTOPS"><code>SCI_AUTOCSTOPS</code></a>.</p>\r
3283 \r
3284     <p><b id="SCI_AUTOCACTIVE">SCI_AUTOCACTIVE</b><br />\r
3285      This message returns non-zero if there is an active autocompletion list and zero if there is\r
3286     not.</p>\r
3287 \r
3288     <p><b id="SCI_AUTOCPOSSTART">SCI_AUTOCPOSSTART</b><br />\r
3289      This returns the value of the current position when <code>SCI_AUTOCSHOW</code> started display\r
3290     of the list.</p>\r
3291 \r
3292     <p><b id="SCI_AUTOCCOMPLETE">SCI_AUTOCCOMPLETE</b><br />\r
3293      This message triggers autocompletion. This has the same effect as the tab key.</p>\r
3294 \r
3295     <p><b id="SCI_AUTOCSTOPS">SCI_AUTOCSTOPS(&lt;unused&gt;, const char *chars)</b><br />\r
3296      The <code>chars</code> argument is a string containing a list of characters that will\r
3297     automatically cancel the autocompletion list. When you start the editor, this list is\r
3298     empty.</p>\r
3299 \r
3300     <p><b id="SCI_AUTOCSETSEPARATOR">SCI_AUTOCSETSEPARATOR(char separator)</b><br />\r
3301      <b id="SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</b><br />\r
3302      These two messages set and get the separator character used to separate words in the\r
3303     <code>SCI_AUTOCSHOW</code> list. The default is the space character.</p>\r
3304 \r
3305     <p><b id="SCI_AUTOCSELECT">SCI_AUTOCSELECT(&lt;unused&gt;, const char *select)</b><br />\r
3306      <b id="SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</b><br />\r
3307      This message selects an item in the autocompletion list. It searches the list of words for the\r
3308     first that matches <code>select</code>. By default, comparisons are case sensitive, but you can\r
3309     change this with <a class="message"\r
3310     href="#SCI_AUTOCSETIGNORECASE"><code>SCI_AUTOCSETIGNORECASE</code></a>. The match is character\r
3311     by character for the length of the <code>select</code> string. That is, if select is "Fred" it\r
3312     will match "Frederick" if this is the first item in the list that begins with "Fred". If an\r
3313     item is found, it is selected. If the item is not found, the autocompletion list closes if\r
3314     auto-hide is true (see <a class="message"\r
3315     href="#SCI_AUTOCSETAUTOHIDE"><code>SCI_AUTOCSETAUTOHIDE</code></a>).<br />\r
3316     The current selection can be retrieved with <code>SCI_AUTOCGETCURRENT</code>\r
3317     </p>\r
3318 \r
3319     <p><b id="SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool cancel)</b><br />\r
3320      <b id="SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</b><br />\r
3321      The default behavior is for the list to be cancelled if the caret moves before the location it\r
3322     was at when the list was displayed. By calling this message with a <code>false</code> argument,\r
3323     the list is not cancelled until the caret moves before the first character of the word being\r
3324     completed.</p>\r
3325 \r
3326     <p><b id="SCI_AUTOCSETFILLUPS">SCI_AUTOCSETFILLUPS(&lt;unused&gt;, const char *chars)</b><br />\r
3327      If a fillup character is typed with an autocompletion list active, the currently selected item\r
3328     in the list is added into the document, then the fillup character is added. Common fillup\r
3329     characters are '(', '[' and '.' but others are possible depending on the language. By default,\r
3330     no fillup characters are set.</p>\r
3331 \r
3332     <p><b id="SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)</b><br />\r
3333      <b id="SCI_AUTOCGETCHOOSESINGLE">SCI_AUTOCGETCHOOSESINGLE</b><br />\r
3334      If you use <code>SCI_AUTOCSETCHOOSESINGLE(1)</code> and a list has only one item, it is\r
3335     automatically added and no list is displayed. The default is to display the list even if there\r
3336     is only a single item.</p>\r
3337 \r
3338     <p><b id="SCI_AUTOCSETIGNORECASE">SCI_AUTOCSETIGNORECASE(bool ignoreCase)</b><br />\r
3339      <b id="SCI_AUTOCGETIGNORECASE">SCI_AUTOCGETIGNORECASE</b><br />\r
3340      By default, matching of characters to list members is case sensitive. These messages let you\r
3341     set and get case sensitivity.</p>\r
3342 \r
3343     <p><b id="SCI_AUTOCSETAUTOHIDE">SCI_AUTOCSETAUTOHIDE(bool autoHide)</b><br />\r
3344      <b id="SCI_AUTOCGETAUTOHIDE">SCI_AUTOCGETAUTOHIDE</b><br />\r
3345      By default, the list is cancelled if there are no viable matches (the user has typed\r
3346     characters that no longer match a list entry). If you want to keep displaying the original\r
3347     list, set <code>autoHide</code> to <code>false</code>. This also effects <a class="message"\r
3348     href="#SCI_AUTOCSELECT"><code>SCI_AUTOCSELECT</code></a>.</p>\r
3349 \r
3350     <p><b id="SCI_AUTOCSETDROPRESTOFWORD">SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)</b><br />\r
3351      <b id="SCI_AUTOCGETDROPRESTOFWORD">SCI_AUTOCGETDROPRESTOFWORD</b><br />\r
3352      When an item is selected, any word characters following the caret are first erased if\r
3353     <code>dropRestOfWord</code> is set <code>true</code>. The default is <code>false</code>.</p>\r
3354 \r
3355     <p>\r
3356       <b id="SCI_REGISTERIMAGE">SCI_REGISTERIMAGE(int type, const char *xpmData)</b><br />\r
3357       <b id="SCI_CLEARREGISTEREDIMAGES">SCI_CLEARREGISTEREDIMAGES</b><br />\r
3358       <b id="SCI_AUTOCSETTYPESEPARATOR">SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)</b><br />\r
3359       <b id="SCI_AUTOCGETTYPESEPARATOR">SCI_AUTOCGETTYPESEPARATOR</b><br />\r
3360 \r
3361       Autocompletion list items may display an image as well as text. Each image is first registered with an integer\r
3362       type. Then this integer is included in the text of the list separated by a '?' from the text. For example,\r
3363       "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen".\r
3364       The images are in XPM format as is described for\r
3365       <a class="message" href="#SCI_MARKERDEFINEPIXMAP"><code>SCI_MARKERDEFINEPIXMAP</code></a>\r
3366       The set of registered images can be cleared with <code>SCI_CLEARREGISTEREDIMAGES</code> and the '?' separator changed\r
3367       with <code>SCI_AUTOCSETTYPESEPARATOR</code>.\r
3368     </p>\r
3369 \r
3370     <p>\r
3371       <b id="SCI_AUTOCSETMAXHEIGHT">SCI_AUTOCSETMAXHEIGHT(int rowCount)</b><br />\r
3372       <b id="SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT</b><br />\r
3373 \r
3374       Get or set the maximum number of rows that will be visible in an autocompletion list. If there are more rows in the list, then a vertical\r
3375       scrollbar is shown. The default is 5.\r
3376      </p>\r
3377 \r
3378     <p>\r
3379       <b id="SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</b><br />\r
3380       <b id="SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH</b><br />\r
3381 \r
3382       Get or set the maximum width of an autocompletion list expressed as the number of characters in the longest item that will be totally visible.\r
3383       If zero (the default) then the list's width is calculated to fit the item with the most characters. Any items that cannot be fully displayed within\r
3384       the available width are indicated by the presence of ellipsis.\r
3385      </p>\r
3386 \r
3387     <h2 id="UserLists">User lists</h2>\r
3388 \r
3389     <p>User lists use the same internal mechanisms as autocompletion lists, and all the calls\r
3390     listed for autocompletion work on them; you cannot display a user list at the same time as an\r
3391     autocompletion list is active. They differ in the following respects:</p>\r
3392 \r
3393     <p>o The <code><a class="message"\r
3394     href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE</a></code> message has no\r
3395     effect.<br />\r
3396      o When the user makes a selection you are sent a <code><a class="message"\r
3397     href="#SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</a></code> <a class="jump"\r
3398     href="#Notifications">notification message</a> rather than <code><a class="message"\r
3399     href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code>.</p>\r
3400 \r
3401     <p>BEWARE: if you have set fillup characters or stop characters, these will still be active\r
3402     with the user list, and may result in items being selected or the user list cancelled due to\r
3403     the user typing into the editor.</p>\r
3404 \r
3405     <p><b id="SCI_USERLISTSHOW">SCI_USERLISTSHOW(int listType, const char *list)</b><br />\r
3406      The <code>listType</code> parameter is returned to the container as the <code>wParam</code>\r
3407     field of the <a class="message" href="#SCNotification"><code>SCNotification</code></a>\r
3408     structure. It must be greater than 0 as this is how Scintilla tells the difference between an\r
3409     autocompletion list and a user list. If you have different types of list, for example a list of\r
3410     buffers and a list of macros, you can use <code>listType</code> to tell which one has returned\r
3411     a selection. </p>\r
3412 \r
3413     <h2 id="CallTips">Call tips</h2>\r
3414 \r
3415     <p>Call tips are small windows displaying the arguments to a function and are displayed after\r
3416     the user has typed the name of the function. They normally display characters using the font\r
3417     facename, size and character set defined by\r
3418     <code><a class="message" href="#StyleDefinition">STYLE_DEFAULT</a></code>. You can choose to\r
3419     use <code><a class="message" href="#StyleDefinition">STYLE_CALLTIP</a></code> to define the\r
3420     facename, size, foreground and background colours and character set with\r
3421     <code><a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE</a></code>.\r
3422     This also enables support for Tab characters.\r
3423 \r
3424     There is some interaction between call tips and autocompletion lists in that showing a\r
3425     call tip cancels any active autocompletion list, and vice versa.</p>\r
3426 \r
3427     <p>Call tips can highlight part of the text within them. You could use this to highlight the\r
3428     current argument to a function by counting the number of commas (or whatever separator your\r
3429     language uses). See <code>SciTEBase::CharAdded()</code> in <code>SciTEBase.cxx</code> for an\r
3430     example of call tip use.</p>\r
3431 \r
3432     <p>The mouse may be clicked on call tips and this causes a\r
3433     <code><a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a></code>\r
3434     notification to be sent to the container. Small up and down arrows may be displayed within\r
3435     a call tip by, respectively, including the characters '\001', or '\002'. This is useful\r
3436     for showing that there are overloaded variants of one function name and that the user can\r
3437     click on the arrows to cycle through the overloads.</p>\r
3438 \r
3439     <p>Alternatively, call tips can be displayed when you leave the mouse pointer for a while over\r
3440     a word in response to the <code><a class="message"\r
3441     href="#SCN_DWELLSTART">SCN_DWELLSTART</a></code> <a class="jump"\r
3442     href="#Notifications">notification</a> and cancelled in response to <code><a class="message"\r
3443     href="#SCN_DWELLEND">SCN_DWELLEND</a></code>. This method could be used in a debugger to give\r
3444     the value of a variable, or during editing to give information about the word under the\r
3445     pointer.</p>\r
3446     <code><a class="message" href="#SCI_CALLTIPSHOW">SCI_CALLTIPSHOW(int posStart, const char\r
3447     *definition)</a><br />\r
3448      <a class="message" href="#SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</a><br />\r
3449      <a class="message" href="#SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</a><br />\r
3450      <a class="message" href="#SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</a><br />\r
3451      <a class="message" href="#SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int highlightStart, int\r
3452     highlightEnd)</a><br />\r
3453      <a class="message" href="#SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</a><br />\r
3454      <a class="message" href="#SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</a><br />\r
3455      <a class="message" href="#SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</a><br />\r
3456      <a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE(int tabsize)</a><br />\r
3457     </code>\r
3458 \r
3459     <p><b id="SCI_CALLTIPSHOW">SCI_CALLTIPSHOW(int posStart, const char *definition)</b><br />\r
3460      This message starts the process by displaying the call tip window. If a call tip is already\r
3461     active, this has no effect.<br />\r
3462      <code>posStart</code> is the position in the document at which to align the call tip. The call\r
3463     tip text is aligned to start 1 line below this character unless you have included up and/or\r
3464     down arrows in the call tip text in which case the tip is aligned to the right-hand edge of\r
3465     the rightmost arrow. The assumption is that you will start the text with something like\r
3466     "\001 1 of 3 \002".<br />\r
3467      <code>definition</code> is the call tip text. This can contain multiple lines separated by\r
3468     '\n' (Line Feed, ASCII code 10) characters. Do not include '\r' (Carriage Return, ASCII\r
3469      code 13), as this will most likely print as an empty box. '\t' (Tab, ASCII code 9) is\r
3470      supported if you set a tabsize with\r
3471     <code><a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE</a></code>.<br /></p>\r
3472 \r
3473     <p><b id="SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</b><br />\r
3474      This message cancels any displayed call tip. Scintilla will also cancel call tips for you if\r
3475     you use any keyboard commands that are not compatible with editing the argument list of a\r
3476     function.</p>\r
3477 \r
3478     <p><b id="SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</b><br />\r
3479      This returns 1 if a call tip is active and 0 if it is not active.</p>\r
3480 \r
3481     <p><b id="SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</b><br />\r
3482      This message returns the value of the current position when <code>SCI_CALLTIPSHOW</code>\r
3483     started to display the tip.</p>\r
3484 \r
3485     <p><b id="SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int hlStart, int hlEnd)</b><br />\r
3486      This sets the region of the call tips text to display in a highlighted style.\r
3487     <code>hlStart</code> is the zero-based index into the string of the first character to\r
3488     highlight and <code>hlEnd</code> is the index of the first character after the highlight.\r
3489     <code>hlEnd</code> must be greater than <code>hlStart</code>; <code>hlEnd-hlStart</code> is the\r
3490     number of characters to highlight. Highlights can extend over line ends if this is\r
3491     required.</p>\r
3492 \r
3493     <p>Unhighlighted text is drawn in a mid gray. Selected text is drawn in a dark blue. The\r
3494     background is white. These can be changed with\r
3495     <code>SCI_CALLTIPSETBACK</code>,\r
3496     <code>SCI_CALLTIPSETFORE</code>, and\r
3497     <code>SCI_CALLTIPSETFOREHLT</code>.\r
3498     </p>\r
3499 \r
3500     <p><b id="SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</b><br />\r
3501      The background colour of call tips can be set with this message; the default colour is white.\r
3502     It is not a good idea to set a dark colour as the background as the default colour for normal\r
3503     calltip text is mid gray and the defaultcolour for highlighted text is dark blue. This also\r
3504     sets the background colour of <code>STYLE_CALLTIP</code>.</p>\r
3505 \r
3506     <p><b id="SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</b><br />\r
3507      The colour of call tip text can be set with this message; the default colour is mid gray.\r
3508     This also sets the foreground colour of <code>STYLE_CALLTIP</code>.</p>\r
3509 \r
3510     <p><b id="SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</b><br />\r
3511      The colour of highlighted call tip text can be set with this message; the default colour\r
3512     is dark blue.</p>\r
3513 \r
3514     <p><b id="SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE(int tabsize)</b><br />\r
3515      This message changes the style used for call tips from <code>STYLE_DEFAULT</code> to\r
3516     <code>STYLE_CALLTIP</code> and sets a tab size in screen pixels. If <code>tabsize</code> is\r
3517     less than 1, Tab characters are not treated specially. Once this call has been used, the\r
3518     call tip foreground and background colours are also taken from the style.</p>\r
3519 \r
3520 \r
3521     <h2 id="KeyboardCommands">Keyboard commands</h2>\r
3522 \r
3523     <p>To allow the container application to perform any of the actions available to the user with\r
3524     keyboard, all the keyboard actions are messages. They do not take any parameters. These\r
3525     commands are also used when redefining the key bindings with the <a class="message"\r
3526     href="#SCI_ASSIGNCMDKEY"><code>SCI_ASSIGNCMDKEY</code></a> message.</p>\r
3527 \r
3528     <table border="0" summary="Keyboard commands">\r
3529       <tbody>\r
3530         <tr>\r
3531           <td><code>SCI_LINEDOWN</code></td>\r
3532 \r
3533           <td><code>SCI_LINEDOWNEXTEND</code></td>\r
3534 \r
3535           <td><code>SCI_LINEDOWNRECTEXTEND</code></td>\r
3536 \r
3537           <td><code>SCI_LINESCROLLDOWN</code></td>\r
3538         </tr>\r
3539 \r
3540         <tr>\r
3541           <td><code>SCI_LINEUP</code></td>\r
3542 \r
3543           <td><code>SCI_LINEUPEXTEND</code></td>\r
3544 \r
3545           <td><code>SCI_LINEUPRECTEXTEND</code></td>\r
3546 \r
3547           <td><code>SCI_LINESCROLLUP</code></td>\r
3548         </tr>\r
3549 \r
3550         <tr>\r
3551           <td><code>SCI_PARADOWN</code></td>\r
3552 \r
3553           <td><code>SCI_PARADOWNEXTEND</code></td>\r
3554 \r
3555           <td><code>SCI_PARAUP</code></td>\r
3556 \r
3557           <td><code>SCI_PARAUPEXTEND</code></td>\r
3558         </tr>\r
3559 \r
3560         <tr>\r
3561           <td><code>SCI_CHARLEFT</code></td>\r
3562 \r
3563           <td><code>SCI_CHARLEFTEXTEND</code></td>\r
3564 \r
3565           <td><code>SCI_CHARLEFTRECTEXTEND</code></td>\r
3566         </tr>\r
3567 \r
3568         <tr>\r
3569           <td><code>SCI_CHARRIGHT</code></td>\r
3570 \r
3571           <td><code>SCI_CHARRIGHTEXTEND</code></td>\r
3572 \r
3573           <td><code>SCI_CHARRIGHTRECTEXTEND</code></td>\r
3574         </tr>\r
3575 \r
3576         <tr>\r
3577           <td><code>SCI_WORDLEFT</code></td>\r
3578 \r
3579           <td><code>SCI_WORDLEFTEXTEND</code></td>\r
3580 \r
3581           <td><code>SCI_WORDRIGHT</code></td>\r
3582 \r
3583           <td><code>SCI_WORDRIGHTEXTEND</code></td>\r
3584         </tr>\r
3585 \r
3586         <tr>\r
3587           <td><code>SCI_WORDLEFTEND</code></td>\r
3588 \r
3589           <td><code>SCI_WORDLEFTENDEXTEND</code></td>\r
3590 \r
3591           <td><code>SCI_WORDRIGHTEND</code></td>\r
3592 \r
3593           <td><code>SCI_WORDRIGHTENDEXTEND</code></td>\r
3594         </tr>\r
3595 \r
3596         <tr>\r
3597           <td><code>SCI_WORDPARTLEFT</code></td>\r
3598 \r
3599           <td><code>SCI_WORDPARTLEFTEXTEND</code></td>\r
3600 \r
3601           <td><code>SCI_WORDPARTRIGHT</code></td>\r
3602 \r
3603           <td><code>SCI_WORDPARTRIGHTEXTEND</code></td>\r
3604         </tr>\r
3605 \r
3606         <tr>\r
3607           <td><code>SCI_HOME</code></td>\r
3608 \r
3609           <td><code>SCI_HOMEEXTEND</code></td>\r
3610 \r
3611           <td><code>[SCI_HOMERECTEXTEND]</code></td>\r
3612         </tr>\r
3613 \r
3614         <tr>\r
3615           <td><code>SCI_HOMEDISPLAY</code></td>\r
3616 \r
3617           <td><code>SCI_HOMEDISPLAYEXTEND</code></td>\r
3618 \r
3619           <td><code>SCI_HOMEWRAP</code></td>\r
3620 \r
3621           <td><code>SCI_HOMEWRAPEXTEND</code></td>\r
3622         </tr>\r
3623 \r
3624         <tr>\r
3625           <td><code>SCI_VCHOME</code></td>\r
3626 \r
3627           <td><code>SCI_VCHOMEEXTEND</code></td>\r
3628 \r
3629           <td><code>SCI_VCHOMERECTEXTEND</code></td>\r
3630         </tr>\r
3631 \r
3632         <tr>\r
3633           <td><code>SCI_VCHOMEWRAP</code></td>\r
3634 \r
3635           <td><code>SCI_VCHOMEWRAPEXTEND</code></td>\r
3636         </tr>\r
3637 \r
3638         <tr>\r
3639           <td><code>SCI_LINEEND</code></td>\r
3640 \r
3641           <td><code>SCI_LINEENDEXTEND</code></td>\r
3642 \r
3643           <td><code>SCI_LINEENDRECTEXTEND</code></td>\r
3644         </tr>\r
3645 \r
3646         <tr>\r
3647           <td><code>SCI_LINEENDDISPLAY</code></td>\r
3648 \r
3649           <td><code>SCI_LINEENDDISPLAYEXTEND</code></td>\r
3650 \r
3651           <td><code>SCI_LINEENDWRAP</code></td>\r
3652 \r
3653           <td><code>SCI_LINEENDWRAPEXTEND</code></td>\r
3654         </tr>\r
3655 \r
3656         <tr>\r
3657           <td><code>SCI_DOCUMENTSTART</code></td>\r
3658 \r
3659           <td><code>SCI_DOCUMENTSTARTEXTEND</code></td>\r
3660 \r
3661           <td><code>SCI_DOCUMENTEND</code></td>\r
3662 \r
3663           <td><code>SCI_DOCUMENTENDEXTEND</code></td>\r
3664         </tr>\r
3665 \r
3666         <tr>\r
3667           <td><code>SCI_PAGEUP</code></td>\r
3668 \r
3669           <td><code>SCI_PAGEUPEXTEND</code></td>\r
3670 \r
3671           <td><code>SCI_PAGEUPRECTEXTEND</code></td>\r
3672         </tr>\r
3673 \r
3674         <tr>\r
3675           <td><code>SCI_PAGEDOWN</code></td>\r
3676 \r
3677           <td><code>SCI_PAGEDOWNEXTEND</code></td>\r
3678 \r
3679           <td><code>SCI_PAGEDOWNRECTEXTEND</code></td>\r
3680         </tr>\r
3681 \r
3682 \r
3683         <tr>\r
3684           <td><code>SCI_STUTTEREDPAGEUP</code></td>\r
3685 \r
3686           <td><code>SCI_STUTTEREDPAGEUPEXTEND</code></td>\r
3687         </tr>\r
3688 \r
3689         <tr>\r
3690           <td><code>SCI_STUTTEREDPAGEDOWN</code></td>\r
3691 \r
3692           <td><code>SCI_STUTTEREDPAGEDOWNEXTEND</code></td>\r
3693         </tr>\r
3694 \r
3695         <tr>\r
3696           <td><code>SCI_DELETEBACK</code></td>\r
3697 \r
3698           <td><code>SCI_DELETEBACKNOTLINE</code></td>\r
3699         </tr>\r
3700 \r
3701         <tr>\r
3702           <td><code>SCI_DELWORDLEFT</code></td>\r
3703 \r
3704           <td><code>SCI_DELWORDRIGHT</code></td>\r
3705 \r
3706           <td><code>SCI_DELWORDRIGHTEND</code></td>\r
3707         </tr>\r
3708 \r
3709         <tr>\r
3710           <td><code>SCI_DELLINELEFT</code></td>\r
3711 \r
3712           <td><code>SCI_DELLINERIGHT</code></td>\r
3713 \r
3714           <td><code>SCI_LINEDELETE</code></td>\r
3715         </tr>\r
3716 \r
3717         <tr>\r
3718           <td><code>SCI_LINECUT</code></td>\r
3719 \r
3720           <td><code>SCI_LINECOPY</code></td>\r
3721 \r
3722           <td><code>SCI_LINETRANSPOSE</code></td>\r
3723 \r
3724           <td><code>SCI_LINEDUPLICATE</code></td>\r
3725         </tr>\r
3726 \r
3727         <tr>\r
3728           <td><code>SCI_LOWERCASE</code></td>\r
3729 \r
3730           <td><code>SCI_UPPERCASE</code></td>\r
3731 \r
3732           <td><code>SCI_CANCEL</code></td>\r
3733 \r
3734           <td><code>SCI_EDITTOGGLEOVERTYPE</code></td>\r
3735         </tr>\r
3736 \r
3737         <tr>\r
3738           <td><code>SCI_NEWLINE</code></td>\r
3739 \r
3740           <td><code>SCI_FORMFEED</code></td>\r
3741 \r
3742           <td><code>SCI_TAB</code></td>\r
3743 \r
3744           <td><code>SCI_BACKTAB</code></td>\r
3745         </tr>\r
3746 \r
3747         <tr>\r
3748           <td><code>SCI_SELECTIONDUPLICATE</code></td>\r
3749 \r
3750         </tr>\r
3751      </tbody>\r
3752     </table>\r
3753 \r
3754     <p>The <code>SCI_*EXTEND</code> messages extend the selection.</p>\r
3755 \r
3756     <p>The <code>SCI_*RECTEXTEND</code> messages extend the rectangular selection\r
3757     (and convert regular selection to rectangular one, if any).</p>\r
3758 \r
3759     <p>The <code>SCI_WORDPART*</code> commands are used to move between word segments marked by\r
3760     capitalisation (aCamelCaseIdentifier) or underscores (an_under_bar_ident).</p>\r
3761 \r
3762     <p>The <code>SCI_HOME*</code> commands move the caret to the start of the line, while the\r
3763     <code>SCI_VCHOME*</code>commands move the caret to the first non-blank character of the line\r
3764     (ie. just after the indentation) unless it is already there; in this case, it acts as SCI_HOME*.</p>\r
3765 \r
3766     <p>The <code>SCI_[HOME|LINEEND]DISPLAY*</code> commands are used when in line wrap mode to\r
3767     allow movement to the start or end of display lines as opposed to the normal\r
3768     <code>SCI_[HOME|LINEEND]</code> commands which move to the start or end of document lines.</p>\r
3769 \r
3770     <p>The <code>SCI_[[VC]HOME|LINEEND]WRAP*</code> commands are like their namesakes\r
3771     <code>SCI_[[VC]HOME|LINEEND]*</code> except they behave differently when word-wrap is enabled:\r
3772      They go first to the start / end of the display line, like <code>SCI_[HOME|LINEEND]DISPLAY*</code>,\r
3773      but if the cursor is already at the point, it goes on to the start or end of the document line,\r
3774      as appropriate for <code>SCI_[[VC]HOME|LINEEND]*</code>.\r
3775      </p>\r
3776 \r
3777     <h2 id="KeyBindings">Key bindings</h2>\r
3778 \r
3779     <p>There is a default binding of keys to commands that is defined in the Scintilla source in\r
3780     the file <code>KeyMap.cxx</code> by the constant <code>KeyMap::MapDefault[]</code>. This table\r
3781     maps key definitions to <code>SCI_*</code> messages with no parameters (mostly the <a\r
3782     class="jump" href="#KeyboardCommands">keyboard commands</a> discussed above, but any Scintilla\r
3783     command that has no arguments can be mapped). You can change the mapping to suit your own\r
3784     requirements.</p>\r
3785     <code><a class="message" href="#SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int keyDefinition, int\r
3786     sciCommand)</a><br />\r
3787      <a class="message" href="#SCI_CLEARCMDKEY">SCI_CLEARCMDKEY(int keyDefinition)</a><br />\r
3788      <a class="message" href="#SCI_CLEARALLCMDKEYS">SCI_CLEARALLCMDKEYS</a><br />\r
3789      <a class="message" href="#SCI_NULL">SCI_NULL</a><br />\r
3790     </code>\r
3791 \r
3792     <p><b id="keyDefinition">keyDefinition</b><br />\r
3793      A key definition contains the key code in the low 16-bits and the key modifiers in the high\r
3794     16-bits. To combine <code>keyCode</code> and <code>keyMod</code> set:<br />\r
3795     <br />\r
3796      <code>keyDefinition = keyCode + (keyMod &lt;&lt; 16)</code></p>\r
3797 \r
3798     <p>The key code is a visible or control character or a key from the <code>SCK_*</code>\r
3799     enumeration, which contains:<br />\r
3800      <code>SCK_ADD</code>, <code>SCK_BACK</code>, <code>SCK_DELETE</code>, <code>SCK_DIVIDE</code>,\r
3801     <code>SCK_DOWN</code>, <code>SCK_END</code>, <code>SCK_ESCAPE</code>, <code>SCK_HOME</code>,\r
3802     <code>SCK_INSERT</code>, <code>SCK_LEFT</code>, <code>SCK_MENU</code>, <code>SCK_NEXT</code> (Page Down),\r
3803     <code>SCK_PRIOR</code> (Page Up), <code>SCK_RETURN</code>, <code>SCK_RIGHT</code>,\r
3804     <code>SCK_RWIN</code>,\r
3805     <code>SCK_SUBTRACT</code>, <code>SCK_TAB</code>, <code>SCK_UP</code>, and\r
3806     <code>SCK_WIN</code>.</p>\r
3807 \r
3808     <p>The modifiers are a combination of zero or more of <code>SCMOD_ALT</code>,\r
3809     <code>SCMOD_CTRL</code>, and <code>SCMOD_SHIFT</code>. If you are building a table, you might\r
3810     want to use <code>SCMOD_NORM</code>, which has the value 0, to mean no modifiers.</p>\r
3811 \r
3812     <p><b id="SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int <a class="jump"\r
3813     href="#keyDefinition">keyDefinition</a>, int sciCommand)</b><br />\r
3814      This assigns the given key definition to a Scintilla command identified by\r
3815     <code>sciCommand</code>. <code>sciCommand</code> can be any <code>SCI_*</code> command that has\r
3816     no arguments.</p>\r
3817 \r
3818     <p><b id="SCI_CLEARCMDKEY">SCI_CLEARCMDKEY(int <a class="jump"\r
3819     href="#keyDefinition">keyDefinition</a>)</b><br />\r
3820      This makes the given key definition do nothing by assigning the action <code>SCI_NULL</code>\r
3821     to it.</p>\r
3822 \r
3823     <p><b id="SCI_CLEARALLCMDKEYS">SCI_CLEARALLCMDKEYS</b><br />\r
3824      This command removes all keyboard command mapping by setting an empty mapping table.</p>\r
3825 \r
3826     <p><b id="SCI_NULL">SCI_NULL</b><br />\r
3827      The <code>SCI_NULL</code> does nothing and is the value assigned to keys that perform no\r
3828     action. SCI_NULL ensures that keys do not propagate to the parent window as that may\r
3829     cause focus to move. If you want the standard platform behaviour use the constant 0 instead.</p>\r
3830 \r
3831     <h2 id="PopupEditMenu">Popup edit menu</h2>\r
3832 \r
3833     <p><b id="SCI_USEPOPUP">SCI_USEPOPUP(bool bEnablePopup)</b><br />\r
3834      Clicking the wrong button on the mouse pops up a short default editing menu. This may be\r
3835     turned off with <code>SCI_USEPOPUP(0)</code>. If you turn it off, context menu commands (in\r
3836     Windows, <code>WM_CONTEXTMENU</code>) will not be handled by Scintilla, so the parent of the\r
3837     Scintilla window will have the opportunity to handle the message.</p>\r
3838 \r
3839     <h2 id="MacroRecording">Macro recording</h2>\r
3840 \r
3841     <p>Start and stop macro recording mode. In macro recording mode, actions are reported to the\r
3842     container through <code><a class="message" href="#SCN_MACRORECORD">SCN_MACRORECORD</a></code>\r
3843     <a class="jump" href="#Notifications">notifications</a>. It is then up to the container to\r
3844     record these actions for future replay.</p>\r
3845 \r
3846     <p><b id="SCI_STARTRECORD">SCI_STARTRECORD</b><br />\r
3847      <b id="SCI_STOPRECORD">SCI_STOPRECORD</b><br />\r
3848      These two messages turn macro recording on and off.</p>\r
3849 \r
3850     <h2 id="Printing">Printing</h2>\r
3851 \r
3852     <p>On Windows <code>SCI_FORMATRANGE</code> can be used to draw the text onto a display context\r
3853     which can include a printer display context. Printed output shows text styling as on the\r
3854     screen, but it hides all margins except a line number margin. All special marker effects are\r
3855     removed and the selection and caret are hidden.</p>\r
3856     <code><a class="message" href="#SCI_FORMATRANGE">SCI_FORMATRANGE(bool bDraw, RangeToFormat\r
3857     *pfr)</a><br />\r
3858      <a class="message" href="#SCI_SETPRINTMAGNIFICATION">SCI_SETPRINTMAGNIFICATION(int\r
3859     magnification)</a><br />\r
3860      <a class="message" href="#SCI_GETPRINTMAGNIFICATION">SCI_GETPRINTMAGNIFICATION</a><br />\r
3861      <a class="message" href="#SCI_SETPRINTCOLOURMODE">SCI_SETPRINTCOLOURMODE(int mode)</a><br />\r
3862      <a class="message" href="#SCI_GETPRINTCOLOURMODE">SCI_GETPRINTCOLOURMODE</a><br />\r
3863      <a class="message" href="#SCI_SETPRINTWRAPMODE">SCI_SETPRINTWRAPMODE</a><br />\r
3864      <a class="message" href="#SCI_GETPRINTWRAPMODE">SCI_GETPRINTWRAPMODE</a><br />\r
3865     </code>\r
3866 \r
3867     <p><b id="SCI_FORMATRANGE">SCI_FORMATRANGE(bool bDraw, RangeToFormat *pfr)</b><br />\r
3868      This call allows Windows users to render a range of text into a device context. If you use\r
3869     this for printing, you will probably want to arrange a page header and footer; Scintilla does\r
3870     not do this for you. See <code>SciTEWin::Print()</code> in <code>SciTEWinDlg.cxx</code> for an\r
3871     example. Each use of this message renders a range of text into a rectangular area and returns\r
3872     the position in the document of the next character to print.</p>\r
3873 \r
3874     <p><code>bDraw</code> controls if any output is done. Set this to false if you are paginating\r
3875     (for example, if you use this with MFC you will need to paginate in\r
3876     <code>OnBeginPrinting()</code> before you output each page.</p>\r
3877 <pre>\r
3878 struct RangeToFormat {\r
3879     SurfaceID hdc;        // The HDC (device context) we print to\r
3880     SurfaceID hdcTarget;  // The HDC we use for measuring (may be same as hdc)\r
3881     PRectangle rc;        // Rectangle in which to print\r
3882     PRectangle rcPage;    // Physically printable page size\r
3883     CharacterRange chrg;  // Range of characters to print\r
3884 };\r
3885 </pre>\r
3886 \r
3887     <p><code>hdc</code> and <code>hdcTarget</code> should both be set to the device context handle\r
3888     of the output device (usually a printer). If you print to a metafile these will not be the same\r
3889     as Windows metafiles (unlike extended metafiles) do not implement the full API for returning\r
3890     information. In this case, set <code>hdcTarget</code> to the screen DC.<br />\r
3891      <code>rcPage</code> is the rectangle <code>{0, 0, maxX, maxY}</code> where <code>maxX+1</code>\r
3892     and <code>maxY+1</code> are the number of physically printable pixels in x and y.<br />\r
3893      <code>rc</code> is the rectangle to render the text in (which will, of course, fit within the\r
3894     rectangle defined by rcPage).<br />\r
3895      <code>chrg.cpMin</code> and <code>chrg.cpMax</code> define the start position and maximum\r
3896     position of characters to output. All of each line within this character range is drawn.</p>\r
3897 \r
3898     <p>When printing, the most tedious part is always working out what the margins should be to\r
3899     allow for the non-printable area of the paper and printing a header and footer. If you look at\r
3900     the printing code in SciTE, you will find that most of it is taken up with this. The loop that\r
3901     causes Scintilla to render text is quite simple if you strip out all the margin, non-printable\r
3902     area, header and footer code.</p>\r
3903 \r
3904     <p><b id="SCI_SETPRINTMAGNIFICATION">SCI_SETPRINTMAGNIFICATION(int magnification)</b><br />\r
3905      <b id="SCI_GETPRINTMAGNIFICATION">SCI_GETPRINTMAGNIFICATION</b><br />\r
3906      <code>SCI_GETPRINTMAGNIFICATION</code> lets you to print at a different size than the screen\r
3907     font. <code>magnification</code> is the number of points to add to the size of each screen\r
3908     font. A value of -3 or -4 gives reasonably small print. You can get this value with\r
3909     <code>SCI_GETPRINTMAGNIFICATION</code>.</p>\r
3910 \r
3911     <p><b id="SCI_SETPRINTCOLOURMODE">SCI_SETPRINTCOLOURMODE(int mode)</b><br />\r
3912      <b id="SCI_GETPRINTCOLOURMODE">SCI_GETPRINTCOLOURMODE</b><br />\r
3913      These two messages set and get the method used to render coloured text on a printer that is\r
3914     probably using white paper. It is especially important to consider the treatment of colour if\r
3915     you use a dark or black screen background. Printing white on black uses up toner and ink very\r
3916     many times faster than the other way around. You can set the mode to one of:</p>\r
3917 \r
3918     <table cellpadding="1" cellspacing="2" border="0" summary="Colour printing modes">\r
3919       <tbody>\r
3920         <tr>\r
3921           <th align="left">Symbol</th>\r
3922 \r
3923           <th>Value</th>\r
3924 \r
3925           <th align="left">Purpose</th>\r
3926         </tr>\r
3927       </tbody>\r
3928 \r
3929       <tbody valign="top">\r
3930         <tr>\r
3931           <td align="left"><code>SC_PRINT_NORMAL</code></td>\r
3932 \r
3933           <td align="center">0</td>\r
3934 \r
3935           <td>Print using the current screen colours. This is the default.</td>\r
3936         </tr>\r
3937 \r
3938         <tr>\r
3939           <td align="left"><code>SC_PRINT_INVERTLIGHT</code></td>\r
3940 \r
3941           <td align="center">1</td>\r
3942 \r
3943           <td>If you use a dark screen background this saves ink by inverting the light value of\r
3944           all colours and printing on a white background.</td>\r
3945         </tr>\r
3946 \r
3947         <tr>\r
3948           <td align="left"><code>SC_PRINT_BLACKONWHITE</code></td>\r
3949 \r
3950           <td align="center">2</td>\r
3951 \r
3952           <td>Print all text as black on a white background.</td>\r
3953         </tr>\r
3954 \r
3955         <tr>\r
3956           <td align="left"><code>SC_PRINT_COLOURONWHITE</code></td>\r
3957 \r
3958           <td align="center">3</td>\r
3959 \r
3960           <td>Everything prints in its own colour on a white background.</td>\r
3961         </tr>\r
3962 \r
3963         <tr>\r
3964           <td align="left"><code>SC_PRINT_COLOURONWHITEDEFAULTBG</code></td>\r
3965 \r
3966           <td align="center">4</td>\r
3967 \r
3968           <td>Everything prints in its own colour on a white background except that line numbers\r
3969           use their own background colour.</td>\r
3970         </tr>\r
3971       </tbody>\r
3972     </table>\r
3973 \r
3974     <p><b id="SCI_SETPRINTWRAPMODE">SCI_SETPRINTWRAPMODE(int wrapMode)</b><br />\r
3975      <b id="SCI_GETPRINTWRAPMODE">SCI_GETPRINTWRAPMODE</b><br />\r
3976      These two functions get and set the printer wrap mode. <code>wrapMode</code> can be\r
3977      set to <code>SC_WRAP_NONE</code> (0), <code>SC_WRAP_WORD</code> (1) or\r
3978      <code>SC_WRAP_CHAR</code> (2). The default is\r
3979      <code>SC_WRAP_WORD</code>, which wraps printed output so that all characters fit\r
3980      into the print rectangle. If you set <code>SC_WRAP_NONE</code>, each line of text\r
3981      generates one line of output and the line is truncated if it is too long to fit\r
3982      into the print area.<br />\r
3983      <code>SC_WRAP_WORD</code> tries to wrap only between words as indicated by\r
3984      white space or style changes although if a word is longer than a line, it will be wrapped before\r
3985      the line end. <code>SC_WRAP_CHAR</code> is preferred to\r
3986      <code>SC_WRAP_WORD</code> for Asian languages where there is no white space\r
3987      between words.</p>\r
3988 \r
3989     <h2 id="DirectAccess">Direct access</h2>\r
3990     <code><a class="message" href="#SCI_GETDIRECTFUNCTION">SCI_GETDIRECTFUNCTION</a><br />\r
3991      <a class="message" href="#SCI_GETDIRECTPOINTER">SCI_GETDIRECTPOINTER</a><br />\r
3992      <a class="message" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a><br />\r
3993     </code>\r
3994 \r
3995     <p>On Windows, the message-passing scheme used to communicate between the container and\r
3996     Scintilla is mediated by the operating system <code>SendMessage</code> function and can lead to\r
3997     bad performance when calling intensively. To avoid this overhead, Scintilla provides messages\r
3998     that allow you to call the Scintilla message function directly. The code to do this in C/C++ is\r
3999     of the form:</p>\r
4000 <pre>\r
4001 #include "Scintilla.h"\r
4002 SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);\r
4003 sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);\r
4004 \r
4005 // now a wrapper to call Scintilla directly\r
4006 sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){\r
4007     return pSciMsg(pSciWndData, iMessage, wParam, lParam);\r
4008 }\r
4009 </pre>\r
4010 \r
4011     <p><code>SciFnDirect</code>, <code>sptr_t</code> and <code>uptr_t</code> are declared in\r
4012     <code>Scintilla.h</code>. <code>hSciWnd</code> is the window handle returned when you created\r
4013     the Scintilla window.</p>\r
4014 \r
4015     <p>While faster, this direct calling will cause problems if performed from a different thread\r
4016     to the native thread of the Scintilla window in which case <code>SendMessage(hSciWnd, SCI_*,\r
4017     wParam, lParam)</code> should be used to synchronize with the window's thread.</p>\r
4018 \r
4019     <p>This feature also works on GTK+ but has no significant impact on speed.</p>\r
4020 \r
4021     <p>From version 1.47 on Windows, Scintilla exports a function called\r
4022     <code>Scintilla_DirectFunction</code> that can be used the same as the function returned by\r
4023     <code>SCI_GETDIRECTFUNCTION</code>. This saves you the call to\r
4024     <code>SCI_GETDIRECTFUNCTION</code> and the need to call Scintilla indirectly via the function\r
4025     pointer.</p>\r
4026 \r
4027     <p><b id="SCI_GETDIRECTFUNCTION">SCI_GETDIRECTFUNCTION</b><br />\r
4028      This message returns the address of the function to call to handle Scintilla messages without\r
4029     the overhead of passing through the Windows messaging system. You need only call this once,\r
4030     regardless of the number of Scintilla windows you create.</p>\r
4031 \r
4032     <p><b id="SCI_GETDIRECTPOINTER">SCI_GETDIRECTPOINTER</b><br />\r
4033      This returns a pointer to data that identifies which Scintilla window is in use. You must call\r
4034     this once for each Scintilla window you create. When you call the direct function, you must\r
4035     pass in the direct pointer associated with the target window.</p>\r
4036 \r
4037     <p><b id="SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</b><br />\r
4038      Move the gap within Scintilla so that the text of the document is stored consecutively\r
4039      and ensure there is a NUL character after the text, then return a pointer to the first character.\r
4040      Applications may then pass this to a function that accepts a character pointer such as a regular\r
4041      expression search or a parser. The pointer should <em>not</em> be written to as that may desynchronize\r
4042      the internal state of Scintilla.</p>\r
4043      <p>Since any action in Scintilla may change its internal state\r
4044      this pointer becomes invalid after any call or by allowing user interface activity. The application\r
4045      should reacquire the pointer after making any call to Scintilla or performing any user-interface calls such\r
4046      as modifying a progress indicator.</p>\r
4047      <p>This call takes similar time to inserting a character at the end of the document and this may\r
4048      include moving the document contents. Specifically, all the characters after the document gap\r
4049      are moved to before the gap. This compacted state should persist over calls and user interface\r
4050      actions that do not change the document contents so reacquiring the pointer afterwards is very\r
4051      quick. If this call is used to implement a global replace operation, then each replacement will\r
4052      move the gap so if <code>SCI_GETCHARACTERPOINTER</code> is called after\r
4053      each replacement then the operation will become O(n^2) rather than O(n). Instead, all\r
4054      matches should be found and remembered, then all the replacements performed.</p>\r
4055 \r
4056     <h2 id="MultipleViews">Multiple views</h2>\r
4057 \r
4058     <p>A Scintilla window and the document that it displays are separate entities. When you create\r
4059     a new window, you also create a new, empty document. Each document has a reference count that\r
4060     is initially set to 1. The document also has a list of the Scintilla windows that are linked to\r
4061     it so when any window changes the document, all other windows in which it appears are notified\r
4062     to cause them to update. The system is arranged in this way so that you can work with many\r
4063     documents in a single Scintilla window and so you can display a single document in multiple\r
4064     windows (for use with splitter windows).</p>\r
4065 \r
4066     <p>Although these messages use <code>document *pDoc</code>, to ensure compatibility with future\r
4067     releases of Scintilla you should treat <code>pDoc</code> as an opaque <code>void*</code>. That\r
4068     is, you can use and store the pointer as described in this section but you should not\r
4069     dereference it.</p>\r
4070     <code><a class="message" href="#SCI_GETDOCPOINTER">SCI_GETDOCPOINTER</a><br />\r
4071      <a class="message" href="#SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(&lt;unused&gt;, document\r
4072     *pDoc)</a><br />\r
4073      <a class="message" href="#SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</a><br />\r
4074      <a class="message" href="#SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(&lt;unused&gt;, document\r
4075     *pDoc)</a><br />\r
4076      <a class="message" href="#SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(&lt;unused&gt;, document\r
4077     *pDoc)</a><br />\r
4078     </code>\r
4079 \r
4080     <p><b id="SCI_GETDOCPOINTER">SCI_GETDOCPOINTER</b><br />\r
4081      This returns a pointer to the document currently in use by the window. It has no other\r
4082     effect.</p>\r
4083 \r
4084     <p><b id="SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(&lt;unused&gt;, document *pDoc)</b><br />\r
4085      This message does the following:<br />\r
4086      1. It removes the current window from the list held by the current document.<br />\r
4087      2. It reduces the reference count of the current document by 1.<br />\r
4088      3. If the reference count reaches 0, the document is deleted.<br />\r
4089      4. <code>pDoc</code> is set as the new document for the window.<br />\r
4090      5. If <code>pDoc</code> was 0, a new, empty document is created and attached to the\r
4091     window.<br />\r
4092      6. If <code>pDoc</code> was not 0, its reference count is increased by 1.</p>\r
4093 \r
4094     <p><b id="SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</b><br />\r
4095      This message creates a new, empty document and returns a pointer to it. This document is not\r
4096     selected into the editor and starts with a reference count of 1. This means that you have\r
4097     ownership of it and must either reduce its reference count by 1 after using\r
4098     <code>SCI_SETDOCPOINTER</code> so that the Scintilla window owns it or you must make sure that\r
4099     you reduce the reference count by 1 with <code>SCI_RELEASEDOCUMENT</code> before you close the\r
4100     application to avoid memory leaks.</p>\r
4101 \r
4102     <p><b id="SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(&lt;unused&gt;, document *pDoc)</b><br />\r
4103      This increases the reference count of a document by 1. If you want to replace the current\r
4104     document in the Scintilla window and take ownership of the current document, for example if you\r
4105     are editing many documents in one window, do the following:<br />\r
4106      1. Use <code>SCI_GETDOCPOINTER</code> to get a pointer to the document,\r
4107     <code>pDoc</code>.<br />\r
4108      2. Use <code>SCI_ADDREFDOCUMENT(0, pDoc)</code> to increment the reference count.<br />\r
4109      3. Use <code>SCI_SETDOCPOINTER(0, pNewDoc)</code> to set a different document or\r
4110     <code>SCI_SETDOCPOINTER(0, 0)</code> to set a new, empty document.</p>\r
4111 \r
4112     <p><b id="SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(&lt;unused&gt;, document *pDoc)</b><br />\r
4113      This message reduces the reference count of the document identified by <code>pDoc</code>. pDoc\r
4114     must be the result of <code>SCI_GETDOCPOINTER</code> or <code>SCI_CREATEDOCUMENT</code> and\r
4115     must point at a document that still exists. If you call this on a document with a reference\r
4116     count of 1 that is still attached to a Scintilla window, bad things will happen. To keep the\r
4117     world spinning in its orbit you must balance each call to <code>SCI_CREATEDOCUMENT</code> or\r
4118     <code>SCI_ADDREFDOCUMENT</code> with a call to <code>SCI_RELEASEDOCUMENT</code>.</p>\r
4119 \r
4120     <h2 id="Folding">Folding</h2>\r
4121 \r
4122     <p>The fundamental operation in folding is making lines invisible or visible. Line visibility\r
4123     is a property of the view rather than the document so each view may be displaying a different\r
4124     set of lines. From the point of view of the user, lines are hidden and displayed using fold\r
4125     points. Generally, the fold points of a document are based on the hierarchical structure of the\r
4126     document contents. In Python, the hierarchy is determined by indentation and in C++ by brace\r
4127     characters. This hierarchy can be represented within a Scintilla document object by attaching a\r
4128     numeric "fold level" to each line. The fold level is most easily set by a lexer, but you can\r
4129     also set it with messages.</p>\r
4130 \r
4131     <p>It is up to your code to set the connection between user actions and folding and unfolding.\r
4132     The best way to see how this is done is to search the SciTE source code for the messages used\r
4133     in this section of the documentation and see how they are used. You will also need to use\r
4134     markers and a folding margin to complete your folding implementation.\r
4135     The <code>"fold"</code> property should be set to <code>"1"</code> with\r
4136     <code>SCI_SETPROPERTY("fold", "1")</code> to enable folding. </p>\r
4137     <code><a class="message" href="#SCI_VISIBLEFROMDOCLINE">SCI_VISIBLEFROMDOCLINE(int\r
4138     docLine)</a><br />\r
4139      <a class="message" href="#SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(int\r
4140     displayLine)</a><br />\r
4141      <a class="message" href="#SCI_SHOWLINES">SCI_SHOWLINES(int lineStart, int lineEnd)</a><br />\r
4142      <a class="message" href="#SCI_HIDELINES">SCI_HIDELINES(int lineStart, int lineEnd)</a><br />\r
4143      <a class="message" href="#SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(int line)</a><br />\r
4144      <a class="message" href="#SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(int line, int level)</a><br />\r
4145      <a class="message" href="#SCI_GETFOLDLEVEL">SCI_GETFOLDLEVEL(int line)</a><br />\r
4146      <a class="message" href="#SCI_SETFOLDFLAGS">SCI_SETFOLDFLAGS(int flags)</a><br />\r
4147      <a class="message" href="#SCI_GETLASTCHILD">SCI_GETLASTCHILD(int line, int level)</a><br />\r
4148      <a class="message" href="#SCI_GETFOLDPARENT">SCI_GETFOLDPARENT(int line)</a><br />\r
4149      <a class="message" href="#SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool\r
4150     expanded)</a><br />\r
4151      <a class="message" href="#SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line)</a><br />\r
4152      <a class="message" href="#SCI_TOGGLEFOLD">SCI_TOGGLEFOLD(int line)</a><br />\r
4153      <a class="message" href="#SCI_ENSUREVISIBLE">SCI_ENSUREVISIBLE(int line)</a><br />\r
4154      <a class="message" href="#SCI_ENSUREVISIBLEENFORCEPOLICY">SCI_ENSUREVISIBLEENFORCEPOLICY(int\r
4155     line)</a><br />\r
4156     </code>\r
4157 \r
4158     <p><b id="SCI_VISIBLEFROMDOCLINE">SCI_VISIBLEFROMDOCLINE(int docLine)</b><br />\r
4159      When some lines are folded, then a particular line in the document may be displayed at a\r
4160     different position to its document position. If no lines are folded, this message returns\r
4161     <code>docLine</code>. Otherwise, this returns the display line (counting the very first visible\r
4162     line as 0). The display line of an invisible line is the same as the previous visible line. The\r
4163     display line number of the first line in the document is 0. If there is folding and\r
4164     <code>docLine</code> is outside the range of lines in the document, the return value is -1.\r
4165     Lines can occupy more than one display line if they wrap.</p>\r
4166 \r
4167     <p><b id="SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(int displayLine)</b><br />\r
4168      When some lines are hidden, then a particular line in the document may be displayed at a\r
4169     different position to its document position. This message returns the document line number that\r
4170     corresponds to a display line (counting the display line of the first line in the document as\r
4171     0). If <code>displayLine</code> is less than or equal to 0, the result is 0. If\r
4172     <code>displayLine</code> is greater than or equal to the number of displayed lines, the result\r
4173     is the number of lines in the document.</p>\r
4174 \r
4175     <p><b id="SCI_SHOWLINES">SCI_SHOWLINES(int lineStart, int lineEnd)</b><br />\r
4176      <b id="SCI_HIDELINES">SCI_HIDELINES(int lineStart, int lineEnd)</b><br />\r
4177      <b id="SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(int line)</b><br />\r
4178      The first two messages mark a range of lines as visible or invisible and then redraw the\r
4179     display. The third message reports on the visible state of a line and returns 1 if it is\r
4180     visible and 0 if it is not visible. These messages have no effect on fold levels or fold\r
4181     flags. The first line can not be hidden.</p>\r
4182 \r
4183     <p><b id="SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(int line, int level)</b><br />\r
4184      <b id="SCI_GETFOLDLEVEL">SCI_GETFOLDLEVEL(int line)</b><br />\r
4185      These two messages set and get a 32-bit value that contains the fold level of a line and some\r
4186     flags associated with folding. The fold level is a number in the range 0 to\r
4187     <code>SC_FOLDLEVELNUMBERMASK</code> (4095). However, the initial fold level is set to\r
4188     <code>SC_FOLDLEVELBASE</code> (1024) to allow unsigned arithmetic on folding levels. There are\r
4189     two addition flag bits. <code>SC_FOLDLEVELWHITEFLAG</code> indicates that the line is blank and\r
4190     allows it to be treated slightly different then its level may indicate. For example, blank\r
4191     lines should generally not be fold points and will be considered part of the preceding section even though\r
4192     they may have a lesser fold level.\r
4193     <code>SC_FOLDLEVELHEADERFLAG</code> indicates that\r
4194     the line is a header (fold point).</p>\r
4195 \r
4196     <p>Use <code>SCI_GETFOLDLEVEL(line) &amp; SC_FOLDLEVELNUMBERMASK</code> to get the fold level\r
4197     of a line. Likewise, use <code>SCI_GETFOLDLEVEL(line) &amp; SC_FOLDLEVEL*FLAG</code> to get the\r
4198     state of the flags. To set the fold level you must or in the associated flags. For instance, to\r
4199     set the level to <code>thisLevel</code> and mark a line as being a fold point use:\r
4200     <code>SCI_SETFOLDLEVEL(line, thisLevel | SC_FOLDLEVELHEADERFLAG)</code>.</p>\r
4201     If you use a lexer, you should not need to use <code>SCI_SETFOLDLEVEL</code> as this is far\r
4202     better handled by the lexer. You will need to use <code>SCI_GETFOLDLEVEL</code> to decide how\r
4203     to handle user folding requests. If you do change the fold levels, the folding margin will\r
4204     update to match your changes.\r
4205 \r
4206     <p><b id="SCI_SETFOLDFLAGS">SCI_SETFOLDFLAGS(int flags)</b><br />\r
4207      In addition to showing markers in the folding margin, you can indicate folds to the user by\r
4208     drawing lines in the text area. The lines are drawn in the foreground colour set for <a\r
4209     class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. Bits set in\r
4210     <code>flags</code> determine where folding lines are drawn:<br />\r
4211     </p>\r
4212 \r
4213     <table cellpadding="1" cellspacing="2" border="0" summary="Fold flags">\r
4214       <tbody>\r
4215         <tr>\r
4216           <th align="center">Value</th>\r
4217 \r
4218           <th align="left">Effect</th>\r
4219         </tr>\r
4220       </tbody>\r
4221 \r
4222       <tbody valign="top">\r
4223         <tr>\r
4224           <td align="center">1</td>\r
4225 \r
4226           <td align="left">Experimental - draw boxes if expanded</td>\r
4227         </tr>\r
4228 \r
4229         <tr>\r
4230           <td align="center">2</td>\r
4231 \r
4232           <td align="left">Draw above if expanded</td>\r
4233         </tr>\r
4234 \r
4235         <tr>\r
4236           <td align="center">4</td>\r
4237 \r
4238           <td align="left">Draw above if not expanded</td>\r
4239         </tr>\r
4240 \r
4241         <tr>\r
4242           <td align="center">8</td>\r
4243 \r
4244           <td align="left">Draw below if expanded</td>\r
4245         </tr>\r
4246 \r
4247         <tr>\r
4248           <td align="center">16</td>\r
4249 \r
4250           <td align="left">Draw below if not expanded</td>\r
4251         </tr>\r
4252 \r
4253         <tr>\r
4254           <td align="center">64</td>\r
4255 \r
4256           <td align="left">display hexadecimal fold levels in line margin to aid debugging of\r
4257           folding. This feature needs to be redesigned to be sensible.</td>\r
4258         </tr>\r
4259       </tbody>\r
4260     </table>\r
4261 \r
4262     <p>This message causes the display to redraw.</p>\r
4263 \r
4264     <p><b id="SCI_GETLASTCHILD">SCI_GETLASTCHILD(int startLine, int level)</b><br />\r
4265      This message searches for the next line after <code>startLine</code>, that has a folding level\r
4266     that is less than or equal to <code>level</code> and then returns the previous line number. If\r
4267     you set <code>level</code> to -1, <code>level</code> is set to the folding level of line\r
4268     <code>startLine</code>. If <code>from</code> is a fold point, <code>SCI_GETLASTCHILD(from,\r
4269     -1)</code> returns the last line that would be in made visible or hidden by toggling the fold\r
4270     state.</p>\r
4271 \r
4272     <p><b id="SCI_GETFOLDPARENT">SCI_GETFOLDPARENT(int startLine)</b><br />\r
4273      This message returns the line number of the first line before <code>startLine</code> that is\r
4274     marked as a fold point with <code>SC_FOLDLEVELHEADERFLAG</code> and has a fold level less than\r
4275     the <code>startLine</code>. If no line is found, or if the header flags and fold levels are\r
4276     inconsistent, the return value is -1.</p>\r
4277 \r
4278     <p><b id="SCI_TOGGLEFOLD">SCI_TOGGLEFOLD(int line)</b><br />\r
4279      Each fold point may be either expanded, displaying all its child lines, or contracted, hiding\r
4280     all the child lines. This message toggles the folding state of the given line as long as it has\r
4281     the <code>SC_FOLDLEVELHEADERFLAG</code> set. This message takes care of folding or expanding\r
4282     all the lines that depend on the line. The display updates after this message.</p>\r
4283 \r
4284     <p><b id="SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool expanded)</b><br />\r
4285      <b id="SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line)</b><br />\r
4286      These messages set and get the expanded state of a single line. The set message has no effect\r
4287     on the visible state of the line or any lines that depend on it. It does change the markers in\r
4288     the folding margin. If you ask for the expansion state of a line that is outside the document,\r
4289     the result is <code>false</code> (0).</p>\r
4290 \r
4291     <p>If you just want to toggle the fold state of one line and handle all the lines that are\r
4292     dependent on it, it is much easier to use <code>SCI_TOGGLEFOLD</code>. You would use the\r
4293     <code>SCI_SETFOLDEXPANDED</code> message to process many folds without updating the display\r
4294     until you had finished. See <code>SciTEBase::FoldAll()</code> and\r
4295     <code>SciTEBase::Expand()</code> for examples of the use of these messages.</p>\r
4296 \r
4297     <p><b id="SCI_ENSUREVISIBLE">SCI_ENSUREVISIBLE(int line)</b><br />\r
4298      <b id="SCI_ENSUREVISIBLEENFORCEPOLICY">SCI_ENSUREVISIBLEENFORCEPOLICY(int line)</b><br />\r
4299      A line may be hidden because more than one of its parent lines is contracted. Both these\r
4300     message travels up the fold hierarchy, expanding any contracted folds until they reach the top\r
4301     level. The line will then be visible. If you use <code>SCI_ENSUREVISIBLEENFORCEPOLICY</code>,\r
4302     the vertical caret policy set by <a class="message"\r
4303     href="#SCI_SETVISIBLEPOLICY"><code>SCI_SETVISIBLEPOLICY</code></a> is then applied.</p>\r
4304 \r
4305     <h2 id="LineWrapping">Line wrapping</h2>\r
4306 \r
4307     <code><a class="message" href="#SCI_SETWRAPMODE">SCI_SETWRAPMODE(int wrapMode)</a><br />\r
4308      <a class="message" href="#SCI_GETWRAPMODE">SCI_GETWRAPMODE</a><br />\r
4309      <a class="message" href="#SCI_SETWRAPVISUALFLAGS">SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)</a><br />\r
4310      <a class="message" href="#SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</a><br />\r
4311      <a class="message" href="#SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</a><br />\r
4312      <a class="message" href="#SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</a><br />\r
4313      <a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</a><br />\r
4314      <a class="message" href="#SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</a><br />\r
4315      <a class="message" href="#SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</a><br />\r
4316      <a class="message" href="#SCI_GETLAYOUTCACHE">SCI_GETLAYOUTCACHE</a><br />\r
4317      <a class="message" href="#SCI_SETPOSITIONCACHE">SCI_SETPOSITIONCACHE(int size)</a><br />\r
4318      <a class="message" href="#SCI_GETPOSITIONCACHE">SCI_GETPOSITIONCACHE</a><br />\r
4319      <a class="message" href="#SCI_LINESSPLIT">SCI_LINESSPLIT(int pixelWidth)</a><br />\r
4320      <a class="message" href="#SCI_LINESJOIN">SCI_LINESJOIN</a><br />\r
4321      <a class="message" href="#SCI_WRAPCOUNT">SCI_WRAPCOUNT(int docLine)</a><br />\r
4322     </code>\r
4323 \r
4324     <p>By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider\r
4325     than the window width are continued on the following lines. Lines are broken after space or tab\r
4326     characters or between runs of different styles. If this is not possible because a word in one\r
4327     style is wider than the window then the break occurs after the last character that completely\r
4328     fits on the line. The horizontal scroll bar does not appear when wrap mode is on.</p>\r
4329 \r
4330         <p>For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a\r
4331         wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla\r
4332         draws the visual flag at begin of the next subline this subline will be indented by one char.\r
4333         Independent from drawing a visual flag at the begin the subline can have an indention.</p>\r
4334 \r
4335     <p>Much of the time used by Scintilla is spent on laying out and drawing text. The same text\r
4336     layout calculations may be performed many times even when the data used in these calculations\r
4337     does not change. To avoid these unnecessary calculations in some circumstances, the line layout\r
4338     cache can store the results of the calculations. The cache is invalidated whenever the\r
4339     underlying data, such as the contents or styling of the document changes. Caching the layout of\r
4340     the whole document has the most effect, making dynamic line wrap as much as 20 times faster but\r
4341     this requires 7 times the memory required by the document contents plus around 80 bytes per\r
4342     line.</p>\r
4343 \r
4344     <p>Wrapping is not performed immediately there is a change but is delayed until the display\r
4345     is redrawn. This delay improves peformance by allowing a set of changes to be performed\r
4346     and then wrapped and displayed once. Because of this, some operations may not occur as\r
4347     expected. If a file is read and the scroll position moved to a particular line in the text,\r
4348     such as occurs when a container tries to restore a previous editing session, then\r
4349     the scroll position will have been determined before wrapping so an unexpected range\r
4350     of text will be displayed. To scroll to the position correctly, delay the scroll until the\r
4351     wrapping has been performed by waiting for an initial\r
4352     <a class="message" href="#SCN_PAINTED">SCN_PAINTED</a> notification.</p>\r
4353 \r
4354     <p><b id="SCI_SETWRAPMODE">SCI_SETWRAPMODE(int wrapMode)</b><br />\r
4355      <b id="SCI_GETWRAPMODE">SCI_GETWRAPMODE</b><br />\r
4356      Set wrapMode to <code>SC_WRAP_WORD</code> (1) to enable wrapping\r
4357      on word boundaries, <code>SC_WRAP_CHAR</code> (2) to enable wrapping\r
4358      between any characters, and to <code>SC_WRAP_NONE</code> (0) to disable line\r
4359      wrapping. <code>SC_WRAP_CHAR</code> is preferred to\r
4360      <code>SC_WRAP_WORD</code> for Asian languages where there is no white space\r
4361      between words.</p>\r
4362 \r
4363 \r
4364     <p><b id="SCI_SETWRAPVISUALFLAGS">SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)</b><br />\r
4365      <b id="SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</b><br />\r
4366                 You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in\r
4367                 wrapVisualFlags determine which visual flags are drawn.\r
4368 \r
4369     <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags">\r
4370       <tbody>\r
4371         <tr>\r
4372           <th align="left">Symbol</th>\r
4373           <th>Value</th>\r
4374           <th align="left">Effect</th>\r
4375         </tr>\r
4376       </tbody>\r
4377 \r
4378       <tbody valign="top">\r
4379         <tr>\r
4380           <td align="left"><code>SC_WRAPVISUALFLAG_NONE</code></td>\r
4381           <td align="center">0</td>\r
4382           <td>No visual flags</td>\r
4383         </tr>\r
4384 \r
4385         <tr>\r
4386           <td align="left"><code>SC_WRAPVISUALFLAG_END</code></td>\r
4387           <td align="center">1</td>\r
4388           <td>Visual flag at end of subline of a wrapped line.</td>\r
4389         </tr>\r
4390 \r
4391         <tr>\r
4392           <td align="left"><code>SC_WRAPVISUALFLAG_START</code></td>\r
4393           <td align="center">2</td>\r
4394           <td>Visual flag at begin of subline of a wrapped line.<br />\r
4395                                              Subline is indented by at least 1 to make room for the flag.<br />\r
4396                                 </td>\r
4397         </tr>\r
4398       </tbody>\r
4399     </table>\r
4400 \r
4401     <p><b id="SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</b><br />\r
4402      <b id="SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</b><br />\r
4403                 You can set wether the visual flags to indicate a line is wrapped are drawn near the border or near the text.\r
4404                 Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.\r
4405 \r
4406     <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations">\r
4407       <tbody>\r
4408         <tr>\r
4409           <th align="left">Symbol</th>\r
4410           <th>Value</th>\r
4411           <th align="left">Effect</th>\r
4412         </tr>\r
4413       </tbody>\r
4414 \r
4415       <tbody valign="top">\r
4416         <tr>\r
4417           <td align="left"><code>SC_WRAPVISUALFLAGLOC_DEFAULT</code></td>\r
4418           <td align="center">0</td>\r
4419           <td>Visual flags drawn near border</td>\r
4420         </tr>\r
4421 \r
4422         <tr>\r
4423           <td align="left"><code>SC_WRAPVISUALFLAGLOC_END_BY_TEXT</code></td>\r
4424           <td align="center">1</td>\r
4425           <td>Visual flag at end of subline drawn near text</td>\r
4426         </tr>\r
4427 \r
4428         <tr>\r
4429           <td align="left"><code>SC_WRAPVISUALFLAGLOC_START_BY_TEXT</code></td>\r
4430           <td align="center">2</td>\r
4431           <td>Visual flag at begin of subline drawn near text</td>\r
4432         </tr>\r
4433       </tbody>\r
4434     </table>\r
4435     </p>\r
4436 \r
4437     <p><b id="SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</b><br />\r
4438      <b id="SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</b><br />\r
4439      <code>SCI_SETWRAPSTARTINDENT</code> sets the size of indentation of sublines for\r
4440                  wrapped lines in terms of the width of a space in\r
4441                 <a class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>.\r
4442                 There are no limits on indent sizes, but values        less than 0 or large values may have\r
4443                 undesirable effects.<br />\r
4444                 The indention of sublines is independent of visual flags, but if\r
4445                 <code>SC_WRAPVISUALFLAG_START</code> is set an indent of at least 1 is used.\r
4446      </p>\r
4447 \r
4448     <p><b id="SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</b><br />\r
4449      <b id="SCI_GETLAYOUTCACHE">SCI_GETLAYOUTCACHE</b><br />\r
4450      You can set <code>cacheMode</code> to one of the symbols in the table:</p>\r
4451 \r
4452     <table cellpadding="1" cellspacing="2" border="0" summary="Line caching styles">\r
4453       <tbody>\r
4454         <tr>\r
4455           <th align="left">Symbol</th>\r
4456 \r
4457           <th>Value</th>\r
4458 \r
4459           <th align="left">Layout cached for these lines</th>\r
4460         </tr>\r
4461       </tbody>\r
4462 \r
4463       <tbody valign="top">\r
4464         <tr>\r
4465           <td align="left"><code>SC_CACHE_NONE</code></td>\r
4466 \r
4467           <td align="center">0</td>\r
4468 \r
4469           <td>No lines are cached.</td>\r
4470         </tr>\r
4471 \r
4472         <tr>\r
4473           <td align="left"><code>SC_CACHE_CARET</code></td>\r
4474 \r
4475           <td align="center">1</td>\r
4476 \r
4477           <td>The line containing the text caret. This is the default.</td>\r
4478         </tr>\r
4479 \r
4480         <tr>\r
4481           <td align="left"><code>SC_CACHE_PAGE</code></td>\r
4482 \r
4483           <td align="center">2</td>\r
4484 \r
4485           <td>Visible lines plus the line containing the caret.</td>\r
4486         </tr>\r
4487 \r
4488         <tr>\r
4489           <td align="left"><code>SC_CACHE_DOCUMENT</code></td>\r
4490 \r
4491           <td align="center">3</td>\r
4492 \r
4493           <td>All lines in the document.</td>\r
4494         </tr>\r
4495       </tbody>\r
4496     </table>\r
4497     </p>\r
4498 \r
4499     <p><b id="SCI_SETPOSITIONCACHE">SCI_SETPOSITIONCACHE(int size)</b><br />\r
4500      <b id="SCI_GETPOSITIONCACHE">SCI_GETPOSITIONCACHE</b><br />\r
4501      The position cache stores position information for short runs of text\r
4502      so that their layout can be determined more quickly if the run recurs.\r
4503      The size in entries of this cache can be set with <code>SCI_SETPOSITIONCACHE</code>.</p>\r
4504 \r
4505     <p><b id="SCI_LINESSPLIT">SCI_LINESSPLIT(int pixelWidth)</b><br />\r
4506      Split a range of lines indicated by the target into lines that are at most pixelWidth wide.\r
4507      Splitting occurs on word boundaries wherever possible in a similar manner to line wrapping.\r
4508      When <code>pixelWidth</code> is 0 then the width of the window is used.\r
4509      </p>\r
4510 \r
4511     <p><b id="SCI_LINESJOIN">SCI_LINESJOIN</b><br />\r
4512      Join a range of lines indicated by the target into one line by\r
4513      removing line end characters.\r
4514      Where this would lead to no space between words, an extra space is inserted.\r
4515      </p>\r
4516 \r
4517     <p><b id="SCI_WRAPCOUNT">SCI_WRAPCOUNT(int docLine)</b><br />\r
4518     Document lines can occupy more than one display line if they wrap and this\r
4519     returns the number of display lines needed to wrap a document line.</p>\r
4520 \r
4521     <h2 id="Zooming">Zooming</h2>\r
4522 \r
4523     <p>Scintilla incorporates a "zoom factor" that lets you make all the text in the document\r
4524     larger or smaller in steps of one point. The displayed point size never goes below 2, whatever\r
4525     zoom factor you set. You can set zoom factors in the range -10 to +20 points.</p>\r
4526     <code><a class="message" href="#SCI_ZOOMIN">SCI_ZOOMIN</a><br />\r
4527      <a class="message" href="#SCI_ZOOMOUT">SCI_ZOOMOUT</a><br />\r
4528      <a class="message" href="#SCI_SETZOOM">SCI_SETZOOM(int zoomInPoints)</a><br />\r
4529      <a class="message" href="#SCI_GETZOOM">SCI_GETZOOM</a><br />\r
4530     </code>\r
4531 \r
4532     <p><b id="SCI_ZOOMIN">SCI_ZOOMIN</b><br />\r
4533      <b id="SCI_ZOOMOUT">SCI_ZOOMOUT</b><br />\r
4534      <code>SCI_ZOOMIN</code> increases the zoom factor by one point if the current zoom factor is\r
4535     less than 20 points. <code>SCI_ZOOMOUT</code> decreases the zoom factor by one point if the\r
4536     current zoom factor is greater than -10 points.</p>\r
4537 \r
4538     <p><b id="SCI_SETZOOM">SCI_SETZOOM(int zoomInPoints)</b><br />\r
4539      <b id="SCI_GETZOOM">SCI_GETZOOM</b><br />\r
4540      These messages let you set and get the zoom factor directly. There is no limit set on the\r
4541     factors you can set, so limiting yourself to -10 to +20 to match the incremental zoom functions\r
4542     is a good idea.</p>\r
4543 \r
4544     <h2 id="LongLines">Long lines</h2>\r
4545 \r
4546     <p>You can choose to mark lines that exceed a given length by drawing a vertical line or by\r
4547     colouring the background of characters that exceed the set length.</p>\r
4548     <code><a class="message" href="#SCI_SETEDGEMODE">SCI_SETEDGEMODE(int mode)</a><br />\r
4549      <a class="message" href="#SCI_GETEDGEMODE">SCI_GETEDGEMODE</a><br />\r
4550      <a class="message" href="#SCI_SETEDGECOLUMN">SCI_SETEDGECOLUMN(int column)</a><br />\r
4551      <a class="message" href="#SCI_GETEDGECOLUMN">SCI_GETEDGECOLUMN</a><br />\r
4552      <a class="message" href="#SCI_SETEDGECOLOUR">SCI_SETEDGECOLOUR(int colour)</a><br />\r
4553      <a class="message" href="#SCI_GETEDGECOLOUR">SCI_GETEDGECOLOUR</a><br />\r
4554     </code>\r
4555 \r
4556     <p><b id="SCI_SETEDGEMODE">SCI_SETEDGEMODE(int edgeMode)</b><br />\r
4557      <b id="SCI_GETEDGEMODE">SCI_GETEDGEMODE</b><br />\r
4558      These two messages set and get the mode used to display long lines. You can set one of the\r
4559     values in the table:</p>\r
4560 \r
4561     <table cellpadding="1" cellspacing="2" border="0" summary="Long line styles">\r
4562       <tbody>\r
4563         <tr>\r
4564           <th align="left">Symbol</th>\r
4565 \r
4566           <th>Value</th>\r
4567 \r
4568           <th align="left">Long line display mode</th>\r
4569         </tr>\r
4570       </tbody>\r
4571 \r
4572       <tbody valign="top">\r
4573         <tr>\r
4574           <td align="left"><code>EDGE_NONE</code></td>\r
4575 \r
4576           <td align="center">0</td>\r
4577 \r
4578           <td>Long lines are not marked. This is the default state.</td>\r
4579         </tr>\r
4580 \r
4581         <tr>\r
4582           <td align="left"><code>EDGE_LINE</code></td>\r
4583 \r
4584           <td align="center">1</td>\r
4585 \r
4586           <td>A vertical line is drawn at the column number set by <code>SCI_SETEDGECOLUMN</code>.\r
4587           This works well for monospaced fonts. The line is drawn at a position based on the width\r
4588           of a space character in <a class="message"\r
4589           href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>, so it may not work very well if\r
4590           your styles use proportional fonts or if your style have varied font sizes or you use a\r
4591           mixture of bold, italic and normal text.</td>\r
4592         </tr>\r
4593 \r
4594         <tr>\r
4595           <td align="left"><code>EDGE_BACKGROUND</code></td>\r
4596 \r
4597           <td align="center">2</td>\r
4598 \r
4599           <td>The background colour of characters after the column limit is changed to the colour\r
4600           set by <code>SCI_SETEDGECOLOUR</code>. This is recommended for proportional fonts.</td>\r
4601         </tr>\r
4602       </tbody>\r
4603     </table>\r
4604 \r
4605     <p><b id="SCI_SETEDGECOLUMN">SCI_SETEDGECOLUMN(int column)</b><br />\r
4606      <b id="SCI_GETEDGECOLUMN">SCI_GETEDGECOLUMN</b><br />\r
4607      These messages set and get the column number at which to display the long line marker. When\r
4608     drawing lines, the column sets a position in units of the width of a space character in\r
4609     <code>STYLE_DEFAULT</code>. When setting the background colour, the column is a character count\r
4610     (allowing for tabs) into the line.</p>\r
4611 \r
4612     <p><b id="SCI_SETEDGECOLOUR">SCI_SETEDGECOLOUR(int <a class="jump"\r
4613     href="#colour">colour</a>)</b><br />\r
4614      <b id="SCI_GETEDGECOLOUR">SCI_GETEDGECOLOUR</b><br />\r
4615      These messages set and get the colour of the marker used to show that a line has exceeded the\r
4616     length set by <code>SCI_SETEDGECOLUMN</code>.</p>\r
4617 \r
4618     <h2 id="Lexer">Lexer</h2>\r
4619 \r
4620     <p>If you define the symbol <code>SCI_LEXER</code> when building Scintilla, (this is sometimes\r
4621     called the SciLexer version of Scintilla), lexing support for a wide range programming\r
4622     languages is included and the messages in this section are supported. If you want to set\r
4623     styling and fold points for an unsupported language you can either do this in the container or\r
4624     better still, write your own lexer following the pattern of one of the existing ones.</p>\r
4625 \r
4626     <p>Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export four\r
4627     functions: <code>GetLexerCount</code>, <code>GetLexerName</code>, <code>Lex</code> and\r
4628     <code>Fold</code>. See <code>externalLexer.cxx</code> for more.</p>\r
4629     <code><a class="message" href="#SCI_SETLEXER">SCI_SETLEXER(int lexer)</a><br />\r
4630      <a class="message" href="#SCI_GETLEXER">SCI_GETLEXER</a><br />\r
4631      <a class="message" href="#SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(&lt;unused&gt;, char\r
4632     *name)</a><br />\r
4633      <a class="message" href="#SCI_LOADLEXERLIBRARY">SCI_LOADLEXERLIBRARY(&lt;unused&gt;, char\r
4634     *path)</a><br />\r
4635      <a class="message" href="#SCI_COLOURISE">SCI_COLOURISE(int start, int end)</a><br />\r
4636      <a class="message" href="#SCI_SETPROPERTY">SCI_SETPROPERTY(const char *key, const char *value)</a><br />\r
4637      <a class="message" href="#SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value)</a><br />\r
4638      <a class="message" href="#SCI_GETPROPERTYEXPANDED">SCI_GETPROPERTYEXPANDED(const char *key, char *value)</a><br />\r
4639      <a class="message" href="#SCI_GETPROPERTYINT">SCI_GETPROPERTYINT(const char *key, int default)</a><br />\r
4640      <a class="message" href="#SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char\r
4641     *keyWordList)</a><br />\r
4642      <a class="message" href="#SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</a>\r
4643     <br />\r
4644     </code>\r
4645 \r
4646     <p><b id="SCI_SETLEXER">SCI_SETLEXER(int lexer)</b><br />\r
4647      <b id="SCI_GETLEXER">SCI_GETLEXER</b><br />\r
4648      You can select the lexer to use with an integer code from the <code>SCLEX_*</code> enumeration\r
4649     in <code>Scintilla.h</code>. There are two codes in this sequence that do not use lexers:\r
4650     <code>SCLEX_NULL</code> to select no lexing action and <code>SCLEX_CONTAINER</code> which sends\r
4651     the <code><a class="message" href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a></code> notification to\r
4652     the container whenever a range of text needs to be styled. You cannot use the\r
4653     <code>SCLEX_AUTOMATIC</code> value; this identifies additional external lexers that Scintilla\r
4654     assigns unused lexer numbers to.</p>\r
4655 \r
4656     <p><b id="SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(&lt;unused&gt;, const char *name)</b><br />\r
4657      This message lets you select a lexer by name, and is the only method if you are using an\r
4658     external lexer or if you have written a lexer module for a language of your own and do not wish\r
4659     to assign it an explicit lexer number. To select an existing lexer, set <code>name</code> to\r
4660     match the (case sensitive) name given to the module, for example "ada" or "python", not "Ada"\r
4661     or "Python". To locate the name for the built-in lexers, open the relevant\r
4662     <code>Lex*.cxx</code> file and search for <code>LexerModule</code>. The third argument in the\r
4663     <code>LexerModule</code> constructor is the name to use.</p>\r
4664 \r
4665     <p>To test if your lexer assignment worked, use <a class="message"\r
4666     href="#SCI_GETLEXER"><code>SCI_GETLEXER</code></a> before and after setting the new lexer to\r
4667     see if the lexer number changed.</p>\r
4668 \r
4669     <p><b id="SCI_LOADLEXERLIBRARY">SCI_LOADLEXERLIBRARY(&lt;unused&gt;, const char *path)</b><br />\r
4670      Load a lexer implemented in a shared library. This is a .so file on GTK+/Linux or a .DLL file on Windows.\r
4671      </p>\r
4672 \r
4673     <p><b id="SCI_COLOURISE">SCI_COLOURISE(int startPos, int endPos)</b><br />\r
4674      This requests the current lexer or the container (if the lexer is set to\r
4675     <code>SCLEX_CONTAINER</code>) to style the document between <code>startPos</code> and\r
4676     <code>endPos</code>. If <code>endPos</code> is -1, the document is styled from\r
4677     <code>startPos</code> to the end. If the <code>"fold"</code> property is set to\r
4678     <code>"1"</code> and your lexer or container supports folding, fold levels are also set. This\r
4679     message causes a redraw.</p>\r
4680 \r
4681     <p><b id="SCI_SETPROPERTY">SCI_SETPROPERTY(const char *key, const char *value)</b><br />\r
4682      You can communicate settings to lexers with keyword:value string pairs. There is no limit to\r
4683     the number of keyword pairs you can set, other than available memory. <code>key</code> is a\r
4684     case sensitive keyword, <code>value</code> is a string that is associated with the keyword. If\r
4685     there is already a value string associated with the keyword, it is replaced. If you pass a zero\r
4686     length string, the message does nothing. Both <code>key</code> and <code>value</code> are used\r
4687     without modification; extra spaces at the beginning or end of <code>key</code> are\r
4688     significant.</p>\r
4689 \r
4690     <p>The <code>value</code> string can refer to other keywords. For example,\r
4691     <code>SCI_SETPROPERTY("foldTimes10", "$(fold)0")</code> stores the string\r
4692     <code>"$(fold)0"</code>, but when this is accessed, the <code>$(fold)</code> is replaced by the\r
4693     value of the <code>"fold"</code> keyword (or by nothing if this keyword does not exist).</p>\r
4694 \r
4695     <p>Currently the "fold" property is defined for most of the lexers to set the fold structure if\r
4696     set to "1". <code>SCLEX_PYTHON</code> understands <code>"tab.timmy.whinge.level"</code> as a\r
4697     setting that determines how to indicate bad indentation. Most keywords have values that are\r
4698     interpreted as integers. Search the lexer sources for <code>GetPropertyInt</code> to see how\r
4699     properties are used.</p>\r
4700 \r
4701     <p>There is a convention for naming properties used by lexers so that the set of properties can be found by scripts.\r
4702     Property names should start with "lexer.&lt;lexer&gt;." or "fold.&lt;lexer&gt;." when they apply to one\r
4703     lexer or start with "lexer." or "fold." if they apply to multiple lexers.</p>\r
4704 \r
4705     <p><b id="SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value)</b><br />\r
4706     Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied\r
4707     buffer and return the length (not including the terminating 0).  If not found, copy an empty string\r
4708     to the buffer and return 0.</p>\r
4709 \r
4710     <p>Note that  "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">\r
4711     <code>SCI_SETPROPERTY</code></a> will not be performed.</p>\r
4712 \r
4713     <p>If the value argument is 0 then the length that should be allocated to store the value is returned;\r
4714     again, the terminating 0 is not included.</p>\r
4715 \r
4716     <p><b id="SCI_GETPROPERTYEXPANDED">SCI_GETPROPERTYEXPANDED(const char *key, char *value)</b><br />\r
4717     Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied\r
4718     buffer and return the length (not including the terminating 0).  If not found, copy an empty string\r
4719     to the buffer and return 0.</p>\r
4720 \r
4721     <p>Note that  "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">\r
4722     <code>SCI_SETPROPERTY</code></a> will be performed.</p>\r
4723 \r
4724     <p>If the value argument is 0 then the length that should be allocated to store the value (including any indicated keyword replacement)\r
4725     is returned; again, the terminating 0 is not included.</p>\r
4726 \r
4727     <p><b id="SCI_GETPROPERTYINT">SCI_GETPROPERTYINT(const char *key, int default)</b><br />\r
4728     Lookup a keyword:value pair using the specified key; if found, interpret the value as an integer and return it.\r
4729     If not found (or the value is an empty string) then return the supplied default.  If the keyword:value pair is found but is not\r
4730     a number, then return 0.</p>\r
4731 \r
4732     <p>Note that  "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">\r
4733     <code>SCI_SETPROPERTY</code></a> will be performed before any numeric interpretation.</p>\r
4734 \r
4735     <p><b id="SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)</b><br />\r
4736      You can set up to 9 lists of keywords for use by the current lexer. This was increased from 6\r
4737     at revision 1.50. <code>keyWordSet</code> can be 0 to 8 (actually 0 to <code>KEYWORDSET_MAX</code>)\r
4738     and selects which keyword list to replace. <code>keyWordList</code> is a list of keywords\r
4739     separated by spaces, tabs, <code>"\n"</code> or <code>"\r"</code> or any combination of these.\r
4740     It is expected that the keywords will be composed of standard ASCII printing characters,\r
4741     but there is nothing to stop you using any non-separator character codes from 1 to 255\r
4742     (except common sense).</p>\r
4743 \r
4744     <p>How these keywords are used is entirely up to the lexer. Some languages, such as HTML may\r
4745     contain embedded languages, VBScript and JavaScript are common for HTML. For HTML, key word set\r
4746     0 is for HTML, 1 is for JavaScript and 2 is for VBScript, 3 is for Python, 4 is for PHP and 5\r
4747     is for SGML and DTD keywords. Review the lexer code to see examples of keyword list. A fully\r
4748     conforming lexer sets the fourth argument of the <code>LexerModule</code> constructor to be a\r
4749     list of strings that describe the uses of the keyword lists.</p>\r
4750 \r
4751     <p>Alternatively, you might use set 0 for general keywords, set 1 for keywords that cause\r
4752     indentation and set 2 for keywords that cause unindentation. Yet again, you might have a simple\r
4753     lexer that colours keywords and you could change languages by changing the keywords in set 0.\r
4754     There is nothing to stop you building your own keyword lists into the lexer, but this means\r
4755     that the lexer must be rebuilt if more keywords are added.</p>\r
4756 \r
4757     <p><b id="SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</b><br />\r
4758      Retrieve the number of bits the current lexer needs for styling. This should normally be the argument\r
4759      to <a class="message" href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS</a>.\r
4760      </p>\r
4761 \r
4762     <h2 id="Notifications">Notifications</h2>\r
4763 \r
4764     <p>Notifications are sent (fired) from the Scintilla control to its container when an event has\r
4765     occurred that may interest the container. Notifications are sent using the\r
4766     <code>WM_NOTIFY</code> message on Windows and the "notify" signal on GTK+. The container is\r
4767     passed a <code>SCNotification</code> structure containing information about the event.</p>\r
4768 <pre id="SCNotification">\r
4769 struct NotifyHeader {   // This matches the Win32 NMHDR structure\r
4770     void *hwndFrom;     // environment specific window handle/pointer\r
4771     uptr_t idFrom;        // CtrlID of the window issuing the notification\r
4772     unsigned int code;  // The SCN_* notification code\r
4773 };\r
4774 \r
4775 struct SCNotification {\r
4776     struct NotifyHeader nmhdr;\r
4777     int position;\r
4778     // SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_DWELLSTART,\r
4779     // SCN_DWELLEND, SCN_CALLTIPCLICK,\r
4780     // SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK\r
4781     int ch;             // SCN_CHARADDED, SCN_KEY\r
4782     int modifiers;      // SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK\r
4783     int modificationType; // SCN_MODIFIED\r
4784     const char *text;   // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION\r
4785     int length;         // SCN_MODIFIED\r
4786     int linesAdded;     // SCN_MODIFIED\r
4787     int message;        // SCN_MACRORECORD\r
4788     uptr_t wParam;      // SCN_MACRORECORD\r
4789     sptr_t lParam;      // SCN_MACRORECORD\r
4790     int line;           // SCN_MODIFIED, SCN_DOUBLECLICK\r
4791     int foldLevelNow;   // SCN_MODIFIED\r
4792     int foldLevelPrev;  // SCN_MODIFIED\r
4793     int margin;         // SCN_MARGINCLICK\r
4794     int listType;       // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION\r
4795     int x;              // SCN_DWELLSTART, SCN_DWELLEND\r
4796     int y;              // SCN_DWELLSTART, SCN_DWELLEND\r
4797 };\r
4798 </pre>\r
4799 \r
4800     <p>The notification messages that your container can choose to handle and the messages\r
4801     associated with them are:</p>\r
4802     <code><a class="message" href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a><br />\r
4803      <a class="message" href="#SCN_CHARADDED">SCN_CHARADDED</a><br />\r
4804      <a class="message" href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a><br />\r
4805      <a class="message" href="#SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</a><br />\r
4806      <a class="message" href="#SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</a><br />\r
4807      <a class="message" href="#SCN_KEY">SCN_KEY</a><br />\r
4808      <a class="message" href="#SCN_DOUBLECLICK">SCN_DOUBLECLICK</a><br />\r
4809      <a class="message" href="#SCN_UPDATEUI">SCN_UPDATEUI</a><br />\r
4810      <a class="message" href="#SCN_MODIFIED">SCN_MODIFIED</a><br />\r
4811      <a class="message" href="#SCN_MACRORECORD">SCN_MACRORECORD</a><br />\r
4812      <a class="message" href="#SCN_MARGINCLICK">SCN_MARGINCLICK</a><br />\r
4813      <a class="message" href="#SCN_NEEDSHOWN">SCN_NEEDSHOWN</a><br />\r
4814      <a class="message" href="#SCN_PAINTED">SCN_PAINTED</a><br />\r
4815      <a class="message" href="#SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</a><br />\r
4816      <a class="message" href="#SCN_URIDROPPED">SCN_URIDROPPED</a><br />\r
4817      <a class="message" href="#SCN_DWELLSTART">SCN_DWELLSTART</a><br />\r
4818      <a class="message" href="#SCN_DWELLEND">SCN_DWELLEND</a><br />\r
4819      <a class="message" href="#SCN_ZOOM">SCN_ZOOM</a><br />\r
4820      <a class="message" href="#SCN_HOTSPOTCLICK">SCN_HOTSPOTCLICK</a><br />\r
4821      <a class="message" href="#SCN_HOTSPOTDOUBLECLICK">SCN_HOTSPOTDOUBLECLICK</a><br />\r
4822      <a class="message" href="#SCN_INDICATORCLICK">SCN_INDICATORCLICK</a><br />\r
4823      <a class="message" href="#SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</a><br />\r
4824      <a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a><br />\r
4825      <a class="message" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a><br />\r
4826      <a class="message" href="#SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</a><br />\r
4827     </code>\r
4828 \r
4829     <p>The following <code>SCI_*</code> messages are associated with these notifications:</p>\r
4830     <code><a class="message" href="#SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK(int\r
4831     eventMask)</a><br />\r
4832      <a class="message" href="#SCI_GETMODEVENTMASK">SCI_GETMODEVENTMASK</a><br />\r
4833      <a class="message" href="#SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</a><br />\r
4834      <a class="message" href="#SCI_GETMOUSEDWELLTIME">SCI_GETMOUSEDWELLTIME</a><br />\r
4835     </code>\r
4836 \r
4837     <p>The following additional notifications are sent using the <code>WM_COMMAND</code> message on\r
4838     Windows and the "Command" signal on GTK+. This emulates the Windows Edit control. Only the lower\r
4839     16 bits of the control's ID is passed in these notifications.</p>\r
4840     <code><a class="message" href="#SCEN_CHANGE">SCEN_CHANGE</a><br />\r
4841      <a class="message" href="#SCEN_SETFOCUS">SCEN_SETFOCUS</a><br />\r
4842      <a class="message" href="#SCEN_KILLFOCUS">SCEN_KILLFOCUS</a><br />\r
4843     </code>\r
4844 \r
4845     <p><b id="SCN_STYLENEEDED">SCN_STYLENEEDED</b><br />\r
4846      If you used <code><a class="message"\r
4847     href="#SCI_SETLEXER">SCI_SETLEXER</a>(SCLEX_CONTAINER)</code> to make the container act as the\r
4848     lexer, you will receive this notification when Scintilla is about to display or print text that\r
4849     requires styling. You are required to style the text from the line that contains the position\r
4850     returned by <a class="message" href="#SCI_GETENDSTYLED"><code>SCI_GETENDSTYLED</code></a> up to\r
4851     the position passed in <code>SCNotification.position</code>. Symbolically, you need code of the\r
4852     form:</p>\r
4853 <pre>\r
4854     startPos = <a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a>()\r
4855     lineNumber = <a class="message"\r
4856 href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION</a>(startPos);\r
4857     startPos = <a class="message"\r
4858 href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);\r
4859     MyStyleRoutine(startPos, SCNotification.position);\r
4860 </pre>\r
4861 \r
4862     <p><b id="SCN_CHARADDED">SCN_CHARADDED</b><br />\r
4863      This is sent when the user types an ordinary text character (as opposed to a command\r
4864     character) that is entered into the text. The container can use this to decide to display a <a\r
4865     class="jump" href="#CallTips">call tip</a> or an <a class="jump" href="#Autocompletion">auto\r
4866     completion list</a>. The character is in <code>SCNotification.ch</code>.\r
4867         This notification is sent before the character has been styled so processing that depends on\r
4868         styling should instead be performed in the SCN_UPDATEUI notification.</p>\r
4869 \r
4870     <p><b id="SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</b><br />\r
4871      <b id="SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</b><br />\r
4872      Sent to the container when the save point is entered or left, allowing the container to\r
4873     display a "document dirty" indicator and change its menus.<br />\r
4874      See also: <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>, <a\r
4875     class="message" href="#SCI_GETMODIFY"><code>SCI_GETMODIFY</code></a></p>\r
4876 \r
4877     <p><b id="SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</b><br />\r
4878      When in read-only mode, this notification is sent to the container if the user tries to change\r
4879     the text. This can be used to check the document out of a version control system. You can set\r
4880     the read-only state of a document with <code><a class="message"\r
4881     href="#SCI_SETREADONLY">SCI_SETREADONLY</a></code>.</p>\r
4882 \r
4883     <p><b id="SCN_KEY">SCN_KEY</b><br />\r
4884      Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of\r
4885      some problems with keyboard focus and is not sent by the Windows version. <code>SCNotification.ch</code> holds the key code and\r
4886     <code>SCNotification.modifiers</code> holds the modifiers. This notification is sent if the\r
4887     modifiers include <code>SCMOD_ALT</code> or <code>SCMOD_CTRL</code> and the key code is less\r
4888     than 256.</p>\r
4889 \r
4890     <p><b id="SCN_DOUBLECLICK">SCN_DOUBLECLICK</b><br />\r
4891      The mouse button was double clicked in editor. The <code>position</code> field is set to the text position of the\r
4892     double click and the <code>line</code> field is set to the line of the double click.</p>\r
4893 \r
4894     <p><b id="SCN_UPDATEUI">SCN_UPDATEUI</b><br />\r
4895      Either the text or styling of the document has changed or the selection range has changed. Now\r
4896     would be a good time to update any container UI elements that depend on document or view state.\r
4897     This was previously called <code><a class="message"\r
4898     href="#SCN_CHECKBRACE">SCN_CHECKBRACE</a></code> because a common use is to check whether the\r
4899     caret is next to a brace and set highlights on this brace and its corresponding matching brace.\r
4900     This also replaces <a class="message" href="#SCN_POSCHANGED"><code>SCN_POSCHANGED</code></a>,\r
4901     which is now deprecated.</p>\r
4902 \r
4903     <p><b id="SCN_MODIFIED">SCN_MODIFIED</b><br />\r
4904      This notification is sent when the text or styling of the document changes or is about to\r
4905     change. You can set a mask for the notifications that are sent to the container with <a\r
4906     class="message" href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>. The\r
4907     notification structure contains information about what changed, how the change occurred and\r
4908     whether this changed the number of lines in the document. No modifications may be performed\r
4909     while in a <code>SCN_MODIFIED</code> event. The <code>SCNotification</code> fields used\r
4910     are:</p>\r
4911 \r
4912     <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification types">\r
4913       <tbody>\r
4914         <tr>\r
4915           <th align="left">Field</th>\r
4916 \r
4917           <th align="left">Usage</th>\r
4918         </tr>\r
4919       </tbody>\r
4920 \r
4921       <tbody valign="top">\r
4922         <tr>\r
4923           <td align="left"><code>modificationType</code></td>\r
4924 \r
4925           <td align="left">A set of flags that identify the change(s) made. See the next\r
4926           table.</td>\r
4927         </tr>\r
4928 \r
4929         <tr>\r
4930           <td align="left"><code>position</code></td>\r
4931 \r
4932           <td align="left">Start position of a text or styling change. Set to 0 if not used.</td>\r
4933         </tr>\r
4934 \r
4935         <tr>\r
4936           <td align="left"><code>length</code></td>\r
4937 \r
4938           <td align="left">Length of the change in cells or characters when the text or styling\r
4939           changes. Set to 0 if not used.</td>\r
4940         </tr>\r
4941 \r
4942         <tr>\r
4943           <td align="left"><code>linesAdded</code></td>\r
4944 \r
4945           <td align="left">Number of added lines. If negative, the number of deleted lines. Set to\r
4946           0 if not used or no lines added or deleted.</td>\r
4947         </tr>\r
4948 \r
4949         <tr>\r
4950           <td align="left"><code>text</code></td>\r
4951 \r
4952           <td align="left">Valid for text changes, not for style changes. If we are collecting undo\r
4953           information this holds a pointer to the text that is handed to the Undo system, otherwise\r
4954           it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0 and\r
4955                   for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells,\r
4956                    not bytes and the length is the number of cells.</td>\r
4957         </tr>\r
4958 \r
4959         <tr>\r
4960           <td align="left"><code>line</code></td>\r
4961 \r
4962           <td align="left">The line number at which a fold level or marker change occurred. This is\r
4963           0 if unused and may be -1 if more than one line changed.</td>\r
4964         </tr>\r
4965 \r
4966         <tr>\r
4967           <td align="left"><code>foldLevelNow</code></td>\r
4968 \r
4969           <td align="left">The new fold level applied to the line or 0 if this field is\r
4970           unused.</td>\r
4971         </tr>\r
4972 \r
4973         <tr>\r
4974           <td align="left"><code>foldLevelPrev</code></td>\r
4975 \r
4976           <td align="left">The previous folding level of the line or 0 if this field is\r
4977           unused.</td>\r
4978         </tr>\r
4979       </tbody>\r
4980     </table>\r
4981 \r
4982     <p>The <code>SCNotification.modificationType</code> field has bits set to tell you what has\r
4983     been done. The <code>SC_MOD_*</code> bits correspond to actions. The\r
4984     <code>SC_PERFORMED_*</code> bits tell you if the action was done by the user, or the result of\r
4985     Undo or Redo of a previous action.</p>\r
4986 \r
4987     <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification type flags">\r
4988       <tbody>\r
4989         <tr>\r
4990           <th align="left">Symbol</th>\r
4991 \r
4992           <th>Value</th>\r
4993 \r
4994           <th align="left">Meaning</th>\r
4995 \r
4996           <th align="left">SCNotification fields</th>\r
4997         </tr>\r
4998       </tbody>\r
4999 \r
5000       <tbody valign="top">\r
5001         <tr>\r
5002           <td align="left"><code>SC_MOD_INSERTTEXT</code></td>\r
5003 \r
5004           <td align="center">0x01</td>\r
5005 \r
5006           <td>Text has been inserted into the document.</td>\r
5007 \r
5008           <td><code>position, length, text, linesAdded</code></td>\r
5009         </tr>\r
5010 \r
5011         <tr>\r
5012           <td align="left"><code>SC_MOD_DELETETEXT</code></td>\r
5013 \r
5014           <td align="center">0x02</td>\r
5015 \r
5016           <td>Text has been removed from the document.</td>\r
5017 \r
5018           <td><code>position, length, text, linesAdded</code></td>\r
5019         </tr>\r
5020 \r
5021         <tr>\r
5022           <td align="left"><code>SC_MOD_CHANGESTYLE</code></td>\r
5023 \r
5024           <td align="center">0x04</td>\r
5025 \r
5026           <td>A style change has occurred.</td>\r
5027 \r
5028           <td><code>position, length</code></td>\r
5029         </tr>\r
5030 \r
5031         <tr>\r
5032           <td align="left"><code>SC_MOD_CHANGEFOLD</code></td>\r
5033 \r
5034           <td align="center">0x08</td>\r
5035 \r
5036           <td>A folding change has occurred.</td>\r
5037 \r
5038           <td><code>line, foldLevelNow, foldLevelPrev</code></td>\r
5039         </tr>\r
5040 \r
5041         <tr>\r
5042           <td align="left"><code>SC_PERFORMED_USER</code></td>\r
5043 \r
5044           <td align="center">0x10</td>\r
5045 \r
5046           <td>Information: the operation was done by the user.</td>\r
5047 \r
5048           <td>None</td>\r
5049         </tr>\r
5050 \r
5051         <tr>\r
5052           <td align="left"><code>SC_PERFORMED_UNDO</code></td>\r
5053 \r
5054           <td align="center">0x20</td>\r
5055 \r
5056           <td>Information: this was the result of an Undo.</td>\r
5057 \r
5058           <td>None</td>\r
5059         </tr>\r
5060 \r
5061         <tr>\r
5062           <td align="left"><code>SC_PERFORMED_REDO</code></td>\r
5063 \r
5064           <td align="center">0x40</td>\r
5065 \r
5066           <td>Information: this was the result of a Redo.</td>\r
5067 \r
5068           <td>None</td>\r
5069         </tr>\r
5070 \r
5071         <tr>\r
5072           <td align="left"><code>SC_MULTISTEPUNDOREDO</code></td>\r
5073 \r
5074           <td align="center">0x80</td>\r
5075 \r
5076           <td>This is part of a multi-step Undo or Redo transaction.</td>\r
5077 \r
5078           <td>None</td>\r
5079         </tr>\r
5080 \r
5081         <tr>\r
5082           <td align="left"><code>SC_LASTSTEPINUNDOREDO</code></td>\r
5083 \r
5084           <td align="center">0x100</td>\r
5085 \r
5086           <td>This is the final step in an Undo or Redo transaction.</td>\r
5087 \r
5088           <td>None</td>\r
5089         </tr>\r
5090 \r
5091         <tr>\r
5092           <td align="left"><code>SC_MOD_CHANGEMARKER</code></td>\r
5093 \r
5094           <td align="center">0x200</td>\r
5095 \r
5096           <td>One or more markers has changed in a line.</td>\r
5097 \r
5098           <td><code>line</code></td>\r
5099         </tr>\r
5100 \r
5101         <tr>\r
5102           <td align="left"><code>SC_MOD_BEFOREINSERT</code></td>\r
5103 \r
5104           <td align="center">0x400</td>\r
5105 \r
5106           <td>Text is about to be inserted into the document.</td>\r
5107 \r
5108           <td><code>position, if performed by user then text in cells, length in cells</code></td>\r
5109         </tr>\r
5110 \r
5111         <tr>\r
5112           <td align="left"><code>SC_MOD_BEFOREDELETE</code></td>\r
5113 \r
5114           <td align="center">0x800</td>\r
5115 \r
5116           <td>Text is about to be deleted from the document.</td>\r
5117 \r
5118           <td><code>position, length</code></td>\r
5119         </tr>\r
5120 \r
5121         <tr>\r
5122           <td align="left"><code>SC_MOD_CHANGEINDICATOR</code></td>\r
5123 \r
5124           <td align="center">0x4000</td>\r
5125 \r
5126           <td>An indicator has been added or removed from a range of text.</td>\r
5127 \r
5128           <td><code>position, length</code></td>\r
5129         </tr>\r
5130 \r
5131         <tr>\r
5132           <td align="left"><code id="SC_MOD_CHANGELINESTATE">SC_MOD_CHANGELINESTATE</code></td>\r
5133 \r
5134           <td align="center">0x8000</td>\r
5135 \r
5136           <td>A line state has changed because <a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE</a>\r
5137           was called.</td>\r
5138 \r
5139           <td><code>line</code></td>\r
5140         </tr>\r
5141 \r
5142         <tr>\r
5143           <td align="left"><code>SC_MULTILINEUNDOREDO</code></td>\r
5144 \r
5145           <td align="center">0x1000</td>\r
5146 \r
5147           <td>This is part of an Undo or Redo with multi-line changes.</td>\r
5148 \r
5149           <td>None</td>\r
5150         </tr>\r
5151 \r
5152         <tr>\r
5153           <td align="left"><code>SC_STARTACTION</code></td>\r
5154 \r
5155           <td align="center">0x2000</td>\r
5156 \r
5157           <td>This is set on a SC_PERFORMED_USER action when it is the\r
5158           first or only step in an undo transaction. This can be used to integrate the Scintilla\r
5159           undo stack with an undo stack in the container application by adding a Scintilla\r
5160           action to the container's stack for the currently opened container transaction or\r
5161           to open a new container transaction if there is no open container transaction.\r
5162           </td>\r
5163 \r
5164           <td>None</td>\r
5165         </tr>\r
5166 \r
5167         <tr>\r
5168           <td align="left"><code>SC_MODEVENTMASKALL</code></td>\r
5169 \r
5170           <td align="center">0x1fff</td>\r
5171 \r
5172           <td>This is a mask for all valid flags. This is the default mask state set by <a\r
5173           class="message" href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>.</td>\r
5174 \r
5175           <td>None</td>\r
5176         </tr>\r
5177       </tbody>\r
5178     </table>\r
5179 \r
5180     <p><b id="SCEN_CHANGE">SCEN_CHANGE</b><br />\r
5181      <code>SCEN_CHANGE</code> (768) is fired when the text (not the style) of the document changes.\r
5182     This notification is sent using the <code>WM_COMMAND</code> message on Windows and the\r
5183     "Command" signal on GTK+ as this is the behavior of the standard Edit control\r
5184     (<code>SCEN_CHANGE</code> has the same value as the Windows Edit control\r
5185     <code>EN_CHANGE</code>). No other information is sent. If you need more detailed information\r
5186     use <a class="message" href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a>. You can filter the\r
5187     types of changes you are notified about with <a class="message"\r
5188     href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>.</p>\r
5189 \r
5190     <p><b id="SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK(int eventMask)</b><br />\r
5191      <b id="SCI_GETMODEVENTMASK">SCI_GETMODEVENTMASK</b><br />\r
5192      These messages set and get an event mask that determines which document change events are\r
5193     notified to the container with <a class="message"\r
5194     href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a> and <a class="message"\r
5195     href="#SCEN_CHANGE"><code>SCEN_CHANGE</code></a>. For example, a container may decide to see\r
5196     only notifications about changes to text and not styling changes by calling\r
5197     <code>SCI_SETMODEVENTMASK(SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT)</code>.</p>\r
5198 \r
5199     <p>The possible notification types are the same as the <code>modificationType</code> bit flags\r
5200     used by <code>SCN_MODIFIED</code>: <code>SC_MOD_INSERTTEXT</code>,\r
5201     <code>SC_MOD_DELETETEXT</code>, <code>SC_MOD_CHANGESTYLE</code>,\r
5202     <code>SC_MOD_CHANGEFOLD</code>, <code>SC_PERFORMED_USER</code>, <code>SC_PERFORMED_UNDO</code>,\r
5203     <code>SC_PERFORMED_REDO</code>, <code>SC_MULTISTEPUNDOREDO</code>,\r
5204     <code>SC_LASTSTEPINUNDOREDO</code>, <code>SC_MOD_CHANGEMARKER</code>,\r
5205     <code>SC_MOD_BEFOREINSERT</code>, <code>SC_MOD_BEFOREDELETE</code>,\r
5206     <code>SC_MULTILINEUNDOREDO</code>, and <code>SC_MODEVENTMASKALL</code>.</p>\r
5207 \r
5208     <p><b id="SCEN_SETFOCUS">SCEN_SETFOCUS</b><br />\r
5209      <b id="SCEN_KILLFOCUS">SCEN_KILLFOCUS</b><br />\r
5210      <code>SCEN_SETFOCUS</code> (512) is fired when Scintilla receives focus and\r
5211     <code>SCEN_KILLFOCUS</code> (256) when it loses focus. These notifications are sent using the\r
5212     <code>WM_COMMAND</code> message on Windows and the "Command" signal on GTK+ as this is the\r
5213     behavior of the standard Edit control. Unfortunately, these codes do not match the Windows Edit\r
5214     notification codes <code>EN_SETFOCUS</code> (256) and <code>EN_KILLFOCUS</code> (512). It is\r
5215     now too late to change the Scintilla codes as clients depend on the current values.</p>\r
5216 \r
5217     <p><b id="SCN_MACRORECORD">SCN_MACRORECORD</b><br />\r
5218      The <code><a class="message" href="#SCI_STARTRECORD">SCI_STARTRECORD</a></code> and <a\r
5219     class="message" href="#SCI_STOPRECORD"><code>SCI_STOPRECORD</code></a> messages enable and\r
5220     disable macro recording. When enabled, each time a recordable change occurs, the\r
5221     <code>SCN_MACRORECORD</code> notification is sent to the container. It is up to the container\r
5222     to record the action. To see the complete list of <code>SCI_*</code> messages that are\r
5223     recordable, search the Scintilla source <code>Editor.cxx</code> for\r
5224     <code>Editor::NotifyMacroRecord</code>. The fields of <code>SCNotification</code> set in this\r
5225     notification are:</p>\r
5226 \r
5227     <table cellpadding="1" cellspacing="2" border="0" summary="Macro record notification data">\r
5228       <tbody>\r
5229         <tr>\r
5230           <th align="left">Field</th>\r
5231 \r
5232           <th align="left">Usage</th>\r
5233         </tr>\r
5234       </tbody>\r
5235 \r
5236       <tbody valign="top">\r
5237         <tr>\r
5238           <td align="left"><code>message</code></td>\r
5239 \r
5240           <td align="left">The <code>SCI_*</code> message that caused the notification.</td>\r
5241         </tr>\r
5242 \r
5243         <tr>\r
5244           <td align="left"><code>wParam</code></td>\r
5245 \r
5246           <td align="left">The value of <code>wParam</code> in the <code>SCI_*</code> message.</td>\r
5247         </tr>\r
5248 \r
5249         <tr>\r
5250           <td align="left"><code>lParam</code></td>\r
5251 \r
5252           <td align="left">The value of <code>lParam</code> in the <code>SCI_*</code> message.</td>\r
5253         </tr>\r
5254       </tbody>\r
5255     </table>\r
5256 \r
5257     <p><b id="SCN_MARGINCLICK">SCN_MARGINCLICK</b><br />\r
5258      This notification tells the container that the mouse was clicked inside a <a class="jump"\r
5259     href="#Margins">margin</a> that was marked as sensitive (see <a class="message"\r
5260     href="#SCI_SETMARGINSENSITIVEN"><code>SCI_SETMARGINSENSITIVEN</code></a>). This can be used to\r
5261     perform folding or to place breakpoints. The following <code>SCNotification</code> fields are\r
5262     used:</p>\r
5263 \r
5264     <table cellpadding="1" cellspacing="2" border="0" summary="Margin click notification">\r
5265       <tbody>\r
5266         <tr>\r
5267           <th align="left">Field</th>\r
5268 \r
5269           <th align="left">Usage</th>\r
5270         </tr>\r
5271       </tbody>\r
5272 \r
5273       <tbody valign="top">\r
5274         <tr>\r
5275           <td align="left"><code>modifiers</code></td>\r
5276 \r
5277           <td align="left">The appropriate combination of <code>SCI_SHIFT</code>,\r
5278           <code>SCI_CTRL</code> and <code>SCI_ALT</code> to indicate the keys that were held down\r
5279           at the time of the margin click.</td>\r
5280         </tr>\r
5281 \r
5282         <tr>\r
5283           <td align="left"><code>position</code></td>\r
5284 \r
5285           <td align="left">The position of the start of the line in the document that corresponds\r
5286           to the margin click.</td>\r
5287         </tr>\r
5288 \r
5289         <tr>\r
5290           <td align="left"><code>margin</code></td>\r
5291 \r
5292           <td align="left">The margin number that was clicked.</td>\r
5293         </tr>\r
5294       </tbody>\r
5295     </table>\r
5296 \r
5297     <p><b id="SCN_NEEDSHOWN">SCN_NEEDSHOWN</b><br />\r
5298      Scintilla has determined that a range of lines that is currently invisible should be made\r
5299     visible. An example of where this may be needed is if the end of line of a contracted fold\r
5300     point is deleted. This message is sent to the container in case it wants to make the line\r
5301     visible in some unusual way such as making the whole document visible. Most containers will\r
5302     just ensure each line in the range is visible by calling <a class="message"\r
5303     href="#SCI_ENSUREVISIBLE"><code>SCI_ENSUREVISIBLE</code></a>. The <code>position</code> and\r
5304     <code>length</code> fields of <code>SCNotification</code> indicate the range of the document\r
5305     that should be made visible. The container code will be similar to the following code\r
5306     skeleton:</p>\r
5307 <pre>\r
5308 firstLine = SCI_LINEFROMPOSITION(scn.position)\r
5309 lastLine = SCI_LINEFROMPOSITION(scn.position+scn.length-1)\r
5310 for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next\r
5311 </pre>\r
5312 \r
5313     <p><b id="SCN_PAINTED">SCN_PAINTED</b><br />\r
5314      Painting has just been done. Useful when you want to update some other widgets based on a\r
5315     change in Scintilla, but want to have the paint occur first to appear more responsive. There is\r
5316     no other information in <code>SCNotification</code>.</p>\r
5317 \r
5318     <p><b id="SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</b><br />\r
5319      The user has selected an item in a <a class="jump" href="#UserLists">user list</a>. The\r
5320     <code>SCNotification</code> fields used are:</p>\r
5321 \r
5322     <table cellpadding="1" cellspacing="2" border="0" summary="User list notification">\r
5323       <tbody>\r
5324         <tr>\r
5325           <th align="left">Field</th>\r
5326 \r
5327           <th align="left">Usage</th>\r
5328         </tr>\r
5329       </tbody>\r
5330 \r
5331       <tbody valign="top">\r
5332         <tr>\r
5333           <td align="left"><code>wParam</code></td>\r
5334 \r
5335           <td align="left">This is set to the <code>listType</code> parameter from the <a\r
5336           class="message" href="#SCI_USERLISTSHOW"><code>SCI_USERLISTSHOW</code></a> message that\r
5337           initiated the list.</td>\r
5338         </tr>\r
5339 \r
5340         <tr>\r
5341           <td align="left"><code>text</code></td>\r
5342 \r
5343           <td align="left">The text of the selection.</td>\r
5344         </tr>\r
5345       </tbody>\r
5346     </table>\r
5347     <br />\r
5348      <br />\r
5349 \r
5350 \r
5351     <p><b id="SCN_URIDROPPED">SCN_URIDROPPED</b><br />\r
5352      Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web\r
5353     address onto Scintilla. The container could interpret this as a request to open the file. The\r
5354     <code>text</code> field of <code>SCNotification</code> points at the URI text.</p>\r
5355 \r
5356     <p><b id="SCN_DWELLSTART">SCN_DWELLSTART</b><br />\r
5357      <b id="SCN_DWELLEND">SCN_DWELLEND</b><br />\r
5358      <code>SCN_DWELLSTART</code> is generated when the user keeps the mouse in one position for the\r
5359     dwell period (see <code><a class="message"\r
5360     href="#SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</a></code>). <code>SCN_DWELLEND</code> is\r
5361     generated after a <code>SCN_DWELLSTART</code> and the mouse is moved or other activity such as\r
5362     key press indicates the dwell is over. Both notifications set the same fields in\r
5363     <code>SCNotification</code>:</p>\r
5364 \r
5365     <table cellpadding="1" cellspacing="2" border="0" summary="Mouse dwell notification">\r
5366       <tbody>\r
5367         <tr>\r
5368           <th align="left">Field</th>\r
5369 \r
5370           <th align="left">Usage</th>\r
5371         </tr>\r
5372       </tbody>\r
5373 \r
5374       <tbody valign="top">\r
5375         <tr>\r
5376           <td align="left"><code>position</code></td>\r
5377 \r
5378           <td align="left">This is the nearest position in the document to the position where the\r
5379           mouse pointer was lingering.</td>\r
5380         </tr>\r
5381 \r
5382         <tr>\r
5383           <td align="left"><code>x, y</code></td>\r
5384 \r
5385           <td align="left">Where the pointer lingered. The <code>position</code> field is set to\r
5386           <code><a class="message"\r
5387           href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE</a>(x, y)</code>.</td>\r
5388         </tr>\r
5389       </tbody>\r
5390     </table>\r
5391     <br />\r
5392      <br />\r
5393 \r
5394     <p><b id="SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</b><br />\r
5395      <b id="SCI_GETMOUSEDWELLTIME">SCI_GETMOUSEDWELLTIME</b><br />\r
5396      These two messages set and get the time the mouse must sit still, in milliseconds, to generate\r
5397     a <code><a class="message" href="#SCN_DWELLSTART">SCN_DWELLSTART</a></code> notification. If\r
5398     set to <code>SC_TIME_FOREVER</code>, the default, no dwell events are generated.</p>\r
5399 \r
5400     <p><b id="SCN_ZOOM">SCN_ZOOM</b><br />\r
5401      This notification is generated when the user zooms the display using the keyboard or the\r
5402     <code><a class="message" href="#SCI_SETZOOM">SCI_SETZOOM</a></code> method is called. This\r
5403     notification can be used to recalculate positions, such as the width of the line number margin\r
5404     to maintain sizes in terms of characters rather than pixels. <code>SCNotification</code> has no\r
5405     additional information.</p>\r
5406 \r
5407     <p>\r
5408     <b id="SCN_HOTSPOTCLICK">SCN_HOTSPOTCLICK</b><br />\r
5409     <b id="SCN_HOTSPOTDOUBLECLICK">SCN_HOTSPOTDOUBLECLICK</b><br />\r
5410      These notifications are generated when the user clicks or double clicks on\r
5411      text that is in a style with the hotspot attribute set.\r
5412     This notification can be used to link to variable definitions or web pages.\r
5413     The <code>position</code> field is set the text position of the click or\r
5414     double click and the <code>modifiers</code> field set to the key modifiers\r
5415     held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.</p>\r
5416 \r
5417     <p>\r
5418     <b id="SCN_INDICATORCLICK">SCN_INDICATORCLICK</b><br />\r
5419     <b id="SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</b><br />\r
5420      These notifications are generated when the user clicks or releases the mouse on\r
5421      text that has an indicator.\r
5422     The <code>position</code> field is set the text position of the click or\r
5423     double click and the <code>modifiers</code> field set to the key modifiers\r
5424     held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.</p>\r
5425 \r
5426     <p><b id="SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</b><br />\r
5427      This notification is generated when the user clicks on a calltip.\r
5428     This notification can be used to display the next function prototype when a\r
5429     function name is overloaded with different arguments.\r
5430     The <code>position</code> field is set to 1 if the click is in an up arrow,\r
5431     2 if in a down arrow, and 0 if elsewhere.</p>\r
5432 \r
5433     <p><b id="SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</b><br />\r
5434      The user has selected an item in an <a class="jump" href="#Autocompletion">autocompletion list</a>. The\r
5435      notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a\r
5436      <code><a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a></code> message\r
5437      before returning from the notification. The <code>SCNotification</code> fields used are:</p>\r
5438 \r
5439     <table cellpadding="1" cellspacing="2" border="0" summary="Autocompletion list notification">\r
5440       <tbody>\r
5441         <tr>\r
5442           <th align="left">Field</th>\r
5443 \r
5444           <th align="left">Usage</th>\r
5445         </tr>\r
5446       </tbody>\r
5447 \r
5448       <tbody valign="top">\r
5449         <tr>\r
5450           <td align="left"><code>lParam</code></td>\r
5451 \r
5452           <td align="left">The start position of the word being completed.</td>\r
5453         </tr>\r
5454         <tr>\r
5455           <td align="left"><code>text</code></td>\r
5456 \r
5457           <td align="left">The text of the selection.</td>\r
5458         </tr>\r
5459       </tbody>\r
5460     </table>\r
5461 \r
5462     <p><b id="SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</b><br />\r
5463      The user has cancelled an <a class="jump" href="#Autocompletion">autocompletion list</a>.\r
5464      There is no other information in SCNotification.\r
5465 \r
5466     <h2 id="GTK">GTK+</h2>\r
5467     <p>On GTK+, the following functions create a Scintilla widget, communicate with it and allow\r
5468     resources to be released after all Scintilla widgets have been destroyed.</p>\r
5469     <code><a class="message" href="#scintilla_new">GtkWidget *scintilla_new()</a><br />\r
5470      <a class="message" href="#scintilla_set_id">void scintilla_set_id(ScintillaObject *sci, uptr_t id)</a><br />\r
5471      <a class="message" href="#scintilla_send_message">sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)</a><br />\r
5472      <a class="message" href="#scintilla_release_resources">void scintilla_release_resources()</a><br />\r
5473      </code>\r
5474 \r
5475     <p><b id="scintilla_new">GtkWidget *scintilla_new()</b></b><br />\r
5476     Create a new Scintilla widget. The returned pointer can be added to a container and displayed in the same way as other\r
5477     widgets.</p>\r
5478 \r
5479     <p><b id="scintilla_set_id">void scintilla_set_id(ScintillaObject *sci, uptr_t id)</b></b><br />\r
5480     Set the control ID which will be used in the idFrom field of the NotifyHeader structure of all\r
5481     notifications for this instance. When an application creates multiple Scintilla widgets, this allows\r
5482     the source of each notification to be found. The value should be small, preferrably less than 16 bits,\r
5483     rather than a pointer as some of the functions will only transmit 16 or 32 bits.</p>\r
5484 \r
5485     <p><b id="scintilla_send_message">sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)</b><br />\r
5486     The main entry point allows sending any of the messages described in this document.</p>\r
5487 \r
5488     <p><b id="scintilla_release_resources">void scintilla_release_resources()</b><br />\r
5489     Call this to free any remaining resources after all the Scintilla widgets have been destroyed.</p>\r
5490 \r
5491     <h2 id="DeprecatedMessages">Deprecated messages and notifications</h2>\r
5492 \r
5493     <p>The following messages are currently supported to emulate existing Windows controls, but\r
5494     they will be removed in future versions of Scintilla. If you use these messages you should\r
5495     replace them with the Scintilla equivalent.</p>\r
5496 <pre>\r
5497 WM_GETTEXT(int length, char *text)\r
5498 WM_SETTEXT(&lt;unused&gt;, const char *text)\r
5499 EM_GETLINE(int line, char *text)\r
5500 EM_REPLACESEL(&lt;unused&gt;, const char *text)\r
5501 EM_SETREADONLY\r
5502 EM_GETTEXTRANGE(&lt;unused&gt;, TEXTRANGE *tr)\r
5503 WM_CUT\r
5504 WM_COPY\r
5505 WM_PASTE\r
5506 WM_CLEAR\r
5507 WM_UNDO\r
5508 EM_CANUNDO\r
5509 EM_EMPTYUNDOBUFFER\r
5510 WM_GETTEXTLENGTH\r
5511 EM_GETFIRSTVISIBLELINE\r
5512 EM_GETLINECOUNT\r
5513 EM_GETMODIFY\r
5514 EM_SETMODIFY(bool isModified)\r
5515 EM_GETRECT(RECT *rect)\r
5516 EM_GETSEL(int *start, int *end)\r
5517 EM_EXGETSEL(&lt;unused&gt;, CHARRANGE *cr)\r
5518 EM_SETSEL(int start, int end)\r
5519 EM_EXSETSEL(&lt;unused&gt;, CHARRANGE *cr)\r
5520 EM_GETSELTEXT(&lt;unused&gt;, char *text)\r
5521 EM_LINEFROMCHAR(int position)\r
5522 EM_EXLINEFROMCHAR(int position)\r
5523 EM_LINEINDEX(int line)\r
5524 EM_LINELENGTH(int position)\r
5525 EM_SCROLL(int line)\r
5526 EM_LINESCROLL(int column, int line)\r
5527 EM_SCROLLCARET()\r
5528 EM_CANPASTE\r
5529 EM_CHARFROMPOS(&lt;unused&gt;, POINT *location)\r
5530 EM_POSFROMCHAR(int position, POINT *location)\r
5531 EM_SELECTIONTYPE\r
5532 EM_HIDESELECTION(bool hide)\r
5533 EM_FINDTEXT(int flags, FINDTEXTEX *ft)\r
5534 EM_FINDTEXTEX(int flags, FINDTEXTEX *ft)\r
5535 EM_GETMARGINS\r
5536 EM_SETMARGINS(EC_LEFTMARGIN or EC_RIGHTMARGIN or EC_USEFONTINFO, int val)\r
5537 EM_FORMATRANGE\r
5538 </pre>\r
5539 \r
5540     <p>The following are features that are only included if you define\r
5541     <code>INCLUDE_DEPRECATED_FEATURES</code> in <code>Scintilla.h</code>. To ensure future\r
5542     compatibility you should change them as indicated.</p>\r
5543 \r
5544     <p><b id="SCN_POSCHANGED">SCN_POSCHANGED()</b> Deprecated<br />\r
5545      Fired when the user moves the cursor to a different position in the text. Use <a\r
5546     class="message" href="#SCN_UPDATEUI"><code>SCN_UPDATEUI</code></a> instead.</p>\r
5547 \r
5548     <p><b id="SCN_CHECKBRACE">SCN_CHECKBRACE</b> Deprecated<br />\r
5549      Either the text or styling of the document has changed or the selection range has changed.\r
5550     This is replaced by <a class="message" href="#SCN_UPDATEUI"><code>SCN_UPDATEUI</code></a>. You\r
5551     can also use <code><a class="message" href="#SCN_MODIFIED">SCN_MODIFIED</a></code> for more\r
5552     detailed information on text and styling changes,</p>\r
5553 \r
5554     <h2 id="EditMessagesNeverSupportedByScintilla">Edit messages never supported by Scintilla</h2>\r
5555 <pre>\r
5556 EM_GETWORDBREAKPROC EM_GETWORDBREAKPROCEX\r
5557 EM_SETWORDBREAKPROC EM_SETWORDBREAKPROCEX\r
5558 EM_GETWORDWRAPMODE EM_SETWORDWRAPMODE\r
5559 EM_LIMITTEXT EM_EXLIMITTEXT\r
5560 EM_SETRECT EM_SETRECTNP\r
5561 EM_FMTLINES\r
5562 EM_GETHANDLE EM_SETHANDLE\r
5563 EM_GETPASSWORDCHAR EM_SETPASSWORDCHAR\r
5564 EM_SETTABSTOPS\r
5565 EM_FINDWORDBREAK\r
5566 EM_GETCHARFORMAT EM_SETCHARFORMAT\r
5567 EM_GETOLEINTERFACE EM_SETOLEINTERFACE\r
5568 EM_SETOLECALLBACK\r
5569 EM_GETPARAFORMAT EM_SETPARAFORMAT\r
5570 EM_PASTESPECIAL\r
5571 EM_REQUESTRESIZE\r
5572 EM_GETBKGNDCOLOR EM_SETBKGNDCOLOR\r
5573 EM_STREAMIN EM_STREAMOUT\r
5574 EM_GETIMECOLOR EM_SETIMECOLOR\r
5575 EM_GETIMEOPTIONS EM_SETIMEOPTIONS\r
5576 EM_GETOPTIONS EM_SETOPTIONS\r
5577 EM_GETPUNCTUATION EM_SETPUNCTUATION\r
5578 EM_GETTHUMB\r
5579 EM_GETEVENTMASK\r
5580 EM_SETEVENTMASK\r
5581 EM_DISPLAYBAND\r
5582 EM_SETTARGETDEVICE\r
5583 </pre>\r
5584 \r
5585     <p>Scintilla tries to be a superset of the standard windows Edit and RichEdit controls wherever\r
5586     that makes sense. As it is not intended for use in a word processor, some edit messages can not\r
5587     be sensibly handled. Unsupported messages have no effect.</p>\r
5588 \r
5589     <h2 id="BuildingScintilla">Building Scintilla</h2>\r
5590 \r
5591     <p>To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE\r
5592     directories. For Windows, GCC 3.2, Borland C++ or Microsoft Visual Studio .NET can be used\r
5593     for building. There is a make file for building Scintilla but not SciTE with Visual C++ 6 at\r
5594     scintilla/win32/scintilla_vc6.mak. For GTK+, GCC 3.1 should be used. GTK+ 1.2x and 2.0x are\r
5595     supported. The version of GTK+ installed should be detected automatically.\r
5596     When both GTK+ 1 and GTK+ 2 are present, building for GTK+ 1.x requires defining GTK1\r
5597     on the command line.</p>\r
5598 \r
5599     <h3>Static linking</h3>\r
5600 \r
5601     <p>On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to\r
5602     link Scintilla directly into your application .EXE or .DLL file, then the\r
5603     <code>STATIC_BUILD</code> preprocessor symbol should be defined and\r
5604     <code>Scintilla_RegisterClasses</code> called. <code>STATIC_BUILD</code> prevents compiling the\r
5605     <code>DllMain</code> function which will conflict with any <code>DllMain</code> defined in your\r
5606     code. <code>Scintilla_RegisterClasses</code> takes the <code>HINSTANCE</code> of your\r
5607     application and ensures that the "Scintilla" window class is registered. To make sure that the\r
5608     right pointing arrow cursor used in the margin is displayed by Scintilla add the\r
5609     <code>scintilla/win32/Margin.cur</code> file to your application's resources with the ID\r
5610     <code>IDC_MARGIN</code> which is defined in <code>scintilla/win32/platfromRes.h</code> as\r
5611     400.</p>\r
5612 \r
5613     <h3>Ensuring lexers are linked into Scintilla</h3>\r
5614 \r
5615     <p>Depending on the compiler and linker used, the lexers may be stripped out. This is most\r
5616     often caused when building a static library. To ensure the lexers are linked in, the\r
5617     <code>Scintilla_LinkLexers()</code> function may be called.</p>\r
5618 \r
5619     <h3>Changing set of lexers</h3>\r
5620 \r
5621     <p>To change the set of lexers in Scintilla, add and remove lexer source files\r
5622     (<code>Lex*.cxx</code>) from the <code>scintilla/src directory</code> and run the\r
5623     <code>src/LexGen.py</code> script from the <code>src</code> directory to update the make files\r
5624     and <code>KeyWords.cxx</code>. <code>LexGen.py</code> requires Python 2.1 or later. If you do\r
5625     not have access to Python, you can hand edit <code>KeyWords.cxx</code> in a simple-minded way,\r
5626     following the patterns of other lexers. The important thing is to include\r
5627     <code>LINK_LEXER(lmMyLexer);</code> to correspond with the <code>LexerModule\r
5628     lmMyLexer(...);</code> in your lexer source code.</p>\r
5629 \r
5630     <h3>Building with an alternative Regular Expression implementation</h3>\r
5631 \r
5632  <p id="AlternativeRegEx">A simple interface provides support for switching the Regular Expressions engine at\r
5633  compile time. You must implement <code>RegexSearchBase</code> for your chosen engine,\r
5634  look at the built-in implementation <code>BuiltinRegex</code> to see how this is done.\r
5635  You then need to implement the factory method <code>CreateRegexSearch</code>\r
5636  to create an instance of your class. You must disable the built-in implementation by defining\r
5637  <code>SCI_OWNREGEX</code>.</p>\r
5638 \r
5639   </body>\r
5640 </html>\r
5641 \r