--- /dev/null
+<?xml version="1.0"?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+ <head>\r
+ <meta name="generator"\r
+ content="HTML Tidy for Windows (vers 1st August 2002), see www.w3.org" />\r
+ <meta name="generator" content="SciTE" />\r
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\r
+\r
+ <title>Scintilla and SciTE</title>\r
+\r
+ <style type="text/css">\r
+<!--\r
+/*<![CDATA[*/\r
+ CODE { font-family: "Courier New", monospace; }\r
+ A:visited { color: blue; }\r
+ A:hover { text-decoration: underline ! important; }\r
+ A.message { text-decoration: none; font-family: "Courier New", monospace; }\r
+ A.toc { text-decoration: none; }\r
+ A.jump { text-decoration: none; }\r
+/*]]>*/\r
+-->\r
+ </style>\r
+ </head>\r
+\r
+ <body bgcolor="#FFFFFF" text="#000000">\r
+ <table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0"\r
+ summary="Banner">\r
+ <tr>\r
+ <td><img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" /></td>\r
+\r
+ <td><a href="index.html"\r
+ style="color:white;text-decoration:none;font-size:200%">Scintilla</a></td>\r
+ </tr>\r
+ </table>\r
+\r
+ <h1>Scintilla Documentation</h1>\r
+\r
+ <p>Last edited 20/June/2007 NH</p>\r
+\r
+ <p>There is <a class="jump" href="Design.html">an overview of the internal design of\r
+ Scintilla</a>.<br />\r
+ <a class="jump" href="ScintillaUsage.html">Some notes on using Scintilla</a>.<br />\r
+ <a class="jump" href="Steps.html">How to use the Scintilla Edit Control on Windows</a>.<br />\r
+ <a class="jump" href="http://www.scintilla.org/dmapp.zip">A simple sample using Scintilla from\r
+ C++ on Windows</a>.<br />\r
+ <a class="jump" href="http://www.scintilla.org/SciTry.vb">A simple sample using Scintilla from\r
+ Visual Basic</a>.<br />\r
+ <a class="jump" href="http://www.scintilla.org/bait.zip">Bait is a tiny sample using Scintilla\r
+ on GTK+</a>.<br />\r
+ <a class="jump" href="Lexer.txt">A detailed description of how to write a lexer, including a\r
+ discussion of folding</a>.<br />\r
+ <a class="jump" href="http://sphere.sourceforge.net/flik/docs/scintilla-container_lexer.html">\r
+ How to implement a lexer in the container</a>.<br />\r
+ <a class="jump" href="http://sphere.sourceforge.net/flik/docs/scintilla-folding.html">\r
+ How to implement folding</a>.<br />\r
+ The <a class="jump" href="SciCoding.html">coding style</a> used in Scintilla and SciTE is\r
+ worth following if you want to contribute code to Scintilla but is not compulsory.</p>\r
+\r
+ <h2>Introduction</h2>\r
+\r
+ <p>The Windows version of Scintilla is a Windows Control. As such, its primary programming\r
+ interface is through Windows messages. Early versions of Scintilla emulated much of the API\r
+ defined by the standard Windows Edit and RichEdit controls but those APIs are now deprecated in\r
+ favour of Scintilla's own, more consistent API. In addition to messages performing the actions\r
+ of a normal Edit control, Scintilla allows control of syntax styling, folding, markers, autocompletion\r
+ and call tips.</p>\r
+\r
+ <p>The GTK+ version also uses messages in a similar way to the Windows version. This is\r
+ different to normal GTK+ practice but made it easier to implement rapidly.</p>\r
+\r
+ <p>This documentation describes the individual messages and notifications used by Scintilla. It\r
+ does not describe how to link them together to form a useful editor. For now, the best way to\r
+ work out how to develop using Scintilla is to see how SciTE uses it. SciTE exercises most of\r
+ Scintilla's facilities.</p>\r
+\r
+ <p>In the descriptions that follow, the messages are described as function calls with zero, one\r
+ or two arguments. These two arguments are the standard <code>wParam</code> and\r
+ <code>lParam</code> familiar to Windows programmers. These parameters are integers that\r
+ are large enough to hold pointers, and the return value is also an integer large enough to contain a\r
+ pointer.\r
+ Although the commands only use the\r
+ arguments described, because all messages have two arguments whether Scintilla uses them or\r
+ not, it is strongly recommended that any unused arguments are set to 0. This allows future\r
+ enhancement of messages without the risk of breaking existing code. Common argument types\r
+ are:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Common argument types">\r
+ <tbody valign="top">\r
+ <tr>\r
+ <th align="left">bool</th>\r
+\r
+ <td>Arguments expect the values 0 for <code>false</code> and 1 for\r
+ <code>true</code>.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left">int</th>\r
+\r
+ <td>Arguments are 32-bit signed integers.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left">const char *</th>\r
+\r
+ <td>Arguments point at text that is being passed to Scintilla but not modified. The text\r
+ may be zero terminated or another argument may specify the character count, the\r
+ description will make this clear.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left">char *</th>\r
+\r
+ <td>Arguments point at text buffers that Scintilla will fill with text. In some cases,\r
+ another argument will tell Scintilla the buffer size. In others, you must make sure that\r
+ the buffer is big enough to hold the requested text. If a NULL pointer (0) is passed\r
+ then, for SCI_* calls, the length that should be allocated is returned.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left" id="colour">colour</th>\r
+\r
+ <td>Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour\r
+ is set in the range 0 to 255. If you have three such intensities, they are combined as:\r
+ red | (green << 8) | (blue << 16). If you set all intensities to 255, the\r
+ colour is white. If you set all intensities to 0, the colour is black. When you set a\r
+ colour, you are making a request. What you will get depends on the capabilities of the\r
+ system and the current screen mode.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left" id="alpha">alpha</th>\r
+\r
+ <td>Translucency is set using an alpha value.\r
+ Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to\r
+ 255 (SC_ALPHA_OPAQUE) which is opaque. The value 256 (SC_ALPHA_NOALPHA)\r
+ is opaque and uses code that is not alpha-aware and may be faster. Not all platforms support\r
+ translucency and only some Scintilla features implement translucency.\r
+ The default alpha value for most features is SC_ALPHA_NOALPHA.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><unused></th>\r
+\r
+ <td>This is an unused argument. Setting it to 0 will ensure compatibility with future\r
+ enhancements.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <h2 id="MessageCategories">Contents</h2>\r
+\r
+ <table cellpadding="4" cellspacing="2" border="0" summary="Message categories">\r
+ <tbody>\r
+ <tr>\r
+ <td>o <a class="toc" href="#TextRetrievalAndModification">Text retrieval and\r
+ modification</a></td>\r
+\r
+ <td>o <a class="toc" href="#Searching">Searching and replacing</a></td>\r
+\r
+ <td>o <a class="toc" href="#Overtype">Overtype</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#CutCopyAndPaste">Cut, copy and paste</a></td>\r
+\r
+ <td>o <a class="toc" href="#ErrorHandling">Error handling</a></td>\r
+\r
+ <td>o <a class="toc" href="#UndoAndRedo">Undo and Redo</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#SelectionAndInformation">Selection and information</a></td>\r
+\r
+ <td>o <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic\r
+ scrolling</a></td>\r
+\r
+ <td>o <a class="toc" href="#WhiteSpace">White space</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#Cursor">Cursor</a></td>\r
+\r
+ <td>o <a class="toc" href="#MouseCapture">Mouse capture</a></td>\r
+\r
+ <td>o <a class="toc" href="#LineEndings">Line endings</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#Styling">Styling</a></td>\r
+\r
+ <td>o <a class="toc" href="#StyleDefinition">Style definition</a></td>\r
+\r
+ <td>o <a class="toc" href="#CaretAndSelectionStyles">Caret, selection, and hotspot styles</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#Margins">Margins</a></td>\r
+\r
+ <td>o <a class="toc" href="#OtherSettings">Other settings</a></td>\r
+\r
+ <td>o <a class="toc" href="#BraceHighlighting">Brace highlighting</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation\r
+ Guides</a></td>\r
+\r
+ <td>o <a class="toc" href="#Markers">Markers</a></td>\r
+\r
+ <td>o <a class="toc" href="#Indicators">Indicators</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td>\r
+\r
+ <td>o <a class="toc" href="#UserLists">User lists</a></td>\r
+\r
+ <td>o <a class="toc" href="#CallTips">Call tips</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td>\r
+\r
+ <td>o <a class="toc" href="#KeyBindings">Key bindings</a></td>\r
+\r
+ <td>o <a class="toc" href="#PopupEditMenu">Popup edit menu</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#MacroRecording">Macro recording</a></td>\r
+\r
+ <td>o <a class="toc" href="#Printing">Printing</a></td>\r
+\r
+ <td>o <a class="toc" href="#DirectAccess">Direct access</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#MultipleViews">Multiple views</a></td>\r
+\r
+ <td>o <a class="toc" href="#Folding">Folding</a></td>\r
+\r
+ <td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#Zooming">Zooming</a></td>\r
+\r
+ <td>o <a class="toc" href="#LongLines">Long lines</a></td>\r
+\r
+ <td>o <a class="toc" href="#Lexer">Lexer</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#Notifications">Notifications</a></td>\r
+\r
+ <td>o <a class="toc" href="#GTK">GTK+</a></td>\r
+\r
+ <td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>o <a class="toc" href="#EditMessagesNeverSupportedByScintilla">Edit messages never\r
+ supported by Scintilla</a></td>\r
+\r
+ <td>o <a class="toc" href="#BuildingScintilla">Building Scintilla</a></td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>Messages with names of the form <code>SCI_SETxxxxx</code> often have a companion\r
+ <code>SCI_GETxxxxx</code>. To save tedious repetition, if the <code>SCI_GETxxxxx</code> message\r
+ returns the value set by the <code>SCI_SETxxxxx</code> message, the <code>SET</code> routine is\r
+ described and the <code>GET</code> routine is left to your imagination.</p>\r
+\r
+ <h2 id="TextRetrievalAndModification">Text retrieval and modification</h2>\r
+\r
+ <p>Each character in a Scintilla document is followed by an associated byte of styling\r
+ information. The combination of a character byte and a style byte is called a cell. Style bytes\r
+ are interpreted an index into an array of styles.\r
+ Style bytes may be split into an index and a set of indicator bits\r
+ but this use is discouraged and indicators should now use\r
+ <a class="message" href ="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a>\r
+ and related calls.\r
+ The default split is with the index in the low 5 bits and 3 high bits as <a class="jump"\r
+ href="#Indicators">indicators</a>. This allows 32 fundamental styles, which is enough for most\r
+ languages, and three independent indicators so that, for example, syntax errors, deprecated\r
+ names and bad indentation could all be displayed at once. The number of bits used for styles\r
+ can be altered with <a class="message"\r
+ href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> up to a maximum of 7 bits.\r
+ The remaining bits can be used for indicators.</p>\r
+\r
+ <p>Positions within the Scintilla document refer to a character or the gap before that\r
+ character. The first character in a document is 0, the second 1 and so on. If a document\r
+ contains <code>nLen</code> characters, the last character is numbered <code>nLen</code>-1.\r
+ The caret exists between character positions and can be located from before the first character (0)\r
+ to after the last character (<code>nLen</code>).</p>\r
+\r
+ <p>There are places where the caret can not go where two character bytes make up one character.\r
+ This occurs when a DBCS character from a language like Japanese is included in the document or\r
+ when line ends are marked with the CP/M standard of a carriage return followed by a line feed.\r
+ The <code>INVALID_POSITION</code> constant (-1) represents an invalid position within the\r
+ document.</p>\r
+\r
+ <p>All lines of text in Scintilla are the same height, and this height is calculated from the\r
+ largest font in any current style. This restriction is for performance; if lines differed in\r
+ height then calculations involving positioning of text would require the text to be styled\r
+ first.</p>\r
+ <code><a class="message" href="#SCI_GETTEXT">SCI_GETTEXT(int length, char *text)</a><br />\r
+ <a class="message" href="#SCI_SETTEXT">SCI_SETTEXT(<unused>, const char *text)</a><br />\r
+ <a class="message" href="#SCI_SETSAVEPOINT">SCI_SETSAVEPOINT</a><br />\r
+ <a class="message" href="#SCI_GETLINE">SCI_GETLINE(int line, char *text)</a><br />\r
+ <a class="message" href="#SCI_REPLACESEL">SCI_REPLACESEL(<unused>, const char\r
+ *text)</a><br />\r
+ <a class="message" href="#SCI_SETREADONLY">SCI_SETREADONLY(bool readOnly)</a><br />\r
+ <a class="message" href="#SCI_GETREADONLY">SCI_GETREADONLY</a><br />\r
+ <a class="message" href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE(<unused>, TextRange\r
+ *tr)</a><br />\r
+ <a class="message" href="#SCI_ALLOCATE">SCI_ALLOCATE(int bytes, <unused>)</a><br />\r
+ <a class="message" href="#SCI_ADDTEXT">SCI_ADDTEXT(int length, const char *s)</a><br />\r
+ <a class="message" href="#SCI_ADDSTYLEDTEXT">SCI_ADDSTYLEDTEXT(int length, cell *s)</a><br />\r
+ <a class="message" href="#SCI_APPENDTEXT">SCI_APPENDTEXT(int length, const char *s)</a><br />\r
+ <a class="message" href="#SCI_INSERTTEXT">SCI_INSERTTEXT(int pos, const char *text)</a><br />\r
+ <a class="message" href="#SCI_CLEARALL">SCI_CLEARALL</a><br />\r
+ <a class="message" href="#SCI_CLEARDOCUMENTSTYLE">SCI_CLEARDOCUMENTSTYLE</a><br />\r
+ <a class="message" href="#SCI_GETCHARAT">SCI_GETCHARAT(int position)</a><br />\r
+ <a class="message" href="#SCI_GETSTYLEAT">SCI_GETSTYLEAT(int position)</a><br />\r
+ <a class="message" href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(<unused>, TextRange\r
+ *tr)</a><br />\r
+ <a class="message" href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</a><br />\r
+ <a class="message" href="#SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</a><br />\r
+ <a class="message" href="#SCI_TARGETASUTF8">SCI_TARGETASUTF8(<unused>, char *s)</a><br />\r
+ <a class="message" href="#SCI_ENCODEDFROMUTF8">SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)</a><br />\r
+ <a class="message" href="#SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_GETTEXT">SCI_GETTEXT(int length, char *text)</b><br />\r
+ This returns <code>length</code>-1 characters of text from the start of the document plus one\r
+ terminating 0 character. To collect all the text in a document, use <code>SCI_GETLENGTH</code>\r
+ to get the number of characters in the document (<code>nLen</code>), allocate a character\r
+ buffer of length <code>nLen+1</code> bytes, then call <code>SCI_GETTEXT(nLen+1, char\r
+ *text)</code>. If the text argument is 0 then the length that should be allocated to store the\r
+ entire document is returned.\r
+ If you then save the text, you should use <code>SCI_SETSAVEPOINT</code> to mark\r
+ the text as unmodified.</p>\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
+ class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"\r
+ href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>\r
+\r
+ <p><b id="SCI_SETTEXT">SCI_SETTEXT(<unused>, const char *text)</b><br />\r
+ This replaces all the text in the document with the zero terminated text string you pass\r
+ in.</p>\r
+\r
+ <p><b id="SCI_SETSAVEPOINT">SCI_SETSAVEPOINT</b><br />\r
+ This message tells Scintilla that the current state of the document is unmodified. This is\r
+ usually done when the file is saved or loaded, hence the name "save point". As Scintilla\r
+ performs undo and redo operations, it notifies the container that it has entered or left the\r
+ save point with <code><a class="message"\r
+ href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a></code> and <code><a class="message"\r
+ href="#SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</a></code> <a class="jump"\r
+ href="#Notifications">notification messages</a>, allowing the container to know if the file\r
+ should be considered dirty or not.</p>\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</a>, <a\r
+ class="message" href="#SCI_GETMODIFY">SCI_GETMODIFY</a></code></p>\r
+\r
+ <p><b id="SCI_GETLINE">SCI_GETLINE(int line, char *text)</b><br />\r
+ This fills the buffer defined by text with the contents of the nominated line (lines start at\r
+ 0). The buffer is not terminated by a 0 character. It is up to you to make sure that the buffer\r
+ is long enough for the text, use <a class="message"\r
+ href="#SCI_LINELENGTH"><code>SCI_LINELENGTH(int line)</code></a>. The returned value is the\r
+ number of characters copied to the buffer. The returned text includes any end of line\r
+ characters. If you ask for a line number outside the range of lines in the document, 0\r
+ characters are copied. If the text argument is 0 then the length that should be allocated\r
+ to store the entire line is returned.</p>\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a\r
+ class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a class="message"\r
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>, <a class="message"\r
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
+ href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>\r
+\r
+ <p><b id="SCI_REPLACESEL">SCI_REPLACESEL(<unused>, const char *text)</b><br />\r
+ The currently selected text between the <a class="jump" href="#SelectionAndInformation">anchor\r
+ and the current position</a> is replaced by the 0 terminated text string. If the anchor and\r
+ current position are the same, the text is inserted at the caret position. The caret is\r
+ positioned after the inserted text and the caret is scrolled into view.</p>\r
+\r
+ <p><b id="SCI_SETREADONLY">SCI_SETREADONLY(bool readOnly)</b><br />\r
+ <b id="SCI_GETREADONLY">SCI_GETREADONLY</b><br />\r
+ These messages set and get the read-only flag for the document. If you mark a document as read\r
+ only, attempts to modify the text cause the <a class="message"\r
+ href="#SCN_MODIFYATTEMPTRO"><code>SCN_MODIFYATTEMPTRO</code></a> notification.</p>\r
+\r
+ <p><b id="SCI_GETTEXTRANGE">SCI_GETTEXTRANGE(<unused>, <a class="jump"\r
+ href="#TextRange">TextRange</a> *tr)</b><br />\r
+ This collects the text between the positions <code>cpMin</code> and <code>cpMax</code> and\r
+ copies it to <code>lpstrText</code> (see <code>struct TextRange</code> in\r
+ <code>Scintilla.h</code>). If <code>cpMax</code> is -1, text is returned to the end of the\r
+ document. The text is 0 terminated, so you must supply a buffer that is at least 1 character\r
+ longer than the number of characters you wish to read. The return value is the length of the\r
+ returned text not including the terminating 0.</p>\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
+ href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"\r
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
+ href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>\r
+\r
+ <p><b id="SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(<unused>, <a class="jump"\r
+ href="#TextRange">TextRange</a> *tr)</b><br />\r
+ This collects styled text into a buffer using two bytes for each cell, with the character at\r
+ the lower address of each pair and the style byte at the upper address. Characters between the\r
+ positions <code>cpMin</code> and <code>cpMax</code> are copied to <code>lpstrText</code> (see\r
+ <code>struct TextRange</code> in <code>Scintilla.h</code>). Two 0 bytes are added to the end of\r
+ the text, so the buffer that <code>lpstrText</code> points at must be at least\r
+ <code>2*(cpMax-cpMin)+2</code> bytes long. No check is made for sensible values of\r
+ <code>cpMin</code> or <code>cpMax</code>. Positions outside the document return character codes\r
+ and style bytes of 0.</p>\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
+ href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a class="message"\r
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a>, <a class="message"\r
+ href="#SCI_GETTEXT">SCI_GETTEXT</a></code></p>\r
+\r
+ <p><b id="SCI_ALLOCATE">SCI_ALLOCATE(int bytes, <unused>)</b><br />\r
+ Allocate a document buffer large enough to store a given number of bytes.\r
+ The document will not be made smaller than its current contents.</p>\r
+\r
+ <p><b id="SCI_ADDTEXT">SCI_ADDTEXT(int length, const char *s)</b><br />\r
+ This inserts the first <code>length</code> characters from the string <code>s</code>\r
+ at the current position. This will include any 0's in the string that you might have expected\r
+ to stop the insert operation. The current position is set at the end of the inserted text,\r
+ but it is not scrolled into view.</p>\r
+\r
+ <p><b id="SCI_ADDSTYLEDTEXT">SCI_ADDSTYLEDTEXT(int length, cell *s)</b><br />\r
+ This behaves just like <code>SCI_ADDTEXT</code>, but inserts styled text.</p>\r
+\r
+ <p><b id="SCI_APPENDTEXT">SCI_APPENDTEXT(int length, const char *s)</b><br />\r
+ This adds the first <code>length</code> characters from the string <code>s</code> to the end\r
+ of the document. This will include any 0's in the string that you might have expected to stop\r
+ the operation. The current selection is not changed and the new text is not scrolled into\r
+ view.</p>\r
+\r
+ <p><b id="SCI_INSERTTEXT">SCI_INSERTTEXT(int pos, const char *text)</b><br />\r
+ This inserts the zero terminated <code>text</code> string at position <code>pos</code> or at\r
+ the current position if <code>pos</code> is -1. If the current position is after the insertion point\r
+ then it is moved along with its surrounding text but no scrolling is performed.</p>\r
+\r
+ <p><b id="SCI_CLEARALL">SCI_CLEARALL</b><br />\r
+ Unless the document is read-only, this deletes all the text.</p>\r
+\r
+ <p><b id="SCI_CLEARDOCUMENTSTYLE">SCI_CLEARDOCUMENTSTYLE</b><br />\r
+ When wanting to completely restyle the document, for example after choosing a lexer, the\r
+ <code>SCI_CLEARDOCUMENTSTYLE</code> can be used to clear all styling information and reset the\r
+ folding state.</p>\r
+\r
+ <p><b id="SCI_GETCHARAT">SCI_GETCHARAT(int pos)</b><br />\r
+ This returns the character at <code>pos</code> in the document or 0 if <code>pos</code> is\r
+ negative or past the end of the document.</p>\r
+\r
+ <p><b id="SCI_GETSTYLEAT">SCI_GETSTYLEAT(int pos)</b><br />\r
+ This returns the style at <code>pos</code> in the document, or 0 if <code>pos</code> is\r
+ negative or past the end of the document.</p>\r
+\r
+ <p><b id="SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</b><br />\r
+ <b id="SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</b><br />\r
+ This pair of routines sets and reads back the number of bits in each cell to use for styling,\r
+ to a maximum of 7 style bits. The remaining bits can be used as indicators. The standard\r
+ setting is <code>SCI_SETSTYLEBITS(5)</code>.\r
+ The number of styling bits needed by the current lexer can be found with\r
+ <a class="message" href="#SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</a>.</p>\r
+\r
+ <p><b id="TextRange">TextRange</b> and <b id="CharacterRange">CharacterRange</b><br />\r
+ These structures are defined to be exactly the same shape as the Win32 <code>TEXTRANGE</code>\r
+ and <code>CHARRANGE</code>, so that older code that treats Scintilla as a RichEdit will\r
+ work.</p>\r
+<pre>\r
+struct CharacterRange {\r
+ long cpMin;\r
+ long cpMax;\r
+};\r
+\r
+struct TextRange {\r
+ struct CharacterRange chrg;\r
+ char *lpstrText;\r
+};\r
+</pre>\r
+\r
+ <h3 id="EncodedAccess">GTK+-specific: Access to encoded text</h3>\r
+\r
+ <p><b id="SCI_TARGETASUTF8">SCI_TARGETASUTF8(<unused>, char *s)</b><br />\r
+ This method retrieves the value of the target encoded as UTF-8 which is the default\r
+ encoding of GTK+ so is useful for retrieving text for use in other parts of the user interface,\r
+ such as find and replace dialogs. The length of the encoded text in bytes is returned.\r
+ </p>\r
+\r
+ <p><b id="SCI_ENCODEDFROMUTF8">SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)</b><br />\r
+ <b id="SCI_SETLENGTHFORENCODE">SCI_SETLENGTHFORENCODE(int bytes)</b><br />\r
+ <code>SCI_ENCODEDFROMUTF8</code> converts a UTF-8 string into the document's\r
+ encoding which is useful for taking the results of a find dialog, for example, and receiving\r
+ a string of bytes that can be searched for in the document. Since the text can contain nul bytes,\r
+ the <code>SCI_SETLENGTHFORENCODE</code> method can be used to set the\r
+ length that will be converted. If set to -1, the length is determined by finding a nul byte.\r
+ The length of the converted string is returned.\r
+ </p>\r
+\r
+\r
+ <h2 id="Searching">Searching</h2>\r
+ <p>\r
+ There are methods to search for text and for regular expressions. The regular expression support\r
+ is limited and should only be used for simple cases and initial development. A different regular expression\r
+ library can be <a class="jump" href="#AlternativeRegEx">integrated into Scintilla</a>\r
+ or can be called from the container using direct access to the buffer contents through\r
+ <a class="jump" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a>.\r
+ </p>\r
+ <code><a class="message" href="#SCI_FINDTEXT">SCI_FINDTEXT(int flags, TextToFind\r
+ *ttf)</a><br />\r
+ <a class="message" href="#SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</a><br />\r
+ <a class="message" href="#SCI_SEARCHNEXT">SCI_SEARCHNEXT(int searchFlags, const char\r
+ *text)</a><br />\r
+ <a class="message" href="#SCI_SEARCHPREV">SCI_SEARCHPREV(int searchFlags, const char\r
+ *text)</a><br />\r
+ <a class="jump" href="#SearchAndReplaceUsingTheTarget">Search and replace using the\r
+ target</a><br />\r
+ </code>\r
+\r
+ <p><b id="searchFlags"><code>searchFlags</code></b><br />\r
+ Several of the search routines use flag options, which include a simple regular expression\r
+ search. Combine the flag options by adding them:</p>\r
+\r
+ <table border="0" summary="Search flags">\r
+ <tbody>\r
+ <tr>\r
+ <td><code>SCFIND_MATCHCASE</code></td>\r
+\r
+ <td>A match only occurs with text that matches the case of the search string.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCFIND_WHOLEWORD</code></td>\r
+\r
+ <td>A match only occurs if the characters before and after are not word characters.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCFIND_WORDSTART</code></td>\r
+\r
+ <td>A match only occurs if the character before is not a word character.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCFIND_REGEXP</code></td>\r
+\r
+ <td>The search string should be interpreted as a regular expression.</td>\r
+ </tr>\r
+ <tr>\r
+ <td><code>SCFIND_POSIX</code></td>\r
+\r
+ <td>Treat regular expression in a more POSIX compatible manner\r
+ by interpreting bare ( and ) for tagged sections rather than \( and \).</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>If <code>SCFIND_REGEXP</code> is not included in the <code>searchFlags</code>, you can\r
+ search backwards to find the previous occurrence of a search string by setting the end of the\r
+ search range before the start. If <code>SCFIND_REGEXP</code> is included, searches are always\r
+ from a lower position to a higher position, even if the search range is backwards.</p>\r
+\r
+ <p>In a regular expression, special characters interpreted are:</p>\r
+\r
+ <table border="0" summary="Regular expression synopsis">\r
+ <tbody>\r
+ <tr>\r
+ <td><code>.</code></td>\r
+\r
+ <td>Matches any character</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>\(</code></td>\r
+\r
+ <td>This marks the start of a region for tagging a match.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>\)</code></td>\r
+\r
+ <td>This marks the end of a tagged region.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>\n</code></td>\r
+\r
+ <td>Where <code>n</code> is 1 through 9 refers to the first through ninth tagged region\r
+ when replacing. For example, if the search string was <code>Fred\([1-9]\)XXX</code> and\r
+ the replace string was <code>Sam\1YYY</code>, when applied to <code>Fred2XXX</code> this\r
+ would generate <code>Sam2YYY</code>.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>\<</code></td>\r
+\r
+ <td>This matches the start of a word using Scintilla's definitions of words.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>\></code></td>\r
+\r
+ <td>This matches the end of a word using Scintilla's definition of words.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>\x</code></td>\r
+\r
+ <td>This allows you to use a character x that would otherwise have a special meaning. For\r
+ example, \[ would be interpreted as [ and not as the start of a character set.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>[...]</code></td>\r
+\r
+ <td>This indicates a set of characters, for example, [abc] means any of the characters a,\r
+ b or c. You can also use ranges, for example [a-z] for any lower case character.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>[^...]</code></td>\r
+\r
+ <td>The complement of the characters in the set. For example, [^A-Za-z] means any\r
+ character except an alphabetic character.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>^</code></td>\r
+\r
+ <td>This matches the start of a line (unless used inside a set, see above).</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>$</code></td>\r
+\r
+ <td>This matches the end of a line.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>*</code></td>\r
+\r
+ <td>This matches 0 or more times. For example, <code>Sa*m</code> matches <code>Sm</code>,\r
+ <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>+</code></td>\r
+\r
+ <td>This matches 1 or more times. For example, <code>Sa+m</code> matches\r
+ <code>Sam</code>, <code>Saam</code>, <code>Saaam</code> and so on.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_FINDTEXT">SCI_FINDTEXT(int searchFlags, <a class="jump"\r
+ href="#TextToFind">TextToFind</a> *ttf)</b><br />\r
+ This message searches for text in the document. It does not use or move the current selection.\r
+ The <a class="jump" href="#searchFlags"><code>searchFlags</code></a> argument controls the\r
+ search type, which includes regular expression searches.</p>\r
+\r
+ <p>The <code>TextToFind</code> structure is defined in <code>Scintilla.h</code>; set\r
+ <code>chrg.cpMin</code> and <code>chrg.cpMax</code> with the range of positions in the document\r
+ to search. If <code>SCFIND_REGEXP</code> is not included in the flags, you can search backwards by\r
+ setting <code>chrg.cpMax</code> less than <code>chrg.cpMin</code>. If <code>SCFIND_REGEXP</code>\r
+ is included, the search is always forwards (even if <code>chrg.cpMax</code> is less than <code>chrg.cpMin</code>).\r
+ Set the <code>lpstrText</code> member of <code>TextToFind</code> to point at a zero terminated\r
+ text string holding the search pattern. If your language makes the use of <code>TextToFind</code>\r
+ difficult, you should consider using <code>SCI_SEARCHINTARGET</code> instead.</p>\r
+\r
+ <p>The return value is -1 if the search fails or the position of the start of the found text if\r
+ it succeeds. The <code>chrgText.cpMin</code> and <code>chrgText.cpMax</code> members of\r
+ <code>TextToFind</code> are filled in with the start and end positions of the found text.</p>\r
+\r
+ <p>See also: <code><a class="message"\r
+ href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET</a></code></p>\r
+\r
+ <p><b id="TextToFind">TextToFind</b><br />\r
+ This structure is defined to have exactly the same shape as the Win32 structure\r
+ <code>FINDTEXTEX</code> for old code that treated Scintilla as a RichEdit control.</p>\r
+<pre>\r
+struct TextToFind {\r
+ struct <a class="jump" href="#CharacterRange">CharacterRange</a> chrg; // range to search\r
+ char *lpstrText; // the search pattern (zero terminated)\r
+ struct CharacterRange chrgText; // returned as position of matching text\r
+};\r
+</pre>\r
+\r
+ <p><b id="SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</b><br />\r
+ <b id="SCI_SEARCHNEXT">SCI_SEARCHNEXT(int searchFlags, const char *text)</b><br />\r
+ <b id="SCI_SEARCHPREV">SCI_SEARCHPREV(int searchFlags, const char *text)</b><br />\r
+ These messages provide relocatable search support. This allows multiple incremental\r
+ interactive searches to be macro recorded while still setting the selection to found text so\r
+ the find/select operation is self-contained. These three messages send <a class="message"\r
+ href="#SCN_MACRORECORD"><code>SCN_MACRORECORD</code></a> <a class="jump"\r
+ href="#Notifications">notifications</a> if macro recording is enabled.</p>\r
+\r
+ <p><code>SCI_SEARCHANCHOR</code> sets the search start point used by\r
+ <code>SCI_SEARCHNEXT</code> and <code>SCI_SEARCHPREV</code> to the start of the current\r
+ selection, that is, the end of the selection that is nearer to the start of the document. You\r
+ should always call this before calling either of <code>SCI_SEARCHNEXT</code> or\r
+ <code>SCI_SEARCHPREV</code>.</p>\r
+\r
+ <p><code>SCI_SEARCHNEXT</code> and <code>SCI_SEARCHPREV</code> search for the next and previous\r
+ occurrence of the zero terminated search string pointed at by text. The search is modified by\r
+ the <a class="jump" href="#searchFlags"><code>searchFlags</code></a>. If you request a regular\r
+ expression, <code>SCI_SEARCHPREV</code> finds the first occurrence of the search string in the\r
+ document, not the previous one before the anchor point.</p>\r
+\r
+ <p>The return value is -1 if nothing is found, otherwise the return value is the start position\r
+ of the matching text. The selection is updated to show the matched text, but is not scrolled\r
+ into view.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_SEARCHINTARGET"><code>SCI_SEARCHINTARGET</code></a>,\r
+ <a class="message" href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a></p>\r
+\r
+ <h3 id="SearchAndReplaceUsingTheTarget">Search and replace using the target</h3>\r
+\r
+ <p>Using <a class="message" href="#SCI_REPLACESEL"><code>SCI_REPLACESEL</code></a>,\r
+ modifications cause scrolling and other visible changes, which may take some time and cause\r
+ unwanted display updates. If performing many changes, such as a replace all command, the target\r
+ can be used instead. First, set the target, ie. the range to be replaced. Then call\r
+ <code>SCI_REPLACETARGET</code> or <code>SCI_REPLACETARGETRE</code>.</p>\r
+\r
+ <p>Searching can be performed within the target range with <code>SCI_SEARCHINTARGET</code>,\r
+ which uses a counted string to allow searching for null characters. It returns the length of\r
+ range or -1 for failure, in which case the target is not moved. The flags used by\r
+ <code>SCI_SEARCHINTARGET</code> such as <code>SCFIND_MATCHCASE</code>,\r
+ <code>SCFIND_WHOLEWORD</code>, <code>SCFIND_WORDSTART</code>, and <code>SCFIND_REGEXP</code>\r
+ can be set with <code>SCI_SETSEARCHFLAGS</code>. <code>SCI_SEARCHINTARGET</code> may be simpler\r
+ for some clients to use than <a class="message"\r
+ href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a>, as that requires using a pointer to a\r
+ structure.</p>\r
+ <code><a class="message" href="#SCI_SETTARGETSTART">SCI_SETTARGETSTART(int pos)</a><br />\r
+ <a class="message" href="#SCI_GETTARGETSTART">SCI_GETTARGETSTART</a><br />\r
+ <a class="message" href="#SCI_SETTARGETEND">SCI_SETTARGETEND(int pos)</a><br />\r
+ <a class="message" href="#SCI_GETTARGETEND">SCI_GETTARGETEND</a><br />\r
+ <a class="message" href="#SCI_TARGETFROMSELECTION">SCI_TARGETFROMSELECTION</a><br />\r
+ <a class="message" href="#SCI_SETSEARCHFLAGS">SCI_SETSEARCHFLAGS(int searchFlags)</a><br />\r
+ <a class="message" href="#SCI_GETSEARCHFLAGS">SCI_GETSEARCHFLAGS</a><br />\r
+ <a class="message" href="#SCI_SEARCHINTARGET">SCI_SEARCHINTARGET(int length, const char\r
+ *text)</a><br />\r
+ <a class="message" href="#SCI_REPLACETARGET">SCI_REPLACETARGET(int length, const char\r
+ *text)</a><br />\r
+ <a class="message" href="#SCI_REPLACETARGETRE">SCI_REPLACETARGETRE(int length, const char\r
+ *text)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETTARGETSTART">SCI_SETTARGETSTART(int pos)</b><br />\r
+ <b id="SCI_GETTARGETSTART">SCI_GETTARGETSTART</b><br />\r
+ <b id="SCI_SETTARGETEND">SCI_SETTARGETEND(int pos)</b><br />\r
+ <b id="SCI_GETTARGETEND">SCI_GETTARGETEND</b><br />\r
+ These functions set and return the start and end of the target. When searching in non-regular\r
+ expression mode, you can set start greater than end to find the last matching text in the\r
+ target rather than the first matching text. The target is also set by a successful\r
+ <code>SCI_SEARCHINTARGET</code>.</p>\r
+\r
+ <p><b id="SCI_TARGETFROMSELECTION">SCI_TARGETFROMSELECTION</b><br />\r
+ Set the target start and end to the start and end positions of the selection.</p>\r
+\r
+ <p><b id="SCI_SETSEARCHFLAGS">SCI_SETSEARCHFLAGS(int searchFlags)</b><br />\r
+ <b id="SCI_GETSEARCHFLAGS">SCI_GETSEARCHFLAGS</b><br />\r
+ These get and set the <a class="jump" href="#searchFlags"><code>searchFlags</code></a> used by\r
+ <code>SCI_SEARCHINTARGET</code>. There are several option flags including a simple regular\r
+ expression search.</p>\r
+\r
+ <p><b id="SCI_SEARCHINTARGET">SCI_SEARCHINTARGET(int length, const char *text)</b><br />\r
+ This searches for the first occurrence of a text string in the target defined by\r
+ <code>SCI_SETTARGETSTART</code> and <code>SCI_SETTARGETEND</code>. The text string is not zero\r
+ terminated; the size is set by <code>length</code>. The search is modified by the search flags\r
+ set by <code>SCI_SETSEARCHFLAGS</code>. If the search succeeds, the target is set to the found\r
+ text and the return value is the position of the start of the matching text. If the search\r
+ fails, the result is -1.</p>\r
+\r
+ <p><b id="SCI_REPLACETARGET">SCI_REPLACETARGET(int length, const char *text)</b><br />\r
+ If <code>length</code> is -1, <code>text</code> is a zero terminated string, otherwise\r
+ <code>length</code> sets the number of character to replace the target with.\r
+ After replacement, the target range refers to the replacement text.\r
+ The return value\r
+ is the length of the replacement string.<br />\r
+ Note that the recommended way to delete text in the document is to set the target to the text to be removed,\r
+ and to perform a replace target with an empty string.</p>\r
+\r
+ <p><b id="SCI_REPLACETARGETRE">SCI_REPLACETARGETRE(int length, const char *text)</b><br />\r
+ This replaces the target using regular expressions. If <code>length</code> is -1,\r
+ <code>text</code> is a zero terminated string, otherwise <code>length</code> is the number of\r
+ characters to use. The replacement string is formed from the text string with any sequences of\r
+ <code>\1</code> through <code>\9</code> replaced by tagged matches from the most recent regular\r
+ expression search.\r
+ After replacement, the target range refers to the replacement text.\r
+ The return value is the length of the replacement string.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_FINDTEXT"><code>SCI_FINDTEXT</code></a></p>\r
+\r
+ <h2 id="Overtype">Overtype</h2>\r
+\r
+ <p><b id="SCI_SETOVERTYPE">SCI_SETOVERTYPE(bool overType)</b><br />\r
+ <b id="SCI_GETOVERTYPE">SCI_GETOVERTYPE</b><br />\r
+ When overtype is enabled, each typed character replaces the character to the right of the text\r
+ caret. When overtype is disabled, characters are inserted at the caret.\r
+ <code>SCI_GETOVERTYPE</code> returns <code>TRUE</code> (1) if overtyping is active, otherwise\r
+ <code>FALSE</code> (0) will be returned. Use <code>SCI_SETOVERTYPE</code> to set the overtype\r
+ mode.</p>\r
+\r
+ <h2 id="CutCopyAndPaste">Cut, copy and paste</h2>\r
+\r
+ <code><a class="message" href="#SCI_CUT">SCI_CUT</a><br />\r
+ <a class="message" href="#SCI_COPY">SCI_COPY</a><br />\r
+ <a class="message" href="#SCI_PASTE">SCI_PASTE</a><br />\r
+ <a class="message" href="#SCI_CLEAR">SCI_CLEAR</a><br />\r
+ <a class="message" href="#SCI_CANPASTE">SCI_CANPASTE</a><br />\r
+ <a class="message" href="#SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</a><br />\r
+ <a class="message" href="#SCI_COPYTEXT">SCI_COPYTEXT(int length,\r
+ const char *text)</a><br />\r
+ <a class="message" href="#SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</a><br />\r
+ <a class="message" href="#SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</a><br />\r
+ <a class="message" href="#SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_CUT">SCI_CUT</b><br />\r
+ <b id="SCI_COPY">SCI_COPY</b><br />\r
+ <b id="SCI_PASTE">SCI_PASTE</b><br />\r
+ <b id="SCI_CLEAR">SCI_CLEAR</b><br />\r
+ <b id="SCI_CANPASTE">SCI_CANPASTE</b><br />\r
+ <b id="SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</b><br />\r
+ These commands perform the standard tasks of cutting and copying data to the clipboard,\r
+ pasting from the clipboard into the document, and clearing the document.\r
+ <code>SCI_CANPASTE</code> returns non-zero if the document isn't read-only and if the selection\r
+ doesn't contain protected text. If you need a "can copy" or "can cut", use\r
+ <code>SCI_GETSELECTIONSTART()-SCI_GETSELECTIONEND()</code>, which will be non-zero if you can\r
+ copy or cut to the clipboard.</p>\r
+\r
+ <p>GTK+ does not really support <code>SCI_CANPASTE</code> and always returns <code>TRUE</code>\r
+ unless the document is read-only.</p>\r
+\r
+ <p>On X, the clipboard is asynchronous and may require several messages between\r
+ the destination and source applications. Data from SCI_PASTE will not arrive in the\r
+ document immediately.</p>\r
+\r
+ <p><code>SCI_COPYALLOWLINE</code> works the same as SCI_COPY except that if the\r
+ selection is empty then the current line is copied. On Windows, an extra "MSDEVLineSelect" marker\r
+ is added to the clipboard which is then used in <code>SCI_PASTE</code> to paste\r
+ the whole line before the current line.</p>\r
+\r
+ <b id="SCI_COPYRANGE">SCI_COPYRANGE(int start, int end)</b><br />\r
+ <b id="SCI_COPYTEXT">SCI_COPYTEXT(int length, const char *text)</b><br />\r
+ <p><code>SCI_COPYRANGE</code> copies a range of text from the document to\r
+ the system clipboard and <code>SCI_COPYTEXT</code> copies a supplied piece of\r
+ text to the system clipboard.</p>\r
+\r
+ <p><b id="SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</b><br />\r
+ <b id="SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS</b><br />\r
+ If this property is set then when text is pasted any line ends are converted to match the document's\r
+ end of line mode as set with\r
+ <a class="message" href="#SCI_SETEOLMODE">SCI_SETEOLMODE</a>.\r
+ Currently only changeable on Windows. On GTK+ pasted text is always converted.</p>\r
+\r
+ <h2 id="ErrorHandling">Error handling</h2>\r
+\r
+ <p><b id="SCI_SETSTATUS">SCI_SETSTATUS(int status)</b><br />\r
+ <b id="SCI_GETSTATUS">SCI_GETSTATUS</b><br />\r
+ If an error occurs, Scintilla may set an internal error number that can be retrieved with\r
+ <code>SCI_GETSTATUS</code>. Not currently used but will be in the future. To clear the error\r
+ status call <code>SCI_SETSTATUS(0)</code>.</p>\r
+\r
+ <h2 id="UndoAndRedo">Undo and Redo</h2>\r
+\r
+ <p>Scintilla has multiple level undo and redo. It will continue to collect undoable actions\r
+ until memory runs out. Scintilla saves actions that change the document. Scintilla does not\r
+ save caret and selection movements, view scrolling and the like. Sequences of typing or\r
+ deleting are compressed into single transactions to make it easier to undo and redo at a sensible\r
+ level of detail. Sequences of actions can be combined into transactions that are undone as a unit.\r
+ These sequences occur between <code>SCI_BEGINUNDOACTION</code> and\r
+ <code>SCI_ENDUNDOACTION</code> messages. These transactions can be nested and only the top-level\r
+ sequences are undone as units.</p>\r
+ <code><a class="message" href="#SCI_UNDO">SCI_UNDO</a><br />\r
+ <a class="message" href="#SCI_CANUNDO">SCI_CANUNDO</a><br />\r
+ <a class="message" href="#SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</a><br />\r
+ <a class="message" href="#SCI_REDO">SCI_REDO</a><br />\r
+ <a class="message" href="#SCI_CANREDO">SCI_CANREDO</a><br />\r
+ <a class="message" href="#SCI_SETUNDOCOLLECTION">SCI_SETUNDOCOLLECTION(bool\r
+ collectUndo)</a><br />\r
+ <a class="message" href="#SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION</a><br />\r
+ <a class="message" href="#SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</a><br />\r
+ <a class="message" href="#SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_UNDO">SCI_UNDO</b><br />\r
+ <b id="SCI_CANUNDO">SCI_CANUNDO</b><br />\r
+ <code>SCI_UNDO</code> undoes one action, or if the undo buffer has reached a\r
+ <code>SCI_ENDUNDOACTION</code> point, all the actions back to the corresponding\r
+ <code>SCI_BEGINUNDOACTION</code>.</p>\r
+\r
+ <p><code>SCI_CANUNDO</code> returns 0 if there is nothing to undo, and 1 if there is. You would\r
+ typically use the result of this message to enable/disable the Edit menu Undo command.</p>\r
+\r
+ <p><b id="SCI_REDO">SCI_REDO</b><br />\r
+ <b id="SCI_CANREDO">SCI_CANREDO</b><br />\r
+ <code>SCI_REDO</code> undoes the effect of the last <code>SCI_UNDO</code> operation.</p>\r
+\r
+ <p><code>SCI_CANREDO</code> returns 0 if there is no action to redo and 1 if there are undo\r
+ actions to redo. You could typically use the result of this message to enable/disable the Edit\r
+ menu Redo command.</p>\r
+\r
+ <p><b id="SCI_EMPTYUNDOBUFFER">SCI_EMPTYUNDOBUFFER</b><br />\r
+ This command tells Scintilla to forget any saved undo or redo history. It also sets the save\r
+ point to the start of the undo buffer, so the document will appear to be unmodified. This does\r
+ not cause the <code><a class="message"\r
+ href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a></code> notification to be sent to the\r
+ container.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a></p>\r
+\r
+ <p><b id="SCI_SETUNDOCOLLECTION">SCI_SETUNDOCOLLECTION(bool collectUndo)</b><br />\r
+ <b id="SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION</b><br />\r
+ You can control whether Scintilla collects undo information with\r
+ <code>SCI_SETUNDOCOLLECTION</code>. Pass in <code>true</code> (1) to collect information and\r
+ <code>false</code> (0) to stop collecting. If you stop collection, you should also use\r
+ <code>SCI_EMPTYUNDOBUFFER</code> to avoid the undo buffer being unsynchronized with the data in\r
+ the buffer.</p>\r
+\r
+ <p>You might wish to turn off saving undo information if you use the Scintilla to store text\r
+ generated by a program (a Log view) or in a display window where text is often deleted and\r
+ regenerated.</p>\r
+\r
+ <p><b id="SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</b><br />\r
+ <b id="SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</b><br />\r
+ Send these two messages to Scintilla to mark the beginning and end of a set of operations that\r
+ you want to undo all as one operation but that you have to generate as several operations.\r
+ Alternatively, you can use these to mark a set of operations that you do not want to have\r
+ combined with the preceding or following operations if they are undone.</p>\r
+\r
+ <h2 id="SelectionAndInformation">Selection and information</h2>\r
+\r
+ <p>Scintilla maintains a selection that stretches between two points, the anchor and the\r
+ current position. If the anchor and the current position are the same, there is no selected\r
+ text. Positions in the document range from 0 (before the first character), to the document size\r
+ (after the last character). If you use messages, there is nothing to stop you setting a\r
+ position that is in the middle of a CRLF pair, or in the middle of a 2 byte character. However,\r
+ keyboard commands will not move the caret into such positions.</p>\r
+ <code><a class="message" href="#SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</a><br />\r
+ <a class="message" href="#SCI_GETLENGTH">SCI_GETLENGTH</a><br />\r
+ <a class="message" href="#SCI_GETLINECOUNT">SCI_GETLINECOUNT</a><br />\r
+ <a class="message" href="#SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</a><br />\r
+ <a class="message" href="#SCI_LINESONSCREEN">SCI_LINESONSCREEN</a><br />\r
+ <a class="message" href="#SCI_GETMODIFY">SCI_GETMODIFY</a><br />\r
+ <a class="message" href="#SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</a><br />\r
+ <a class="message" href="#SCI_GOTOPOS">SCI_GOTOPOS(int position)</a><br />\r
+ <a class="message" href="#SCI_GOTOLINE">SCI_GOTOLINE(int line)</a><br />\r
+ <a class="message" href="#SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int position)</a><br />\r
+ <a class="message" href="#SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</a><br />\r
+ <a class="message" href="#SCI_SETANCHOR">SCI_SETANCHOR(int position)</a><br />\r
+ <a class="message" href="#SCI_GETANCHOR">SCI_GETANCHOR</a><br />\r
+ <a class="message" href="#SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int position)</a><br />\r
+ <a class="message" href="#SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</a><br />\r
+ <a class="message" href="#SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int position)</a><br />\r
+ <a class="message" href="#SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</a><br />\r
+ <a class="message" href="#SCI_SELECTALL">SCI_SELECTALL</a><br />\r
+ <a class="message" href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int position)</a><br />\r
+ <a class="message" href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</a><br />\r
+ <a class="message" href="#SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</a><br />\r
+ <a class="message" href="#SCI_LINELENGTH">SCI_LINELENGTH(int line)</a><br />\r
+ <a class="message" href="#SCI_GETCOLUMN">SCI_GETCOLUMN(int position)</a><br />\r
+ <a class="message" href="#SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</a><br />\r
+ <a class="message" href="#SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</a><br />\r
+ <a class="message" href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int\r
+ y)</a><br />\r
+ <a class="message" href="#SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(<unused>, int\r
+ position)</a><br />\r
+ <a class="message" href="#SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(<unused>, int\r
+ position)</a><br />\r
+ <a class="message" href="#SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</a><br />\r
+ <a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT(<unused>, char *text)</a><br />\r
+ <a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</a><br />\r
+ <a class="message" href="#SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</a><br />\r
+ <a class="message" href="#SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</a><br />\r
+ <a class="message" href="#SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</a><br />\r
+ <a class="message" href="#SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</a><br />\r
+ <a class="message" href="#SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</a><br />\r
+ <a class="message" href="#SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</a><br />\r
+ <a class="message" href="#SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool\r
+ onlyWordCharacters)</a><br />\r
+ <a class="message" href="#SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool\r
+ onlyWordCharacters)</a><br />\r
+ <a class="message" href="#SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</a><br />\r
+ <a class="message" href="#SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</a><br />\r
+ <a class="message" href="#SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</a><br />\r
+ <a class="message" href="#SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</a><br />\r
+ <a class="message" href="#SCI_CHOOSECARETX">SCI_CHOOSECARETX</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</b><br />\r
+ <b id="SCI_GETLENGTH">SCI_GETLENGTH</b><br />\r
+ Both these messages return the length of the document in characters.</p>\r
+\r
+ <p><b id="SCI_GETLINECOUNT">SCI_GETLINECOUNT</b><br />\r
+ This returns the number of lines in the document. An empty document contains 1 line. A\r
+ document holding only an end of line sequence has 2 lines.</p>\r
+\r
+ <p><b id="SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</b><br />\r
+ This returns the line number of the first visible line in the Scintilla view. The first line\r
+ in the document is numbered 0. The value is a visible line rather than a document line.</p>\r
+\r
+ <p><b id="SCI_LINESONSCREEN">SCI_LINESONSCREEN</b><br />\r
+ This returns the number of complete lines visible on the screen. With a constant line height,\r
+ this is the vertical space available divided by the line separation. Unless you arrange to size\r
+ your window to an integral number of lines, there may be a partial line visible at the bottom\r
+ of the view.</p>\r
+\r
+ <p><b id="SCI_GETMODIFY">SCI_GETMODIFY</b><br />\r
+ This returns non-zero if the document is modified and 0 if it is unmodified. The modified\r
+ status of a document is determined by the undo position relative to the save point. The save\r
+ point is set by <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>,\r
+ usually when you have saved data to a file.</p>\r
+\r
+ <p>If you need to be notified when the document becomes modified, Scintilla notifies the\r
+ container that it has entered or left the save point with the <a class="message"\r
+ href="#SCN_SAVEPOINTREACHED"><code>SCN_SAVEPOINTREACHED</code></a> and <a class="message"\r
+ href="#SCN_SAVEPOINTLEFT"><code>SCN_SAVEPOINTLEFT</code></a> <a class="jump"\r
+ href="#Notifications">notification messages</a>.</p>\r
+\r
+ <p><b id="SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</b><br />\r
+ This message sets both the anchor and the current position. If <code>currentPos</code> is\r
+ negative, it means the end of the document. If <code>anchorPos</code> is negative, it means\r
+ remove any selection (i.e. set the anchor to the same position as <code>currentPos</code>). The\r
+ caret is scrolled into view after this operation.</p>\r
+\r
+ <p><b id="SCI_GOTOPOS">SCI_GOTOPOS(int pos)</b><br />\r
+ This removes any selection, sets the caret at <code>pos</code> and scrolls the view to make\r
+ the caret visible, if necessary. It is equivalent to\r
+ <code>SCI_SETSEL(pos, pos)</code>. The anchor position is set the same as the current\r
+ position.</p>\r
+\r
+ <p><b id="SCI_GOTOLINE">SCI_GOTOLINE(int line)</b><br />\r
+ This removes any selection and sets the caret at the start of line number <code>line</code>\r
+ and scrolls the view (if needed) to make it visible. The anchor position is set the same as the\r
+ current position. If <code>line</code> is outside the lines in the document (first line is 0),\r
+ the line set is the first or last.</p>\r
+\r
+ <p><b id="SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int pos)</b><br />\r
+ This sets the current position and creates a selection between the anchor and the current\r
+ position. The caret is not scrolled into view.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>\r
+\r
+ <p><b id="SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</b><br />\r
+ This returns the current position.</p>\r
+\r
+ <p><b id="SCI_SETANCHOR">SCI_SETANCHOR(int pos)</b><br />\r
+ This sets the anchor position and creates a selection between the anchor position and the\r
+ current position. The caret is not scrolled into view.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>\r
+\r
+ <p><b id="SCI_GETANCHOR">SCI_GETANCHOR</b><br />\r
+ This returns the current anchor position.</p>\r
+\r
+ <p><b id="SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int pos)</b><br />\r
+ <b id="SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int pos)</b><br />\r
+ These set the selection based on the assumption that the anchor position is less than the\r
+ current position. They do not make the caret visible. The table shows the positions of the\r
+ anchor and the current position after using these messages.</p>\r
+\r
+ <table cellpadding="3" cellspacing="0" border="1" summary="SetSelection caret positioning">\r
+ <thead align="center">\r
+ <tr>\r
+ <th>\r
+ </th>\r
+\r
+ <th>anchor</th>\r
+\r
+ <th>current</th>\r
+ </tr>\r
+ </thead>\r
+\r
+ <tbody align="center">\r
+ <tr>\r
+ <th><code>SCI_SETSELECTIONSTART</code></th>\r
+\r
+ <td><code>pos</code></td>\r
+\r
+ <td><code>Max(pos, current)</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th><code>SCI_SETSELECTIONEND</code></th>\r
+\r
+ <td><code>Min(anchor, pos)</code></td>\r
+\r
+ <td><code>pos</code></td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>\r
+\r
+ <p><b id="SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</b><br />\r
+ <b id="SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</b><br />\r
+ These return the start and end of the selection without regard to which end is the current\r
+ position and which is the anchor. <code>SCI_GETSELECTIONSTART</code> returns the smaller of the\r
+ current position or the anchor position. <code>SCI_GETSELECTIONEND</code> returns the larger of\r
+ the two values.</p>\r
+\r
+ <p><b id="SCI_SELECTALL">SCI_SELECTALL</b><br />\r
+ This selects all the text in the document. The current position is not scrolled into view.</p>\r
+\r
+ <p><b id="SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int pos)</b><br />\r
+ This message returns the line that contains the position <code>pos</code> in the document. The\r
+ return value is 0 if <code>pos</code> <= 0. The return value is the last line if\r
+ <code>pos</code> is beyond the end of the document.</p>\r
+\r
+ <p><b id="SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</b><br />\r
+ This returns the document position that corresponds with the start of the line. If\r
+ <code>line</code> is negative, the position of the line holding the start of the selection is\r
+ returned. If <code>line</code> is greater than the lines in the document, the return value is\r
+ -1. If <code>line</code> is equal to the number of lines in the document (i.e. 1 line past the\r
+ last line), the return value is the end of the document.</p>\r
+\r
+ <p><b id="SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</b><br />\r
+ This returns the position at the end of the line, before any line end characters. If <code>line</code>\r
+ is the last line in the document (which does not have any end of line characters), the result is the size of the\r
+ document. If <code>line</code> is negative or <code>line</code> >= <a class="message"\r
+ href="#SCI_GETLINECOUNT"><code>SCI_GETLINECOUNT()</code></a>, the result is undefined.</p>\r
+\r
+ <p><b id="SCI_LINELENGTH">SCI_LINELENGTH(int line)</b><br />\r
+ This returns the length of the line, including any line end characters. If <code>line</code>\r
+ is negative or beyond the last line in the document, the result is 0. If you want the length of\r
+ the line not including any end of line characters, use <a class="message"\r
+ href="#SCI_GETLINEENDPOSITION"><code>SCI_GETLINEENDPOSITION(line)</code></a> - <a class="message"\r
+ href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p>\r
+ <b id="SCI_GETSELTEXT">SCI_GETSELTEXT(<unused>, char *text)</b><br />\r
+ This copies the currently selected text and a terminating 0 byte to the <code>text</code>\r
+ buffer. The buffer must be at least\r
+ <code>SCI_GETSELECTIONEND()-SCI_GETSELECTIONSTART()+1</code> bytes long. <br />\r
+ If the text argument is 0 then the length that should be allocated\r
+ to store the entire selection is returned.<br />\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a\r
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
+ href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"\r
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>\r
+\r
+ <p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</b><br />\r
+ This retrieves the text of the line containing the caret and returns the position within the\r
+ line of the caret. Pass in <code>char* text</code> pointing at a buffer large enough to hold\r
+ the text you wish to retrieve and a terminating 0 character.\r
+ Set <code>textLen</code> to the\r
+ length of the buffer which must be at least 1 to hold the terminating 0 character.\r
+ If the text argument is 0 then the length that should be allocated\r
+ to store the entire current line is returned.</p>\r
+\r
+ <p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a\r
+ class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"\r
+ href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"\r
+ href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"\r
+ href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>\r
+\r
+ <p><b id="SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</b><br />\r
+ This returns 1 if the current selection is in rectangle mode, 0 if not.</p>\r
+\r
+ <p><b id="SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</b><br />\r
+ <b id="SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</b><br />\r
+ The two functions set and get the selection mode, which can be\r
+ stream (<code>SC_SEL_STREAM</code>=0) or\r
+ rectangular (<code>SC_SEL_RECTANGLE</code>=1)\r
+ or by lines (<code>SC_SEL_LINES</code>=2).\r
+ When set in these modes, regular caret moves will extend or reduce the selection,\r
+ until the mode is cancelled by a call with same value or with <code>SCI_CANCEL</code>.\r
+ The get function returns the current mode even if the selection was made by mouse\r
+ or with regular extended moves.</p>\r
+\r
+ <p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</b><br />\r
+ <b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</b><br />\r
+ Retrieve the position of the start and end of the selection at the given line with\r
+ INVALID_POSITION returned if no selection on this line.</p>\r
+\r
+ <p><b id="SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</b><br />\r
+ If the caret is off the top or bottom of the view, it is moved to the nearest line that is\r
+ visible to its current position. Any selection is lost.</p>\r
+\r
+ <p><b id="SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool\r
+ onlyWordCharacters)</b><br />\r
+ <b id="SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool\r
+ onlyWordCharacters)</b><br />\r
+ These messages return the start and end of words using the same definition of words as used\r
+ internally within Scintilla. You can set your own list of characters that count as words with\r
+ <a class="message" href="#SCI_SETWORDCHARS"><code>SCI_SETWORDCHARS</code></a>. The position\r
+ sets the start or the search, which is forwards when searching for the end and backwards when\r
+ searching for the start.</p>\r
+\r
+ <p>Set <code>onlyWordCharacters</code> to <code>true</code> (1) to stop searching at the first\r
+ non-word character in the search direction. If <code>onlyWordCharacters</code> is\r
+ <code>false</code> (0), the first character in the search direction sets the type of the search\r
+ as word or non-word and the search stops at the first non-matching character. Searches are also\r
+ terminated by the start or end of the document.</p>\r
+\r
+ <p>If "w" represents word characters and "." represents non-word characters and "|" represents\r
+ the position and <code>true</code> or <code>false</code> is the state of\r
+ <code>onlyWordCharacters</code>:</p>\r
+\r
+ <table cellpadding="3" cellspacing="0" border="1" summary="Word start and end positions">\r
+ <thead align="center">\r
+ <tr>\r
+ <th>Initial state</th>\r
+\r
+ <th>end, true</th>\r
+\r
+ <th>end, false</th>\r
+\r
+ <th>start, true</th>\r
+\r
+ <th>start, false</th>\r
+ </tr>\r
+ </thead>\r
+\r
+ <tbody align="center">\r
+ <tr>\r
+ <td>..ww..|..ww..</td>\r
+\r
+ <td>..ww..|..ww..</td>\r
+\r
+ <td>..ww....|ww..</td>\r
+\r
+ <td>..ww..|..ww..</td>\r
+\r
+ <td>..ww|....ww..</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>....ww|ww....</td>\r
+\r
+ <td>....wwww|....</td>\r
+\r
+ <td>....wwww|....</td>\r
+\r
+ <td>....|wwww....</td>\r
+\r
+ <td>....|wwww....</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>..ww|....ww..</td>\r
+\r
+ <td>..ww|....ww..</td>\r
+\r
+ <td>..ww....|ww..</td>\r
+\r
+ <td>..|ww....ww..</td>\r
+\r
+ <td>..|ww....ww..</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>..ww....|ww..</td>\r
+\r
+ <td>..ww....ww|..</td>\r
+\r
+ <td>..ww....ww|..</td>\r
+\r
+ <td>..ww....|ww..</td>\r
+\r
+ <td>..ww|....ww..</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</b><br />\r
+ <b id="SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</b><br />\r
+ These messages return the position before and after another position\r
+ in the document taking into account the current code page. The minimum\r
+ position returned is 0 and the maximum is the last position in the document.\r
+ If called with a position within a multi byte character will return the position\r
+ of the start/end of that character.</p>\r
+\r
+ <p><b id="SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</b><br />\r
+ This returns the pixel width of a string drawn in the given <code>styleNumber</code> which can\r
+ be used, for example, to decide how wide to make the line number margin in order to display a\r
+ given number of numerals.</p>\r
+\r
+ <p><b id="SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</b><br />\r
+ This returns the height in pixels of a particular line. Currently all lines are the same\r
+ height.</p>\r
+\r
+ <p><b id="SCI_GETCOLUMN">SCI_GETCOLUMN(int pos)</b><br />\r
+ This message returns the column number of a position <code>pos</code> within the document\r
+ taking the width of tabs into account. This returns the column number of the last tab on the\r
+ line before <code>pos</code>, plus the number of characters between the last tab and\r
+ <code>pos</code>. If there are no tab characters on the line, the return value is the number of\r
+ characters up to the position on the line. In both cases, double byte characters count as a\r
+ single character. This is probably only useful with monospaced fonts.</p>\r
+\r
+ <p><b id="SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</b><br />\r
+ This message returns the position of a <code>column</code> on a <code>line</code>\r
+ taking the width of tabs into account. It treats a multi-byte character as a single column.\r
+ Column numbers, like lines start at 0.</p>\r
+\r
+ <p><b id="SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</b><br />\r
+ <b id="SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int y)</b><br />\r
+ <code>SCI_POSITIONFROMPOINT</code> finds the closest character position to a point and\r
+ <code>SCI_POSITIONFROMPOINTCLOSE</code> is similar but returns -1 if the point is outside the\r
+ window or not close to any characters.</p>\r
+\r
+ <p><b id="SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(<unused>, int pos)</b><br />\r
+ <b id="SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(<unused>, int pos)</b><br />\r
+ These messages return the x and y display pixel location of text at position <code>pos</code>\r
+ in the document.</p>\r
+\r
+ <p><b id="SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</b><br />\r
+ The normal state is to make the selection visible by drawing it as set by <a class="message"\r
+ href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a> and <a class="message"\r
+ href="#SCI_SETSELBACK"><code>SCI_SETSELBACK</code></a>. However, if you hide the selection, it\r
+ is drawn as normal text.</p>\r
+\r
+ <p><b id="SCI_CHOOSECARETX">SCI_CHOOSECARETX</b><br />\r
+ Scintilla remembers the x value of the last position horizontally moved to explicitly by the\r
+ user and this value is then used when moving vertically such as by using the up and down keys.\r
+ This message sets the current x position of the caret as the remembered value.</p>\r
+\r
+ <h2 id="ScrollingAndAutomaticScrolling">Scrolling and automatic scrolling</h2>\r
+ <code><a class="message" href="#SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</a><br />\r
+ <a class="message" href="#SCI_SCROLLCARET">SCI_SCROLLCARET</a><br />\r
+ <a class="message" href="#SCI_SETXCARETPOLICY">SCI_SETXCARETPOLICY(int caretPolicy, int\r
+ caretSlop)</a><br />\r
+ <a class="message" href="#SCI_SETYCARETPOLICY">SCI_SETYCARETPOLICY(int caretPolicy, int\r
+ caretSlop)</a><br />\r
+ <a class="message" href="#SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY(int caretPolicy, int\r
+ caretSlop)</a><br />\r
+ <a class="message" href="#SCI_SETHSCROLLBAR">SCI_SETHSCROLLBAR(bool visible)</a><br />\r
+ <a class="message" href="#SCI_GETHSCROLLBAR">SCI_GETHSCROLLBAR</a><br />\r
+ <a class="message" href="#SCI_SETVSCROLLBAR">SCI_SETVSCROLLBAR(bool visible)</a><br />\r
+ <a class="message" href="#SCI_GETVSCROLLBAR">SCI_GETVSCROLLBAR</a><br />\r
+ <a class="message" href="#SCI_GETXOFFSET">SCI_GETXOFFSET</a><br />\r
+ <a class="message" href="#SCI_SETXOFFSET">SCI_SETXOFFSET(int xOffset)</a><br />\r
+ <a class="message" href="#SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH(int pixelWidth)</a><br />\r
+ <a class="message" href="#SCI_GETSCROLLWIDTH">SCI_GETSCROLLWIDTH</a><br />\r
+ <a class="message" href="#SCI_SETSCROLLWIDTHTRACKING">SCI_SETSCROLLWIDTHTRACKING(bool tracking)</a><br />\r
+ <a class="message" href="#SCI_GETSCROLLWIDTHTRACKING">SCI_GETSCROLLWIDTHTRACKING</a><br />\r
+ <a class="message" href="#SCI_SETENDATLASTLINE">SCI_SETENDATLASTLINE(bool\r
+ endAtLastLine)</a><br />\r
+ <a class="message" href="#SCI_GETENDATLASTLINE">SCI_GETENDATLASTLINE</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_LINESCROLL">SCI_LINESCROLL(int column, int line)</b><br />\r
+ This will attempt to scroll the display by the number of columns and lines that you specify.\r
+ Positive line values increase the line number at the top of the screen (i.e. they move the text\r
+ upwards as far as the user is concerned), Negative line values do the reverse.</p>\r
+\r
+ <p>The column measure is the width of a space in the default style. Positive values increase\r
+ the column at the left edge of the view (i.e. they move the text leftwards as far as the user\r
+ is concerned). Negative values do the reverse.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_SETXOFFSET"><code>SCI_SETXOFFSET</code></a></p>\r
+\r
+ <p><b id="SCI_SCROLLCARET">SCI_SCROLLCARET</b><br />\r
+ If the current position (this is the caret if there is no selection) is not visible, the view\r
+ is scrolled to make it visible according to the current caret policy.</p>\r
+\r
+ <p><b id="SCI_SETXCARETPOLICY">SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)</b><br />\r
+ <b id="SCI_SETYCARETPOLICY">SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)</b><br />\r
+ These set the caret policy. The value of <code>caretPolicy</code> is a combination of\r
+ <code>CARET_SLOP</code>, <code>CARET_STRICT</code>, <code>CARET_JUMPS</code> and\r
+ <code>CARET_EVEN</code>.</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Caret policy">\r
+ <tbody valign="top">\r
+ <tr>\r
+ <th align="left"><code>CARET_SLOP</code></th>\r
+\r
+ <td>If set, we can define a slop value: <code>caretSlop</code>. This value defines an\r
+ unwanted zone (UZ) where the caret is... unwanted. This zone is defined as a number of\r
+ pixels near the vertical margins, and as a number of lines near the horizontal margins.\r
+ By keeping the caret away from the edges, it is seen within its context. This makes it\r
+ likely that the identifier that the caret is on can be completely seen, and that the\r
+ current line is seen with some of the lines following it, which are often dependent on\r
+ that line.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>CARET_STRICT</code></th>\r
+\r
+ <td>If set, the policy set by <code>CARET_SLOP</code> is enforced... strictly. The caret\r
+ is centred on the display if <code>caretSlop</code> is not set, and cannot go in the UZ\r
+ if <code>caretSlop</code> is set.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>CARET_JUMPS</code></th>\r
+\r
+ <td>If set, the display is moved more energetically so the caret can move in the same\r
+ direction longer before the policy is applied again. '3UZ' notation is used to indicate\r
+ three time the size of the UZ as a distance to the margin.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>CARET_EVEN</code></th>\r
+\r
+ <td>If not set, instead of having symmetrical UZs, the left and bottom UZs are extended\r
+ up to right and top UZs respectively. This way, we favour the displaying of useful\r
+ information: the beginning of lines, where most code reside, and the lines after the\r
+ caret, for example, the body of a function.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <table cellpadding="3" cellspacing="0" border="1" summary="Caret positioning">\r
+ <thead align="center">\r
+ <tr>\r
+ <th>slop</th>\r
+\r
+ <th>strict</th>\r
+\r
+ <th>jumps</th>\r
+\r
+ <th>even</th>\r
+\r
+ <th>Caret can go to the margin</th>\r
+\r
+ <th>On reaching limit (going out of visibility<br />\r
+ or going into the UZ) display is...</th>\r
+ </tr>\r
+ </thead>\r
+\r
+ <tbody align="center">\r
+ <tr>\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved to put caret on top/on right</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved by one position</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved to put caret on top/on right</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>centred on the caret</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>-</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>Caret is always on top/on right of display</td>\r
+\r
+ <td>-</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>-</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>No, caret is always centred</td>\r
+\r
+ <td>-</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved to put caret out of the asymmetrical UZ</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved to put caret out of the UZ</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved to put caret at 3UZ of the top or right margin</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>Yes</td>\r
+\r
+ <td>moved to put caret at 3UZ of the margin</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>-</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>Caret is always at UZ of top/right margin</td>\r
+\r
+ <td>-</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>No, kept out of UZ</td>\r
+\r
+ <td>moved by one position</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td>1</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>1</td>\r
+\r
+ <td>0</td>\r
+\r
+ <td>No, kept out of UZ</td>\r
+\r
+ <td>moved to put caret at 3UZ of the margin</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)</b><br />\r
+ This determines how the vertical positioning is determined when <a class="message"\r
+ href="#SCI_ENSUREVISIBLEENFORCEPOLICY"><code>SCI_ENSUREVISIBLEENFORCEPOLICY</code></a> is\r
+ called. It takes <code>VISIBLE_SLOP</code> and <code>VISIBLE_STRICT</code> flags for the policy\r
+ parameter. It is similar in operation to <a class="message"\r
+ href="#SCI_SETYCARETPOLICY"><code>SCI_SETYCARETPOLICY(int caretPolicy, int\r
+ caretSlop)</code></a>.</p>\r
+\r
+ <p><b id="SCI_SETHSCROLLBAR">SCI_SETHSCROLLBAR(bool visible)</b><br />\r
+ <b id="SCI_GETHSCROLLBAR">SCI_GETHSCROLLBAR</b><br />\r
+ The horizontal scroll bar is only displayed if it is needed for the assumed width.\r
+ If you never wish to see it, call\r
+ <code>SCI_SETHSCROLLBAR(0)</code>. Use <code>SCI_SETHSCROLLBAR(1)</code> to enable it again.\r
+ <code>SCI_GETHSCROLLBAR</code> returns the current state. The default state is to display it\r
+ when needed.</p>\r
+ <p>See also: <a class="message" href="#SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH</a>.</p>\r
+\r
+ <p><b id="SCI_SETVSCROLLBAR">SCI_SETVSCROLLBAR(bool visible)</b><br />\r
+ <b id="SCI_GETVSCROLLBAR">SCI_GETVSCROLLBAR</b><br />\r
+ By default, the vertical scroll bar is always displayed when required. You can choose to hide\r
+ or show it with <code>SCI_SETVSCROLLBAR</code> and get the current state with\r
+ <code>SCI_GETVSCROLLBAR</code>.</p>\r
+\r
+ <p><b id="SCI_SETXOFFSET">SCI_SETXOFFSET(int xOffset)</b><br />\r
+ <b id="SCI_GETXOFFSET">SCI_GETXOFFSET</b><br />\r
+ The <code>xOffset</code> is the horizontal scroll position in pixels of the start of the text\r
+ view. A value of 0 is the normal position with the first text column visible at the left of the\r
+ view.</p>\r
+\r
+ <p>See also: <a class="message" href="#SCI_LINESCROLL"><code>SCI_LINESCROLL</code></a></p>\r
+\r
+ <p><b id="SCI_SETSCROLLWIDTH">SCI_SETSCROLLWIDTH(int pixelWidth)</b><br />\r
+ <b id="SCI_GETSCROLLWIDTH">SCI_GETSCROLLWIDTH</b><br />\r
+ For performance, Scintilla does not measure the display width of the document to determine\r
+ the properties of the horizontal scroll bar. Instead, an assumed width is used.\r
+ These messages set and get the document width in pixels assumed by Scintilla.\r
+ The default value is 2000.\r
+ To ensure the width of the currently visible lines can be scrolled use\r
+ <a class="message" href="#SCI_SETSCROLLWIDTHTRACKING"><code>SCI_SETSCROLLWIDTHTRACKING</code></a></p>\r
+\r
+ <p><b id="SCI_SETSCROLLWIDTHTRACKING">SCI_SETSCROLLWIDTHTRACKING(bool tracking)</b><br />\r
+ <b id="SCI_GETSCROLLWIDTHTRACKING">SCI_GETSCROLLWIDTHTRACKING</b><br />\r
+ If scroll width tracking is enabled then the scroll width is adjusted to ensure that all of the lines currently\r
+ displayed can be completely scrolled. This mode never adjusts the scroll width to be narrower.</p>\r
+\r
+ <p><b id="SCI_SETENDATLASTLINE">SCI_SETENDATLASTLINE(bool endAtLastLine)</b><br />\r
+ <b id="SCI_GETENDATLASTLINE">SCI_GETENDATLASTLINE</b><br />\r
+ <code>SCI_SETENDATLASTLINE</code> sets the scroll range so that maximum scroll position has\r
+ the last line at the bottom of the view (default). Setting this to <code>false</code> allows\r
+ scrolling one page below the last line.</p>\r
+\r
+ <h2 id="WhiteSpace">White space</h2>\r
+ <code><a class="message" href="#SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</a><br />\r
+ <a class="message" href="#SCI_GETVIEWWS">SCI_GETVIEWWS</a><br />\r
+ <a class="message" href="#SCI_SETWHITESPACEFORE">SCI_SETWHITESPACEFORE(bool\r
+ useWhitespaceForeColour, int colour)</a><br />\r
+ <a class="message" href="#SCI_SETWHITESPACEBACK">SCI_SETWHITESPACEBACK(bool\r
+ useWhitespaceBackColour, int colour)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETVIEWWS">SCI_SETVIEWWS(int wsMode)</b><br />\r
+ <b id="SCI_GETVIEWWS">SCI_GETVIEWWS</b><br />\r
+ White space can be made visible which may useful for languages in which white space is\r
+ significant, such as Python. Space characters appear as small centred dots and tab characters\r
+ as light arrows pointing to the right. There are also ways to control the display of <a\r
+ class="jump" href="#LineEndings">end of line characters</a>. The two messages set and get the\r
+ white space display mode. The <code>wsMode</code> argument can be one of:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="White space policy">\r
+ <tbody valign="top">\r
+ <tr>\r
+ <th align="left"><code>SCWS_INVISIBLE</code></th>\r
+\r
+ <td>0</td>\r
+\r
+ <td>The normal display mode with white space displayed as an empty background\r
+ colour.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>SCWS_VISIBLEALWAYS</code></th>\r
+\r
+ <td>1</td>\r
+\r
+ <td>White space characters are drawn as dots and arrows,</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>SCWS_VISIBLEAFTERINDENT</code></th>\r
+\r
+ <td>2</td>\r
+\r
+ <td>White space used for indentation is displayed normally but after the first visible\r
+ character, it is shown as dots and arrows.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>The effect of using any other <code>wsMode</code> value is undefined.</p>\r
+\r
+ <p><b id="SCI_SETWHITESPACEFORE">SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int <a\r
+ class="jump" href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_SETWHITESPACEBACK">SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int <a\r
+ class="jump" href="#colour">colour</a>)</b><br />\r
+ By default, the colour of visible white space is determined by the lexer in use. The\r
+ foreground and/or background colour of all visible white space can be set globally, overriding\r
+ the lexer's colours with <code>SCI_SETWHITESPACEFORE</code> and\r
+ <code>SCI_SETWHITESPACEBACK</code>.</p>\r
+\r
+ <h2 id="Cursor">Cursor</h2>\r
+\r
+ <p><b id="SCI_SETCURSOR">SCI_SETCURSOR(int curType)</b><br />\r
+ <b id="SCI_GETCURSOR">SCI_GETCURSOR</b><br />\r
+ The cursor is normally chosen in a context sensitive way, so it will be different over the\r
+ margin than when over the text. When performing a slow action, you may wish to change to a wait\r
+ cursor. You set the cursor type with <code>SCI_SETCURSOR</code>. The <code>curType</code>\r
+ argument can be:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Mouse cursors">\r
+ <tbody valign="top">\r
+ <tr>\r
+ <th align="left"><code>SC_CURSORNORMAL</code></th>\r
+\r
+ <td>-1</td>\r
+\r
+ <td>The normal cursor is displayed.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>SC_CURSORWAIT</code></th>\r
+\r
+ <td> 4</td>\r
+\r
+ <td>The wait cursor is displayed when the mouse is over or owned by the Scintilla\r
+ window.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>Cursor values 1 through 7 have defined cursors, but only <code>SC_CURSORWAIT</code> is\r
+ usefully controllable. Other values of <code>curType</code> cause a pointer to be displayed.\r
+ The <code>SCI_GETCURSOR</code> message returns the last cursor type you set, or\r
+ <code>SC_CURSORNORMAL</code> (-1) if you have not set a cursor type.</p>\r
+\r
+ <h2 id="MouseCapture">Mouse capture</h2>\r
+\r
+ <p><b id="SCI_SETMOUSEDOWNCAPTURES">SCI_SETMOUSEDOWNCAPTURES(bool captures)</b><br />\r
+ <b id="SCI_GETMOUSEDOWNCAPTURES">SCI_GETMOUSEDOWNCAPTURES</b><br />\r
+ When the mouse is pressed inside Scintilla, it is captured so future mouse movement events are\r
+ sent to Scintilla. This behavior may be turned off with\r
+ <code>SCI_SETMOUSEDOWNCAPTURES(0)</code>.</p>\r
+\r
+ <h2 id="LineEndings">Line endings</h2>\r
+\r
+ <p>Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix\r
+ (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line\r
+ end strings is inserted into the buffer. The default is \r\n in Windows and \n in Unix, but\r
+ this can be changed with the <code>SCI_SETEOLMODE</code> message. You can also convert the\r
+ entire document to one of these line endings with <code>SCI_CONVERTEOLS</code>. Finally, you\r
+ can choose to display the line endings with <code>SCI_SETVIEWEOL</code>.</p>\r
+ <code><a class="message" href="#SCI_SETEOLMODE">SCI_SETEOLMODE(int eolMode)</a><br />\r
+ <a class="message" href="#SCI_GETEOLMODE">SCI_GETEOLMODE</a><br />\r
+ <a class="message" href="#SCI_CONVERTEOLS">SCI_CONVERTEOLS(int eolMode)</a><br />\r
+ <a class="message" href="#SCI_SETVIEWEOL">SCI_SETVIEWEOL(bool visible)</a><br />\r
+ <a class="message" href="#SCI_GETVIEWEOL">SCI_GETVIEWEOL</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETEOLMODE">SCI_SETEOLMODE(int eolMode)</b><br />\r
+ <b id="SCI_GETEOLMODE">SCI_GETEOLMODE</b><br />\r
+ <code>SCI_SETEOLMODE</code> sets the characters that are added into the document when the user\r
+ presses the Enter key. You can set <code>eolMode</code> to one of <code>SC_EOL_CRLF</code> (0),\r
+ <code>SC_EOL_CR</code> (1), or <code>SC_EOL_LF</code> (2). The <code>SCI_GETEOLMODE</code>\r
+ message retrieves the current state.</p>\r
+\r
+ <p><b id="SCI_CONVERTEOLS">SCI_CONVERTEOLS(int eolMode)</b><br />\r
+ This message changes all the end of line characters in the document to match\r
+ <code>eolMode</code>. Valid values are: <code>SC_EOL_CRLF</code> (0), <code>SC_EOL_CR</code>\r
+ (1), or <code>SC_EOL_LF</code> (2).</p>\r
+\r
+ <p><b id="SCI_SETVIEWEOL">SCI_SETVIEWEOL(bool visible)</b><br />\r
+ <b id="SCI_GETVIEWEOL">SCI_GETVIEWEOL</b><br />\r
+ Normally, the end of line characters are hidden, but <code>SCI_SETVIEWEOL</code> allows you to\r
+ display (or hide) them by setting <code>visible</code> <code>true</code> (or\r
+ <code>false</code>). The visible rendering of the end of line characters is similar to\r
+ <code>(CR)</code>, <code>(LF)</code>, or <code>(CR)(LF)</code>. <code>SCI_GETVIEWEOL</code>\r
+ returns the current state.</p>\r
+\r
+ <h2 id="Styling">Styling</h2>\r
+\r
+ <p>The styling messages allow you to assign styles to text. The standard Scintilla settings\r
+ divide the 8 style bits available for each character into 5 bits (0 to 4 = <a class="jump"\r
+ href="#StyleDefinition">styles 0 to 31</a>) that set a style and three bits (5 to 7) that\r
+ define <a class="jump" href="#Indicators">indicators</a>. You can change the balance between\r
+ styles and indicators with <a class="message"\r
+ href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a>. If your styling needs can be met by\r
+ one of the standard lexers, or if you can write your own, then a lexer is probably the easiest\r
+ way to style your document. If you choose to use the container to do the styling you can use\r
+ the <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a> command to select\r
+ <code>SCLEX_CONTAINER</code>, in which case the container is sent a <a class="message"\r
+ href="#SCN_STYLENEEDED"><code>SCN_STYLENEEDED</code></a> <a class="jump"\r
+ href="#Notifications">notification</a> each time text needs styling for display. As another\r
+ alternative, you might use idle time to style the document. Even if you use a lexer, you might\r
+ use the styling commands to mark errors detected by a compiler. The following commands can be\r
+ used.</p>\r
+ <code><a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a><br />\r
+ <a class="message" href="#SCI_STARTSTYLING">SCI_STARTSTYLING(int position, int mask)</a><br />\r
+ <a class="message" href="#SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</a><br />\r
+ <a class="message" href="#SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char\r
+ *styles)</a><br />\r
+ <a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</a><br />\r
+ <a class="message" href="#SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</a><br />\r
+ <a class="message" href="#SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_GETENDSTYLED">SCI_GETENDSTYLED</b><br />\r
+ Scintilla keeps a record of the last character that is likely to be styled correctly. This is\r
+ moved forwards when characters after it are styled and moved backwards if changes are made to\r
+ the text of the document before it. Before drawing text, this position is checked to see if any\r
+ styling is needed and, if so, a <code><a class="message"\r
+ href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a></code> notification message is sent to the\r
+ container. The container can send <code>SCI_GETENDSTYLED</code> to work out where it needs to\r
+ start styling. Scintilla will always ask to style whole lines.</p>\r
+\r
+ <p><b id="SCI_STARTSTYLING">SCI_STARTSTYLING(int pos, int mask)</b><br />\r
+ This prepares for styling by setting the styling position <code>pos</code> to start at and a\r
+ <code>mask</code> indicating which bits of the style bytes can be set. The mask allows styling\r
+ to occur over several passes, with, for example, basic styling done on an initial pass to\r
+ ensure that the text of the code is seen quickly and correctly, and then a second slower pass,\r
+ detecting syntax errors and using indicators to show where these are. For example, with the\r
+ standard settings of 5 style bits and 3 indicator bits, you would use a <code>mask</code> value\r
+ of 31 (0x1f) if you were setting text styles and did not want to change the indicators. After\r
+ <code>SCI_STARTSTYLING</code>, send multiple <code>SCI_SETSTYLING</code> messages for each\r
+ lexical entity to style.</p>\r
+\r
+ <p><b id="SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</b><br />\r
+ This message sets the style of <code>length</code> characters starting at the styling position\r
+ and then increases the styling position by <code>length</code>, ready for the next call. If\r
+ <code>sCell</code> is the style byte, the operation is:<br />\r
+ <code>if ((sCell & mask) != style) sCell = (sCell & ~mask) | (style &\r
+ mask);</code><br />\r
+ </p>\r
+\r
+ <p><b id="SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char *styles)</b><br />\r
+ As an alternative to <code>SCI_SETSTYLING</code>, which applies the same style to each byte,\r
+ you can use this message which specifies the styles for each of <code>length</code> bytes from\r
+ the styling position and then increases the styling position by <code>length</code>, ready for\r
+ the next call. The <code>length</code> styling bytes pointed at by <code>styles</code> should\r
+ not contain any bits not set in mask.</p>\r
+\r
+ <p><b id="SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</b><br />\r
+ <b id="SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</b><br />\r
+ As well as the 8 bits of lexical state stored for each character there is also an integer\r
+ stored for each line. This can be used for longer lived parse states such as what the current\r
+ scripting language is in an ASP page. Use <code>SCI_SETLINESTATE</code> to set the integer\r
+ value and <code>SCI_GETLINESTATE</code> to get the value.\r
+ Changing the value produces a <a class="message" href="#SC_MOD_CHANGELINESTATE">SC_MOD_CHANGELINESTATE</a> notification.\r
+ </p>\r
+\r
+ <p><b id="SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</b><br />\r
+ This returns the last line that has any line state.</p>\r
+\r
+ <h2 id="StyleDefinition">Style definition</h2>\r
+\r
+ <p>While the style setting messages mentioned above change the style numbers associated with\r
+ text, these messages define how those style numbers are interpreted visually. There are 256\r
+ lexer styles that can be set, numbered 0 to <code>STYLE_MAX</code> (255). Unless you use <a\r
+ class="message" href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> to change the number\r
+ of style bits, styles 0 to 31 are used to set the text attributes. There are also some\r
+ predefined numbered styles starting at 32, The following <code>STYLE_</code>* constants are\r
+ defined.</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Preset styles">\r
+ <tbody valign="top">\r
+ <tr>\r
+ <th align="left"><code>STYLE_DEFAULT</code></th>\r
+\r
+ <td>32</td>\r
+\r
+ <td>This style defines the attributes that all styles receive when the\r
+ <code>SCI_STYLECLEARALL</code> message is used.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_LINENUMBER</code></th>\r
+\r
+ <td>33</td>\r
+\r
+ <td>This style sets the attributes of the text used to display line numbers in a line\r
+ number margin. The background colour set for this style also sets the background colour\r
+ for all margins that do not have any folding mask bits set. That is, any margin for which\r
+ <code>mask & SC_MASK_FOLDERS</code> is 0. See <a class="message"\r
+ href="#SCI_SETMARGINMASKN"><code>SCI_SETMARGINMASKN</code></a> for more about masks.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_BRACELIGHT</code></th>\r
+\r
+ <td>34</td>\r
+\r
+ <td>This style sets the attributes used when highlighting braces with the <a\r
+ class="message" href="#BraceHighlighting"><code>SCI_BRACEHIGHLIGHT</code></a> message and\r
+ when highlighting the corresponding indentation with <a class="message"\r
+ href="#SCI_SETHIGHLIGHTGUIDE"><code>SCI_SETHIGHLIGHTGUIDE</code></a>.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_BRACEBAD</code></th>\r
+\r
+ <td>35</td>\r
+\r
+ <td>This style sets the display attributes used when marking an unmatched brace with the\r
+ <a class="message" href="#BraceHighlighting"><code>SCI_BRACEBADLIGHT</code></a>\r
+ message.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_CONTROLCHAR</code></th>\r
+\r
+ <td>36</td>\r
+\r
+ <td>This style sets the font used when drawing control characters.\r
+ Only the font, size, bold, italics, and character set attributes are used and not\r
+ the colour attributes. See\r
+ also: <a class="message"\r
+ href="#SCI_SETCONTROLCHARSYMBOL"><code>SCI_SETCONTROLCHARSYMBOL</code></a>.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_INDENTGUIDE</code></th>\r
+\r
+ <td>37</td>\r
+\r
+ <td>This style sets the foreground and background colours used when drawing the\r
+ indentation guides.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_CALLTIP</code></th>\r
+\r
+ <td>38</td>\r
+\r
+ <td> Call tips normally use the font attributes defined by <code>STYLE_DEFAULT</code>.\r
+ Use of <a class="message" href="#SCI_CALLTIPUSESTYLE"><code>SCI_CALLTIPUSESTYLE</code></a>\r
+ causes call tips to use this style instead. Only the font face name, font size,\r
+ foreground and background colours and character set attributes are used.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_LASTPREDEFINED</code></th>\r
+\r
+ <td>39</td>\r
+\r
+ <td>To make it easier for client code to discover the range of styles that are\r
+ predefined, this is set to the style number of the last predefined style. This is\r
+ currently set to 39 and the last style with an identifier is 38, which reserves space\r
+ for one future predefined style.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>STYLE_MAX</code></th>\r
+\r
+ <td>255</td>\r
+\r
+ <td>This is not a style but is the number of the maximum style that can be set. Styles\r
+ between <code>STYLE_LASTPREDEFINED</code> and <code>STYLE_MAX</code> would be appropriate\r
+ if you used <a class="message" href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a>\r
+ to set more than 5 style bits.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>For each style you can set the font name, size and use of bold, italic and underline,\r
+ foreground and background colour and the character set. You can also choose to hide text with a\r
+ given style, display all characters as upper or lower case and fill from the last character on\r
+ a line to the end of the line (for embedded languages). There is also an experimental attribute\r
+ to make text read-only.</p>\r
+\r
+ <p>It is entirely up to you how you use styles. If you want to use syntax colouring you might\r
+ use style 0 for white space, style 1 for numbers, style 2 for keywords, style 3 for strings,\r
+ style 4 for preprocessor, style 5 for operators, and so on.</p>\r
+ <code><a class="message" href="#SCI_STYLERESETDEFAULT">SCI_STYLERESETDEFAULT</a><br />\r
+ <a class="message" href="#SCI_STYLECLEARALL">SCI_STYLECLEARALL</a><br />\r
+ <a class="message" href="#SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, char\r
+ *fontName)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName)</a><br />\r
+ <a class="message" href="#SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int\r
+ sizeInPoints)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETBOLD">SCI_STYLESETBOLD(int styleNumber, bool\r
+ bold)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETITALIC">SCI_STYLESETITALIC(int styleNumber, bool\r
+ italic)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int styleNumber, bool\r
+ underline)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETUNDERLINE">SCI_STYLEGETUNDERLINE(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETFORE">SCI_STYLESETFORE(int styleNumber, int\r
+ colour)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int\r
+ colour)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETBACK">SCI_STYLESETBACK(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool\r
+ eolFilled)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET(int styleNumber,\r
+ int charSet)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETCHARACTERSET">SCI_STYLEGETCHARACTERSET(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int\r
+ caseMode)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool\r
+ visible)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETVISIBLE">SCI_STYLEGETVISIBLE(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETCHANGEABLE">SCI_STYLESETCHANGEABLE(int styleNumber, bool\r
+ changeable)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETCHANGEABLE">SCI_STYLEGETCHANGEABLE(int styleNumber)</a><br />\r
+ <a class="message" href="#SCI_STYLESETHOTSPOT">SCI_STYLESETHOTSPOT(int styleNumber, bool\r
+ hotspot)</a><br />\r
+ <a class="message" href="#SCI_STYLEGETHOTSPOT">SCI_STYLEGETHOTSPOT(int styleNumber)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_STYLERESETDEFAULT">SCI_STYLERESETDEFAULT</b><br />\r
+ This message resets <code>STYLE_DEFAULT</code> to its state when Scintilla was\r
+ initialised.</p>\r
+\r
+ <p><b id="SCI_STYLECLEARALL">SCI_STYLECLEARALL</b><br />\r
+ This message sets all styles to have the same attributes as <code>STYLE_DEFAULT</code>. If you\r
+ are setting up Scintilla for syntax colouring, it is likely that the lexical styles you set\r
+ will be very similar. One way to set the styles is to:<br />\r
+ 1. Set <code>STYLE_DEFAULT</code> to the common features of all styles.<br />\r
+ 2. Use <code>SCI_STYLECLEARALL</code> to copy this to all styles.<br />\r
+ 3. Set the style attributes that make your lexical styles different.</p>\r
+\r
+ <p><b id="SCI_STYLESETFONT">SCI_STYLESETFONT(int styleNumber, const char *fontName)</b><br />\r
+ <b id="SCI_STYLEGETFONT">SCI_STYLEGETFONT(int styleNumber, char *fontName)</b><br />\r
+ <b id="SCI_STYLESETSIZE">SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)</b><br />\r
+ <b id="SCI_STYLEGETSIZE">SCI_STYLEGETSIZE(int styleNumber)</b><br />\r
+ <b id="SCI_STYLESETBOLD">SCI_STYLESETBOLD(int styleNumber, bool bold)</b><br />\r
+ <b id="SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int styleNumber)</b><br />\r
+ <b id="SCI_STYLESETITALIC">SCI_STYLESETITALIC(int styleNumber, bool italic)</b><br />\r
+ <b id="SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int styleNumber)</b><br />\r
+ These messages (plus <a class="message"\r
+ href="#SCI_STYLESETCHARACTERSET"><code>SCI_STYLESETCHARACTERSET</code></a>) set the font\r
+ attributes that are used to match the fonts you request to those available. The\r
+ <code>fontName</code> is a zero terminated string holding the name of a font. Under Windows,\r
+ only the first 32 characters of the name are used and the name is not case sensitive. For\r
+ internal caching, Scintilla tracks fonts by name and does care about the casing of font names,\r
+ so please be consistent. On GTK+ 2.x, either GDK or Pango can be used to display text.\r
+ Pango antialiases text, works well with Unicode and is better supported in recent versions of GTK+\r
+ but GDK is faster.\r
+ Prepend a '!' character to the font name to use Pango.</p>\r
+\r
+ <p><b id="SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int styleNumber, bool\r
+ underline)</b><br />\r
+ <b id="SCI_STYLEGETUNDERLINE">SCI_STYLEGETUNDERLINE(int styleNumber)</b><br />\r
+ You can set a style to be underlined. The underline is drawn in the foreground colour. All\r
+ characters with a style that includes the underline attribute are underlined, even if they are\r
+ white space.</p>\r
+\r
+ <p><b id="SCI_STYLESETFORE">SCI_STYLESETFORE(int styleNumber, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_STYLEGETFORE">SCI_STYLEGETFORE(int styleNumber)</b><br />\r
+ <b id="SCI_STYLESETBACK">SCI_STYLESETBACK(int styleNumber, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_STYLEGETBACK">SCI_STYLEGETBACK(int styleNumber)</b><br />\r
+ Text is drawn in the foreground colour. The space in each character cell that is not occupied\r
+ by the character is drawn in the background colour.</p>\r
+\r
+ <p><b id="SCI_STYLESETEOLFILLED">SCI_STYLESETEOLFILLED(int styleNumber, bool\r
+ eolFilled)</b><br />\r
+ <b id="SCI_STYLEGETEOLFILLED">SCI_STYLEGETEOLFILLED(int styleNumber)</b><br />\r
+ If the last character in the line has a style with this attribute set, the remainder of the\r
+ line up to the right edge of the window is filled with the background colour set for the last\r
+ character. This is useful when a document contains embedded sections in another language such\r
+ as HTML pages with embedded JavaScript. By setting <code>eolFilled</code> to <code>true</code>\r
+ and a consistent background colour (different from the background colour set for the HTML\r
+ styles) to all JavaScript styles then JavaScript sections will be easily distinguished from\r
+ HTML.</p>\r
+\r
+ <p><b id="SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET(int styleNumber, int\r
+ charSet)</b><br />\r
+ <b id="SCI_STYLEGETCHARACTERSET">SCI_STYLEGETCHARACTERSET(int styleNumber)</b><br />\r
+ You can set a style to use a different character set than the default. The places where such\r
+ characters sets are likely to be useful are comments and literal strings. For example,\r
+ <code>SCI_STYLESETCHARACTERSET(SCE_C_STRING, SC_CHARSET_RUSSIAN)</code> would ensure that\r
+ strings in Russian would display correctly in C and C++ (<code>SCE_C_STRING</code> is the style\r
+ number used by the C and C++ lexer to display literal strings; it has the value 6). This\r
+ feature works differently on Windows and GTK+.</p>\r
+\r
+ <p>The character sets supported on Windows are:<br />\r
+ <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_ARABIC</code>, <code>SC_CHARSET_BALTIC</code>,\r
+ <code>SC_CHARSET_CHINESEBIG5</code>, <code>SC_CHARSET_DEFAULT</code>,\r
+ <code>SC_CHARSET_EASTEUROPE</code>, <code>SC_CHARSET_GB2312</code>,\r
+ <code>SC_CHARSET_GREEK</code>, <code>SC_CHARSET_HANGUL</code>, <code>SC_CHARSET_HEBREW</code>,\r
+ <code>SC_CHARSET_JOHAB</code>, <code>SC_CHARSET_MAC</code>, <code>SC_CHARSET_OEM</code>,\r
+ <code>SC_CHARSET_RUSSIAN</code> (code page 1251),\r
+ <code>SC_CHARSET_SHIFTJIS</code>, <code>SC_CHARSET_SYMBOL</code>, <code>SC_CHARSET_THAI</code>,\r
+ <code>SC_CHARSET_TURKISH</code>, and <code>SC_CHARSET_VIETNAMESE</code>.</p>\r
+\r
+ <p>The character sets supported on GTK+ are:<br />\r
+ <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_CYRILLIC</code> (code page 1251),\r
+ <code>SC_CHARSET_EASTEUROPE</code>,\r
+ <code>SC_CHARSET_GB2312</code>, <code>SC_CHARSET_HANGUL</code>,\r
+ <code>SC_CHARSET_RUSSIAN</code> (KOI8-R), <code>SC_CHARSET_SHIFTJIS</code>, and\r
+ <code>SC_CHARSET_8859_15</code>.</p>\r
+\r
+ <p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int caseMode)</b><br />\r
+ <b id="SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</b><br />\r
+ The value of caseMode determines how text is displayed. You can set upper case\r
+ (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or display\r
+ normally (<code>SC_CASE_MIXED</code>, 0). This does not change the stored text, only how it is\r
+ displayed.</p>\r
+\r
+ <p><b id="SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool visible)</b><br />\r
+ <b id="SCI_STYLEGETVISIBLE">SCI_STYLEGETVISIBLE(int styleNumber)</b><br />\r
+ Text is normally visible. However, you can completely hide it by giving it a style with the\r
+ <code>visible</code> set to 0. This could be used to hide embedded formatting instructions or\r
+ hypertext keywords in HTML or XML.</p>\r
+\r
+ <p><b id="SCI_STYLESETCHANGEABLE">SCI_STYLESETCHANGEABLE(int styleNumber, bool\r
+ changeable)</b><br />\r
+ <b id="SCI_STYLEGETCHANGEABLE">SCI_STYLEGETCHANGEABLE(int styleNumber)</b><br />\r
+ This is an experimental and incompletely implemented style attribute. The default setting is\r
+ <code>changeable</code> set <code>true</code> but when set <code>false</code> it makes text\r
+ read-only. Currently it only stops the caret from being within not-changeable text and does not\r
+ yet stop deleting a range that contains not-changeable text.</p>\r
+\r
+ <p><b id="SCI_STYLESETHOTSPOT">SCI_STYLESETHOTSPOT(int styleNumber, bool\r
+ hotspot)</b><br />\r
+ <b id="SCI_STYLEGETHOTSPOT">SCI_STYLEGETHOTSPOT(int styleNumber)</b><br />\r
+ This style is used to mark ranges of text that can detect mouse clicks.\r
+ The cursor changes to a hand over hotspots, and the foreground, and background colours\r
+ may change and an underline appear to indicate that these areas are sensitive to clicking.\r
+ This may be used to allow hyperlinks to other documents.</p>\r
+\r
+ <h2 id="CaretAndSelectionStyles">Caret, selection, and hotspot styles</h2>\r
+\r
+ <p>The selection is shown by changing the foreground and/or background colours. If one of these\r
+ is not set then that attribute is not changed for the selection. The default is to show the\r
+ selection by changing the background to light gray and leaving the foreground the same as when\r
+ it was not selected. When there is no selection, the current insertion point is marked by the\r
+ text caret. This is a vertical line that is normally blinking on and off to attract the users\r
+ attention.</p>\r
+ <code><a class="message" href="#SCI_SETSELFORE">SCI_SETSELFORE(bool useSelectionForeColour,\r
+ int <a class="jump" href="#colour">colour<a>)</a><br />\r
+ <a class="message" href="#SCI_SETSELBACK">SCI_SETSELBACK(bool useSelectionBackColour,\r
+ int <a class="jump" href="#colour">colour<a>)</a><br />\r
+ <a class="message" href="#SCI_SETSELALPHA">SCI_SETSELALPHA(int alpha)</a><br />\r
+ <a class="message" href="#SCI_GETSELALPHA">SCI_GETSELALPHA</a><br />\r
+ <a class="message" href="#SCI_SETSELEOLFILLED">SCI_SETSELEOLFILLED(bool filled)</a><br />\r
+ <a class="message" href="#SCI_GETSELEOLFILLED">SCI_GETSELEOLFILLED</a><br />\r
+ <a class="message" href="#SCI_SETCARETFORE">SCI_SETCARETFORE(int colour)</a><br />\r
+ <a class="message" href="#SCI_GETCARETFORE">SCI_GETCARETFORE</a><br />\r
+ <a class="message" href="#SCI_SETCARETLINEVISIBLE">SCI_SETCARETLINEVISIBLE(bool\r
+ show)</a><br />\r
+ <a class="message" href="#SCI_GETCARETLINEVISIBLE">SCI_GETCARETLINEVISIBLE</a><br />\r
+ <a class="message" href="#SCI_SETCARETLINEBACK">SCI_SETCARETLINEBACK(int colour)</a><br />\r
+ <a class="message" href="#SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</a><br />\r
+ <a class="message" href="#SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int alpha)</a><br />\r
+ <a class="message" href="#SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</a><br />\r
+ <a class="message" href="#SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</a><br />\r
+ <a class="message" href="#SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</a><br />\r
+ <a class="message" href="#SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</a><br />\r
+ <a class="message" href="#SCI_GETCARETSTYLE">SCI_GETCARETSTYLE</a><br />\r
+ <a class="message" href="#SCI_SETCARETWIDTH">SCI_SETCARETWIDTH(int pixels)</a><br />\r
+ <a class="message" href="#SCI_GETCARETWIDTH">SCI_GETCARETWIDTH</a><br />\r
+ <a class="message" href="#SCI_SETHOTSPOTACTIVEFORE">SCI_SETHOTSPOTACTIVEFORE(bool useSetting,\r
+ int <a class="jump" href="#colour">colour<a>)</a><br />\r
+ <a class="message" href="#SCI_GETHOTSPOTACTIVEFORE">SCI_GETHOTSPOTACTIVEFORE</a><br />\r
+ <a class="message" href="#SCI_SETHOTSPOTACTIVEBACK">SCI_SETHOTSPOTACTIVEBACK(bool useSetting,\r
+ int <a class="jump" href="#colour">colour<a>)</a><br />\r
+ <a class="message" href="#SCI_GETHOTSPOTACTIVEBACK">SCI_GETHOTSPOTACTIVEBACK</a><br />\r
+ <a class="message" href="#SCI_SETHOTSPOTACTIVEUNDERLINE">SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)</a><br />\r
+ <a class="message" href="#SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</a><br />\r
+ <a class="message" href="#SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</a><br />\r
+ <a class="message" href="#SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</a><br />\r
+ <a class="message" href="#SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int\r
+ symbol)</a><br />\r
+ <a class="message" href="#SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</a><br />\r
+ <a class="message" href="#SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(bool useCaretStickyBehaviour)</a><br />\r
+ <a class="message" href="#SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</a><br />\r
+ <a class="message" href="#SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETSELFORE">SCI_SETSELFORE(bool useSelectionForeColour, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_SETSELBACK">SCI_SETSELBACK(bool useSelectionBackColour, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ You can choose to override the default selection colouring with these two messages. The colour\r
+ you provide is used if you set <code>useSelection*Colour</code> to <code>true</code>. If it is\r
+ set to <code>false</code>, the default styled colouring is used and the <code>colour</code>\r
+ argument has no effect.</p>\r
+ <p><b id="SCI_SETSELALPHA">SCI_SETSELALPHA(int <a class="jump" href="#alpha">alpha</a>)</b><br />\r
+ <b id="SCI_GETSELALPHA">SCI_GETSELALPHA</b><br />\r
+ The selection can be drawn translucently in the selection background colour by\r
+ setting an alpha value.</p>\r
+\r
+ <p><b id="SCI_SETSELEOLFILLED">SCI_SETSELEOLFILLED(bool filled)</b><br />\r
+ <b id="SCI_GETSELEOLFILLED">SCI_GETSELEOLFILLED</b><br />\r
+ The selection can be drawn up to the right hand border by setting this property.</p>\r
+\r
+ <p><b id="SCI_SETCARETFORE">SCI_SETCARETFORE(int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_GETCARETFORE">SCI_GETCARETFORE</b><br />\r
+ The colour of the caret can be set with <code>SCI_SETCARETFORE</code> and retrieved with\r
+ <code>SCI_GETCARETFORE</code>.</p>\r
+\r
+ <p><b id="SCI_SETCARETLINEVISIBLE">SCI_SETCARETLINEVISIBLE(bool show)</b><br />\r
+ <b id="SCI_GETCARETLINEVISIBLE">SCI_GETCARETLINEVISIBLE</b><br />\r
+ <b id="SCI_SETCARETLINEBACK">SCI_SETCARETLINEBACK(int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</b><br />\r
+ <b id="SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int <a class="jump" href="#alpha">alpha</a>)</b><br />\r
+ <b id="SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</b><br />\r
+ You can choose to make the background colour of the line containing the caret different with\r
+ these messages. To do this, set the desired background colour with\r
+ <code>SCI_SETCARETLINEBACK</code>, then use <code>SCI_SETCARETLINEVISIBLE(true)</code> to\r
+ enable the effect. You can cancel the effect with <code>SCI_SETCARETLINEVISIBLE(false)</code>.\r
+ The two <code>SCI_GETCARET*</code> functions return the state and the colour. This form of\r
+ background colouring has highest priority when a line has markers that would otherwise change\r
+ the background colour.\r
+ The caret line may also be drawn translucently which allows other background colours to show\r
+ through. This is done by setting the alpha (translucency) value by calling\r
+ SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA,\r
+ the caret line is drawn after all other features so will affect the colour of all other features.\r
+ </p>\r
+\r
+ <p><b id="SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</b><br />\r
+ <b id="SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</b><br />\r
+ The rate at which the caret blinks can be set with <code>SCI_SETCARETPERIOD</code> which\r
+ determines the time in milliseconds that the caret is visible or invisible before changing\r
+ state. Setting the period to 0 stops the caret blinking. The default value is 500 milliseconds.\r
+ <code>SCI_GETCARETPERIOD</code> returns the current setting.</p>\r
+\r
+ <p><b id="SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</b><br />\r
+ <b id="SCI_GETCARETSTYLE">SCI_GETCARETSTYLE</b><br />\r
+ The style of the caret can be set with <code>SCI_SETCARETSTYLE</code> to be a line caret\r
+ (CARETSTYLE_LINE=1), a block caret (CARETSTYLE_BLOCK=2) or to not draw at all\r
+ (CARETSTYLE_INVISIBLE=0). The default value is the line caret (CARETSTYLE_LINE=1).\r
+ You can determine the current caret style setting using <code>SCI_GETCARETSTYLE</code>.</p>\r
+\r
+ <p>The block character draws most combining and multibyte character sequences successfully,\r
+ though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when\r
+ the cursor is positioned at these characters, which may result in only drawing a part of the\r
+ cursor character sequence. This is most notable on Windows platforms.</p>\r
+\r
+ <p><b id="SCI_SETCARETWIDTH">SCI_SETCARETWIDTH(int pixels)</b><br />\r
+ <b id="SCI_GETCARETWIDTH">SCI_GETCARETWIDTH</b><br />\r
+ The width of the line caret can be set with <code>SCI_SETCARETWIDTH</code> to a value of\r
+ 0, 1, 2 or 3 pixels. The default width is 1 pixel. You can read back the current width with\r
+ <code>SCI_GETCARETWIDTH</code>. A width of 0 makes the caret invisible (added at version\r
+ 1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangable).\r
+ This setting only affects the width of the cursor when the cursor style is set to line caret\r
+ mode, it does not affect the width for a block caret.</p>\r
+\r
+ <p><b id="SCI_SETHOTSPOTACTIVEFORE">SCI_SETHOTSPOTACTIVEFORE(bool useHotSpotForeColour, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_GETHOTSPOTACTIVEFORE">SCI_GETHOTSPOTACTIVEFORE</b><br />\r
+ <b id="SCI_SETHOTSPOTACTIVEBACK">SCI_SETHOTSPOTACTIVEBACK(bool useHotSpotBackColour, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_GETHOTSPOTACTIVEBACK">SCI_GETHOTSPOTACTIVEBACK</b><br />\r
+ <b id="SCI_SETHOTSPOTACTIVEUNDERLINE">SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)</b><br />\r
+ <b id="SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</b><br />\r
+ <b id="SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</b><br />\r
+ <b id="SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</b><br />\r
+ While the cursor hovers over text in a style with the hotspot attribute set,\r
+ the default colouring can be modified and an underline drawn with these settings.\r
+ Single line mode stops a hotspot from wrapping onto next line.</p>\r
+\r
+ <p><b id="SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</b><br />\r
+ <b id="SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</b><br />\r
+ By default, Scintilla displays control characters (characters with codes less than 32) in a\r
+ rounded rectangle as ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",\r
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",\r
+ "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US". These mnemonics come from the\r
+ early days of signaling, though some are still used (LF = Line Feed, BS = Back Space, CR =\r
+ Carriage Return, for example).</p>\r
+\r
+ <p>You can choose to replace these mnemonics by a nominated symbol with an ASCII code in the\r
+ range 32 to 255. If you set a symbol value less than 32, all control characters are displayed\r
+ as mnemonics. The symbol you set is rendered in the font of the style set for the character.\r
+ You can read back the current symbol with the <code>SCI_GETCONTROLCHARSYMBOL</code> message.\r
+ The default symbol value is 0.</p>\r
+\r
+ <p><b id="SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(bool useCaretStickyBehaviour)</b><br />\r
+ <b id="SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</b><br />\r
+ <b id="SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</b><br />\r
+ These messages set, get or toggle the caretSticky flag which controls when the last position\r
+ of the caret on the line is saved. When set to true, the position is not saved when you type\r
+ a character, a tab, paste the clipboard content or press backspace.</p>\r
+\r
+ <h2 id="Margins">Margins</h2>\r
+\r
+ <p>There may be up to five margins to the left of the text display, plus a gap either side of\r
+ the text. Each margin can be set to display either symbols or line numbers with <a\r
+ class="message" href="#SCI_SETMARGINTYPEN"><code>SCI_SETMARGINTYPEN</code></a>. The markers\r
+ that can be displayed in each margin are set with <a class="message"\r
+ href="#SCI_SETMARGINMASKN"><code>SCI_SETMARGINMASKN</code></a>. Any markers not associated with\r
+ a visible margin will be displayed as changes in background colour in the text. A width in\r
+ pixels can be set for each margin. Margins with a zero width are ignored completely. You can\r
+ choose if a mouse click in a margin sends a <a class="message"\r
+ href="#SCN_MARGINCLICK"><code>SCN_MARGINCLICK</code></a> notification to the container or\r
+ selects a line of text.</p>\r
+\r
+ <p>The margins are numbered 0 to 4. Using a margin number outside the valid range has no\r
+ effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it\r
+ is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so\r
+ it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it\r
+ is hidden. Of course, you can set the margins to be whatever you wish.</p>\r
+ <code><a class="message" href="#SCI_SETMARGINTYPEN">SCI_SETMARGINTYPEN(int margin, int\r
+ type)</a><br />\r
+ <a class="message" href="#SCI_GETMARGINTYPEN">SCI_GETMARGINTYPEN(int margin)</a><br />\r
+ <a class="message" href="#SCI_SETMARGINWIDTHN">SCI_SETMARGINWIDTHN(int margin, int\r
+ pixelWidth)</a><br />\r
+ <a class="message" href="#SCI_GETMARGINWIDTHN">SCI_GETMARGINWIDTHN(int margin)</a><br />\r
+ <a class="message" href="#SCI_SETMARGINMASKN">SCI_SETMARGINMASKN(int margin, int\r
+ mask)</a><br />\r
+ <a class="message" href="#SCI_GETMARGINMASKN">SCI_GETMARGINMASKN(int margin)</a><br />\r
+ <a class="message" href="#SCI_SETMARGINSENSITIVEN">SCI_SETMARGINSENSITIVEN(int margin, bool\r
+ sensitive)</a><br />\r
+ <a class="message" href="#SCI_GETMARGINSENSITIVEN">SCI_GETMARGINSENSITIVEN(int\r
+ margin)</a><br />\r
+ <a class="message" href="#SCI_SETMARGINLEFT">SCI_SETMARGINLEFT(<unused>, int\r
+ pixels)</a><br />\r
+ <a class="message" href="#SCI_GETMARGINLEFT">SCI_GETMARGINLEFT</a><br />\r
+ <a class="message" href="#SCI_SETMARGINRIGHT">SCI_SETMARGINRIGHT(<unused>, int\r
+ pixels)</a><br />\r
+ <a class="message" href="#SCI_GETMARGINRIGHT">SCI_GETMARGINRIGHT</a><br />\r
+ <a class="message" href="#SCI_SETFOLDMARGINCOLOUR">SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)</a><br />\r
+ <a class="message" href="#SCI_SETFOLDMARGINHICOLOUR">SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETMARGINTYPEN">SCI_SETMARGINTYPEN(int margin, int iType)</b><br />\r
+ <b id="SCI_GETMARGINTYPEN">SCI_GETMARGINTYPEN(int margin)</b><br />\r
+ These two routines set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4.\r
+ You can use the predefined constants <code>SC_MARGIN_SYMBOL</code> (0) and\r
+ <code>SC_MARGIN_NUMBER</code> (1) to set a margin as either a line number or a symbol margin.\r
+ By convention, margin 0 is used for line numbers and the next two are used for symbols. You can\r
+ also use the constants <code>SC_MARGIN_BACK</code> (2) and <code>SC_MARGIN_FORE</code> (3) for\r
+ symbol margins that set their background colour to match the STYLE_DEFAULT background and\r
+ foreground colours.</p>\r
+\r
+ <p><b id="SCI_SETMARGINWIDTHN">SCI_SETMARGINWIDTHN(int margin, int pixelWidth)</b><br />\r
+ <b id="SCI_GETMARGINWIDTHN">SCI_GETMARGINWIDTHN(int margin)</b><br />\r
+ These routines set and get the width of a margin in pixels. A margin with zero width is\r
+ invisible. By default, Scintilla sets margin 1 for symbols with a width of 16 pixels, so this\r
+ is a reasonable guess if you are not sure what would be appropriate. Line number margins widths\r
+ should take into account the number of lines in the document and the line number style. You\r
+ could use something like <a class="message"\r
+ href="#SCI_TEXTWIDTH"><code>SCI_TEXTWIDTH(STYLE_LINENUMBER, "_99999")</code></a> to get a\r
+ suitable width.</p>\r
+\r
+ <p><b id="SCI_SETMARGINMASKN">SCI_SETMARGINMASKN(int margin, int mask)</b><br />\r
+ <b id="SCI_GETMARGINMASKN">SCI_GETMARGINMASKN(int margin)</b><br />\r
+ The mask is a 32-bit value. Each bit corresponds to one of 32 logical symbols that can be\r
+ displayed in a margin that is enabled for symbols. There is a useful constant,\r
+ <code>SC_MASK_FOLDERS</code> (0xFE000000 or -33554432), that is a mask for the 7 logical\r
+ symbols used to denote folding. You can assign a wide range of symbols and colours to each of\r
+ the 32 logical symbols, see <a href="#Markers">Markers</a> for more information. If <code>(mask\r
+ & SC_MASK_FOLDERS)==0</code>, the margin background colour is controlled by style 33 (<a\r
+ class="message" href="#StyleDefinition"><code>STYLE_LINENUMBER</code></a>).</p>\r
+\r
+ <p>You add logical markers to a line with <a class="message"\r
+ href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. If a line has an associated marker that\r
+ does not appear in the mask of any margin with a non-zero width, the marker changes the\r
+ background colour of the line. For example, suppose you decide to use logical marker 10 to mark\r
+ lines with a syntax error and you want to show such lines by changing the background colour.\r
+ The mask for this marker is 1 shifted left 10 times (1<<10) which is 0x400. If you make\r
+ sure that no symbol margin includes 0x400 in its mask, any line with the marker gets the\r
+ background colour changed.</p>\r
+\r
+ <p>To set a non-folding margin 1 use <code>SCI_SETMARGINMASKN(1, ~SC_MASK_FOLDERS)</code>; to\r
+ set a folding margin 2 use <code>SCI_SETMARGINMASKN(2, SC_MASK_FOLDERS)</code>. This is the\r
+ default set by Scintilla. <code>~SC_MASK_FOLDERS</code> is 0x1FFFFFF in hexadecimal or 33554431\r
+ decimal. Of course, you may need to display all 32 symbols in a margin, in which case use\r
+ <code>SCI_SETMARGINMASKN(margin, -1)</code>.</p>\r
+\r
+ <p><b id="SCI_SETMARGINSENSITIVEN">SCI_SETMARGINSENSITIVEN(int margin, bool\r
+ sensitive)</b><br />\r
+ <b id="SCI_GETMARGINSENSITIVEN">SCI_GETMARGINSENSITIVEN(int margin)</b><br />\r
+ Each of the five margins can be set sensitive or insensitive to mouse clicks. A click in a\r
+ sensitive margin sends a <a class="message"\r
+ href="#SCN_MARGINCLICK"><code>SCN_MARGINCLICK</code></a> <a class="jump"\r
+ href="#Notifications">notification</a> to the container. Margins that are not sensitive act as\r
+ selection margins which make it easy to select ranges of lines. By default, all margins are\r
+ insensitive.</p>\r
+\r
+ <p><b id="SCI_SETMARGINLEFT">SCI_SETMARGINLEFT(<unused>, int pixels)</b><br />\r
+ <b id="SCI_GETMARGINLEFT">SCI_GETMARGINLEFT</b><br />\r
+ <b id="SCI_SETMARGINRIGHT">SCI_SETMARGINRIGHT(<unused>, int pixels)</b><br />\r
+ <b id="SCI_GETMARGINRIGHT">SCI_GETMARGINRIGHT</b><br />\r
+ These messages set and get the width of the blank margin on both sides of the text in pixels.\r
+ The default is to one pixel on each side.</p>\r
+\r
+ <p><b id="SCI_SETFOLDMARGINCOLOUR">SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)</b><br />\r
+ <b id="SCI_SETFOLDMARGINHICOLOUR">SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)</b><br />\r
+ These messages allow changing the colour of the fold margin and fold margin highlight.\r
+ On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight\r
+ colour to ::GetSysColor(COLOR_3DHIGHLIGHT).</p>\r
+\r
+ <h2 id="OtherSettings">Other settings</h2>\r
+ <code><a class="message" href="#SCI_SETUSEPALETTE">SCI_SETUSEPALETTE(bool\r
+ allowPaletteUse)</a><br />\r
+ <a class="message" href="#SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</a><br />\r
+ <a class="message" href="#SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</a><br />\r
+ <a class="message" href="#SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</a><br />\r
+ <a class="message" href="#SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</a><br />\r
+ <a class="message" href="#SCI_GETTWOPHASEDRAW">SCI_GETTWOPHASEDRAW</a><br />\r
+ <a class="message" href="#SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</a><br />\r
+ <a class="message" href="#SCI_GETCODEPAGE">SCI_GETCODEPAGE</a><br />\r
+ <a class="message" href="#SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</a><br />\r
+ <a class="message" href="#SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</a><br />\r
+ <a class="message" href="#SCI_SETWORDCHARS">SCI_SETWORDCHARS(<unused>, const char\r
+ *chars)</a><br />\r
+ <a class="message" href="#SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(<unused>, const char\r
+ *chars)</a><br />\r
+ <a class="message" href="#SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</a><br />\r
+ <a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br />\r
+ <a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br />\r
+ <a class="message" href="#SCI_GETFOCUS">SCI_GETFOCUS</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETUSEPALETTE">SCI_SETUSEPALETTE(bool allowPaletteUse)</b><br />\r
+ <b id="SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</b><br />\r
+ On 8 bit displays, which can only display a maximum of 256 colours, the graphics environment\r
+ mediates between the colour needs of applications through the use of palettes. On GTK+,\r
+ Scintilla always uses a palette.</p>\r
+\r
+ <p>On Windows, there are some problems with visual flashing when switching between applications\r
+ with palettes and it is also necessary for the application containing the Scintilla control to\r
+ forward some messages to Scintilla for its palette code to work. Because of this, by default,\r
+ the palette is not used and the application must tell Scintilla to use one. If Scintilla is not\r
+ using a palette, it will only display in those colours already available, which are often the\r
+ 20 Windows system colours.</p>\r
+\r
+ <p>To see an example of how to enable palette support in Scintilla, search the text of SciTE\r
+ for <code>WM_PALETTECHANGED</code>, <code>WM_QUERYNEWPALETTE</code> and\r
+ <code>SCI_SETUSEPALETTE</code>. The Windows messages to forward are:<br />\r
+ <code>WM_SYSCOLORCHANGE</code>, <code>WM_PALETTECHANGED</code>,\r
+ <code>WM_QUERYNEWPALETTE</code> (should return <code>TRUE</code>).</p>\r
+\r
+ <p>To forward a message <code>(WM_XXXX, WPARAM, LPARAM)</code> to Scintilla, you can use\r
+ <code>SendMessage(hScintilla, WM_XXXX, WPARAM, LPARAM)</code> where <code>hScintilla</code> is\r
+ the handle to the Scintilla window you created as your editor.</p>\r
+\r
+ <p>While we are on the subject of forwarding messages in Windows, the top level window should\r
+ forward any <code>WM_SETTINGCHANGE</code> messages to Scintilla (this is currently used to\r
+ collect changes to mouse settings, but could be used for other user interface items in the\r
+ future).</p>\r
+\r
+ <p><b id="SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</b><br />\r
+ <b id="SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</b><br />\r
+ These messages turn buffered drawing on or off and report the buffered drawing state. Buffered\r
+ drawing draws each line into a bitmap rather than directly to the screen and then copies the\r
+ bitmap to the screen. This avoids flickering although it does take longer. The default is for\r
+ drawing to be buffered.</p>\r
+\r
+ <p><b id="SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</b><br />\r
+ <b id="SCI_GETTWOPHASEDRAW">SCI_GETTWOPHASEDRAW</b><br />\r
+ Two phase drawing is a better but slower way of drawing text.\r
+ In single phase drawing each run of characters in one style is drawn along with its background.\r
+ If a character overhangs the end of a run, such as in "<i>V</i>_" where the\r
+ "<i>V</i>" is in a different style from the "_", then this can cause the right hand\r
+ side of the "<i>V</i>" to be overdrawn by the background of the "_" which\r
+ cuts it off. Two phase drawing\r
+ fixes this by drawing all the backgrounds first and then drawing the text in\r
+ transparent mode. Two phase drawing may flicker more than single phase\r
+ unless buffered drawing is on. The default is for drawing to be two phase.</p>\r
+\r
+ <p><b id="SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</b><br />\r
+ <b id="SCI_GETCODEPAGE">SCI_GETCODEPAGE</b><br />\r
+ Scintilla has some support for Japanese, Chinese and Korean DBCS. Use this message with\r
+ <code>codePage</code> set to the code page number to set Scintilla to use code page information\r
+ to ensure double byte characters are treated as one character rather than two. This also stops\r
+ the caret from moving between the two bytes in a double byte character.\r
+ Do not use this message to choose between different single byte character sets: it doesn't do that.\r
+ Call with\r
+ <code>codePage</code> set to zero to disable DBCS support. The default is\r
+ <code>SCI_SETCODEPAGE(0)</code>.</p>\r
+\r
+ <p>Code page <code>SC_CP_UTF8</code> (65001) sets Scintilla into Unicode mode with the document\r
+ treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's\r
+ normal Unicode encoding before being drawn by the OS and thus can display Hebrew, Arabic,\r
+ Cyrillic, and Han characters. Languages which can use two characters stacked vertically in one\r
+ horizontal space, such as Thai, will mostly work but there are some issues where the characters\r
+ are drawn separately leading to visual glitches. Bi-directional text is not supported. Characters outside the\r
+ Basic Multilingual Plane are unlikely to work.</p>\r
+\r
+ <p>On Windows, code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK),\r
+ 949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab)\r
+ although these may require installation of language specific support.</p>\r
+\r
+ <p>On GTK+, code page <code>SC_CP_DBCS</code> (1) sets Scintilla into\r
+ multi byte character mode as is required for Japanese language processing with\r
+ the EUC encoding.</p>\r
+\r
+ <p>For GTK+ 1.x, the locale should be set to a Unicode locale with a call similar to\r
+ <code>setlocale(LC_CTYPE, "en_US.UTF-8")</code>. Fonts with an <code>"iso10646"</code> registry\r
+ should be used in a font set. Font sets are a comma separated list of partial font\r
+ specifications where each partial font specification can be in the form:\r
+ <code>foundry-fontface-charsetregistry-encoding</code> or\r
+ <code>fontface-charsetregistry-encoding</code> or <code>foundry-fontface</code> or\r
+ <code>fontface</code>. An example is <code>"misc-fixed-iso10646-1,*"</code>.\r
+ On GTK+ 2.x, Pango fonts should be used rather than font sets.</p>\r
+\r
+ <p>Setting <code>codePage</code> to a non-zero value that is not <code>SC_CP_UTF8</code> is\r
+ operating system dependent.</p>\r
+\r
+ <p><b id="SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</b><br />\r
+ <b id="SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</b><br />\r
+ On Windows, character keys are normally handled differently depending on whether Scintilla is a wide\r
+ or narrow character window with character messages treated as Unicode when wide and as 8 bit otherwise.\r
+ Set this property to always treat as Unicode. This option is needed for Delphi.</p>\r
+\r
+ <p><b id="SCI_SETWORDCHARS">SCI_SETWORDCHARS(<unused>, const char *chars)</b><br />\r
+ Scintilla has several functions that operate on words, which are defined to be contiguous\r
+ sequences of characters from a particular set of characters. This message defines which\r
+ characters are members of that set. The character sets are set to default values before processing this\r
+ function.\r
+ For example, if you don't allow '_' in your set of characters\r
+ use:<br />\r
+ <code>SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")</code>;</p>\r
+\r
+ <p><b id="SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(<unused>, const char *chars)</b><br />\r
+ Similar to <code>SCI_SETWORDCHARS</code>, this message allows the user to define which chars Scintilla considers\r
+ as whitespace. Setting the whitespace chars allows the user to fine-tune Scintilla's behaviour doing\r
+ such things as moving the cursor to the start or end of a word; for example, by defining punctuation chars\r
+ as whitespace, they will be skipped over when the user presses ctrl+left or ctrl+right.\r
+ This function should be called after <code>SCI_SETWORDCHARS</code> as it will\r
+ reset the whitespace characters to the default set.</p>\r
+ <p><b id="SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</b><br />\r
+ Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other\r
+ characters with codes less than 0x20, with word characters set to alphanumeric and '_'.\r
+ </p>\r
+\r
+\r
+ <p><b id="SCI_GRABFOCUS">SCI_GRABFOCUS</b><br />\r
+ <b id="SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</b><br />\r
+ <b id="SCI_GETFOCUS">SCI_GETFOCUS</b><br />\r
+ Scintilla can be told to grab the focus with this message. This is needed more on GTK+ where\r
+ focus handling is more complicated than on Windows.</p>\r
+\r
+ <p>The internal focus flag can be set with <code>SCI_SETFOCUS</code>. This is used by clients\r
+ that have complex focus requirements such as having their own window that gets the real focus\r
+ but with the need to indicate that Scintilla has the logical focus.</p>\r
+\r
+ <h2 id="BraceHighlighting">Brace highlighting</h2>\r
+ <code><a class="message" href="#SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(int pos1, int\r
+ pos2)</a><br />\r
+ <a class="message" href="#SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</a><br />\r
+ <a class="message" href="#SCI_BRACEMATCH">SCI_BRACEMATCH(int position, int\r
+ maxReStyle)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(int pos1, int pos2)</b><br />\r
+ Up to two characters can be highlighted in a 'brace highlighting style', which is defined as\r
+ style number <a class="message" href="#StyleDefinition"><code>STYLE_BRACELIGHT</code></a> (34).\r
+ If you have enabled indent guides, you may also wish to highlight the indent that corresponds\r
+ with the brace. You can locate the column with <a class="message"\r
+ href="#SCI_GETCOLUMN"><code>SCI_GETCOLUMN</code></a> and highlight the indent with <a\r
+ class="message" href="#SCI_SETHIGHLIGHTGUIDE"><code>SCI_SETHIGHLIGHTGUIDE</code></a>.</p>\r
+\r
+ <p><b id="SCI_BRACEBADLIGHT">SCI_BRACEBADLIGHT(int pos1)</b><br />\r
+ If there is no matching brace then the <a class="jump" href="#StyleDefinition">brace\r
+ badlighting style</a>, style <code>BRACE_BADLIGHT</code> (35), can be used to show the brace\r
+ that is unmatched. Using a position of <code>INVALID_POSITION</code> (-1) removes the\r
+ highlight.</p>\r
+\r
+ <p><b id="SCI_BRACEMATCH">SCI_BRACEMATCH(int pos, int maxReStyle)</b><br />\r
+ The <code>SCI_BRACEMATCH</code> message finds a corresponding matching brace given\r
+ <code>pos</code>, the position of one brace. The brace characters handled are '(', ')', '[',\r
+ ']', '{', '}', '<', and '>'. The search is forwards from an opening brace and backwards\r
+ from a closing brace. If the character at position is not a brace character, or a matching\r
+ brace cannot be found, the return value is -1. Otherwise, the return value is the position of\r
+ the matching brace.</p>\r
+\r
+ <p>A match only occurs if the style of the matching brace is the same as the starting brace or\r
+ the matching brace is beyond the end of styling. Nested braces are handled correctly. The\r
+ <code>maxReStyle</code> parameter must currently be 0 - it may be used in the future to limit\r
+ the length of brace searches.</p>\r
+\r
+ <h2 id="TabsAndIndentationGuides">Tabs and Indentation Guides</h2>\r
+\r
+ <p>Indentation (the white space at the start of a line) is often used by programmers to clarify\r
+ program structure and in some languages, for example Python, it may be part of the language\r
+ syntax. Tabs are normally used in editors to insert a tab character or to pad text with spaces\r
+ up to the next tab.</p>\r
+\r
+ <p>Scintilla can be set to treat tab and backspace in the white space at the start of a line in\r
+ a special way: inserting a tab indents the line to the next indent position rather than just\r
+ inserting a tab at the current character position and backspace unindents the line rather than\r
+ deleting a character. Scintilla can also display indentation guides (vertical lines) to help\r
+ you to generate code.</p>\r
+ <code><a class="message" href="#SCI_SETTABWIDTH">SCI_SETTABWIDTH(int widthInChars)</a><br />\r
+ <a class="message" href="#SCI_GETTABWIDTH">SCI_GETTABWIDTH</a><br />\r
+ <a class="message" href="#SCI_SETUSETABS">SCI_SETUSETABS(bool useTabs)</a><br />\r
+ <a class="message" href="#SCI_GETUSETABS">SCI_GETUSETABS</a><br />\r
+ <a class="message" href="#SCI_SETINDENT">SCI_SETINDENT(int widthInChars)</a><br />\r
+ <a class="message" href="#SCI_GETINDENT">SCI_GETINDENT</a><br />\r
+ <a class="message" href="#SCI_SETTABINDENTS">SCI_SETTABINDENTS(bool tabIndents)</a><br />\r
+ <a class="message" href="#SCI_GETTABINDENTS">SCI_GETTABINDENTS</a><br />\r
+ <a class="message" href="#SCI_SETBACKSPACEUNINDENTS">SCI_SETBACKSPACEUNINDENTS(bool\r
+ bsUnIndents)</a><br />\r
+ <a class="message" href="#SCI_GETBACKSPACEUNINDENTS">SCI_GETBACKSPACEUNINDENTS</a><br />\r
+ <a class="message" href="#SCI_SETLINEINDENTATION">SCI_SETLINEINDENTATION(int line, int\r
+ indentation)</a><br />\r
+ <a class="message" href="#SCI_GETLINEINDENTATION">SCI_GETLINEINDENTATION(int line)</a><br />\r
+ <a class="message" href="#SCI_GETLINEINDENTPOSITION">SCI_GETLINEINDENTPOSITION(int\r
+ line)</a><br />\r
+ <a class="message" href="#SCI_SETINDENTATIONGUIDES">SCI_SETINDENTATIONGUIDES(bool\r
+ view)</a><br />\r
+ <a class="message" href="#SCI_GETINDENTATIONGUIDES">SCI_GETINDENTATIONGUIDES</a><br />\r
+ <a class="message" href="#SCI_SETHIGHLIGHTGUIDE">SCI_SETHIGHLIGHTGUIDE(int column)</a><br />\r
+ <a class="message" href="#SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETTABWIDTH">SCI_SETTABWIDTH(int widthInChars)</b><br />\r
+ <b id="SCI_GETTABWIDTH">SCI_GETTABWIDTH</b><br />\r
+ <code>SCI_SETTABWIDTH</code> sets the size of a tab as a multiple of the size of a space\r
+ character in <code>STYLE_DEFAULT</code>. The default tab width is 8 characters. There are no\r
+ limits on tab sizes, but values less than 1 or large values may have undesirable effects.</p>\r
+\r
+ <p><b id="SCI_SETUSETABS">SCI_SETUSETABS(bool useTabs)</b><br />\r
+ <b id="SCI_GETUSETABS">SCI_GETUSETABS</b><br />\r
+ <code>SCI_SETUSETABS</code> determines whether indentation should be created out of a mixture\r
+ of tabs and spaces or be based purely on spaces. Set <code>useTabs</code> to <code>false</code>\r
+ (0) to create all tabs and indents out of spaces. The default is <code>true</code>. You can use\r
+ <a class="message" href="#SCI_GETCOLUMN"><code>SCI_GETCOLUMN</code></a> to get the column of a\r
+ position taking the width of a tab into account.</p>\r
+ <p><b id="SCI_SETINDENT">SCI_SETINDENT(int widthInChars)</b><br />\r
+ <b id="SCI_GETINDENT">SCI_GETINDENT</b><br />\r
+ <code>SCI_SETINDENT</code> sets the size of indentation in terms of the width of a space in <a\r
+ class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. If you set a width of\r
+ 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values\r
+ less than 0 or large values may have undesirable effects.\r
+ </p>\r
+\r
+ <p><b id="SCI_SETTABINDENTS">SCI_SETTABINDENTS(bool tabIndents)</b><br />\r
+ <b id="SCI_GETTABINDENTS">SCI_GETTABINDENTS</b><br />\r
+ <b id="SCI_SETBACKSPACEUNINDENTS">SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)</b><br />\r
+ <b id="SCI_GETBACKSPACEUNINDENTS">SCI_GETBACKSPACEUNINDENTS</b><br />\r
+ </p>\r
+\r
+ <p>Inside indentation white space, the tab and backspace keys can be made to indent and\r
+ unindent rather than insert a tab character or delete a character with the\r
+ <code>SCI_SETTABINDENTS</code> and <code>SCI_SETBACKSPACEUNINDENTS</code> functions.</p>\r
+\r
+ <p><b id="SCI_SETLINEINDENTATION">SCI_SETLINEINDENTATION(int line, int indentation)</b><br />\r
+ <b id="SCI_GETLINEINDENTATION">SCI_GETLINEINDENTATION(int line)</b><br />\r
+ The amount of indentation on a line can be discovered and set with\r
+ <code>SCI_GETLINEINDENTATION</code> and <code>SCI_SETLINEINDENTATION</code>. The indentation is\r
+ measured in character columns, which correspond to the width of space characters.</p>\r
+\r
+ <p><b id="SCI_GETLINEINDENTPOSITION">SCI_GETLINEINDENTPOSITION(int line)</b><br />\r
+ This returns the position at the end of indentation of a line.</p>\r
+\r
+ <p><b id="SCI_SETINDENTATIONGUIDES">SCI_SETINDENTATIONGUIDES(int indentView)</b><br />\r
+ <b id="SCI_GETINDENTATIONGUIDES">SCI_GETINDENTATIONGUIDES</b><br />\r
+ Indentation guides are dotted vertical lines that appear within indentation white space every\r
+ indent size columns. They make it easy to see which constructs line up especially when they\r
+ extend over multiple pages. Style <a class="message"\r
+ href="#StyleDefinition"><code>STYLE_INDENTGUIDE</code></a> (37) is used to specify the\r
+ foreground and background colour of the indentation guides.</p>\r
+\r
+ <p>There are 4 indentation guide views.\r
+ SC_IV_NONE turns the feature off but the other 3 states determine how far the guides appear on\r
+ empty lines.\r
+ <table border="0" summary="Search flags">\r
+ <tbody>\r
+ <tr>\r
+ <td><code>SC_IV_NONE</code></td>\r
+ <td>No indentation guides are shown.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SC_IV_REAL</code></td>\r
+ <td>Indentation guides are shown inside real indentation white space.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SC_IV_LOOKFORWARD</code></td>\r
+ <td>Indentation guides are shown beyond the actual indentation up to the level of the\r
+ next non-empty line.\r
+ If the previous non-empty line was a fold header then indentation guides are shown for\r
+ one more level of indent than that line. This setting is good for Python.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SC_IV_LOOKBOTH</code></td>\r
+ <td>Indentation guides are shown beyond the actual indentation up to the level of the\r
+ next non-empty line or previous non-empty line whichever is the greater.\r
+ This setting is good for most languages.</td>\r
+ </tr>\r
+\r
+ </table>\r
+ </p>\r
+\r
+ <p><b id="SCI_SETHIGHLIGHTGUIDE">SCI_SETHIGHLIGHTGUIDE(int column)</b><br />\r
+ <b id="SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE</b><br />\r
+ When brace highlighting occurs, the indentation guide corresponding to the braces may be\r
+ highlighted with the brace highlighting style, <a class="message"\r
+ href="#StyleDefinition"><code>STYLE_BRACELIGHT</code></a> (34). Set <code>column</code> to 0 to\r
+ cancel this highlight.</p>\r
+\r
+ <h2 id="Markers">Markers</h2>\r
+\r
+ <p>There are 32 markers, numbered 0 to 31, and you can assign any combination of them to each\r
+ line in the document. Markers appear in the <a class="jump" href="#Margins">selection\r
+ margin</a> to the left of the text. If the selection margin is set to zero width, the\r
+ background colour of the whole line is changed instead. Marker numbers 25 to 31 are used by\r
+ Scintilla in folding margins, and have symbolic names of the form <code>SC_MARKNUM_</code>*,\r
+ for example <code>SC_MARKNUM_FOLDEROPEN</code>.</p>\r
+\r
+ <p>Marker numbers 0 to 24 have no pre-defined function; you can use them to mark syntax errors\r
+ or the current point of execution, break points, or whatever you need marking. If you do not\r
+ need folding, you can use all 32 for any purpose you wish.</p>\r
+\r
+ <p>Each marker number has a symbol associated with it. You can also set the foreground and\r
+ background colour for each marker number, so you can use the same symbol more than once with\r
+ different colouring for different uses. Scintilla has a set of symbols you can assign\r
+ (<code>SC_MARK_</code>*) or you can use characters. By default, all 32 markers are set to\r
+ <code>SC_MARK_CIRCLE</code> with a black foreground and a white background.</p>\r
+\r
+ <p>The markers are drawn in the order of their numbers, so higher numbered markers appear on\r
+ top of lower numbered ones. Markers try to move with their text by tracking where the start of\r
+ their line moves. When a line is deleted, its markers are combined, by an <code>OR</code>\r
+ operation, with the markers of the previous line.</p>\r
+ <code><a class="message" href="#SCI_MARKERDEFINE">SCI_MARKERDEFINE(int markerNumber, int\r
+ markerSymbols)</a><br />\r
+ <a class="message" href="#SCI_MARKERDEFINEPIXMAP">SCI_MARKERDEFINEPIXMAP(int markerNumber,\r
+ const char *xpm)</a><br />\r
+ <a class="message" href="#SCI_MARKERSETFORE">SCI_MARKERSETFORE(int markerNumber, int\r
+ colour)</a><br />\r
+ <a class="message" href="#SCI_MARKERSETBACK">SCI_MARKERSETBACK(int markerNumber, int\r
+ colour)</a><br />\r
+ <a class="message" href="#SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int\r
+ alpha)</a><br />\r
+ <a class="message" href="#SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</a><br />\r
+ <a class="message" href="#SCI_MARKERADDSET">SCI_MARKERADDSET(int line, int markerMask)</a><br />\r
+ <a class="message" href="#SCI_MARKERDELETE">SCI_MARKERDELETE(int line, int\r
+ markerNumber)</a><br />\r
+ <a class="message" href="#SCI_MARKERDELETEALL">SCI_MARKERDELETEALL(int markerNumber)</a><br />\r
+ <a class="message" href="#SCI_MARKERGET">SCI_MARKERGET(int line)</a><br />\r
+ <a class="message" href="#SCI_MARKERNEXT">SCI_MARKERNEXT(int lineStart, int\r
+ markerMask)</a><br />\r
+ <a class="message" href="#SCI_MARKERPREVIOUS">SCI_MARKERPREVIOUS(int lineStart, int\r
+ markerMask)</a><br />\r
+ <a class="message" href="#SCI_MARKERLINEFROMHANDLE">SCI_MARKERLINEFROMHANDLE(int\r
+ handle)</a><br />\r
+ <a class="message" href="#SCI_MARKERDELETEHANDLE">SCI_MARKERDELETEHANDLE(int handle)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_MARKERDEFINE">SCI_MARKERDEFINE(int markerNumber, int markerSymbols)</b><br />\r
+ This message associates a marker number in the range 0 to 31 with one of the marker symbols or\r
+ an ASCII character. The general-purpose marker symbols currently available are:<br />\r
+ <code>SC_MARK_CIRCLE</code>, <code>SC_MARK_ROUNDRECT</code>, <code>SC_MARK_ARROW</code>,\r
+ <code>SC_MARK_SMALLRECT</code>, <code>SC_MARK_SHORTARROW</code>, <code>SC_MARK_EMPTY</code>,\r
+ <code>SC_MARK_ARROWDOWN</code>, <code>SC_MARK_MINUS</code>, <code>SC_MARK_PLUS</code>,\r
+ <code>SC_MARK_ARROWS</code>, <code>SC_MARK_DOTDOTDOT</code>, <code>SC_MARK_EMPTY</code>,\r
+ <code>SC_MARK_BACKGROUND</code>, <code>SC_MARK_LEFTRECT</code>\r
+ and <code>SC_MARK_FULLRECT</code>.</p>\r
+\r
+ <p>The <code>SC_MARK_BACKGROUND</code> marker changes the background colour of the line only.\r
+ The <code>SC_MARK_FULLRECT</code> symbol mirrors this, changing only the margin background colour.\r
+ The <code>SC_MARK_EMPTY</code> symbol is invisible, allowing client code to track the movement\r
+ of lines. You would also use it if you changed the folding style and wanted one or more of the\r
+ <code>SC_FOLDERNUM_</code>* markers to have no associated symbol.</p>\r
+\r
+ <p>There are also marker symbols designed for use in the folding margin in a flattened tree\r
+ style.<br />\r
+ <code>SC_MARK_BOXMINUS</code>, <code>SC_MARK_BOXMINUSCONNECTED</code>,\r
+ <code>SC_MARK_BOXPLUS</code>, <code>SC_MARK_BOXPLUSCONNECTED</code>,\r
+ <code>SC_MARK_CIRCLEMINUS</code>, <code>SC_MARK_CIRCLEMINUSCONNECTED</code>,\r
+ <code>SC_MARK_CIRCLEPLUS</code>, <code>SC_MARK_CIRCLEPLUSCONNECTED</code>,\r
+ <code>SC_MARK_LCORNER</code>, <code>SC_MARK_LCORNERCURVE</code>, <code>SC_MARK_TCORNER</code>,\r
+ <code>SC_MARK_TCORNERCURVE</code>, and <code>SC_MARK_VLINE</code>.</p>\r
+ Characters can be used as markers by adding the ASCII value of the character to\r
+ <code>SC_MARK_CHARACTER</code> (10000). For example, to use 'A' (ASCII code 65) as marker\r
+ number 1 use:<br />\r
+ <code>SCI_MARKERDEFINE(1, SC_MARK_CHARACTER+65)</code>. <br />\r
+\r
+ <p>The marker numbers <code>SC_MARKNUM_FOLDER</code> and <code>SC_MARKNUM_FOLDEROPEN</code> are\r
+ used for showing that a fold is present and open or closed. Any symbols may be assigned for\r
+ this purpose although the (<code>SC_MARK_PLUS</code>, <code>SC_MARK_MINUS</code>) pair or the\r
+ (<code>SC_MARK_ARROW</code>, <code>SC_MARK_ARROWDOWN</code>) pair are good choices. As well as\r
+ these two, more assignments are needed for the flattened tree style:\r
+ <code>SC_MARKNUM_FOLDEREND</code>, <code>SC_MARKNUM_FOLDERMIDTAIL</code>,\r
+ <code>SC_MARKNUM_FOLDEROPENMID</code>, <code>SC_MARKNUM_FOLDERSUB</code>, and\r
+ <code>SC_MARKNUM_FOLDERTAIL</code>. The bits used for folding are specified by\r
+ <code>SC_MASK_FOLDERS</code>, which is commonly used as an argument to\r
+ <code>SCI_SETMARGINMASKN</code> when defining a margin to be used for folding.</p>\r
+\r
+ <p>This table shows which <code>SC_MARK_</code>* symbols should be assigned to which\r
+ <code>SC_MARKNUM_</code>* marker numbers to obtain four folding styles: Arrow (mimics\r
+ Macintosh), plus/minus shows folded lines as '+' and opened folds as '-', Circle tree, Box\r
+ tree.</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Markers used for folding">\r
+ <thead align="left">\r
+ <tr>\r
+ <th><code>SC_MARKNUM_</code>*</th>\r
+\r
+ <th>Arrow</th>\r
+\r
+ <th>Plus/minus</th>\r
+\r
+ <th>Circle tree</th>\r
+\r
+ <th>Box tree</th>\r
+ </tr>\r
+ </thead>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <th align="left"><code>FOLDEROPEN</code></th>\r
+\r
+ <td><code>ARROWDOWN</code></td>\r
+\r
+ <td><code>MINUS</code></td>\r
+\r
+ <td><code>CIRCLEMINUS</code></td>\r
+\r
+ <td><code>BOXMINUS</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>FOLDER</code></th>\r
+\r
+ <td><code>ARROW</code></td>\r
+\r
+ <td><code>PLUS</code></td>\r
+\r
+ <td><code>CIRCLEPLUS</code></td>\r
+\r
+ <td><code>BOXPLUS</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>FOLDERSUB</code></th>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>VLINE</code></td>\r
+\r
+ <td><code>VLINE</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>FOLDERTAIL</code></th>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>LCORNERCURVE</code></td>\r
+\r
+ <td><code>LCORNER</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>FOLDEREND</code></th>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>CIRCLEPLUSCONNECTED</code></td>\r
+\r
+ <td><code>BOXPLUSCONNECTED</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>FOLDEROPENMID</code></th>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>CIRCLEMINUSCONNECTED</code></td>\r
+\r
+ <td><code>BOXMINUSCONNECTED</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <th align="left"><code>FOLDERMIDTAIL</code></th>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>EMPTY</code></td>\r
+\r
+ <td><code>TCORNERCURVE</code></td>\r
+\r
+ <td><code>TCORNER</code></td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_MARKERDEFINEPIXMAP">SCI_MARKERDEFINEPIXMAP(int markerNumber, const char\r
+ *xpm)</b><br />\r
+ Markers can be set to pixmaps with this message. The XPM format is used for the pixmap and it\r
+ is limited to pixmaps that use one character per pixel with no named colours.\r
+ The transparent colour may be named 'None'.\r
+ The data should be null terminated.\r
+ Pixmaps use the <code>SC_MARK_PIXMAP</code> marker symbol. You can find the full description of\r
+ the XPM format <a class="jump" href="http://koala.ilog.fr/lehors/xpm.html">here</a>.</p>\r
+\r
+ <p><b id="SCI_MARKERSETFORE">SCI_MARKERSETFORE(int markerNumber, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_MARKERSETBACK">SCI_MARKERSETBACK(int markerNumber, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ These two messages set the foreground and background colour of a marker number.</p>\r
+ <p><b id="SCI_MARKERSETALPHA">SCI_MARKERSETALPHA(int markerNumber, int <a class="jump"\r
+ href="#alpha">alpha</a>)</b><br />\r
+ When markers are drawn in the content area, either because there is no margin for them or\r
+ they are of SC_MARK_BACKGROUND type, they may be drawn translucently by\r
+ setting an alpha value.</p>\r
+\r
+ <p><b id="SCI_MARKERADD">SCI_MARKERADD(int line, int markerNumber)</b><br />\r
+ This message adds marker number <code>markerNumber</code> to a line. The message returns -1 if\r
+ this fails (illegal line number, out of memory) or it returns a marker handle number that\r
+ identifies the added marker. You can use this returned handle with <a class="message"\r
+ href="#SCI_MARKERLINEFROMHANDLE"><code>SCI_MARKERLINEFROMHANDLE</code></a> to find where a\r
+ marker is after moving or combining lines and with <a class="message"\r
+ href="#SCI_MARKERDELETEHANDLE"><code>SCI_MARKERDELETEHANDLE</code></a> to delete the marker\r
+ based on its handle. The message does not check the value of markerNumber, nor does it\r
+ check if the line already contains the marker.</p>\r
+\r
+ <p><b id="SCI_MARKERADDSET">SCI_MARKERADDSET(int line, int markerMask)</b><br />\r
+ 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
+ <a class="message" href="#SCI_MARKERGET"><code>SCI_MARKERGET</code></a>\r
+ (and used by the mask-based marker search functions\r
+ <a class="message" href="#SCI_MARKERNEXT"><code>SCI_MARKERNEXT</code></a> and\r
+ <a class="message" href="#SCI_MARKERPREVIOUS"><code>SCI_MARKERPREVIOUS</code></a>).\r
+ As with\r
+ <a class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>, no check is made\r
+ to see if any of the markers are already present on the targeted line.</p>\r
+\r
+ <p><b id="SCI_MARKERDELETE">SCI_MARKERDELETE(int line, int markerNumber)</b><br />\r
+ This searches the given line number for the given marker number and deletes it if it is\r
+ present. If you added the same marker more than once to the line, this will delete one copy\r
+ each time it is used. If you pass in a marker number of -1, all markers are deleted from the\r
+ line.</p>\r
+\r
+ <p><b id="SCI_MARKERDELETEALL">SCI_MARKERDELETEALL(int markerNumber)</b><br />\r
+ This removes markers of the given number from all lines. If markerNumber is -1, it deletes all\r
+ markers from all lines.</p>\r
+\r
+ <p><b id="SCI_MARKERGET">SCI_MARKERGET(int line)</b><br />\r
+ This returns a 32-bit integer that indicates which markers were present on the line. Bit 0 is\r
+ set if marker 0 is present, bit 1 for marker 1 and so on.</p>\r
+\r
+ <p><b id="SCI_MARKERNEXT">SCI_MARKERNEXT(int lineStart, int markerMask)</b><br />\r
+ <b id="SCI_MARKERPREVIOUS">SCI_MARKERPREVIOUS(int lineStart, int markerMask)</b><br />\r
+ These messages search efficiently for lines that include a given set of markers. The search\r
+ starts at line number <code>lineStart</code> and continues forwards to the end of the file\r
+ (<code>SCI_MARKERNEXT</code>) or backwards to the start of the file\r
+ (<code>SCI_MARKERPREVIOUS</code>). The <code>markerMask</code> argument should have one bit set\r
+ for each marker you wish to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on. The\r
+ message returns the line number of the first line that contains one of the markers in\r
+ <code>markerMask</code> or -1 if no marker is found.</p>\r
+\r
+ <p><b id="SCI_MARKERLINEFROMHANDLE">SCI_MARKERLINEFROMHANDLE(int markerHandle)</b><br />\r
+ The <code>markerHandle</code> argument is an identifier for a marker returned by <a\r
+ class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. This function searches\r
+ the document for the marker with this handle and returns the line number that contains it or -1\r
+ if it is not found.</p>\r
+\r
+ <p><b id="SCI_MARKERDELETEHANDLE">SCI_MARKERDELETEHANDLE(int markerHandle)</b><br />\r
+ The <code>markerHandle</code> argument is an identifier for a marker returned by <a\r
+ class="message" href="#SCI_MARKERADD"><code>SCI_MARKERADD</code></a>. This function searches\r
+ the document for the marker with this handle and deletes the marker if it is found.</p>\r
+\r
+ <h2 id="Indicators">Indicators</h2>\r
+\r
+ <p>Indicators are used to display additional information over the top of styling.\r
+ They can be used to show, for example, syntax errors, deprecated names and bad indentation\r
+ by drawing underlines under text or boxes around text. Originally, Scintilla stored indicator information in\r
+ the style bytes but this has proved limiting, so now up to 32 separately stored indicators may be used.\r
+ While style byte indicators currently still work, they will soon be removed so all the bits in each style\r
+ byte can be used for lexical states.</p>\r
+\r
+ <p>Indicators may be displayed as simple underlines, squiggly underlines, a\r
+ line of small 'T' shapes, a line of diagonal hatching, a strike-out or a rectangle around the text.</p>\r
+\r
+ <p>The <code>SCI_INDIC*</code> messages allow you to get and set the visual appearance of the\r
+ indicators. They all use an <code>indicatorNumber</code> argument in the range 0 to INDIC_MAX(31)\r
+ to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use\r
+ by lexers (0..7) and a range for use by containers\r
+ (8=<code>INDIC_CONTAINER</code> .. 31=<code>INDIC_MAX</code>).</p>\r
+\r
+ <code><a class="message" href="#SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int\r
+ indicatorStyle)</a><br />\r
+ <a class="message" href="#SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</a><br />\r
+ <a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int\r
+ colour)</a><br />\r
+ <a class="message" href="#SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int\r
+ indicatorStyle)</b><br />\r
+ <b id="SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</b><br />\r
+ These two messages set and get the style for a particular indicator. The indicator styles\r
+ currently available are:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Indicators">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+\r
+ <th>Value</th>\r
+\r
+ <th align="left">Visual effect</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>INDIC_PLAIN</code></td>\r
+\r
+ <td align="center">0</td>\r
+\r
+ <td>Underlined with a single, straight line.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_SQUIGGLE</code></td>\r
+\r
+ <td align="center">1</td>\r
+\r
+ <td>A squiggly underline.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_TT</code></td>\r
+\r
+ <td align="center">2</td>\r
+\r
+ <td>A line of small T shapes.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_DIAGONAL</code></td>\r
+\r
+ <td align="center">3</td>\r
+\r
+ <td>Diagonal hatching.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_STRIKE</code></td>\r
+\r
+ <td align="center">4</td>\r
+\r
+ <td>Strike out.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_HIDDEN</code></td>\r
+\r
+ <td align="center">5</td>\r
+\r
+ <td>An indicator with no visual effect.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_BOX</code></td>\r
+\r
+ <td align="center">6</td>\r
+\r
+ <td>A rectangle around the text.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>INDIC_ROUNDBOX</code></td>\r
+\r
+ <td align="center">7</td>\r
+\r
+ <td>A rectangle with rounded corners around the text using translucent drawing with the\r
+ interior more transparent than the border.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>The default indicator styles are equivalent to:<br />\r
+ <code>SCI_INDICSETSTYLE(0, INDIC_SQUIGGLE);</code><br />\r
+ <code>SCI_INDICSETSTYLE(1, INDIC_TT);</code><br />\r
+ <code>SCI_INDICSETSTYLE(2, INDIC_PLAIN);</code></p>\r
+\r
+ <p><b id="SCI_INDICSETFORE">SCI_INDICSETFORE(int indicatorNumber, int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_INDICGETFORE">SCI_INDICGETFORE(int indicatorNumber)</b><br />\r
+ These two messages set and get the colour used to draw an indicator. The default indicator\r
+ colours are equivalent to:<br />\r
+ <code>SCI_INDICSETFORE(0, 0x007f00);</code> (dark green)<br />\r
+ <code>SCI_INDICSETFORE(1, 0xff0000);</code> (light blue)<br />\r
+ <code>SCI_INDICSETFORE(2, 0x0000ff);</code> (light red)</p>\r
+\r
+ <p><b id="SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</b><br />\r
+ <b id="SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</b><br />\r
+ These two messages set and get whether an indicator is drawn under text or over(default).\r
+ Drawing under text works only for modern indicators when <a class="message" href="#SCI_SETTWOPHASEDRAW">two phase drawing</a>\r
+ is enabled.</p>\r
+\r
+ <h3 id="Modern Indicators">Modern Indicators</h3>\r
+\r
+ <p>Modern indicators are stored in a format similar to run length encoding which is efficient in both\r
+ speed and storage for sparse information.</p>\r
+ <p>An indicator may store different values for each range but currently all values are drawn the same.\r
+ In the future, it may be possible to draw different values in different styles.</p>\r
+ <p>\r
+ <b id="SCI_SETINDICATORCURRENT">SCI_SETINDICATORCURRENT(int indicator)</b><br />\r
+ <b id="SCI_GETINDICATORCURRENT">SCI_GETINDICATORCURRENT</b><br />\r
+ These two messages set and get the indicator that will be affected by calls to\r
+ <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a> and\r
+ <a class="message" href="#SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE</a>.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_SETINDICATORVALUE">SCI_SETINDICATORVALUE(int value)</b><br />\r
+ <b id="SCI_GETINDICATORVALUE">SCI_GETINDICATORVALUE</b><br />\r
+ These two messages set and get the value that will be set by calls to\r
+ <a class="message" href="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a>.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE(int position, int fillLength)</b><br />\r
+ <b id="SCI_INDICATORCLEARRANGE">SCI_INDICATORCLEARRANGE(int position, int clearLength)</b><br />\r
+ These two messages fill or clear a range for the current indicator.\r
+ <code>SCI_INDICATORFILLRANGE</code> fills with the\r
+ the current value.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_INDICATORALLONFOR">SCI_INDICATORALLONFOR(int position)</b><br />\r
+ Retrieve a bitmap value representing which indicators are non-zero at a position.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_INDICATORVALUEAT">SCI_INDICATORVALUEAT(int indicator, int position)</b><br />\r
+ Retrieve the value of a particular indicator at a position.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_INDICATORSTART">SCI_INDICATORSTART(int indicator, int position)</b><br />\r
+ <b id="SCI_INDICATOREND">SCI_INDICATOREND(int indicator, int position)</b><br />\r
+ Find the start or end of a range with one value from a position within the range.\r
+ Can be used to iterate through the document to discover all the indicator positions.\r
+ </p>\r
+\r
+ <h3 id="Style Byte Indicators">Style Byte Indicators (deprecated)</h3>\r
+ <p>By default, Scintilla organizes the style byte associated with each text byte as 5 bits of\r
+ style information (for 32 styles) and 3 bits of indicator information for 3 independent\r
+ indicators so that, for example, syntax errors, deprecated names and bad indentation could all\r
+ be displayed at once.</p>\r
+\r
+ <p>The indicators are set using <a class="message"\r
+ href="#SCI_STARTSTYLING"><code>SCI_STARTSTYLING</code></a> with a <code>INDICS_MASK</code> mask\r
+ and <a class="message" href="#SCI_SETSTYLING"><code>SCI_SETSTYLING</code></a> with the values\r
+ <code>INDIC0_MASK</code>, <code>INDIC1_MASK</code> and <code>INDIC2_MASK</code>.</p>\r
+\r
+ <p>If you are using indicators in a buffer that has a lexer active\r
+ (see <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a>),\r
+ you must save lexing state information before setting any indicators and restore it afterwards.\r
+ Use <a class="message" href="#SCI_GETENDSTYLED"><code>SCI_GETENDSTYLED</code></a>\r
+ to retrieve the current "styled to" position and\r
+ <a class="message" href="#SCI_STARTSTYLING"><code>SCI_STARTSTYLING</code></a>\r
+ to reset the styling position and mask (<code>0x1f </code> in the default layout of 5 style bits and 3 indicator bits)\r
+ when you are done.</p>\r
+\r
+ <p>The number of bits used for styles can be altered with <a class="message"\r
+ href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> from 0 to 7 bits. The remaining bits\r
+ can be used for indicators, so there can be from 1 to 8 indicators. However, the\r
+ <code>INDIC*_MASK</code> constants defined in <code>Scintilla.h</code> all assume 5 bits of\r
+ styling information and 3 indicators. If you use a different arrangement, you must define your\r
+ own constants.</p>\r
+\r
+\r
+ <h2 id="Autocompletion">Autocompletion</h2>\r
+\r
+ <p>Autocompletion displays a list box showing likely identifiers based upon the user's typing.\r
+ The user chooses the currently selected item by pressing the tab character or another character\r
+ that is a member of the fillup character set defined with <code>SCI_AUTOCSETFILLUPS</code>.\r
+ Autocompletion is triggered by your application. For example, in C if you detect that the user\r
+ has just typed <code>fred.</code> you could look up <code>fred</code>, and if it has a known\r
+ list of members, you could offer them in an autocompletion list. Alternatively, you could\r
+ monitor the user's typing and offer a list of likely items once their typing has narrowed down\r
+ the choice to a reasonable list. As yet another alternative, you could define a key code to\r
+ activate the list.</p>\r
+\r
+ <p>When the user makes a selection from the list the container is sent a <code><a class="message"\r
+ href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code> <a class="jump"\r
+ href="#Notifications">notification message</a>. On return from the notification Scintilla will insert\r
+ the selected text unless the autocompletion list has been cancelled, for example by the container sending\r
+ <code><a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a></code>.</p>\r
+\r
+ <p>To make use of autocompletion you must monitor each character added to the document. See\r
+ <code>SciTEBase::CharAdded()</code> in SciTEBase.cxx for an example of autocompletion.</p>\r
+ <code><a class="message" href="#SCI_AUTOCSHOW">SCI_AUTOCSHOW(int lenEntered, const char\r
+ *list)</a><br />\r
+ <a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a><br />\r
+ <a class="message" href="#SCI_AUTOCACTIVE">SCI_AUTOCACTIVE</a><br />\r
+ <a class="message" href="#SCI_AUTOCPOSSTART">SCI_AUTOCPOSSTART</a><br />\r
+ <a class="message" href="#SCI_AUTOCCOMPLETE">SCI_AUTOCCOMPLETE</a><br />\r
+ <a class="message" href="#SCI_AUTOCSTOPS">SCI_AUTOCSTOPS(<unused>, const char\r
+ *chars)</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETSEPARATOR">SCI_AUTOCSETSEPARATOR(char\r
+ separator)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</a><br />\r
+ <a class="message" href="#SCI_AUTOCSELECT">SCI_AUTOCSELECT(<unused>, const char\r
+ *select)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool\r
+ cancel)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETFILLUPS">SCI_AUTOCSETFILLUPS(<unused>, const char\r
+ *chars)</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE(bool\r
+ chooseSingle)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETCHOOSESINGLE">SCI_AUTOCGETCHOOSESINGLE</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETIGNORECASE">SCI_AUTOCSETIGNORECASE(bool\r
+ ignoreCase)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETIGNORECASE">SCI_AUTOCGETIGNORECASE</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETAUTOHIDE">SCI_AUTOCSETAUTOHIDE(bool autoHide)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETAUTOHIDE">SCI_AUTOCGETAUTOHIDE</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETDROPRESTOFWORD">SCI_AUTOCSETDROPRESTOFWORD(bool\r
+ dropRestOfWord)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETDROPRESTOFWORD">SCI_AUTOCGETDROPRESTOFWORD</a><br />\r
+ <a class="message" href="#SCI_REGISTERIMAGE">SCI_REGISTERIMAGE</a><br />\r
+ <a class="message" href="#SCI_CLEARREGISTEREDIMAGES">SCI_CLEARREGISTEREDIMAGES</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETTYPESEPARATOR">SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETTYPESEPARATOR">SCI_AUTOCGETTYPESEPARATOR</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETMAXHEIGHT">SCI_AUTOCSETMAXHEIGHT(int rowCount)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT</a><br />\r
+ <a class="message" href="#SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</a><br />\r
+ <a class="message" href="#SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_AUTOCSHOW">SCI_AUTOCSHOW(int lenEntered, const char *list)</b><br />\r
+ This message causes a list to be displayed. <code>lenEntered</code> is the number of\r
+ characters of the word already entered and <code>list</code> is the list of words separated by\r
+ separator characters. The initial separator character is a space but this can be set or got\r
+ with <a class="message" href="#SCI_AUTOCSETSEPARATOR"><code>SCI_AUTOCSETSEPARATOR</code></a>\r
+ and <a class="message"\r
+ href="#SCI_AUTOCGETSEPARATOR"><code>SCI_AUTOCGETSEPARATOR</code></a>.</p>\r
+\r
+ <p>The list of words should be in sorted order. If set to ignore case mode with <a\r
+ class="message" href="#SCI_AUTOCSETIGNORECASE"><code>SCI_AUTOCSETIGNORECASE</code></a>, then\r
+ strings are matched after being converted to upper case. One result of this is that the list\r
+ should be sorted with the punctuation characters '[', '\', ']', '^', '_', and '`' sorted after\r
+ letters.</p>\r
+\r
+ <p><b id="SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</b><br />\r
+ This message cancels any displayed autocompletion list. When in autocompletion mode, the list\r
+ should disappear when the user types a character that can not be part of the autocompletion,\r
+ such as '.', '(' or '[' when typing an identifier. A set of characters that will cancel\r
+ autocompletion can be specified with <a class="message"\r
+ href="#SCI_AUTOCSTOPS"><code>SCI_AUTOCSTOPS</code></a>.</p>\r
+\r
+ <p><b id="SCI_AUTOCACTIVE">SCI_AUTOCACTIVE</b><br />\r
+ This message returns non-zero if there is an active autocompletion list and zero if there is\r
+ not.</p>\r
+\r
+ <p><b id="SCI_AUTOCPOSSTART">SCI_AUTOCPOSSTART</b><br />\r
+ This returns the value of the current position when <code>SCI_AUTOCSHOW</code> started display\r
+ of the list.</p>\r
+\r
+ <p><b id="SCI_AUTOCCOMPLETE">SCI_AUTOCCOMPLETE</b><br />\r
+ This message triggers autocompletion. This has the same effect as the tab key.</p>\r
+\r
+ <p><b id="SCI_AUTOCSTOPS">SCI_AUTOCSTOPS(<unused>, const char *chars)</b><br />\r
+ The <code>chars</code> argument is a string containing a list of characters that will\r
+ automatically cancel the autocompletion list. When you start the editor, this list is\r
+ empty.</p>\r
+\r
+ <p><b id="SCI_AUTOCSETSEPARATOR">SCI_AUTOCSETSEPARATOR(char separator)</b><br />\r
+ <b id="SCI_AUTOCGETSEPARATOR">SCI_AUTOCGETSEPARATOR</b><br />\r
+ These two messages set and get the separator character used to separate words in the\r
+ <code>SCI_AUTOCSHOW</code> list. The default is the space character.</p>\r
+\r
+ <p><b id="SCI_AUTOCSELECT">SCI_AUTOCSELECT(<unused>, const char *select)</b><br />\r
+ <b id="SCI_AUTOCGETCURRENT">SCI_AUTOCGETCURRENT</b><br />\r
+ This message selects an item in the autocompletion list. It searches the list of words for the\r
+ first that matches <code>select</code>. By default, comparisons are case sensitive, but you can\r
+ change this with <a class="message"\r
+ href="#SCI_AUTOCSETIGNORECASE"><code>SCI_AUTOCSETIGNORECASE</code></a>. The match is character\r
+ by character for the length of the <code>select</code> string. That is, if select is "Fred" it\r
+ will match "Frederick" if this is the first item in the list that begins with "Fred". If an\r
+ item is found, it is selected. If the item is not found, the autocompletion list closes if\r
+ auto-hide is true (see <a class="message"\r
+ href="#SCI_AUTOCSETAUTOHIDE"><code>SCI_AUTOCSETAUTOHIDE</code></a>).<br />\r
+ The current selection can be retrieved with <code>SCI_AUTOCGETCURRENT</code>\r
+ </p>\r
+\r
+ <p><b id="SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool cancel)</b><br />\r
+ <b id="SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</b><br />\r
+ The default behavior is for the list to be cancelled if the caret moves before the location it\r
+ was at when the list was displayed. By calling this message with a <code>false</code> argument,\r
+ the list is not cancelled until the caret moves before the first character of the word being\r
+ completed.</p>\r
+\r
+ <p><b id="SCI_AUTOCSETFILLUPS">SCI_AUTOCSETFILLUPS(<unused>, const char *chars)</b><br />\r
+ If a fillup character is typed with an autocompletion list active, the currently selected item\r
+ in the list is added into the document, then the fillup character is added. Common fillup\r
+ characters are '(', '[' and '.' but others are possible depending on the language. By default,\r
+ no fillup characters are set.</p>\r
+\r
+ <p><b id="SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)</b><br />\r
+ <b id="SCI_AUTOCGETCHOOSESINGLE">SCI_AUTOCGETCHOOSESINGLE</b><br />\r
+ If you use <code>SCI_AUTOCSETCHOOSESINGLE(1)</code> and a list has only one item, it is\r
+ automatically added and no list is displayed. The default is to display the list even if there\r
+ is only a single item.</p>\r
+\r
+ <p><b id="SCI_AUTOCSETIGNORECASE">SCI_AUTOCSETIGNORECASE(bool ignoreCase)</b><br />\r
+ <b id="SCI_AUTOCGETIGNORECASE">SCI_AUTOCGETIGNORECASE</b><br />\r
+ By default, matching of characters to list members is case sensitive. These messages let you\r
+ set and get case sensitivity.</p>\r
+\r
+ <p><b id="SCI_AUTOCSETAUTOHIDE">SCI_AUTOCSETAUTOHIDE(bool autoHide)</b><br />\r
+ <b id="SCI_AUTOCGETAUTOHIDE">SCI_AUTOCGETAUTOHIDE</b><br />\r
+ By default, the list is cancelled if there are no viable matches (the user has typed\r
+ characters that no longer match a list entry). If you want to keep displaying the original\r
+ list, set <code>autoHide</code> to <code>false</code>. This also effects <a class="message"\r
+ href="#SCI_AUTOCSELECT"><code>SCI_AUTOCSELECT</code></a>.</p>\r
+\r
+ <p><b id="SCI_AUTOCSETDROPRESTOFWORD">SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)</b><br />\r
+ <b id="SCI_AUTOCGETDROPRESTOFWORD">SCI_AUTOCGETDROPRESTOFWORD</b><br />\r
+ When an item is selected, any word characters following the caret are first erased if\r
+ <code>dropRestOfWord</code> is set <code>true</code>. The default is <code>false</code>.</p>\r
+\r
+ <p>\r
+ <b id="SCI_REGISTERIMAGE">SCI_REGISTERIMAGE(int type, const char *xpmData)</b><br />\r
+ <b id="SCI_CLEARREGISTEREDIMAGES">SCI_CLEARREGISTEREDIMAGES</b><br />\r
+ <b id="SCI_AUTOCSETTYPESEPARATOR">SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)</b><br />\r
+ <b id="SCI_AUTOCGETTYPESEPARATOR">SCI_AUTOCGETTYPESEPARATOR</b><br />\r
+\r
+ Autocompletion list items may display an image as well as text. Each image is first registered with an integer\r
+ type. Then this integer is included in the text of the list separated by a '?' from the text. For example,\r
+ "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen".\r
+ The images are in XPM format as is described for\r
+ <a class="message" href="#SCI_MARKERDEFINEPIXMAP"><code>SCI_MARKERDEFINEPIXMAP</code></a>\r
+ The set of registered images can be cleared with <code>SCI_CLEARREGISTEREDIMAGES</code> and the '?' separator changed\r
+ with <code>SCI_AUTOCSETTYPESEPARATOR</code>.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_AUTOCSETMAXHEIGHT">SCI_AUTOCSETMAXHEIGHT(int rowCount)</b><br />\r
+ <b id="SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT</b><br />\r
+\r
+ 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
+ scrollbar is shown. The default is 5.\r
+ </p>\r
+\r
+ <p>\r
+ <b id="SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</b><br />\r
+ <b id="SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH</b><br />\r
+\r
+ 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
+ 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
+ the available width are indicated by the presence of ellipsis.\r
+ </p>\r
+\r
+ <h2 id="UserLists">User lists</h2>\r
+\r
+ <p>User lists use the same internal mechanisms as autocompletion lists, and all the calls\r
+ listed for autocompletion work on them; you cannot display a user list at the same time as an\r
+ autocompletion list is active. They differ in the following respects:</p>\r
+\r
+ <p>o The <code><a class="message"\r
+ href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE</a></code> message has no\r
+ effect.<br />\r
+ o When the user makes a selection you are sent a <code><a class="message"\r
+ href="#SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</a></code> <a class="jump"\r
+ href="#Notifications">notification message</a> rather than <code><a class="message"\r
+ href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code>.</p>\r
+\r
+ <p>BEWARE: if you have set fillup characters or stop characters, these will still be active\r
+ with the user list, and may result in items being selected or the user list cancelled due to\r
+ the user typing into the editor.</p>\r
+\r
+ <p><b id="SCI_USERLISTSHOW">SCI_USERLISTSHOW(int listType, const char *list)</b><br />\r
+ The <code>listType</code> parameter is returned to the container as the <code>wParam</code>\r
+ field of the <a class="message" href="#SCNotification"><code>SCNotification</code></a>\r
+ structure. It must be greater than 0 as this is how Scintilla tells the difference between an\r
+ autocompletion list and a user list. If you have different types of list, for example a list of\r
+ buffers and a list of macros, you can use <code>listType</code> to tell which one has returned\r
+ a selection. </p>\r
+\r
+ <h2 id="CallTips">Call tips</h2>\r
+\r
+ <p>Call tips are small windows displaying the arguments to a function and are displayed after\r
+ the user has typed the name of the function. They normally display characters using the font\r
+ facename, size and character set defined by\r
+ <code><a class="message" href="#StyleDefinition">STYLE_DEFAULT</a></code>. You can choose to\r
+ use <code><a class="message" href="#StyleDefinition">STYLE_CALLTIP</a></code> to define the\r
+ facename, size, foreground and background colours and character set with\r
+ <code><a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE</a></code>.\r
+ This also enables support for Tab characters.\r
+\r
+ There is some interaction between call tips and autocompletion lists in that showing a\r
+ call tip cancels any active autocompletion list, and vice versa.</p>\r
+\r
+ <p>Call tips can highlight part of the text within them. You could use this to highlight the\r
+ current argument to a function by counting the number of commas (or whatever separator your\r
+ language uses). See <code>SciTEBase::CharAdded()</code> in <code>SciTEBase.cxx</code> for an\r
+ example of call tip use.</p>\r
+\r
+ <p>The mouse may be clicked on call tips and this causes a\r
+ <code><a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a></code>\r
+ notification to be sent to the container. Small up and down arrows may be displayed within\r
+ a call tip by, respectively, including the characters '\001', or '\002'. This is useful\r
+ for showing that there are overloaded variants of one function name and that the user can\r
+ click on the arrows to cycle through the overloads.</p>\r
+\r
+ <p>Alternatively, call tips can be displayed when you leave the mouse pointer for a while over\r
+ a word in response to the <code><a class="message"\r
+ href="#SCN_DWELLSTART">SCN_DWELLSTART</a></code> <a class="jump"\r
+ href="#Notifications">notification</a> and cancelled in response to <code><a class="message"\r
+ href="#SCN_DWELLEND">SCN_DWELLEND</a></code>. This method could be used in a debugger to give\r
+ the value of a variable, or during editing to give information about the word under the\r
+ pointer.</p>\r
+ <code><a class="message" href="#SCI_CALLTIPSHOW">SCI_CALLTIPSHOW(int posStart, const char\r
+ *definition)</a><br />\r
+ <a class="message" href="#SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</a><br />\r
+ <a class="message" href="#SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</a><br />\r
+ <a class="message" href="#SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</a><br />\r
+ <a class="message" href="#SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int highlightStart, int\r
+ highlightEnd)</a><br />\r
+ <a class="message" href="#SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</a><br />\r
+ <a class="message" href="#SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</a><br />\r
+ <a class="message" href="#SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</a><br />\r
+ <a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE(int tabsize)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_CALLTIPSHOW">SCI_CALLTIPSHOW(int posStart, const char *definition)</b><br />\r
+ This message starts the process by displaying the call tip window. If a call tip is already\r
+ active, this has no effect.<br />\r
+ <code>posStart</code> is the position in the document at which to align the call tip. The call\r
+ tip text is aligned to start 1 line below this character unless you have included up and/or\r
+ down arrows in the call tip text in which case the tip is aligned to the right-hand edge of\r
+ the rightmost arrow. The assumption is that you will start the text with something like\r
+ "\001 1 of 3 \002".<br />\r
+ <code>definition</code> is the call tip text. This can contain multiple lines separated by\r
+ '\n' (Line Feed, ASCII code 10) characters. Do not include '\r' (Carriage Return, ASCII\r
+ code 13), as this will most likely print as an empty box. '\t' (Tab, ASCII code 9) is\r
+ supported if you set a tabsize with\r
+ <code><a class="message" href="#SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE</a></code>.<br /></p>\r
+\r
+ <p><b id="SCI_CALLTIPCANCEL">SCI_CALLTIPCANCEL</b><br />\r
+ This message cancels any displayed call tip. Scintilla will also cancel call tips for you if\r
+ you use any keyboard commands that are not compatible with editing the argument list of a\r
+ function.</p>\r
+\r
+ <p><b id="SCI_CALLTIPACTIVE">SCI_CALLTIPACTIVE</b><br />\r
+ This returns 1 if a call tip is active and 0 if it is not active.</p>\r
+\r
+ <p><b id="SCI_CALLTIPPOSSTART">SCI_CALLTIPPOSSTART</b><br />\r
+ This message returns the value of the current position when <code>SCI_CALLTIPSHOW</code>\r
+ started to display the tip.</p>\r
+\r
+ <p><b id="SCI_CALLTIPSETHLT">SCI_CALLTIPSETHLT(int hlStart, int hlEnd)</b><br />\r
+ This sets the region of the call tips text to display in a highlighted style.\r
+ <code>hlStart</code> is the zero-based index into the string of the first character to\r
+ highlight and <code>hlEnd</code> is the index of the first character after the highlight.\r
+ <code>hlEnd</code> must be greater than <code>hlStart</code>; <code>hlEnd-hlStart</code> is the\r
+ number of characters to highlight. Highlights can extend over line ends if this is\r
+ required.</p>\r
+\r
+ <p>Unhighlighted text is drawn in a mid gray. Selected text is drawn in a dark blue. The\r
+ background is white. These can be changed with\r
+ <code>SCI_CALLTIPSETBACK</code>,\r
+ <code>SCI_CALLTIPSETFORE</code>, and\r
+ <code>SCI_CALLTIPSETFOREHLT</code>.\r
+ </p>\r
+\r
+ <p><b id="SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</b><br />\r
+ The background colour of call tips can be set with this message; the default colour is white.\r
+ It is not a good idea to set a dark colour as the background as the default colour for normal\r
+ calltip text is mid gray and the defaultcolour for highlighted text is dark blue. This also\r
+ sets the background colour of <code>STYLE_CALLTIP</code>.</p>\r
+\r
+ <p><b id="SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</b><br />\r
+ The colour of call tip text can be set with this message; the default colour is mid gray.\r
+ This also sets the foreground colour of <code>STYLE_CALLTIP</code>.</p>\r
+\r
+ <p><b id="SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</b><br />\r
+ The colour of highlighted call tip text can be set with this message; the default colour\r
+ is dark blue.</p>\r
+\r
+ <p><b id="SCI_CALLTIPUSESTYLE">SCI_CALLTIPUSESTYLE(int tabsize)</b><br />\r
+ This message changes the style used for call tips from <code>STYLE_DEFAULT</code> to\r
+ <code>STYLE_CALLTIP</code> and sets a tab size in screen pixels. If <code>tabsize</code> is\r
+ less than 1, Tab characters are not treated specially. Once this call has been used, the\r
+ call tip foreground and background colours are also taken from the style.</p>\r
+\r
+\r
+ <h2 id="KeyboardCommands">Keyboard commands</h2>\r
+\r
+ <p>To allow the container application to perform any of the actions available to the user with\r
+ keyboard, all the keyboard actions are messages. They do not take any parameters. These\r
+ commands are also used when redefining the key bindings with the <a class="message"\r
+ href="#SCI_ASSIGNCMDKEY"><code>SCI_ASSIGNCMDKEY</code></a> message.</p>\r
+\r
+ <table border="0" summary="Keyboard commands">\r
+ <tbody>\r
+ <tr>\r
+ <td><code>SCI_LINEDOWN</code></td>\r
+\r
+ <td><code>SCI_LINEDOWNEXTEND</code></td>\r
+\r
+ <td><code>SCI_LINEDOWNRECTEXTEND</code></td>\r
+\r
+ <td><code>SCI_LINESCROLLDOWN</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_LINEUP</code></td>\r
+\r
+ <td><code>SCI_LINEUPEXTEND</code></td>\r
+\r
+ <td><code>SCI_LINEUPRECTEXTEND</code></td>\r
+\r
+ <td><code>SCI_LINESCROLLUP</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_PARADOWN</code></td>\r
+\r
+ <td><code>SCI_PARADOWNEXTEND</code></td>\r
+\r
+ <td><code>SCI_PARAUP</code></td>\r
+\r
+ <td><code>SCI_PARAUPEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_CHARLEFT</code></td>\r
+\r
+ <td><code>SCI_CHARLEFTEXTEND</code></td>\r
+\r
+ <td><code>SCI_CHARLEFTRECTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_CHARRIGHT</code></td>\r
+\r
+ <td><code>SCI_CHARRIGHTEXTEND</code></td>\r
+\r
+ <td><code>SCI_CHARRIGHTRECTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_WORDLEFT</code></td>\r
+\r
+ <td><code>SCI_WORDLEFTEXTEND</code></td>\r
+\r
+ <td><code>SCI_WORDRIGHT</code></td>\r
+\r
+ <td><code>SCI_WORDRIGHTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_WORDLEFTEND</code></td>\r
+\r
+ <td><code>SCI_WORDLEFTENDEXTEND</code></td>\r
+\r
+ <td><code>SCI_WORDRIGHTEND</code></td>\r
+\r
+ <td><code>SCI_WORDRIGHTENDEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_WORDPARTLEFT</code></td>\r
+\r
+ <td><code>SCI_WORDPARTLEFTEXTEND</code></td>\r
+\r
+ <td><code>SCI_WORDPARTRIGHT</code></td>\r
+\r
+ <td><code>SCI_WORDPARTRIGHTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_HOME</code></td>\r
+\r
+ <td><code>SCI_HOMEEXTEND</code></td>\r
+\r
+ <td><code>[SCI_HOMERECTEXTEND]</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_HOMEDISPLAY</code></td>\r
+\r
+ <td><code>SCI_HOMEDISPLAYEXTEND</code></td>\r
+\r
+ <td><code>SCI_HOMEWRAP</code></td>\r
+\r
+ <td><code>SCI_HOMEWRAPEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_VCHOME</code></td>\r
+\r
+ <td><code>SCI_VCHOMEEXTEND</code></td>\r
+\r
+ <td><code>SCI_VCHOMERECTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_VCHOMEWRAP</code></td>\r
+\r
+ <td><code>SCI_VCHOMEWRAPEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_LINEEND</code></td>\r
+\r
+ <td><code>SCI_LINEENDEXTEND</code></td>\r
+\r
+ <td><code>SCI_LINEENDRECTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_LINEENDDISPLAY</code></td>\r
+\r
+ <td><code>SCI_LINEENDDISPLAYEXTEND</code></td>\r
+\r
+ <td><code>SCI_LINEENDWRAP</code></td>\r
+\r
+ <td><code>SCI_LINEENDWRAPEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_DOCUMENTSTART</code></td>\r
+\r
+ <td><code>SCI_DOCUMENTSTARTEXTEND</code></td>\r
+\r
+ <td><code>SCI_DOCUMENTEND</code></td>\r
+\r
+ <td><code>SCI_DOCUMENTENDEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_PAGEUP</code></td>\r
+\r
+ <td><code>SCI_PAGEUPEXTEND</code></td>\r
+\r
+ <td><code>SCI_PAGEUPRECTEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_PAGEDOWN</code></td>\r
+\r
+ <td><code>SCI_PAGEDOWNEXTEND</code></td>\r
+\r
+ <td><code>SCI_PAGEDOWNRECTEXTEND</code></td>\r
+ </tr>\r
+\r
+\r
+ <tr>\r
+ <td><code>SCI_STUTTEREDPAGEUP</code></td>\r
+\r
+ <td><code>SCI_STUTTEREDPAGEUPEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_STUTTEREDPAGEDOWN</code></td>\r
+\r
+ <td><code>SCI_STUTTEREDPAGEDOWNEXTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_DELETEBACK</code></td>\r
+\r
+ <td><code>SCI_DELETEBACKNOTLINE</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_DELWORDLEFT</code></td>\r
+\r
+ <td><code>SCI_DELWORDRIGHT</code></td>\r
+\r
+ <td><code>SCI_DELWORDRIGHTEND</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_DELLINELEFT</code></td>\r
+\r
+ <td><code>SCI_DELLINERIGHT</code></td>\r
+\r
+ <td><code>SCI_LINEDELETE</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_LINECUT</code></td>\r
+\r
+ <td><code>SCI_LINECOPY</code></td>\r
+\r
+ <td><code>SCI_LINETRANSPOSE</code></td>\r
+\r
+ <td><code>SCI_LINEDUPLICATE</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_LOWERCASE</code></td>\r
+\r
+ <td><code>SCI_UPPERCASE</code></td>\r
+\r
+ <td><code>SCI_CANCEL</code></td>\r
+\r
+ <td><code>SCI_EDITTOGGLEOVERTYPE</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_NEWLINE</code></td>\r
+\r
+ <td><code>SCI_FORMFEED</code></td>\r
+\r
+ <td><code>SCI_TAB</code></td>\r
+\r
+ <td><code>SCI_BACKTAB</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><code>SCI_SELECTIONDUPLICATE</code></td>\r
+\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>The <code>SCI_*EXTEND</code> messages extend the selection.</p>\r
+\r
+ <p>The <code>SCI_*RECTEXTEND</code> messages extend the rectangular selection\r
+ (and convert regular selection to rectangular one, if any).</p>\r
+\r
+ <p>The <code>SCI_WORDPART*</code> commands are used to move between word segments marked by\r
+ capitalisation (aCamelCaseIdentifier) or underscores (an_under_bar_ident).</p>\r
+\r
+ <p>The <code>SCI_HOME*</code> commands move the caret to the start of the line, while the\r
+ <code>SCI_VCHOME*</code>commands move the caret to the first non-blank character of the line\r
+ (ie. just after the indentation) unless it is already there; in this case, it acts as SCI_HOME*.</p>\r
+\r
+ <p>The <code>SCI_[HOME|LINEEND]DISPLAY*</code> commands are used when in line wrap mode to\r
+ allow movement to the start or end of display lines as opposed to the normal\r
+ <code>SCI_[HOME|LINEEND]</code> commands which move to the start or end of document lines.</p>\r
+\r
+ <p>The <code>SCI_[[VC]HOME|LINEEND]WRAP*</code> commands are like their namesakes\r
+ <code>SCI_[[VC]HOME|LINEEND]*</code> except they behave differently when word-wrap is enabled:\r
+ They go first to the start / end of the display line, like <code>SCI_[HOME|LINEEND]DISPLAY*</code>,\r
+ but if the cursor is already at the point, it goes on to the start or end of the document line,\r
+ as appropriate for <code>SCI_[[VC]HOME|LINEEND]*</code>.\r
+ </p>\r
+\r
+ <h2 id="KeyBindings">Key bindings</h2>\r
+\r
+ <p>There is a default binding of keys to commands that is defined in the Scintilla source in\r
+ the file <code>KeyMap.cxx</code> by the constant <code>KeyMap::MapDefault[]</code>. This table\r
+ maps key definitions to <code>SCI_*</code> messages with no parameters (mostly the <a\r
+ class="jump" href="#KeyboardCommands">keyboard commands</a> discussed above, but any Scintilla\r
+ command that has no arguments can be mapped). You can change the mapping to suit your own\r
+ requirements.</p>\r
+ <code><a class="message" href="#SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int keyDefinition, int\r
+ sciCommand)</a><br />\r
+ <a class="message" href="#SCI_CLEARCMDKEY">SCI_CLEARCMDKEY(int keyDefinition)</a><br />\r
+ <a class="message" href="#SCI_CLEARALLCMDKEYS">SCI_CLEARALLCMDKEYS</a><br />\r
+ <a class="message" href="#SCI_NULL">SCI_NULL</a><br />\r
+ </code>\r
+\r
+ <p><b id="keyDefinition">keyDefinition</b><br />\r
+ A key definition contains the key code in the low 16-bits and the key modifiers in the high\r
+ 16-bits. To combine <code>keyCode</code> and <code>keyMod</code> set:<br />\r
+ <br />\r
+ <code>keyDefinition = keyCode + (keyMod << 16)</code></p>\r
+\r
+ <p>The key code is a visible or control character or a key from the <code>SCK_*</code>\r
+ enumeration, which contains:<br />\r
+ <code>SCK_ADD</code>, <code>SCK_BACK</code>, <code>SCK_DELETE</code>, <code>SCK_DIVIDE</code>,\r
+ <code>SCK_DOWN</code>, <code>SCK_END</code>, <code>SCK_ESCAPE</code>, <code>SCK_HOME</code>,\r
+ <code>SCK_INSERT</code>, <code>SCK_LEFT</code>, <code>SCK_MENU</code>, <code>SCK_NEXT</code> (Page Down),\r
+ <code>SCK_PRIOR</code> (Page Up), <code>SCK_RETURN</code>, <code>SCK_RIGHT</code>,\r
+ <code>SCK_RWIN</code>,\r
+ <code>SCK_SUBTRACT</code>, <code>SCK_TAB</code>, <code>SCK_UP</code>, and\r
+ <code>SCK_WIN</code>.</p>\r
+\r
+ <p>The modifiers are a combination of zero or more of <code>SCMOD_ALT</code>,\r
+ <code>SCMOD_CTRL</code>, and <code>SCMOD_SHIFT</code>. If you are building a table, you might\r
+ want to use <code>SCMOD_NORM</code>, which has the value 0, to mean no modifiers.</p>\r
+\r
+ <p><b id="SCI_ASSIGNCMDKEY">SCI_ASSIGNCMDKEY(int <a class="jump"\r
+ href="#keyDefinition">keyDefinition</a>, int sciCommand)</b><br />\r
+ This assigns the given key definition to a Scintilla command identified by\r
+ <code>sciCommand</code>. <code>sciCommand</code> can be any <code>SCI_*</code> command that has\r
+ no arguments.</p>\r
+\r
+ <p><b id="SCI_CLEARCMDKEY">SCI_CLEARCMDKEY(int <a class="jump"\r
+ href="#keyDefinition">keyDefinition</a>)</b><br />\r
+ This makes the given key definition do nothing by assigning the action <code>SCI_NULL</code>\r
+ to it.</p>\r
+\r
+ <p><b id="SCI_CLEARALLCMDKEYS">SCI_CLEARALLCMDKEYS</b><br />\r
+ This command removes all keyboard command mapping by setting an empty mapping table.</p>\r
+\r
+ <p><b id="SCI_NULL">SCI_NULL</b><br />\r
+ The <code>SCI_NULL</code> does nothing and is the value assigned to keys that perform no\r
+ action. SCI_NULL ensures that keys do not propagate to the parent window as that may\r
+ cause focus to move. If you want the standard platform behaviour use the constant 0 instead.</p>\r
+\r
+ <h2 id="PopupEditMenu">Popup edit menu</h2>\r
+\r
+ <p><b id="SCI_USEPOPUP">SCI_USEPOPUP(bool bEnablePopup)</b><br />\r
+ Clicking the wrong button on the mouse pops up a short default editing menu. This may be\r
+ turned off with <code>SCI_USEPOPUP(0)</code>. If you turn it off, context menu commands (in\r
+ Windows, <code>WM_CONTEXTMENU</code>) will not be handled by Scintilla, so the parent of the\r
+ Scintilla window will have the opportunity to handle the message.</p>\r
+\r
+ <h2 id="MacroRecording">Macro recording</h2>\r
+\r
+ <p>Start and stop macro recording mode. In macro recording mode, actions are reported to the\r
+ container through <code><a class="message" href="#SCN_MACRORECORD">SCN_MACRORECORD</a></code>\r
+ <a class="jump" href="#Notifications">notifications</a>. It is then up to the container to\r
+ record these actions for future replay.</p>\r
+\r
+ <p><b id="SCI_STARTRECORD">SCI_STARTRECORD</b><br />\r
+ <b id="SCI_STOPRECORD">SCI_STOPRECORD</b><br />\r
+ These two messages turn macro recording on and off.</p>\r
+\r
+ <h2 id="Printing">Printing</h2>\r
+\r
+ <p>On Windows <code>SCI_FORMATRANGE</code> can be used to draw the text onto a display context\r
+ which can include a printer display context. Printed output shows text styling as on the\r
+ screen, but it hides all margins except a line number margin. All special marker effects are\r
+ removed and the selection and caret are hidden.</p>\r
+ <code><a class="message" href="#SCI_FORMATRANGE">SCI_FORMATRANGE(bool bDraw, RangeToFormat\r
+ *pfr)</a><br />\r
+ <a class="message" href="#SCI_SETPRINTMAGNIFICATION">SCI_SETPRINTMAGNIFICATION(int\r
+ magnification)</a><br />\r
+ <a class="message" href="#SCI_GETPRINTMAGNIFICATION">SCI_GETPRINTMAGNIFICATION</a><br />\r
+ <a class="message" href="#SCI_SETPRINTCOLOURMODE">SCI_SETPRINTCOLOURMODE(int mode)</a><br />\r
+ <a class="message" href="#SCI_GETPRINTCOLOURMODE">SCI_GETPRINTCOLOURMODE</a><br />\r
+ <a class="message" href="#SCI_SETPRINTWRAPMODE">SCI_SETPRINTWRAPMODE</a><br />\r
+ <a class="message" href="#SCI_GETPRINTWRAPMODE">SCI_GETPRINTWRAPMODE</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_FORMATRANGE">SCI_FORMATRANGE(bool bDraw, RangeToFormat *pfr)</b><br />\r
+ This call allows Windows users to render a range of text into a device context. If you use\r
+ this for printing, you will probably want to arrange a page header and footer; Scintilla does\r
+ not do this for you. See <code>SciTEWin::Print()</code> in <code>SciTEWinDlg.cxx</code> for an\r
+ example. Each use of this message renders a range of text into a rectangular area and returns\r
+ the position in the document of the next character to print.</p>\r
+\r
+ <p><code>bDraw</code> controls if any output is done. Set this to false if you are paginating\r
+ (for example, if you use this with MFC you will need to paginate in\r
+ <code>OnBeginPrinting()</code> before you output each page.</p>\r
+<pre>\r
+struct RangeToFormat {\r
+ SurfaceID hdc; // The HDC (device context) we print to\r
+ SurfaceID hdcTarget; // The HDC we use for measuring (may be same as hdc)\r
+ PRectangle rc; // Rectangle in which to print\r
+ PRectangle rcPage; // Physically printable page size\r
+ CharacterRange chrg; // Range of characters to print\r
+};\r
+</pre>\r
+\r
+ <p><code>hdc</code> and <code>hdcTarget</code> should both be set to the device context handle\r
+ of the output device (usually a printer). If you print to a metafile these will not be the same\r
+ as Windows metafiles (unlike extended metafiles) do not implement the full API for returning\r
+ information. In this case, set <code>hdcTarget</code> to the screen DC.<br />\r
+ <code>rcPage</code> is the rectangle <code>{0, 0, maxX, maxY}</code> where <code>maxX+1</code>\r
+ and <code>maxY+1</code> are the number of physically printable pixels in x and y.<br />\r
+ <code>rc</code> is the rectangle to render the text in (which will, of course, fit within the\r
+ rectangle defined by rcPage).<br />\r
+ <code>chrg.cpMin</code> and <code>chrg.cpMax</code> define the start position and maximum\r
+ position of characters to output. All of each line within this character range is drawn.</p>\r
+\r
+ <p>When printing, the most tedious part is always working out what the margins should be to\r
+ allow for the non-printable area of the paper and printing a header and footer. If you look at\r
+ the printing code in SciTE, you will find that most of it is taken up with this. The loop that\r
+ causes Scintilla to render text is quite simple if you strip out all the margin, non-printable\r
+ area, header and footer code.</p>\r
+\r
+ <p><b id="SCI_SETPRINTMAGNIFICATION">SCI_SETPRINTMAGNIFICATION(int magnification)</b><br />\r
+ <b id="SCI_GETPRINTMAGNIFICATION">SCI_GETPRINTMAGNIFICATION</b><br />\r
+ <code>SCI_GETPRINTMAGNIFICATION</code> lets you to print at a different size than the screen\r
+ font. <code>magnification</code> is the number of points to add to the size of each screen\r
+ font. A value of -3 or -4 gives reasonably small print. You can get this value with\r
+ <code>SCI_GETPRINTMAGNIFICATION</code>.</p>\r
+\r
+ <p><b id="SCI_SETPRINTCOLOURMODE">SCI_SETPRINTCOLOURMODE(int mode)</b><br />\r
+ <b id="SCI_GETPRINTCOLOURMODE">SCI_GETPRINTCOLOURMODE</b><br />\r
+ These two messages set and get the method used to render coloured text on a printer that is\r
+ probably using white paper. It is especially important to consider the treatment of colour if\r
+ you use a dark or black screen background. Printing white on black uses up toner and ink very\r
+ many times faster than the other way around. You can set the mode to one of:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Colour printing modes">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+\r
+ <th>Value</th>\r
+\r
+ <th align="left">Purpose</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>SC_PRINT_NORMAL</code></td>\r
+\r
+ <td align="center">0</td>\r
+\r
+ <td>Print using the current screen colours. This is the default.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PRINT_INVERTLIGHT</code></td>\r
+\r
+ <td align="center">1</td>\r
+\r
+ <td>If you use a dark screen background this saves ink by inverting the light value of\r
+ all colours and printing on a white background.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PRINT_BLACKONWHITE</code></td>\r
+\r
+ <td align="center">2</td>\r
+\r
+ <td>Print all text as black on a white background.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PRINT_COLOURONWHITE</code></td>\r
+\r
+ <td align="center">3</td>\r
+\r
+ <td>Everything prints in its own colour on a white background.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PRINT_COLOURONWHITEDEFAULTBG</code></td>\r
+\r
+ <td align="center">4</td>\r
+\r
+ <td>Everything prints in its own colour on a white background except that line numbers\r
+ use their own background colour.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_SETPRINTWRAPMODE">SCI_SETPRINTWRAPMODE(int wrapMode)</b><br />\r
+ <b id="SCI_GETPRINTWRAPMODE">SCI_GETPRINTWRAPMODE</b><br />\r
+ These two functions get and set the printer wrap mode. <code>wrapMode</code> can be\r
+ set to <code>SC_WRAP_NONE</code> (0), <code>SC_WRAP_WORD</code> (1) or\r
+ <code>SC_WRAP_CHAR</code> (2). The default is\r
+ <code>SC_WRAP_WORD</code>, which wraps printed output so that all characters fit\r
+ into the print rectangle. If you set <code>SC_WRAP_NONE</code>, each line of text\r
+ generates one line of output and the line is truncated if it is too long to fit\r
+ into the print area.<br />\r
+ <code>SC_WRAP_WORD</code> tries to wrap only between words as indicated by\r
+ white space or style changes although if a word is longer than a line, it will be wrapped before\r
+ the line end. <code>SC_WRAP_CHAR</code> is preferred to\r
+ <code>SC_WRAP_WORD</code> for Asian languages where there is no white space\r
+ between words.</p>\r
+\r
+ <h2 id="DirectAccess">Direct access</h2>\r
+ <code><a class="message" href="#SCI_GETDIRECTFUNCTION">SCI_GETDIRECTFUNCTION</a><br />\r
+ <a class="message" href="#SCI_GETDIRECTPOINTER">SCI_GETDIRECTPOINTER</a><br />\r
+ <a class="message" href="#SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</a><br />\r
+ </code>\r
+\r
+ <p>On Windows, the message-passing scheme used to communicate between the container and\r
+ Scintilla is mediated by the operating system <code>SendMessage</code> function and can lead to\r
+ bad performance when calling intensively. To avoid this overhead, Scintilla provides messages\r
+ that allow you to call the Scintilla message function directly. The code to do this in C/C++ is\r
+ of the form:</p>\r
+<pre>\r
+#include "Scintilla.h"\r
+SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);\r
+sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);\r
+\r
+// now a wrapper to call Scintilla directly\r
+sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){\r
+ return pSciMsg(pSciWndData, iMessage, wParam, lParam);\r
+}\r
+</pre>\r
+\r
+ <p><code>SciFnDirect</code>, <code>sptr_t</code> and <code>uptr_t</code> are declared in\r
+ <code>Scintilla.h</code>. <code>hSciWnd</code> is the window handle returned when you created\r
+ the Scintilla window.</p>\r
+\r
+ <p>While faster, this direct calling will cause problems if performed from a different thread\r
+ to the native thread of the Scintilla window in which case <code>SendMessage(hSciWnd, SCI_*,\r
+ wParam, lParam)</code> should be used to synchronize with the window's thread.</p>\r
+\r
+ <p>This feature also works on GTK+ but has no significant impact on speed.</p>\r
+\r
+ <p>From version 1.47 on Windows, Scintilla exports a function called\r
+ <code>Scintilla_DirectFunction</code> that can be used the same as the function returned by\r
+ <code>SCI_GETDIRECTFUNCTION</code>. This saves you the call to\r
+ <code>SCI_GETDIRECTFUNCTION</code> and the need to call Scintilla indirectly via the function\r
+ pointer.</p>\r
+\r
+ <p><b id="SCI_GETDIRECTFUNCTION">SCI_GETDIRECTFUNCTION</b><br />\r
+ This message returns the address of the function to call to handle Scintilla messages without\r
+ the overhead of passing through the Windows messaging system. You need only call this once,\r
+ regardless of the number of Scintilla windows you create.</p>\r
+\r
+ <p><b id="SCI_GETDIRECTPOINTER">SCI_GETDIRECTPOINTER</b><br />\r
+ This returns a pointer to data that identifies which Scintilla window is in use. You must call\r
+ this once for each Scintilla window you create. When you call the direct function, you must\r
+ pass in the direct pointer associated with the target window.</p>\r
+\r
+ <p><b id="SCI_GETCHARACTERPOINTER">SCI_GETCHARACTERPOINTER</b><br />\r
+ Move the gap within Scintilla so that the text of the document is stored consecutively\r
+ and ensure there is a NUL character after the text, then return a pointer to the first character.\r
+ Applications may then pass this to a function that accepts a character pointer such as a regular\r
+ expression search or a parser. The pointer should <em>not</em> be written to as that may desynchronize\r
+ the internal state of Scintilla.</p>\r
+ <p>Since any action in Scintilla may change its internal state\r
+ this pointer becomes invalid after any call or by allowing user interface activity. The application\r
+ should reacquire the pointer after making any call to Scintilla or performing any user-interface calls such\r
+ as modifying a progress indicator.</p>\r
+ <p>This call takes similar time to inserting a character at the end of the document and this may\r
+ include moving the document contents. Specifically, all the characters after the document gap\r
+ are moved to before the gap. This compacted state should persist over calls and user interface\r
+ actions that do not change the document contents so reacquiring the pointer afterwards is very\r
+ quick. If this call is used to implement a global replace operation, then each replacement will\r
+ move the gap so if <code>SCI_GETCHARACTERPOINTER</code> is called after\r
+ each replacement then the operation will become O(n^2) rather than O(n). Instead, all\r
+ matches should be found and remembered, then all the replacements performed.</p>\r
+\r
+ <h2 id="MultipleViews">Multiple views</h2>\r
+\r
+ <p>A Scintilla window and the document that it displays are separate entities. When you create\r
+ a new window, you also create a new, empty document. Each document has a reference count that\r
+ is initially set to 1. The document also has a list of the Scintilla windows that are linked to\r
+ it so when any window changes the document, all other windows in which it appears are notified\r
+ to cause them to update. The system is arranged in this way so that you can work with many\r
+ documents in a single Scintilla window and so you can display a single document in multiple\r
+ windows (for use with splitter windows).</p>\r
+\r
+ <p>Although these messages use <code>document *pDoc</code>, to ensure compatibility with future\r
+ releases of Scintilla you should treat <code>pDoc</code> as an opaque <code>void*</code>. That\r
+ is, you can use and store the pointer as described in this section but you should not\r
+ dereference it.</p>\r
+ <code><a class="message" href="#SCI_GETDOCPOINTER">SCI_GETDOCPOINTER</a><br />\r
+ <a class="message" href="#SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(<unused>, document\r
+ *pDoc)</a><br />\r
+ <a class="message" href="#SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</a><br />\r
+ <a class="message" href="#SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(<unused>, document\r
+ *pDoc)</a><br />\r
+ <a class="message" href="#SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(<unused>, document\r
+ *pDoc)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_GETDOCPOINTER">SCI_GETDOCPOINTER</b><br />\r
+ This returns a pointer to the document currently in use by the window. It has no other\r
+ effect.</p>\r
+\r
+ <p><b id="SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(<unused>, document *pDoc)</b><br />\r
+ This message does the following:<br />\r
+ 1. It removes the current window from the list held by the current document.<br />\r
+ 2. It reduces the reference count of the current document by 1.<br />\r
+ 3. If the reference count reaches 0, the document is deleted.<br />\r
+ 4. <code>pDoc</code> is set as the new document for the window.<br />\r
+ 5. If <code>pDoc</code> was 0, a new, empty document is created and attached to the\r
+ window.<br />\r
+ 6. If <code>pDoc</code> was not 0, its reference count is increased by 1.</p>\r
+\r
+ <p><b id="SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT</b><br />\r
+ This message creates a new, empty document and returns a pointer to it. This document is not\r
+ selected into the editor and starts with a reference count of 1. This means that you have\r
+ ownership of it and must either reduce its reference count by 1 after using\r
+ <code>SCI_SETDOCPOINTER</code> so that the Scintilla window owns it or you must make sure that\r
+ you reduce the reference count by 1 with <code>SCI_RELEASEDOCUMENT</code> before you close the\r
+ application to avoid memory leaks.</p>\r
+\r
+ <p><b id="SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(<unused>, document *pDoc)</b><br />\r
+ This increases the reference count of a document by 1. If you want to replace the current\r
+ document in the Scintilla window and take ownership of the current document, for example if you\r
+ are editing many documents in one window, do the following:<br />\r
+ 1. Use <code>SCI_GETDOCPOINTER</code> to get a pointer to the document,\r
+ <code>pDoc</code>.<br />\r
+ 2. Use <code>SCI_ADDREFDOCUMENT(0, pDoc)</code> to increment the reference count.<br />\r
+ 3. Use <code>SCI_SETDOCPOINTER(0, pNewDoc)</code> to set a different document or\r
+ <code>SCI_SETDOCPOINTER(0, 0)</code> to set a new, empty document.</p>\r
+\r
+ <p><b id="SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(<unused>, document *pDoc)</b><br />\r
+ This message reduces the reference count of the document identified by <code>pDoc</code>. pDoc\r
+ must be the result of <code>SCI_GETDOCPOINTER</code> or <code>SCI_CREATEDOCUMENT</code> and\r
+ must point at a document that still exists. If you call this on a document with a reference\r
+ count of 1 that is still attached to a Scintilla window, bad things will happen. To keep the\r
+ world spinning in its orbit you must balance each call to <code>SCI_CREATEDOCUMENT</code> or\r
+ <code>SCI_ADDREFDOCUMENT</code> with a call to <code>SCI_RELEASEDOCUMENT</code>.</p>\r
+\r
+ <h2 id="Folding">Folding</h2>\r
+\r
+ <p>The fundamental operation in folding is making lines invisible or visible. Line visibility\r
+ is a property of the view rather than the document so each view may be displaying a different\r
+ set of lines. From the point of view of the user, lines are hidden and displayed using fold\r
+ points. Generally, the fold points of a document are based on the hierarchical structure of the\r
+ document contents. In Python, the hierarchy is determined by indentation and in C++ by brace\r
+ characters. This hierarchy can be represented within a Scintilla document object by attaching a\r
+ numeric "fold level" to each line. The fold level is most easily set by a lexer, but you can\r
+ also set it with messages.</p>\r
+\r
+ <p>It is up to your code to set the connection between user actions and folding and unfolding.\r
+ The best way to see how this is done is to search the SciTE source code for the messages used\r
+ in this section of the documentation and see how they are used. You will also need to use\r
+ markers and a folding margin to complete your folding implementation.\r
+ The <code>"fold"</code> property should be set to <code>"1"</code> with\r
+ <code>SCI_SETPROPERTY("fold", "1")</code> to enable folding. </p>\r
+ <code><a class="message" href="#SCI_VISIBLEFROMDOCLINE">SCI_VISIBLEFROMDOCLINE(int\r
+ docLine)</a><br />\r
+ <a class="message" href="#SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(int\r
+ displayLine)</a><br />\r
+ <a class="message" href="#SCI_SHOWLINES">SCI_SHOWLINES(int lineStart, int lineEnd)</a><br />\r
+ <a class="message" href="#SCI_HIDELINES">SCI_HIDELINES(int lineStart, int lineEnd)</a><br />\r
+ <a class="message" href="#SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(int line)</a><br />\r
+ <a class="message" href="#SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(int line, int level)</a><br />\r
+ <a class="message" href="#SCI_GETFOLDLEVEL">SCI_GETFOLDLEVEL(int line)</a><br />\r
+ <a class="message" href="#SCI_SETFOLDFLAGS">SCI_SETFOLDFLAGS(int flags)</a><br />\r
+ <a class="message" href="#SCI_GETLASTCHILD">SCI_GETLASTCHILD(int line, int level)</a><br />\r
+ <a class="message" href="#SCI_GETFOLDPARENT">SCI_GETFOLDPARENT(int line)</a><br />\r
+ <a class="message" href="#SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool\r
+ expanded)</a><br />\r
+ <a class="message" href="#SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line)</a><br />\r
+ <a class="message" href="#SCI_TOGGLEFOLD">SCI_TOGGLEFOLD(int line)</a><br />\r
+ <a class="message" href="#SCI_ENSUREVISIBLE">SCI_ENSUREVISIBLE(int line)</a><br />\r
+ <a class="message" href="#SCI_ENSUREVISIBLEENFORCEPOLICY">SCI_ENSUREVISIBLEENFORCEPOLICY(int\r
+ line)</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_VISIBLEFROMDOCLINE">SCI_VISIBLEFROMDOCLINE(int docLine)</b><br />\r
+ When some lines are folded, then a particular line in the document may be displayed at a\r
+ different position to its document position. If no lines are folded, this message returns\r
+ <code>docLine</code>. Otherwise, this returns the display line (counting the very first visible\r
+ line as 0). The display line of an invisible line is the same as the previous visible line. The\r
+ display line number of the first line in the document is 0. If there is folding and\r
+ <code>docLine</code> is outside the range of lines in the document, the return value is -1.\r
+ Lines can occupy more than one display line if they wrap.</p>\r
+\r
+ <p><b id="SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(int displayLine)</b><br />\r
+ When some lines are hidden, then a particular line in the document may be displayed at a\r
+ different position to its document position. This message returns the document line number that\r
+ corresponds to a display line (counting the display line of the first line in the document as\r
+ 0). If <code>displayLine</code> is less than or equal to 0, the result is 0. If\r
+ <code>displayLine</code> is greater than or equal to the number of displayed lines, the result\r
+ is the number of lines in the document.</p>\r
+\r
+ <p><b id="SCI_SHOWLINES">SCI_SHOWLINES(int lineStart, int lineEnd)</b><br />\r
+ <b id="SCI_HIDELINES">SCI_HIDELINES(int lineStart, int lineEnd)</b><br />\r
+ <b id="SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(int line)</b><br />\r
+ The first two messages mark a range of lines as visible or invisible and then redraw the\r
+ display. The third message reports on the visible state of a line and returns 1 if it is\r
+ visible and 0 if it is not visible. These messages have no effect on fold levels or fold\r
+ flags. The first line can not be hidden.</p>\r
+\r
+ <p><b id="SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(int line, int level)</b><br />\r
+ <b id="SCI_GETFOLDLEVEL">SCI_GETFOLDLEVEL(int line)</b><br />\r
+ These two messages set and get a 32-bit value that contains the fold level of a line and some\r
+ flags associated with folding. The fold level is a number in the range 0 to\r
+ <code>SC_FOLDLEVELNUMBERMASK</code> (4095). However, the initial fold level is set to\r
+ <code>SC_FOLDLEVELBASE</code> (1024) to allow unsigned arithmetic on folding levels. There are\r
+ two addition flag bits. <code>SC_FOLDLEVELWHITEFLAG</code> indicates that the line is blank and\r
+ allows it to be treated slightly different then its level may indicate. For example, blank\r
+ lines should generally not be fold points and will be considered part of the preceding section even though\r
+ they may have a lesser fold level.\r
+ <code>SC_FOLDLEVELHEADERFLAG</code> indicates that\r
+ the line is a header (fold point).</p>\r
+\r
+ <p>Use <code>SCI_GETFOLDLEVEL(line) & SC_FOLDLEVELNUMBERMASK</code> to get the fold level\r
+ of a line. Likewise, use <code>SCI_GETFOLDLEVEL(line) & SC_FOLDLEVEL*FLAG</code> to get the\r
+ state of the flags. To set the fold level you must or in the associated flags. For instance, to\r
+ set the level to <code>thisLevel</code> and mark a line as being a fold point use:\r
+ <code>SCI_SETFOLDLEVEL(line, thisLevel | SC_FOLDLEVELHEADERFLAG)</code>.</p>\r
+ If you use a lexer, you should not need to use <code>SCI_SETFOLDLEVEL</code> as this is far\r
+ better handled by the lexer. You will need to use <code>SCI_GETFOLDLEVEL</code> to decide how\r
+ to handle user folding requests. If you do change the fold levels, the folding margin will\r
+ update to match your changes.\r
+\r
+ <p><b id="SCI_SETFOLDFLAGS">SCI_SETFOLDFLAGS(int flags)</b><br />\r
+ In addition to showing markers in the folding margin, you can indicate folds to the user by\r
+ drawing lines in the text area. The lines are drawn in the foreground colour set for <a\r
+ class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>. Bits set in\r
+ <code>flags</code> determine where folding lines are drawn:<br />\r
+ </p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Fold flags">\r
+ <tbody>\r
+ <tr>\r
+ <th align="center">Value</th>\r
+\r
+ <th align="left">Effect</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="center">1</td>\r
+\r
+ <td align="left">Experimental - draw boxes if expanded</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="center">2</td>\r
+\r
+ <td align="left">Draw above if expanded</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="center">4</td>\r
+\r
+ <td align="left">Draw above if not expanded</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="center">8</td>\r
+\r
+ <td align="left">Draw below if expanded</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="center">16</td>\r
+\r
+ <td align="left">Draw below if not expanded</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="center">64</td>\r
+\r
+ <td align="left">display hexadecimal fold levels in line margin to aid debugging of\r
+ folding. This feature needs to be redesigned to be sensible.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>This message causes the display to redraw.</p>\r
+\r
+ <p><b id="SCI_GETLASTCHILD">SCI_GETLASTCHILD(int startLine, int level)</b><br />\r
+ This message searches for the next line after <code>startLine</code>, that has a folding level\r
+ that is less than or equal to <code>level</code> and then returns the previous line number. If\r
+ you set <code>level</code> to -1, <code>level</code> is set to the folding level of line\r
+ <code>startLine</code>. If <code>from</code> is a fold point, <code>SCI_GETLASTCHILD(from,\r
+ -1)</code> returns the last line that would be in made visible or hidden by toggling the fold\r
+ state.</p>\r
+\r
+ <p><b id="SCI_GETFOLDPARENT">SCI_GETFOLDPARENT(int startLine)</b><br />\r
+ This message returns the line number of the first line before <code>startLine</code> that is\r
+ marked as a fold point with <code>SC_FOLDLEVELHEADERFLAG</code> and has a fold level less than\r
+ the <code>startLine</code>. If no line is found, or if the header flags and fold levels are\r
+ inconsistent, the return value is -1.</p>\r
+\r
+ <p><b id="SCI_TOGGLEFOLD">SCI_TOGGLEFOLD(int line)</b><br />\r
+ Each fold point may be either expanded, displaying all its child lines, or contracted, hiding\r
+ all the child lines. This message toggles the folding state of the given line as long as it has\r
+ the <code>SC_FOLDLEVELHEADERFLAG</code> set. This message takes care of folding or expanding\r
+ all the lines that depend on the line. The display updates after this message.</p>\r
+\r
+ <p><b id="SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool expanded)</b><br />\r
+ <b id="SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line)</b><br />\r
+ These messages set and get the expanded state of a single line. The set message has no effect\r
+ on the visible state of the line or any lines that depend on it. It does change the markers in\r
+ the folding margin. If you ask for the expansion state of a line that is outside the document,\r
+ the result is <code>false</code> (0).</p>\r
+\r
+ <p>If you just want to toggle the fold state of one line and handle all the lines that are\r
+ dependent on it, it is much easier to use <code>SCI_TOGGLEFOLD</code>. You would use the\r
+ <code>SCI_SETFOLDEXPANDED</code> message to process many folds without updating the display\r
+ until you had finished. See <code>SciTEBase::FoldAll()</code> and\r
+ <code>SciTEBase::Expand()</code> for examples of the use of these messages.</p>\r
+\r
+ <p><b id="SCI_ENSUREVISIBLE">SCI_ENSUREVISIBLE(int line)</b><br />\r
+ <b id="SCI_ENSUREVISIBLEENFORCEPOLICY">SCI_ENSUREVISIBLEENFORCEPOLICY(int line)</b><br />\r
+ A line may be hidden because more than one of its parent lines is contracted. Both these\r
+ message travels up the fold hierarchy, expanding any contracted folds until they reach the top\r
+ level. The line will then be visible. If you use <code>SCI_ENSUREVISIBLEENFORCEPOLICY</code>,\r
+ the vertical caret policy set by <a class="message"\r
+ href="#SCI_SETVISIBLEPOLICY"><code>SCI_SETVISIBLEPOLICY</code></a> is then applied.</p>\r
+\r
+ <h2 id="LineWrapping">Line wrapping</h2>\r
+\r
+ <code><a class="message" href="#SCI_SETWRAPMODE">SCI_SETWRAPMODE(int wrapMode)</a><br />\r
+ <a class="message" href="#SCI_GETWRAPMODE">SCI_GETWRAPMODE</a><br />\r
+ <a class="message" href="#SCI_SETWRAPVISUALFLAGS">SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)</a><br />\r
+ <a class="message" href="#SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</a><br />\r
+ <a class="message" href="#SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</a><br />\r
+ <a class="message" href="#SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</a><br />\r
+ <a class="message" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</a><br />\r
+ <a class="message" href="#SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</a><br />\r
+ <a class="message" href="#SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</a><br />\r
+ <a class="message" href="#SCI_GETLAYOUTCACHE">SCI_GETLAYOUTCACHE</a><br />\r
+ <a class="message" href="#SCI_SETPOSITIONCACHE">SCI_SETPOSITIONCACHE(int size)</a><br />\r
+ <a class="message" href="#SCI_GETPOSITIONCACHE">SCI_GETPOSITIONCACHE</a><br />\r
+ <a class="message" href="#SCI_LINESSPLIT">SCI_LINESSPLIT(int pixelWidth)</a><br />\r
+ <a class="message" href="#SCI_LINESJOIN">SCI_LINESJOIN</a><br />\r
+ <a class="message" href="#SCI_WRAPCOUNT">SCI_WRAPCOUNT(int docLine)</a><br />\r
+ </code>\r
+\r
+ <p>By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider\r
+ than the window width are continued on the following lines. Lines are broken after space or tab\r
+ characters or between runs of different styles. If this is not possible because a word in one\r
+ style is wider than the window then the break occurs after the last character that completely\r
+ fits on the line. The horizontal scroll bar does not appear when wrap mode is on.</p>\r
+\r
+ <p>For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a\r
+ wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla\r
+ draws the visual flag at begin of the next subline this subline will be indented by one char.\r
+ Independent from drawing a visual flag at the begin the subline can have an indention.</p>\r
+\r
+ <p>Much of the time used by Scintilla is spent on laying out and drawing text. The same text\r
+ layout calculations may be performed many times even when the data used in these calculations\r
+ does not change. To avoid these unnecessary calculations in some circumstances, the line layout\r
+ cache can store the results of the calculations. The cache is invalidated whenever the\r
+ underlying data, such as the contents or styling of the document changes. Caching the layout of\r
+ the whole document has the most effect, making dynamic line wrap as much as 20 times faster but\r
+ this requires 7 times the memory required by the document contents plus around 80 bytes per\r
+ line.</p>\r
+\r
+ <p>Wrapping is not performed immediately there is a change but is delayed until the display\r
+ is redrawn. This delay improves peformance by allowing a set of changes to be performed\r
+ and then wrapped and displayed once. Because of this, some operations may not occur as\r
+ expected. If a file is read and the scroll position moved to a particular line in the text,\r
+ such as occurs when a container tries to restore a previous editing session, then\r
+ the scroll position will have been determined before wrapping so an unexpected range\r
+ of text will be displayed. To scroll to the position correctly, delay the scroll until the\r
+ wrapping has been performed by waiting for an initial\r
+ <a class="message" href="#SCN_PAINTED">SCN_PAINTED</a> notification.</p>\r
+\r
+ <p><b id="SCI_SETWRAPMODE">SCI_SETWRAPMODE(int wrapMode)</b><br />\r
+ <b id="SCI_GETWRAPMODE">SCI_GETWRAPMODE</b><br />\r
+ Set wrapMode to <code>SC_WRAP_WORD</code> (1) to enable wrapping\r
+ on word boundaries, <code>SC_WRAP_CHAR</code> (2) to enable wrapping\r
+ between any characters, and to <code>SC_WRAP_NONE</code> (0) to disable line\r
+ wrapping. <code>SC_WRAP_CHAR</code> is preferred to\r
+ <code>SC_WRAP_WORD</code> for Asian languages where there is no white space\r
+ between words.</p>\r
+\r
+\r
+ <p><b id="SCI_SETWRAPVISUALFLAGS">SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)</b><br />\r
+ <b id="SCI_GETWRAPVISUALFLAGS">SCI_GETWRAPVISUALFLAGS</b><br />\r
+ You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in\r
+ wrapVisualFlags determine which visual flags are drawn.\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+ <th>Value</th>\r
+ <th align="left">Effect</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>SC_WRAPVISUALFLAG_NONE</code></td>\r
+ <td align="center">0</td>\r
+ <td>No visual flags</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_WRAPVISUALFLAG_END</code></td>\r
+ <td align="center">1</td>\r
+ <td>Visual flag at end of subline of a wrapped line.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_WRAPVISUALFLAG_START</code></td>\r
+ <td align="center">2</td>\r
+ <td>Visual flag at begin of subline of a wrapped line.<br />\r
+ Subline is indented by at least 1 to make room for the flag.<br />\r
+ </td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_SETWRAPVISUALFLAGSLOCATION">SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)</b><br />\r
+ <b id="SCI_GETWRAPVISUALFLAGSLOCATION">SCI_GETWRAPVISUALFLAGSLOCATION</b><br />\r
+ You can set wether the visual flags to indicate a line is wrapped are drawn near the border or near the text.\r
+ Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Wrap visual flags locations">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+ <th>Value</th>\r
+ <th align="left">Effect</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>SC_WRAPVISUALFLAGLOC_DEFAULT</code></td>\r
+ <td align="center">0</td>\r
+ <td>Visual flags drawn near border</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_WRAPVISUALFLAGLOC_END_BY_TEXT</code></td>\r
+ <td align="center">1</td>\r
+ <td>Visual flag at end of subline drawn near text</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_WRAPVISUALFLAGLOC_START_BY_TEXT</code></td>\r
+ <td align="center">2</td>\r
+ <td>Visual flag at begin of subline drawn near text</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ </p>\r
+\r
+ <p><b id="SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT(int indent)</b><br />\r
+ <b id="SCI_GETWRAPSTARTINDENT">SCI_GETWRAPSTARTINDENT</b><br />\r
+ <code>SCI_SETWRAPSTARTINDENT</code> sets the size of indentation of sublines for\r
+ wrapped lines in terms of the width of a space in\r
+ <a class="message" href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>.\r
+ There are no limits on indent sizes, but values less than 0 or large values may have\r
+ undesirable effects.<br />\r
+ The indention of sublines is independent of visual flags, but if\r
+ <code>SC_WRAPVISUALFLAG_START</code> is set an indent of at least 1 is used.\r
+ </p>\r
+\r
+ <p><b id="SCI_SETLAYOUTCACHE">SCI_SETLAYOUTCACHE(int cacheMode)</b><br />\r
+ <b id="SCI_GETLAYOUTCACHE">SCI_GETLAYOUTCACHE</b><br />\r
+ You can set <code>cacheMode</code> to one of the symbols in the table:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Line caching styles">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+\r
+ <th>Value</th>\r
+\r
+ <th align="left">Layout cached for these lines</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>SC_CACHE_NONE</code></td>\r
+\r
+ <td align="center">0</td>\r
+\r
+ <td>No lines are cached.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_CACHE_CARET</code></td>\r
+\r
+ <td align="center">1</td>\r
+\r
+ <td>The line containing the text caret. This is the default.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_CACHE_PAGE</code></td>\r
+\r
+ <td align="center">2</td>\r
+\r
+ <td>Visible lines plus the line containing the caret.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_CACHE_DOCUMENT</code></td>\r
+\r
+ <td align="center">3</td>\r
+\r
+ <td>All lines in the document.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ </p>\r
+\r
+ <p><b id="SCI_SETPOSITIONCACHE">SCI_SETPOSITIONCACHE(int size)</b><br />\r
+ <b id="SCI_GETPOSITIONCACHE">SCI_GETPOSITIONCACHE</b><br />\r
+ The position cache stores position information for short runs of text\r
+ so that their layout can be determined more quickly if the run recurs.\r
+ The size in entries of this cache can be set with <code>SCI_SETPOSITIONCACHE</code>.</p>\r
+\r
+ <p><b id="SCI_LINESSPLIT">SCI_LINESSPLIT(int pixelWidth)</b><br />\r
+ Split a range of lines indicated by the target into lines that are at most pixelWidth wide.\r
+ Splitting occurs on word boundaries wherever possible in a similar manner to line wrapping.\r
+ When <code>pixelWidth</code> is 0 then the width of the window is used.\r
+ </p>\r
+\r
+ <p><b id="SCI_LINESJOIN">SCI_LINESJOIN</b><br />\r
+ Join a range of lines indicated by the target into one line by\r
+ removing line end characters.\r
+ Where this would lead to no space between words, an extra space is inserted.\r
+ </p>\r
+\r
+ <p><b id="SCI_WRAPCOUNT">SCI_WRAPCOUNT(int docLine)</b><br />\r
+ Document lines can occupy more than one display line if they wrap and this\r
+ returns the number of display lines needed to wrap a document line.</p>\r
+\r
+ <h2 id="Zooming">Zooming</h2>\r
+\r
+ <p>Scintilla incorporates a "zoom factor" that lets you make all the text in the document\r
+ larger or smaller in steps of one point. The displayed point size never goes below 2, whatever\r
+ zoom factor you set. You can set zoom factors in the range -10 to +20 points.</p>\r
+ <code><a class="message" href="#SCI_ZOOMIN">SCI_ZOOMIN</a><br />\r
+ <a class="message" href="#SCI_ZOOMOUT">SCI_ZOOMOUT</a><br />\r
+ <a class="message" href="#SCI_SETZOOM">SCI_SETZOOM(int zoomInPoints)</a><br />\r
+ <a class="message" href="#SCI_GETZOOM">SCI_GETZOOM</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_ZOOMIN">SCI_ZOOMIN</b><br />\r
+ <b id="SCI_ZOOMOUT">SCI_ZOOMOUT</b><br />\r
+ <code>SCI_ZOOMIN</code> increases the zoom factor by one point if the current zoom factor is\r
+ less than 20 points. <code>SCI_ZOOMOUT</code> decreases the zoom factor by one point if the\r
+ current zoom factor is greater than -10 points.</p>\r
+\r
+ <p><b id="SCI_SETZOOM">SCI_SETZOOM(int zoomInPoints)</b><br />\r
+ <b id="SCI_GETZOOM">SCI_GETZOOM</b><br />\r
+ These messages let you set and get the zoom factor directly. There is no limit set on the\r
+ factors you can set, so limiting yourself to -10 to +20 to match the incremental zoom functions\r
+ is a good idea.</p>\r
+\r
+ <h2 id="LongLines">Long lines</h2>\r
+\r
+ <p>You can choose to mark lines that exceed a given length by drawing a vertical line or by\r
+ colouring the background of characters that exceed the set length.</p>\r
+ <code><a class="message" href="#SCI_SETEDGEMODE">SCI_SETEDGEMODE(int mode)</a><br />\r
+ <a class="message" href="#SCI_GETEDGEMODE">SCI_GETEDGEMODE</a><br />\r
+ <a class="message" href="#SCI_SETEDGECOLUMN">SCI_SETEDGECOLUMN(int column)</a><br />\r
+ <a class="message" href="#SCI_GETEDGECOLUMN">SCI_GETEDGECOLUMN</a><br />\r
+ <a class="message" href="#SCI_SETEDGECOLOUR">SCI_SETEDGECOLOUR(int colour)</a><br />\r
+ <a class="message" href="#SCI_GETEDGECOLOUR">SCI_GETEDGECOLOUR</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETEDGEMODE">SCI_SETEDGEMODE(int edgeMode)</b><br />\r
+ <b id="SCI_GETEDGEMODE">SCI_GETEDGEMODE</b><br />\r
+ These two messages set and get the mode used to display long lines. You can set one of the\r
+ values in the table:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Long line styles">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+\r
+ <th>Value</th>\r
+\r
+ <th align="left">Long line display mode</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>EDGE_NONE</code></td>\r
+\r
+ <td align="center">0</td>\r
+\r
+ <td>Long lines are not marked. This is the default state.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>EDGE_LINE</code></td>\r
+\r
+ <td align="center">1</td>\r
+\r
+ <td>A vertical line is drawn at the column number set by <code>SCI_SETEDGECOLUMN</code>.\r
+ This works well for monospaced fonts. The line is drawn at a position based on the width\r
+ of a space character in <a class="message"\r
+ href="#StyleDefinition"><code>STYLE_DEFAULT</code></a>, so it may not work very well if\r
+ your styles use proportional fonts or if your style have varied font sizes or you use a\r
+ mixture of bold, italic and normal text.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>EDGE_BACKGROUND</code></td>\r
+\r
+ <td align="center">2</td>\r
+\r
+ <td>The background colour of characters after the column limit is changed to the colour\r
+ set by <code>SCI_SETEDGECOLOUR</code>. This is recommended for proportional fonts.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCI_SETEDGECOLUMN">SCI_SETEDGECOLUMN(int column)</b><br />\r
+ <b id="SCI_GETEDGECOLUMN">SCI_GETEDGECOLUMN</b><br />\r
+ These messages set and get the column number at which to display the long line marker. When\r
+ drawing lines, the column sets a position in units of the width of a space character in\r
+ <code>STYLE_DEFAULT</code>. When setting the background colour, the column is a character count\r
+ (allowing for tabs) into the line.</p>\r
+\r
+ <p><b id="SCI_SETEDGECOLOUR">SCI_SETEDGECOLOUR(int <a class="jump"\r
+ href="#colour">colour</a>)</b><br />\r
+ <b id="SCI_GETEDGECOLOUR">SCI_GETEDGECOLOUR</b><br />\r
+ These messages set and get the colour of the marker used to show that a line has exceeded the\r
+ length set by <code>SCI_SETEDGECOLUMN</code>.</p>\r
+\r
+ <h2 id="Lexer">Lexer</h2>\r
+\r
+ <p>If you define the symbol <code>SCI_LEXER</code> when building Scintilla, (this is sometimes\r
+ called the SciLexer version of Scintilla), lexing support for a wide range programming\r
+ languages is included and the messages in this section are supported. If you want to set\r
+ styling and fold points for an unsupported language you can either do this in the container or\r
+ better still, write your own lexer following the pattern of one of the existing ones.</p>\r
+\r
+ <p>Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export four\r
+ functions: <code>GetLexerCount</code>, <code>GetLexerName</code>, <code>Lex</code> and\r
+ <code>Fold</code>. See <code>externalLexer.cxx</code> for more.</p>\r
+ <code><a class="message" href="#SCI_SETLEXER">SCI_SETLEXER(int lexer)</a><br />\r
+ <a class="message" href="#SCI_GETLEXER">SCI_GETLEXER</a><br />\r
+ <a class="message" href="#SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(<unused>, char\r
+ *name)</a><br />\r
+ <a class="message" href="#SCI_LOADLEXERLIBRARY">SCI_LOADLEXERLIBRARY(<unused>, char\r
+ *path)</a><br />\r
+ <a class="message" href="#SCI_COLOURISE">SCI_COLOURISE(int start, int end)</a><br />\r
+ <a class="message" href="#SCI_SETPROPERTY">SCI_SETPROPERTY(const char *key, const char *value)</a><br />\r
+ <a class="message" href="#SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value)</a><br />\r
+ <a class="message" href="#SCI_GETPROPERTYEXPANDED">SCI_GETPROPERTYEXPANDED(const char *key, char *value)</a><br />\r
+ <a class="message" href="#SCI_GETPROPERTYINT">SCI_GETPROPERTYINT(const char *key, int default)</a><br />\r
+ <a class="message" href="#SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char\r
+ *keyWordList)</a><br />\r
+ <a class="message" href="#SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</a>\r
+ <br />\r
+ </code>\r
+\r
+ <p><b id="SCI_SETLEXER">SCI_SETLEXER(int lexer)</b><br />\r
+ <b id="SCI_GETLEXER">SCI_GETLEXER</b><br />\r
+ You can select the lexer to use with an integer code from the <code>SCLEX_*</code> enumeration\r
+ in <code>Scintilla.h</code>. There are two codes in this sequence that do not use lexers:\r
+ <code>SCLEX_NULL</code> to select no lexing action and <code>SCLEX_CONTAINER</code> which sends\r
+ the <code><a class="message" href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a></code> notification to\r
+ the container whenever a range of text needs to be styled. You cannot use the\r
+ <code>SCLEX_AUTOMATIC</code> value; this identifies additional external lexers that Scintilla\r
+ assigns unused lexer numbers to.</p>\r
+\r
+ <p><b id="SCI_SETLEXERLANGUAGE">SCI_SETLEXERLANGUAGE(<unused>, const char *name)</b><br />\r
+ This message lets you select a lexer by name, and is the only method if you are using an\r
+ external lexer or if you have written a lexer module for a language of your own and do not wish\r
+ to assign it an explicit lexer number. To select an existing lexer, set <code>name</code> to\r
+ match the (case sensitive) name given to the module, for example "ada" or "python", not "Ada"\r
+ or "Python". To locate the name for the built-in lexers, open the relevant\r
+ <code>Lex*.cxx</code> file and search for <code>LexerModule</code>. The third argument in the\r
+ <code>LexerModule</code> constructor is the name to use.</p>\r
+\r
+ <p>To test if your lexer assignment worked, use <a class="message"\r
+ href="#SCI_GETLEXER"><code>SCI_GETLEXER</code></a> before and after setting the new lexer to\r
+ see if the lexer number changed.</p>\r
+\r
+ <p><b id="SCI_LOADLEXERLIBRARY">SCI_LOADLEXERLIBRARY(<unused>, const char *path)</b><br />\r
+ Load a lexer implemented in a shared library. This is a .so file on GTK+/Linux or a .DLL file on Windows.\r
+ </p>\r
+\r
+ <p><b id="SCI_COLOURISE">SCI_COLOURISE(int startPos, int endPos)</b><br />\r
+ This requests the current lexer or the container (if the lexer is set to\r
+ <code>SCLEX_CONTAINER</code>) to style the document between <code>startPos</code> and\r
+ <code>endPos</code>. If <code>endPos</code> is -1, the document is styled from\r
+ <code>startPos</code> to the end. If the <code>"fold"</code> property is set to\r
+ <code>"1"</code> and your lexer or container supports folding, fold levels are also set. This\r
+ message causes a redraw.</p>\r
+\r
+ <p><b id="SCI_SETPROPERTY">SCI_SETPROPERTY(const char *key, const char *value)</b><br />\r
+ You can communicate settings to lexers with keyword:value string pairs. There is no limit to\r
+ the number of keyword pairs you can set, other than available memory. <code>key</code> is a\r
+ case sensitive keyword, <code>value</code> is a string that is associated with the keyword. If\r
+ there is already a value string associated with the keyword, it is replaced. If you pass a zero\r
+ length string, the message does nothing. Both <code>key</code> and <code>value</code> are used\r
+ without modification; extra spaces at the beginning or end of <code>key</code> are\r
+ significant.</p>\r
+\r
+ <p>The <code>value</code> string can refer to other keywords. For example,\r
+ <code>SCI_SETPROPERTY("foldTimes10", "$(fold)0")</code> stores the string\r
+ <code>"$(fold)0"</code>, but when this is accessed, the <code>$(fold)</code> is replaced by the\r
+ value of the <code>"fold"</code> keyword (or by nothing if this keyword does not exist).</p>\r
+\r
+ <p>Currently the "fold" property is defined for most of the lexers to set the fold structure if\r
+ set to "1". <code>SCLEX_PYTHON</code> understands <code>"tab.timmy.whinge.level"</code> as a\r
+ setting that determines how to indicate bad indentation. Most keywords have values that are\r
+ interpreted as integers. Search the lexer sources for <code>GetPropertyInt</code> to see how\r
+ properties are used.</p>\r
+\r
+ <p>There is a convention for naming properties used by lexers so that the set of properties can be found by scripts.\r
+ Property names should start with "lexer.<lexer>." or "fold.<lexer>." when they apply to one\r
+ lexer or start with "lexer." or "fold." if they apply to multiple lexers.</p>\r
+\r
+ <p><b id="SCI_GETPROPERTY">SCI_GETPROPERTY(const char *key, char *value)</b><br />\r
+ Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied\r
+ buffer and return the length (not including the terminating 0). If not found, copy an empty string\r
+ to the buffer and return 0.</p>\r
+\r
+ <p>Note that "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">\r
+ <code>SCI_SETPROPERTY</code></a> will not be performed.</p>\r
+\r
+ <p>If the value argument is 0 then the length that should be allocated to store the value is returned;\r
+ again, the terminating 0 is not included.</p>\r
+\r
+ <p><b id="SCI_GETPROPERTYEXPANDED">SCI_GETPROPERTYEXPANDED(const char *key, char *value)</b><br />\r
+ Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied\r
+ buffer and return the length (not including the terminating 0). If not found, copy an empty string\r
+ to the buffer and return 0.</p>\r
+\r
+ <p>Note that "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">\r
+ <code>SCI_SETPROPERTY</code></a> will be performed.</p>\r
+\r
+ <p>If the value argument is 0 then the length that should be allocated to store the value (including any indicated keyword replacement)\r
+ is returned; again, the terminating 0 is not included.</p>\r
+\r
+ <p><b id="SCI_GETPROPERTYINT">SCI_GETPROPERTYINT(const char *key, int default)</b><br />\r
+ Lookup a keyword:value pair using the specified key; if found, interpret the value as an integer and return it.\r
+ 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
+ a number, then return 0.</p>\r
+\r
+ <p>Note that "keyword replacement" as described in <a class="message" href="#SCI_SETPROPERTY">\r
+ <code>SCI_SETPROPERTY</code></a> will be performed before any numeric interpretation.</p>\r
+\r
+ <p><b id="SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)</b><br />\r
+ You can set up to 9 lists of keywords for use by the current lexer. This was increased from 6\r
+ at revision 1.50. <code>keyWordSet</code> can be 0 to 8 (actually 0 to <code>KEYWORDSET_MAX</code>)\r
+ and selects which keyword list to replace. <code>keyWordList</code> is a list of keywords\r
+ separated by spaces, tabs, <code>"\n"</code> or <code>"\r"</code> or any combination of these.\r
+ It is expected that the keywords will be composed of standard ASCII printing characters,\r
+ but there is nothing to stop you using any non-separator character codes from 1 to 255\r
+ (except common sense).</p>\r
+\r
+ <p>How these keywords are used is entirely up to the lexer. Some languages, such as HTML may\r
+ contain embedded languages, VBScript and JavaScript are common for HTML. For HTML, key word set\r
+ 0 is for HTML, 1 is for JavaScript and 2 is for VBScript, 3 is for Python, 4 is for PHP and 5\r
+ is for SGML and DTD keywords. Review the lexer code to see examples of keyword list. A fully\r
+ conforming lexer sets the fourth argument of the <code>LexerModule</code> constructor to be a\r
+ list of strings that describe the uses of the keyword lists.</p>\r
+\r
+ <p>Alternatively, you might use set 0 for general keywords, set 1 for keywords that cause\r
+ indentation and set 2 for keywords that cause unindentation. Yet again, you might have a simple\r
+ lexer that colours keywords and you could change languages by changing the keywords in set 0.\r
+ There is nothing to stop you building your own keyword lists into the lexer, but this means\r
+ that the lexer must be rebuilt if more keywords are added.</p>\r
+\r
+ <p><b id="SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</b><br />\r
+ Retrieve the number of bits the current lexer needs for styling. This should normally be the argument\r
+ to <a class="message" href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS</a>.\r
+ </p>\r
+\r
+ <h2 id="Notifications">Notifications</h2>\r
+\r
+ <p>Notifications are sent (fired) from the Scintilla control to its container when an event has\r
+ occurred that may interest the container. Notifications are sent using the\r
+ <code>WM_NOTIFY</code> message on Windows and the "notify" signal on GTK+. The container is\r
+ passed a <code>SCNotification</code> structure containing information about the event.</p>\r
+<pre id="SCNotification">\r
+struct NotifyHeader { // This matches the Win32 NMHDR structure\r
+ void *hwndFrom; // environment specific window handle/pointer\r
+ uptr_t idFrom; // CtrlID of the window issuing the notification\r
+ unsigned int code; // The SCN_* notification code\r
+};\r
+\r
+struct SCNotification {\r
+ struct NotifyHeader nmhdr;\r
+ int position;\r
+ // SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_DWELLSTART,\r
+ // SCN_DWELLEND, SCN_CALLTIPCLICK,\r
+ // SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK\r
+ int ch; // SCN_CHARADDED, SCN_KEY\r
+ int modifiers; // SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK\r
+ int modificationType; // SCN_MODIFIED\r
+ const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION\r
+ int length; // SCN_MODIFIED\r
+ int linesAdded; // SCN_MODIFIED\r
+ int message; // SCN_MACRORECORD\r
+ uptr_t wParam; // SCN_MACRORECORD\r
+ sptr_t lParam; // SCN_MACRORECORD\r
+ int line; // SCN_MODIFIED, SCN_DOUBLECLICK\r
+ int foldLevelNow; // SCN_MODIFIED\r
+ int foldLevelPrev; // SCN_MODIFIED\r
+ int margin; // SCN_MARGINCLICK\r
+ int listType; // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION\r
+ int x; // SCN_DWELLSTART, SCN_DWELLEND\r
+ int y; // SCN_DWELLSTART, SCN_DWELLEND\r
+};\r
+</pre>\r
+\r
+ <p>The notification messages that your container can choose to handle and the messages\r
+ associated with them are:</p>\r
+ <code><a class="message" href="#SCN_STYLENEEDED">SCN_STYLENEEDED</a><br />\r
+ <a class="message" href="#SCN_CHARADDED">SCN_CHARADDED</a><br />\r
+ <a class="message" href="#SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</a><br />\r
+ <a class="message" href="#SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</a><br />\r
+ <a class="message" href="#SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</a><br />\r
+ <a class="message" href="#SCN_KEY">SCN_KEY</a><br />\r
+ <a class="message" href="#SCN_DOUBLECLICK">SCN_DOUBLECLICK</a><br />\r
+ <a class="message" href="#SCN_UPDATEUI">SCN_UPDATEUI</a><br />\r
+ <a class="message" href="#SCN_MODIFIED">SCN_MODIFIED</a><br />\r
+ <a class="message" href="#SCN_MACRORECORD">SCN_MACRORECORD</a><br />\r
+ <a class="message" href="#SCN_MARGINCLICK">SCN_MARGINCLICK</a><br />\r
+ <a class="message" href="#SCN_NEEDSHOWN">SCN_NEEDSHOWN</a><br />\r
+ <a class="message" href="#SCN_PAINTED">SCN_PAINTED</a><br />\r
+ <a class="message" href="#SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</a><br />\r
+ <a class="message" href="#SCN_URIDROPPED">SCN_URIDROPPED</a><br />\r
+ <a class="message" href="#SCN_DWELLSTART">SCN_DWELLSTART</a><br />\r
+ <a class="message" href="#SCN_DWELLEND">SCN_DWELLEND</a><br />\r
+ <a class="message" href="#SCN_ZOOM">SCN_ZOOM</a><br />\r
+ <a class="message" href="#SCN_HOTSPOTCLICK">SCN_HOTSPOTCLICK</a><br />\r
+ <a class="message" href="#SCN_HOTSPOTDOUBLECLICK">SCN_HOTSPOTDOUBLECLICK</a><br />\r
+ <a class="message" href="#SCN_INDICATORCLICK">SCN_INDICATORCLICK</a><br />\r
+ <a class="message" href="#SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</a><br />\r
+ <a class="message" href="#SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</a><br />\r
+ <a class="message" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a><br />\r
+ <a class="message" href="#SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</a><br />\r
+ </code>\r
+\r
+ <p>The following <code>SCI_*</code> messages are associated with these notifications:</p>\r
+ <code><a class="message" href="#SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK(int\r
+ eventMask)</a><br />\r
+ <a class="message" href="#SCI_GETMODEVENTMASK">SCI_GETMODEVENTMASK</a><br />\r
+ <a class="message" href="#SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</a><br />\r
+ <a class="message" href="#SCI_GETMOUSEDWELLTIME">SCI_GETMOUSEDWELLTIME</a><br />\r
+ </code>\r
+\r
+ <p>The following additional notifications are sent using the <code>WM_COMMAND</code> message on\r
+ Windows and the "Command" signal on GTK+. This emulates the Windows Edit control. Only the lower\r
+ 16 bits of the control's ID is passed in these notifications.</p>\r
+ <code><a class="message" href="#SCEN_CHANGE">SCEN_CHANGE</a><br />\r
+ <a class="message" href="#SCEN_SETFOCUS">SCEN_SETFOCUS</a><br />\r
+ <a class="message" href="#SCEN_KILLFOCUS">SCEN_KILLFOCUS</a><br />\r
+ </code>\r
+\r
+ <p><b id="SCN_STYLENEEDED">SCN_STYLENEEDED</b><br />\r
+ If you used <code><a class="message"\r
+ href="#SCI_SETLEXER">SCI_SETLEXER</a>(SCLEX_CONTAINER)</code> to make the container act as the\r
+ lexer, you will receive this notification when Scintilla is about to display or print text that\r
+ requires styling. You are required to style the text from the line that contains the position\r
+ returned by <a class="message" href="#SCI_GETENDSTYLED"><code>SCI_GETENDSTYLED</code></a> up to\r
+ the position passed in <code>SCNotification.position</code>. Symbolically, you need code of the\r
+ form:</p>\r
+<pre>\r
+ startPos = <a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a>()\r
+ lineNumber = <a class="message"\r
+href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION</a>(startPos);\r
+ startPos = <a class="message"\r
+href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);\r
+ MyStyleRoutine(startPos, SCNotification.position);\r
+</pre>\r
+\r
+ <p><b id="SCN_CHARADDED">SCN_CHARADDED</b><br />\r
+ This is sent when the user types an ordinary text character (as opposed to a command\r
+ character) that is entered into the text. The container can use this to decide to display a <a\r
+ class="jump" href="#CallTips">call tip</a> or an <a class="jump" href="#Autocompletion">auto\r
+ completion list</a>. The character is in <code>SCNotification.ch</code>.\r
+ This notification is sent before the character has been styled so processing that depends on\r
+ styling should instead be performed in the SCN_UPDATEUI notification.</p>\r
+\r
+ <p><b id="SCN_SAVEPOINTREACHED">SCN_SAVEPOINTREACHED</b><br />\r
+ <b id="SCN_SAVEPOINTLEFT">SCN_SAVEPOINTLEFT</b><br />\r
+ Sent to the container when the save point is entered or left, allowing the container to\r
+ display a "document dirty" indicator and change its menus.<br />\r
+ See also: <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>, <a\r
+ class="message" href="#SCI_GETMODIFY"><code>SCI_GETMODIFY</code></a></p>\r
+\r
+ <p><b id="SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO</b><br />\r
+ When in read-only mode, this notification is sent to the container if the user tries to change\r
+ the text. This can be used to check the document out of a version control system. You can set\r
+ the read-only state of a document with <code><a class="message"\r
+ href="#SCI_SETREADONLY">SCI_SETREADONLY</a></code>.</p>\r
+\r
+ <p><b id="SCN_KEY">SCN_KEY</b><br />\r
+ Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of\r
+ some problems with keyboard focus and is not sent by the Windows version. <code>SCNotification.ch</code> holds the key code and\r
+ <code>SCNotification.modifiers</code> holds the modifiers. This notification is sent if the\r
+ modifiers include <code>SCMOD_ALT</code> or <code>SCMOD_CTRL</code> and the key code is less\r
+ than 256.</p>\r
+\r
+ <p><b id="SCN_DOUBLECLICK">SCN_DOUBLECLICK</b><br />\r
+ The mouse button was double clicked in editor. The <code>position</code> field is set to the text position of the\r
+ double click and the <code>line</code> field is set to the line of the double click.</p>\r
+\r
+ <p><b id="SCN_UPDATEUI">SCN_UPDATEUI</b><br />\r
+ Either the text or styling of the document has changed or the selection range has changed. Now\r
+ would be a good time to update any container UI elements that depend on document or view state.\r
+ This was previously called <code><a class="message"\r
+ href="#SCN_CHECKBRACE">SCN_CHECKBRACE</a></code> because a common use is to check whether the\r
+ caret is next to a brace and set highlights on this brace and its corresponding matching brace.\r
+ This also replaces <a class="message" href="#SCN_POSCHANGED"><code>SCN_POSCHANGED</code></a>,\r
+ which is now deprecated.</p>\r
+\r
+ <p><b id="SCN_MODIFIED">SCN_MODIFIED</b><br />\r
+ This notification is sent when the text or styling of the document changes or is about to\r
+ change. You can set a mask for the notifications that are sent to the container with <a\r
+ class="message" href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>. The\r
+ notification structure contains information about what changed, how the change occurred and\r
+ whether this changed the number of lines in the document. No modifications may be performed\r
+ while in a <code>SCN_MODIFIED</code> event. The <code>SCNotification</code> fields used\r
+ are:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification types">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Field</th>\r
+\r
+ <th align="left">Usage</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>modificationType</code></td>\r
+\r
+ <td align="left">A set of flags that identify the change(s) made. See the next\r
+ table.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>position</code></td>\r
+\r
+ <td align="left">Start position of a text or styling change. Set to 0 if not used.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>length</code></td>\r
+\r
+ <td align="left">Length of the change in cells or characters when the text or styling\r
+ changes. Set to 0 if not used.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>linesAdded</code></td>\r
+\r
+ <td align="left">Number of added lines. If negative, the number of deleted lines. Set to\r
+ 0 if not used or no lines added or deleted.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>text</code></td>\r
+\r
+ <td align="left">Valid for text changes, not for style changes. If we are collecting undo\r
+ information this holds a pointer to the text that is handed to the Undo system, otherwise\r
+ it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0 and\r
+ for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells,\r
+ not bytes and the length is the number of cells.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>line</code></td>\r
+\r
+ <td align="left">The line number at which a fold level or marker change occurred. This is\r
+ 0 if unused and may be -1 if more than one line changed.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>foldLevelNow</code></td>\r
+\r
+ <td align="left">The new fold level applied to the line or 0 if this field is\r
+ unused.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>foldLevelPrev</code></td>\r
+\r
+ <td align="left">The previous folding level of the line or 0 if this field is\r
+ unused.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p>The <code>SCNotification.modificationType</code> field has bits set to tell you what has\r
+ been done. The <code>SC_MOD_*</code> bits correspond to actions. The\r
+ <code>SC_PERFORMED_*</code> bits tell you if the action was done by the user, or the result of\r
+ Undo or Redo of a previous action.</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Modify notification type flags">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Symbol</th>\r
+\r
+ <th>Value</th>\r
+\r
+ <th align="left">Meaning</th>\r
+\r
+ <th align="left">SCNotification fields</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_INSERTTEXT</code></td>\r
+\r
+ <td align="center">0x01</td>\r
+\r
+ <td>Text has been inserted into the document.</td>\r
+\r
+ <td><code>position, length, text, linesAdded</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_DELETETEXT</code></td>\r
+\r
+ <td align="center">0x02</td>\r
+\r
+ <td>Text has been removed from the document.</td>\r
+\r
+ <td><code>position, length, text, linesAdded</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_CHANGESTYLE</code></td>\r
+\r
+ <td align="center">0x04</td>\r
+\r
+ <td>A style change has occurred.</td>\r
+\r
+ <td><code>position, length</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_CHANGEFOLD</code></td>\r
+\r
+ <td align="center">0x08</td>\r
+\r
+ <td>A folding change has occurred.</td>\r
+\r
+ <td><code>line, foldLevelNow, foldLevelPrev</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PERFORMED_USER</code></td>\r
+\r
+ <td align="center">0x10</td>\r
+\r
+ <td>Information: the operation was done by the user.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PERFORMED_UNDO</code></td>\r
+\r
+ <td align="center">0x20</td>\r
+\r
+ <td>Information: this was the result of an Undo.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_PERFORMED_REDO</code></td>\r
+\r
+ <td align="center">0x40</td>\r
+\r
+ <td>Information: this was the result of a Redo.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MULTISTEPUNDOREDO</code></td>\r
+\r
+ <td align="center">0x80</td>\r
+\r
+ <td>This is part of a multi-step Undo or Redo transaction.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_LASTSTEPINUNDOREDO</code></td>\r
+\r
+ <td align="center">0x100</td>\r
+\r
+ <td>This is the final step in an Undo or Redo transaction.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_CHANGEMARKER</code></td>\r
+\r
+ <td align="center">0x200</td>\r
+\r
+ <td>One or more markers has changed in a line.</td>\r
+\r
+ <td><code>line</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_BEFOREINSERT</code></td>\r
+\r
+ <td align="center">0x400</td>\r
+\r
+ <td>Text is about to be inserted into the document.</td>\r
+\r
+ <td><code>position, if performed by user then text in cells, length in cells</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_BEFOREDELETE</code></td>\r
+\r
+ <td align="center">0x800</td>\r
+\r
+ <td>Text is about to be deleted from the document.</td>\r
+\r
+ <td><code>position, length</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MOD_CHANGEINDICATOR</code></td>\r
+\r
+ <td align="center">0x4000</td>\r
+\r
+ <td>An indicator has been added or removed from a range of text.</td>\r
+\r
+ <td><code>position, length</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code id="SC_MOD_CHANGELINESTATE">SC_MOD_CHANGELINESTATE</code></td>\r
+\r
+ <td align="center">0x8000</td>\r
+\r
+ <td>A line state has changed because <a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE</a>\r
+ was called.</td>\r
+\r
+ <td><code>line</code></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MULTILINEUNDOREDO</code></td>\r
+\r
+ <td align="center">0x1000</td>\r
+\r
+ <td>This is part of an Undo or Redo with multi-line changes.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_STARTACTION</code></td>\r
+\r
+ <td align="center">0x2000</td>\r
+\r
+ <td>This is set on a SC_PERFORMED_USER action when it is the\r
+ first or only step in an undo transaction. This can be used to integrate the Scintilla\r
+ undo stack with an undo stack in the container application by adding a Scintilla\r
+ action to the container's stack for the currently opened container transaction or\r
+ to open a new container transaction if there is no open container transaction.\r
+ </td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>SC_MODEVENTMASKALL</code></td>\r
+\r
+ <td align="center">0x1fff</td>\r
+\r
+ <td>This is a mask for all valid flags. This is the default mask state set by <a\r
+ class="message" href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>.</td>\r
+\r
+ <td>None</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCEN_CHANGE">SCEN_CHANGE</b><br />\r
+ <code>SCEN_CHANGE</code> (768) is fired when the text (not the style) of the document changes.\r
+ This notification is sent using the <code>WM_COMMAND</code> message on Windows and the\r
+ "Command" signal on GTK+ as this is the behavior of the standard Edit control\r
+ (<code>SCEN_CHANGE</code> has the same value as the Windows Edit control\r
+ <code>EN_CHANGE</code>). No other information is sent. If you need more detailed information\r
+ use <a class="message" href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a>. You can filter the\r
+ types of changes you are notified about with <a class="message"\r
+ href="#SCI_SETMODEVENTMASK"><code>SCI_SETMODEVENTMASK</code></a>.</p>\r
+\r
+ <p><b id="SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK(int eventMask)</b><br />\r
+ <b id="SCI_GETMODEVENTMASK">SCI_GETMODEVENTMASK</b><br />\r
+ These messages set and get an event mask that determines which document change events are\r
+ notified to the container with <a class="message"\r
+ href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a> and <a class="message"\r
+ href="#SCEN_CHANGE"><code>SCEN_CHANGE</code></a>. For example, a container may decide to see\r
+ only notifications about changes to text and not styling changes by calling\r
+ <code>SCI_SETMODEVENTMASK(SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT)</code>.</p>\r
+\r
+ <p>The possible notification types are the same as the <code>modificationType</code> bit flags\r
+ used by <code>SCN_MODIFIED</code>: <code>SC_MOD_INSERTTEXT</code>,\r
+ <code>SC_MOD_DELETETEXT</code>, <code>SC_MOD_CHANGESTYLE</code>,\r
+ <code>SC_MOD_CHANGEFOLD</code>, <code>SC_PERFORMED_USER</code>, <code>SC_PERFORMED_UNDO</code>,\r
+ <code>SC_PERFORMED_REDO</code>, <code>SC_MULTISTEPUNDOREDO</code>,\r
+ <code>SC_LASTSTEPINUNDOREDO</code>, <code>SC_MOD_CHANGEMARKER</code>,\r
+ <code>SC_MOD_BEFOREINSERT</code>, <code>SC_MOD_BEFOREDELETE</code>,\r
+ <code>SC_MULTILINEUNDOREDO</code>, and <code>SC_MODEVENTMASKALL</code>.</p>\r
+\r
+ <p><b id="SCEN_SETFOCUS">SCEN_SETFOCUS</b><br />\r
+ <b id="SCEN_KILLFOCUS">SCEN_KILLFOCUS</b><br />\r
+ <code>SCEN_SETFOCUS</code> (512) is fired when Scintilla receives focus and\r
+ <code>SCEN_KILLFOCUS</code> (256) when it loses focus. These notifications are sent using the\r
+ <code>WM_COMMAND</code> message on Windows and the "Command" signal on GTK+ as this is the\r
+ behavior of the standard Edit control. Unfortunately, these codes do not match the Windows Edit\r
+ notification codes <code>EN_SETFOCUS</code> (256) and <code>EN_KILLFOCUS</code> (512). It is\r
+ now too late to change the Scintilla codes as clients depend on the current values.</p>\r
+\r
+ <p><b id="SCN_MACRORECORD">SCN_MACRORECORD</b><br />\r
+ The <code><a class="message" href="#SCI_STARTRECORD">SCI_STARTRECORD</a></code> and <a\r
+ class="message" href="#SCI_STOPRECORD"><code>SCI_STOPRECORD</code></a> messages enable and\r
+ disable macro recording. When enabled, each time a recordable change occurs, the\r
+ <code>SCN_MACRORECORD</code> notification is sent to the container. It is up to the container\r
+ to record the action. To see the complete list of <code>SCI_*</code> messages that are\r
+ recordable, search the Scintilla source <code>Editor.cxx</code> for\r
+ <code>Editor::NotifyMacroRecord</code>. The fields of <code>SCNotification</code> set in this\r
+ notification are:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Macro record notification data">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Field</th>\r
+\r
+ <th align="left">Usage</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>message</code></td>\r
+\r
+ <td align="left">The <code>SCI_*</code> message that caused the notification.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>wParam</code></td>\r
+\r
+ <td align="left">The value of <code>wParam</code> in the <code>SCI_*</code> message.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>lParam</code></td>\r
+\r
+ <td align="left">The value of <code>lParam</code> in the <code>SCI_*</code> message.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCN_MARGINCLICK">SCN_MARGINCLICK</b><br />\r
+ This notification tells the container that the mouse was clicked inside a <a class="jump"\r
+ href="#Margins">margin</a> that was marked as sensitive (see <a class="message"\r
+ href="#SCI_SETMARGINSENSITIVEN"><code>SCI_SETMARGINSENSITIVEN</code></a>). This can be used to\r
+ perform folding or to place breakpoints. The following <code>SCNotification</code> fields are\r
+ used:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Margin click notification">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Field</th>\r
+\r
+ <th align="left">Usage</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>modifiers</code></td>\r
+\r
+ <td align="left">The appropriate combination of <code>SCI_SHIFT</code>,\r
+ <code>SCI_CTRL</code> and <code>SCI_ALT</code> to indicate the keys that were held down\r
+ at the time of the margin click.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>position</code></td>\r
+\r
+ <td align="left">The position of the start of the line in the document that corresponds\r
+ to the margin click.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>margin</code></td>\r
+\r
+ <td align="left">The margin number that was clicked.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCN_NEEDSHOWN">SCN_NEEDSHOWN</b><br />\r
+ Scintilla has determined that a range of lines that is currently invisible should be made\r
+ visible. An example of where this may be needed is if the end of line of a contracted fold\r
+ point is deleted. This message is sent to the container in case it wants to make the line\r
+ visible in some unusual way such as making the whole document visible. Most containers will\r
+ just ensure each line in the range is visible by calling <a class="message"\r
+ href="#SCI_ENSUREVISIBLE"><code>SCI_ENSUREVISIBLE</code></a>. The <code>position</code> and\r
+ <code>length</code> fields of <code>SCNotification</code> indicate the range of the document\r
+ that should be made visible. The container code will be similar to the following code\r
+ skeleton:</p>\r
+<pre>\r
+firstLine = SCI_LINEFROMPOSITION(scn.position)\r
+lastLine = SCI_LINEFROMPOSITION(scn.position+scn.length-1)\r
+for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next\r
+</pre>\r
+\r
+ <p><b id="SCN_PAINTED">SCN_PAINTED</b><br />\r
+ Painting has just been done. Useful when you want to update some other widgets based on a\r
+ change in Scintilla, but want to have the paint occur first to appear more responsive. There is\r
+ no other information in <code>SCNotification</code>.</p>\r
+\r
+ <p><b id="SCN_USERLISTSELECTION">SCN_USERLISTSELECTION</b><br />\r
+ The user has selected an item in a <a class="jump" href="#UserLists">user list</a>. The\r
+ <code>SCNotification</code> fields used are:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="User list notification">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Field</th>\r
+\r
+ <th align="left">Usage</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>wParam</code></td>\r
+\r
+ <td align="left">This is set to the <code>listType</code> parameter from the <a\r
+ class="message" href="#SCI_USERLISTSHOW"><code>SCI_USERLISTSHOW</code></a> message that\r
+ initiated the list.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>text</code></td>\r
+\r
+ <td align="left">The text of the selection.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ <br />\r
+ <br />\r
+\r
+\r
+ <p><b id="SCN_URIDROPPED">SCN_URIDROPPED</b><br />\r
+ Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web\r
+ address onto Scintilla. The container could interpret this as a request to open the file. The\r
+ <code>text</code> field of <code>SCNotification</code> points at the URI text.</p>\r
+\r
+ <p><b id="SCN_DWELLSTART">SCN_DWELLSTART</b><br />\r
+ <b id="SCN_DWELLEND">SCN_DWELLEND</b><br />\r
+ <code>SCN_DWELLSTART</code> is generated when the user keeps the mouse in one position for the\r
+ dwell period (see <code><a class="message"\r
+ href="#SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</a></code>). <code>SCN_DWELLEND</code> is\r
+ generated after a <code>SCN_DWELLSTART</code> and the mouse is moved or other activity such as\r
+ key press indicates the dwell is over. Both notifications set the same fields in\r
+ <code>SCNotification</code>:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Mouse dwell notification">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Field</th>\r
+\r
+ <th align="left">Usage</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>position</code></td>\r
+\r
+ <td align="left">This is the nearest position in the document to the position where the\r
+ mouse pointer was lingering.</td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td align="left"><code>x, y</code></td>\r
+\r
+ <td align="left">Where the pointer lingered. The <code>position</code> field is set to\r
+ <code><a class="message"\r
+ href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE</a>(x, y)</code>.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ <br />\r
+ <br />\r
+\r
+ <p><b id="SCI_SETMOUSEDWELLTIME">SCI_SETMOUSEDWELLTIME</b><br />\r
+ <b id="SCI_GETMOUSEDWELLTIME">SCI_GETMOUSEDWELLTIME</b><br />\r
+ These two messages set and get the time the mouse must sit still, in milliseconds, to generate\r
+ a <code><a class="message" href="#SCN_DWELLSTART">SCN_DWELLSTART</a></code> notification. If\r
+ set to <code>SC_TIME_FOREVER</code>, the default, no dwell events are generated.</p>\r
+\r
+ <p><b id="SCN_ZOOM">SCN_ZOOM</b><br />\r
+ This notification is generated when the user zooms the display using the keyboard or the\r
+ <code><a class="message" href="#SCI_SETZOOM">SCI_SETZOOM</a></code> method is called. This\r
+ notification can be used to recalculate positions, such as the width of the line number margin\r
+ to maintain sizes in terms of characters rather than pixels. <code>SCNotification</code> has no\r
+ additional information.</p>\r
+\r
+ <p>\r
+ <b id="SCN_HOTSPOTCLICK">SCN_HOTSPOTCLICK</b><br />\r
+ <b id="SCN_HOTSPOTDOUBLECLICK">SCN_HOTSPOTDOUBLECLICK</b><br />\r
+ These notifications are generated when the user clicks or double clicks on\r
+ text that is in a style with the hotspot attribute set.\r
+ This notification can be used to link to variable definitions or web pages.\r
+ The <code>position</code> field is set the text position of the click or\r
+ double click and the <code>modifiers</code> field set to the key modifiers\r
+ held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.</p>\r
+\r
+ <p>\r
+ <b id="SCN_INDICATORCLICK">SCN_INDICATORCLICK</b><br />\r
+ <b id="SCN_INDICATORRELEASE">SCN_INDICATORRELEASE</b><br />\r
+ These notifications are generated when the user clicks or releases the mouse on\r
+ text that has an indicator.\r
+ The <code>position</code> field is set the text position of the click or\r
+ double click and the <code>modifiers</code> field set to the key modifiers\r
+ held down in a similar manner to <a class="message" href="#SCN_KEY">SCN_KEY</a>.</p>\r
+\r
+ <p><b id="SCN_CALLTIPCLICK">SCN_CALLTIPCLICK</b><br />\r
+ This notification is generated when the user clicks on a calltip.\r
+ This notification can be used to display the next function prototype when a\r
+ function name is overloaded with different arguments.\r
+ The <code>position</code> field is set to 1 if the click is in an up arrow,\r
+ 2 if in a down arrow, and 0 if elsewhere.</p>\r
+\r
+ <p><b id="SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</b><br />\r
+ The user has selected an item in an <a class="jump" href="#Autocompletion">autocompletion list</a>. The\r
+ notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a\r
+ <code><a class="message" href="#SCI_AUTOCCANCEL">SCI_AUTOCCANCEL</a></code> message\r
+ before returning from the notification. The <code>SCNotification</code> fields used are:</p>\r
+\r
+ <table cellpadding="1" cellspacing="2" border="0" summary="Autocompletion list notification">\r
+ <tbody>\r
+ <tr>\r
+ <th align="left">Field</th>\r
+\r
+ <th align="left">Usage</th>\r
+ </tr>\r
+ </tbody>\r
+\r
+ <tbody valign="top">\r
+ <tr>\r
+ <td align="left"><code>lParam</code></td>\r
+\r
+ <td align="left">The start position of the word being completed.</td>\r
+ </tr>\r
+ <tr>\r
+ <td align="left"><code>text</code></td>\r
+\r
+ <td align="left">The text of the selection.</td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+\r
+ <p><b id="SCN_AUTOCCANCELLED">SCN_AUTOCCANCELLED</b><br />\r
+ The user has cancelled an <a class="jump" href="#Autocompletion">autocompletion list</a>.\r
+ There is no other information in SCNotification.\r
+\r
+ <h2 id="GTK">GTK+</h2>\r
+ <p>On GTK+, the following functions create a Scintilla widget, communicate with it and allow\r
+ resources to be released after all Scintilla widgets have been destroyed.</p>\r
+ <code><a class="message" href="#scintilla_new">GtkWidget *scintilla_new()</a><br />\r
+ <a class="message" href="#scintilla_set_id">void scintilla_set_id(ScintillaObject *sci, uptr_t id)</a><br />\r
+ <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
+ <a class="message" href="#scintilla_release_resources">void scintilla_release_resources()</a><br />\r
+ </code>\r
+\r
+ <p><b id="scintilla_new">GtkWidget *scintilla_new()</b></b><br />\r
+ Create a new Scintilla widget. The returned pointer can be added to a container and displayed in the same way as other\r
+ widgets.</p>\r
+\r
+ <p><b id="scintilla_set_id">void scintilla_set_id(ScintillaObject *sci, uptr_t id)</b></b><br />\r
+ Set the control ID which will be used in the idFrom field of the NotifyHeader structure of all\r
+ notifications for this instance. When an application creates multiple Scintilla widgets, this allows\r
+ the source of each notification to be found. The value should be small, preferrably less than 16 bits,\r
+ rather than a pointer as some of the functions will only transmit 16 or 32 bits.</p>\r
+\r
+ <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
+ The main entry point allows sending any of the messages described in this document.</p>\r
+\r
+ <p><b id="scintilla_release_resources">void scintilla_release_resources()</b><br />\r
+ Call this to free any remaining resources after all the Scintilla widgets have been destroyed.</p>\r
+\r
+ <h2 id="DeprecatedMessages">Deprecated messages and notifications</h2>\r
+\r
+ <p>The following messages are currently supported to emulate existing Windows controls, but\r
+ they will be removed in future versions of Scintilla. If you use these messages you should\r
+ replace them with the Scintilla equivalent.</p>\r
+<pre>\r
+WM_GETTEXT(int length, char *text)\r
+WM_SETTEXT(<unused>, const char *text)\r
+EM_GETLINE(int line, char *text)\r
+EM_REPLACESEL(<unused>, const char *text)\r
+EM_SETREADONLY\r
+EM_GETTEXTRANGE(<unused>, TEXTRANGE *tr)\r
+WM_CUT\r
+WM_COPY\r
+WM_PASTE\r
+WM_CLEAR\r
+WM_UNDO\r
+EM_CANUNDO\r
+EM_EMPTYUNDOBUFFER\r
+WM_GETTEXTLENGTH\r
+EM_GETFIRSTVISIBLELINE\r
+EM_GETLINECOUNT\r
+EM_GETMODIFY\r
+EM_SETMODIFY(bool isModified)\r
+EM_GETRECT(RECT *rect)\r
+EM_GETSEL(int *start, int *end)\r
+EM_EXGETSEL(<unused>, CHARRANGE *cr)\r
+EM_SETSEL(int start, int end)\r
+EM_EXSETSEL(<unused>, CHARRANGE *cr)\r
+EM_GETSELTEXT(<unused>, char *text)\r
+EM_LINEFROMCHAR(int position)\r
+EM_EXLINEFROMCHAR(int position)\r
+EM_LINEINDEX(int line)\r
+EM_LINELENGTH(int position)\r
+EM_SCROLL(int line)\r
+EM_LINESCROLL(int column, int line)\r
+EM_SCROLLCARET()\r
+EM_CANPASTE\r
+EM_CHARFROMPOS(<unused>, POINT *location)\r
+EM_POSFROMCHAR(int position, POINT *location)\r
+EM_SELECTIONTYPE\r
+EM_HIDESELECTION(bool hide)\r
+EM_FINDTEXT(int flags, FINDTEXTEX *ft)\r
+EM_FINDTEXTEX(int flags, FINDTEXTEX *ft)\r
+EM_GETMARGINS\r
+EM_SETMARGINS(EC_LEFTMARGIN or EC_RIGHTMARGIN or EC_USEFONTINFO, int val)\r
+EM_FORMATRANGE\r
+</pre>\r
+\r
+ <p>The following are features that are only included if you define\r
+ <code>INCLUDE_DEPRECATED_FEATURES</code> in <code>Scintilla.h</code>. To ensure future\r
+ compatibility you should change them as indicated.</p>\r
+\r
+ <p><b id="SCN_POSCHANGED">SCN_POSCHANGED()</b> Deprecated<br />\r
+ Fired when the user moves the cursor to a different position in the text. Use <a\r
+ class="message" href="#SCN_UPDATEUI"><code>SCN_UPDATEUI</code></a> instead.</p>\r
+\r
+ <p><b id="SCN_CHECKBRACE">SCN_CHECKBRACE</b> Deprecated<br />\r
+ Either the text or styling of the document has changed or the selection range has changed.\r
+ This is replaced by <a class="message" href="#SCN_UPDATEUI"><code>SCN_UPDATEUI</code></a>. You\r
+ can also use <code><a class="message" href="#SCN_MODIFIED">SCN_MODIFIED</a></code> for more\r
+ detailed information on text and styling changes,</p>\r
+\r
+ <h2 id="EditMessagesNeverSupportedByScintilla">Edit messages never supported by Scintilla</h2>\r
+<pre>\r
+EM_GETWORDBREAKPROC EM_GETWORDBREAKPROCEX\r
+EM_SETWORDBREAKPROC EM_SETWORDBREAKPROCEX\r
+EM_GETWORDWRAPMODE EM_SETWORDWRAPMODE\r
+EM_LIMITTEXT EM_EXLIMITTEXT\r
+EM_SETRECT EM_SETRECTNP\r
+EM_FMTLINES\r
+EM_GETHANDLE EM_SETHANDLE\r
+EM_GETPASSWORDCHAR EM_SETPASSWORDCHAR\r
+EM_SETTABSTOPS\r
+EM_FINDWORDBREAK\r
+EM_GETCHARFORMAT EM_SETCHARFORMAT\r
+EM_GETOLEINTERFACE EM_SETOLEINTERFACE\r
+EM_SETOLECALLBACK\r
+EM_GETPARAFORMAT EM_SETPARAFORMAT\r
+EM_PASTESPECIAL\r
+EM_REQUESTRESIZE\r
+EM_GETBKGNDCOLOR EM_SETBKGNDCOLOR\r
+EM_STREAMIN EM_STREAMOUT\r
+EM_GETIMECOLOR EM_SETIMECOLOR\r
+EM_GETIMEOPTIONS EM_SETIMEOPTIONS\r
+EM_GETOPTIONS EM_SETOPTIONS\r
+EM_GETPUNCTUATION EM_SETPUNCTUATION\r
+EM_GETTHUMB\r
+EM_GETEVENTMASK\r
+EM_SETEVENTMASK\r
+EM_DISPLAYBAND\r
+EM_SETTARGETDEVICE\r
+</pre>\r
+\r
+ <p>Scintilla tries to be a superset of the standard windows Edit and RichEdit controls wherever\r
+ that makes sense. As it is not intended for use in a word processor, some edit messages can not\r
+ be sensibly handled. Unsupported messages have no effect.</p>\r
+\r
+ <h2 id="BuildingScintilla">Building Scintilla</h2>\r
+\r
+ <p>To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE\r
+ directories. For Windows, GCC 3.2, Borland C++ or Microsoft Visual Studio .NET can be used\r
+ for building. There is a make file for building Scintilla but not SciTE with Visual C++ 6 at\r
+ scintilla/win32/scintilla_vc6.mak. For GTK+, GCC 3.1 should be used. GTK+ 1.2x and 2.0x are\r
+ supported. The version of GTK+ installed should be detected automatically.\r
+ When both GTK+ 1 and GTK+ 2 are present, building for GTK+ 1.x requires defining GTK1\r
+ on the command line.</p>\r
+\r
+ <h3>Static linking</h3>\r
+\r
+ <p>On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to\r
+ link Scintilla directly into your application .EXE or .DLL file, then the\r
+ <code>STATIC_BUILD</code> preprocessor symbol should be defined and\r
+ <code>Scintilla_RegisterClasses</code> called. <code>STATIC_BUILD</code> prevents compiling the\r
+ <code>DllMain</code> function which will conflict with any <code>DllMain</code> defined in your\r
+ code. <code>Scintilla_RegisterClasses</code> takes the <code>HINSTANCE</code> of your\r
+ application and ensures that the "Scintilla" window class is registered. To make sure that the\r
+ right pointing arrow cursor used in the margin is displayed by Scintilla add the\r
+ <code>scintilla/win32/Margin.cur</code> file to your application's resources with the ID\r
+ <code>IDC_MARGIN</code> which is defined in <code>scintilla/win32/platfromRes.h</code> as\r
+ 400.</p>\r
+\r
+ <h3>Ensuring lexers are linked into Scintilla</h3>\r
+\r
+ <p>Depending on the compiler and linker used, the lexers may be stripped out. This is most\r
+ often caused when building a static library. To ensure the lexers are linked in, the\r
+ <code>Scintilla_LinkLexers()</code> function may be called.</p>\r
+\r
+ <h3>Changing set of lexers</h3>\r
+\r
+ <p>To change the set of lexers in Scintilla, add and remove lexer source files\r
+ (<code>Lex*.cxx</code>) from the <code>scintilla/src directory</code> and run the\r
+ <code>src/LexGen.py</code> script from the <code>src</code> directory to update the make files\r
+ and <code>KeyWords.cxx</code>. <code>LexGen.py</code> requires Python 2.1 or later. If you do\r
+ not have access to Python, you can hand edit <code>KeyWords.cxx</code> in a simple-minded way,\r
+ following the patterns of other lexers. The important thing is to include\r
+ <code>LINK_LEXER(lmMyLexer);</code> to correspond with the <code>LexerModule\r
+ lmMyLexer(...);</code> in your lexer source code.</p>\r
+\r
+ <h3>Building with an alternative Regular Expression implementation</h3>\r
+\r
+ <p id="AlternativeRegEx">A simple interface provides support for switching the Regular Expressions engine at\r
+ compile time. You must implement <code>RegexSearchBase</code> for your chosen engine,\r
+ look at the built-in implementation <code>BuiltinRegex</code> to see how this is done.\r
+ You then need to implement the factory method <code>CreateRegexSearch</code>\r
+ to create an instance of your class. You must disable the built-in implementation by defining\r
+ <code>SCI_OWNREGEX</code>.</p>\r
+\r
+ </body>\r
+</html>\r
+\r