From ba9f4cd95065dc70e484063eff27d529c648682d Mon Sep 17 00:00:00 2001
From: nyamatongwe
The GTK+ version also uses messages in a similar way to the Windows version. This is @@ -96,7 +96,7 @@
SCI_SETSTYLEBITS up to a maximum of 7 bits. The
- remaining bits can be used for indicators.
+ href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS up to a maximum of 7 bits.
+ The remaining bits can be used for indicators.
Positions within the Scintilla document refer to a character or the gap before that
character. The first character in a document is 0, the second 1 and so on. If a document
- contains nLen characters, the last character is numbered nLen-1. The
- caret exists between character positions and can be located from before the first character (0)
+ contains nLen characters, the last character is numbered nLen-1.
+ The caret exists between character positions and can be located from before the first character (0)
to after the last character (nLen).
There are places where the caret can not go where two character bytes make up one character. @@ -397,9 +397,10 @@ href="#SCI_GETTEXT">SCI_GETTEXT
SCI_ADDTEXT(int length, const char *s)
- This inserts the first length characters from the string s,
- including any 0's in the string that you might have expected to stop the insert operation. The
- current position is set at the end of the inserted text, but it is not scrolled into view.
length characters from the string s
+ at the current position. This will include any 0's in the string that you might have expected
+ to stop the insert operation. The current position is set at the end of the inserted text,
+ but it is not scrolled into view.
SCI_ADDSTYLEDTEXT(int length, cell *s)
This behaves just like SCI_ADDTEXT, but inserts styled text.
The TextToFind structure is defined in Scintilla.h; set
chrg.cpMin and chrg.cpMax with the range of positions in the document
- to search. If SCFIND_REGEXP is included in the flags, the search is always
- forwards (even if chrg.cpMax is less than chrg.cpMin). If
- SCFIND_REGEXP is not included, you can search backwards by setting
- chrg.cpMax less than chrg.cpMin. Set the lpstrText
- member of TextToFind to point at a zero terminated text string holding the search
- pattern. If your language makes the use of TextToFind difficult, you should
- consider using SCI_SEARCHINTARGET instead.
The return value is -1 if the search fails or the position of the start of the found text it
- is succeeds. The chrgText.cpMin and chrgText.cpMax members of
+ to search. If SCFIND_REGEXP is not included in the flags, you can search backwards by
+ setting chrg.cpMax less than chrg.cpMin. If SCFIND_REGEXP
+ is included, the search is always forwards (even if chrg.cpMax is less than chrg.cpMin).
+ Set the lpstrText member of TextToFind to point at a zero terminated
+ text string holding the search pattern. If your language makes the use of TextToFind
+ difficult, you should consider using SCI_SEARCHINTARGET instead.
The return value is -1 if the search fails or the position of the start of the found text if
+ it succeeds. The chrgText.cpMin and chrgText.cpMax members of
TextToFind are filled in with the start and end positions of the found text.
See also: ,
modifications cause scrolling and other visible changes, which may take some time and cause
unwanted display updates. If performing many changes, such as a replace all command, the target
- can be used instead. First, set the range to be replaced. Then call
+ can be used instead. First, set the target, ie. the range to be replaced. Then call
SCI_REPLACETARGET or SCI_REPLACETARGETRE.
Searching can be performed within the target range with SCI_SEARCHINTARGET,
@@ -684,13 +684,13 @@ struct TextToFind {
-
-
+
+
@@ -706,24 +706,11 @@ struct TextToFind {
SCI_TARGETFROMSELECTION
Set the target start and end to the start and end positions of the selection.
SCI_REPLACETARGET(int length, const char *text)
- If length is -1, text is a zero terminated string, otherwise
- length sets the number of character to replace the target with. The return value
- is the length of the replacement string.
SCI_REPLACETARGETRE(int length, const char *text)
- This replaces the target using regular expressions. If length is -1,
- text is a zero terminated string, otherwise length is the number of
- characters to use. The replacement string is formed from the text string with any sequences of
- \1 through \9 replaced by tagged matches from the most recent regular
- expression search. The return value is the length of the replacement string.
SCI_SETSEARCHFLAGS(int searchFlags)
SCI_GETSEARCHFLAGS
These get and set the searchFlags used by
SCI_SEARCHINTARGET. There are several option flags including a simple regular
- expression search.
-
SCI_SEARCHINTARGET(int length, const char *text)
This searches for the first occurrence of a text string in the target defined by
@@ -733,6 +720,20 @@ struct TextToFind {
text and the return value is the position of the start of the matching text. If the search
fails, the result is -1.
SCI_REPLACETARGET(int length, const char *text)
+ If length is -1, text is a zero terminated string, otherwise
+ length sets the number of character to replace the target with. The return value
+ is the length of the replacement string.
+ Note that the recommanded way to delete text in the document is to set the target to the text to be removed,
+ and to perform a replace target with an empty string.
SCI_REPLACETARGETRE(int length, const char *text)
+ This replaces the target using regular expressions. If length is -1,
+ text is a zero terminated string, otherwise length is the number of
+ characters to use. The replacement string is formed from the text string with any sequences of
+ \1 through \9 replaced by tagged matches from the most recent regular
+ expression search. The return value is the length of the replacement string.
See also:
SCI_GETOVERTYPE returns TRUE (1) if overtyping is active, otherwise
- FALSE (0) will be returned. Use SCI_GETOVERTYPE to set the overtype
- node.
+ FALSE (0) will be returned. Use SCI_SETOVERTYPE to set the overtype
+ mode.
SCI_CANPASTE returns non-zero if there is anything in the clipboard in a suitable
- format for pasting. If you need a "can copy" or "can cut", use
+ SCI_CANPASTE returns non-zero if the document isn't read-only and if the selection
+ doesn't contain protected text. If you need a "can copy" or "can cut", use
SCI_GETSELECTIONSTART()-SCI_GETSELECTIONEND(), which will be non-zero if you can
copy or cut to the clipboard.
@@ -833,15 +834,14 @@ struct TextToFind {
container.
See also:
- SCI_SETUNDOCOLLECTION(bool collectUndo)SCI_SETUNDOCOLLECTION(bool collectUndo)
SCI_GETUNDOCOLLECTION
You can control whether Scintilla collects undo information with
SCI_SETUNDOCOLLECTION. Pass in true (1) to collect information and
false (0) to stop collecting. If you stop collection, you should also use
SCI_EMPTYUNDOBUFFER to avoid the undo buffer being unsynchronized with the data in
- the buffer.
-
-
+ the buffer.
You might wish to turn off saving undo information if you use the Scintilla to store text
generated by a program (a Log view) or in a display window where text is often deleted and
@@ -896,6 +896,8 @@ struct TextToFind {
+
+
@@ -947,7 +949,7 @@ struct TextToFind {
SCI_GOTOPOS(int pos)
This removes any selection, sets the caret at pos and scrolls the view to make
the caret visible, if necessary. It is equivalent to
- SCI_SETSEL(pos,&nbrsp;pos). The anchor position is set the same as the current
+ SCI_SETSEL(pos, pos). The anchor position is set the same as the current
position.
SCI_GOTOLINE(int line)
@@ -1055,7 +1057,6 @@ struct TextToFind {
SCI_GETSELECTIONEND()-SCI_SETSELECTIONSTART()+1 bytes long.
-
See also: , , ,
SCI_SETSELECTIONMODE
+ SCI_GETSELECTIONMODE
+ The two functions set and get the selection mode, which can be
+ stream (SC_SEL_STREAM=1) or
+ rectangular (SC_SEL_RECTANGLE=2)
+ or by lines (SC_SEL_LINES=3).
+ When set in these modes, regular caret moves will extend or reduce the selection,
+ until the mode is cancelled by a call with same value or with SCI_CANCEL.
+ The get function returns the current mode even if the selection was made by mouse
+ or with regular extended moves.
SCI_MOVECARETINSIDEVIEW
If the caret is off the top or bottom of the view, it is moved to the nearest line that is
visible to its current position. Any selection is lost.
While the style setting messages mentioned above, change the style numbers associated with +
While the style setting messages mentioned above change the style numbers associated with
text, these messages define how those style numbers are interpreted visually. There are 128
lexer styles that can be set, numbered 0 to STYLEMAX (127). Unless you use to change the number
@@ -2190,7 +2202,7 @@ struct TextToFind {
SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)
SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)
These messages allow changing the colour of the fold margin and fold margin highlight.
- On windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight
+ On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight
colour to ::GetSysColor(COLOR_3DHIGHLIGHT).
chars is null then the default set,
alphanumeric and '_', is used. For example, if you don't allow '_' in your set of characters
use:SCI_SETWORDCHARS(0,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
+ SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
SCI_GRABFOCUS
SCI_SETFOCUS(bool focus)
@@ -2338,7 +2350,7 @@ struct TextToFind {
A match only occurs if the style of the matching brace is the same as the starting brace or
the matching brace is beyond the end of styling. Nested braces are handled correctly. The
- maxReStyle parameter must currently be 0 - it may be used n the future to limit
+ maxReStyle parameter must currently be 0 - it may be used in the future to limit
the length of brace searches.
SC_MARK_CHARACTER (10000). For example, to use 'A' (ASCII code 65) as marker
number 1 use:SCI_MARKETDEFINE(1, SC_MARK_CHARACETR+65). SCI_MARKETDEFINE(1, SC_MARK_CHARACTER+65). SCI_MARKERLINEFROMHANDLE to find where a
marker is after moving or combining lines and with SCI_MARKERDELETEHANDLE to delete the marker
- based on its handle. The message does not check that the value of markerNumber, nor does it
+ based on its handle. The message does not check the value of markerNumber, nor does it
check if the line already contains the marker.
SCI_MARKERDELETE(int line, int markerNumber)
@@ -2690,7 +2702,7 @@ struct TextToFind {
style information (for 32 styles) and 3 bits of indicator information for 3 independent
indicators so that, for example, syntax errors, deprecated names and bad indentation could all
be displayed at once. Indicators may be displayed as simple underlines, squiggly underlines, a
- line of small 'T' shapes, a line of diagonal hatching or as strike-out.
The indicators are set using with a INDICS_MASK mask
@@ -2826,17 +2838,17 @@ struct TextToFind {
-
-
-
@@ -2885,9 +2897,9 @@ struct TextToFind {
of the list.
SCI_AUTOCCOMPLETE
- This message triggers message. This has the same effect as the tab key.
SCI_AUTOCSTOPS(<unused>,const char *chars)
+
SCI_AUTOCSTOPS(<unused>, const char *chars)
The chars argument is a string containing a list of characters that will
automatically cancel the autocompletion list. When you start the editor, this list is
empty.
SCI_AUTOCSHOW list. The default is the space character.
- SCI_AUTOCSELECT(<unused>,const char *select)
+
SCI_AUTOCSELECT(<unused>, const char *select)
This message selects an item in the autocompletion list. It searches the list of words for the
first that matches select. By default, comparisons are case sensitive, but you can
change this with
SCI_LINEDOWNEXTENDSCI_LINEDOWNRECTEXTENDSCI_LINESCROLLDOWNSCI_LINEUPSCI_LINEUPEXTENDSCI_LINEUPRECTEXTENDSCI_LINESCROLLUPSCI_CHARLEFTEXTENDSCI_CHARLEFTRECTEXTENDSCI_CHARRIGHTSCI_CHARRIGHTEXTENDSCI_CHARRIGHTRECTEXTENDSCI_WORDRIGHTEXTENDSCI_WORDPARTLEFTSCI_WORDPARTLEFTEXTENDSCI_WORDPARTRIGHTSCI_WORDPARTRIGHTEXTENDSCI_HOMESCI_HOMEEXTEND[SCI_HOMERECTEXTEND]SCI_HOMEDISPLAYSCI_HOMEDISPLAYEXTENDSCI_HOMEWRAPSCI_HOMEWRAPEXTENDSCI_VCHOMESCI_VCHOMEEXTENDSCI_VCHOMERECTEXTENDSCI_VCHOMEWRAPSCI_VCHOMEWRAPEXTENDSCI_LINEENDSCI_LINEENDEXTENDSCI_LINEENDRECTEXTENDSCI_LINEENDDISPLAYSCI_LINEENDDISPLAYEXTENDSCI_LINEENDWRAPSCI_LINEENDWRAPEXTENDSCI_PAGEUPEXTENDSCI_PAGEDOWNSCI_PAGEDOWNEXTENDSCI_PAGEUPRECTEXTENDSCI_EDITTOGGLEOVERTYPESCI_CANCELSCI_DELETEBACKSCI_DELETEBACKNOTLINESCI_TABSCI_BACKTABSCI_PAGEDOWNSCI_NEWLINESCI_PAGEDOWNEXTENDSCI_FORMFEEDSCI_PAGEDOWNRECTEXTENDSCI_VCHOMESCI_DELETEBACKSCI_VCHOMEEXTENDSCI_DELETEBACKNOTLINESCI_DELWORDLEFTSCI_DELLINERIGHTSCI_LINESCROLLDOWNSCI_LINESCROLLUPSCI_LINEDELETESCI_LINECOPYSCI_LINEDELETESCI_LINETRANSPOSESCI_LINEDUPLICATESCI_LOWERCASESCI_UPPERCASESCI_WORDPARTLEFTSCI_WORDPARTLEFTEXTENDSCI_LOWERCASESCI_WORDPARTRIGHTSCI_UPPERCASESCI_WORDPARTRIGHTEXTENDSCI_CANCELSCI_HOMEDISPLAYSCI_EDITTOGGLEOVERTYPESCI_HOMEDISPLAYEXTENDSCI_LINEENDDISPLAYSCI_NEWLINESCI_LINEENDDISPLAYEXTENDSCI_FORMFEEDSCI_VCHOMEWRAPSCI_TABSCI_VCHOMEWRAPEXTENDSCI_BACKTABThe SCI_*EXTEND messages extend the selection.
The SCI_*RECTEXTEND messages extend the rectangular selection
+ (and convert regular selection to rectangular one, if any).
The SCI_WORDPART* commands are used to move between word segments marked by
capitalisation (aCamelCaseIdentifier) or underscores (an_under_bar_ident).
The SCI_HOME* commands move the caret to the start of the line, while the
+ SCI_VCHOME*commands move the caret to the first non-blank character of the line
+ (ie. just after the indentation) unless it is already there; in this case, it acts as SCI_HOME*.
The SCI_[HOME|LINEEND]DISPLAY* commands are used when in line wrap mode to
allow movement to the start or end of display lines as opposed to the normal
- [HOME|LINEEND] commands which move to the start or end of document lines.
SCI_[HOME|LINEEND] commands which move to the start or end of document lines.
+
+ The SCI_[[VC]HOME|LINEEND]WRAP* commands are like their namesakes
+ SCI_[[VC]HOME|LINEEND]* except they behave differently when word-wrap is enabled:
+ They go first to the start / end of the display line, like SCI_[HOME|LINEEND]DISPLAY*,
+ but if the cursor is already at the point, it goes on to the start or end of the document line,
+ as appropriate for SCI_[[VC]HOME|LINEEND]*.
+
hdcTarget to the screen DC.rcPage is the rectangle {0,0,maxX,maxY} where maxX+1
+ rcPage is the rectangle {0, 0, maxX, maxY} where maxX+1
and maxY+1 are the number of physically printable pixels in x and y.rc is the rectangle to render the text in (which will, of course, fit within the
rectangle defined by rcPage).
#include "Scintilla.h"
-SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION,0,0);
-sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER,0,0);
+SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);
+sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);
// now a wrapper to call Scintilla directly
sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
@@ -3532,7 +3584,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
This returns a pointer to the document currently in use by the window. It has no other
effect.
- SCI_SETDOCPOINTER(<unused>,document *pDoc)
+
SCI_SETDOCPOINTER(<unused>, document *pDoc)
This message does the following:
1. It removes the current window from the list held by the current document.
2. It reduces the reference count of the current document by 1.
@@ -3749,6 +3801,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
href="#SCI_SETVISIBLEPOLICY">SCI_SETVISIBLEPOLICY is then applied.
Line wrapping
+
SCI_SETWRAPMODE(int wrapMode)
SCI_GETWRAPMODE
SCI_SETLAYOUTCACHE(int cacheMode)
@@ -3766,7 +3819,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
Much of the time used by Scintilla is spent on laying out and drawing text. The same text
layout calculations may be performed many times even when the data used in these calculations
does not change. To avoid these unnecessary calculations in some circumstances, the line layout
- cache can store the results of the calculations. The cache in invalidated whenever the
+ cache can store the results of the calculations. The cache is invalidated whenever the
underlying data, such as the contents or styling of the document changes. Caching the layout of
the whole document has the most effect, making dynamic line wrap as much as 20 times faster but
this requires 7 times the memory required by the document contents plus around 80 bytes per
@@ -3958,7 +4011,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
styling and fold points for an unsupported language you can either do this in the container or
better still, write your own lexer following the pattern of one of the existing ones.
- Scintilla (Windows version) also supports external lexers. These are DLLs that export four
+
Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export four
functions: GetLexerCount, GetLexerName, Lex and
Fold. See externalLexer.cxx for more.
SCI_SETLEXER(int lexer)
@@ -4018,7 +4071,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
significant.
The value string can refer to other keywords. For example,
- SCI_SETPROPERTY("foldTimes10","$(fold)0") stores the string
+ SCI_SETPROPERTY("foldTimes10", "$(fold)0") stores the string
"$(fold)0", but when this is accessed, the $(fold) is replaced by the
value of the "fold" keyword (or by nothing if this keyword does not exist).
@@ -4030,11 +4083,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)
You can set up to 9 lists of keywords for use by the current lexer. This was increased from 6
- at revsion 1.50. keyWordSet can be 0 to 8 and selects which keyword list to
- replace. keyWordList is a list of keywords separated by spaces, tabs,
- "\n" or "\r" or any combination of these. It is expected that the
- keywords will be composed of standard ASCII printing characters (but there is nothing to stop
- you using any non-separator character codes from 1 to 255 (except common sense).
+ at revsion 1.50. keyWordSet can be 0 to 8 (actually 0 to KEYWORDSET_MAX)
+ and selects which keyword list to replace. keyWordList is a list of keywords
+ separated by spaces, tabs, "\n" or "\r" or any combination of these.
+ It is expected that the keywords will be composed of standard ASCII printing characters,
+ but there is nothing to stop you using any non-separator character codes from 1 to 255
+ (except common sense).
How these keywords are used is entirely up to the lexer. Some languages, such as HTML may
contain embedded languages, VBScript and JavaScript are common for HTML. For HTML, key word set
@@ -4121,7 +4175,7 @@ struct SCNotification {
The following additional notifications are sent using the WM_COMMAND message on
- Windows and the "Command" signal on GTK+ to emulate the windows edit control:
+ Windows and the "Command" signal on GTK+ to emulate the Windows Edit control:
SCEN_CHANGE
SCEN_SETFOCUS
SCEN_KILLFOCUS
@@ -4224,7 +4278,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
linesAdded
- Number of added lines. if negative, the number of deleted lines. Set to
+ Number of added lines. If negative, the number of deleted lines. Set to
0 if not used or no lines added or deleted.
@@ -4404,8 +4458,8 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
SCEN_CHANGE
SCEN_CHANGE (768) is fired when the text (not the style) of the document changes.
This notification is sent using the WM_COMMAND message on Windows and the
- "Command" signal on GTK+ as this is the behavior of the standard edit control
- (SCEN_CHANGE has the same value as the Windows edit control
+ "Command" signal on GTK+ as this is the behavior of the standard Edit control
+ (SCEN_CHANGE has the same value as the Windows Edit control
EN_CHANGE). No other information is sent. If you need more detailed information
use . You can filter the
types of changes you are notified about with (lineNumber);
SCEN_SETFOCUS (512) is fired when Scintilla receives focus and
SCEN_KILLFOCUS (256) when it loses focus. These notifications are sent using the
WM_COMMAND message on Windows and the "Command" signal on GTK+ as this is the
- behavior of the standard edit control. Unfortunately, these codes do not match the Windows edit
+ behavior of the standard Edit control. Unfortunately, these codes do not match the Windows Edit
notification codes EN_SETFOCUS (256) and EN_KILLFOCUS (512). It is
now too late to change the Scintilla codes as clients depend on the current values.
@@ -4572,7 +4626,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
SCN_URIDROPPED
- Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or web
+ Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web
address onto Scintilla. The container could interpret this as a request to open the file. The
text field of SCNotification points at the URI text.
@@ -4603,11 +4657,11 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
- x,y
+ x, y
Where the pointer lingered. The position field is set to
SCI_POSITIONFROMPOINTCLOSE(x,y).
+ href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(x, y).
--
cgit v1.2.3