From 187818f68f76f51a38c83a212ebce1fc8072496c Mon Sep 17 00:00:00 2001
From: nyamatongwe Last edited 24/January/2010 NH Last edited 23/March/2010 NH There is an overview of the internal design of
Scintilla. SCI_GETTEXTRANGE(<unused>, TextRange *tr) SCI_GETSTYLEDTEXT(<unused>, TextRange *tr) TextRange and CharacterRange Sci_TextRange and Sci_CharacterRangeScintilla Documentation
-
@@ -331,7 +331,7 @@
*text)
-
@@ -342,7 +342,7 @@
-
@@ -413,9 +413,9 @@
href="#SCN_MODIFYATTEMPTRO">SCN_MODIFYATTEMPTRO
notification.
+ href="#Sci_TextRange">Sci_TextRange *tr)
This collects the text between the positions cpMin
and cpMax
and
- copies it to lpstrText
(see struct TextRange
in
+ copies it to lpstrText
(see struct Sci_TextRange
in
Scintilla.h
). If cpMax
is -1, text is returned to the end of the
document. The text is 0 terminated, so you must supply a buffer that is at least 1 character
longer than the number of characters you wish to read. The return value is the length of the
@@ -428,11 +428,11 @@
href="#SCI_GETTEXT">SCI_GETTEXT
+ href="#Sci_TextRange">Sci_TextRange *tr)
This collects styled text into a buffer using two bytes for each cell, with the character at
the lower address of each pair and the style byte at the upper address. Characters between the
positions cpMin
and cpMax
are copied to lpstrText
(see
- struct TextRange
in Scintilla.h
). Two 0 bytes are added to the end of
+ struct Sci_TextRange
in Scintilla.h
). Two 0 bytes are added to the end of
the text, so the buffer that lpstrText
points at must be at least
2*(cpMax-cpMin)+2
bytes long. No check is made for sensible values of
cpMin
or cpMax
. Positions outside the document return character codes
@@ -492,18 +492,18 @@
The number of styling bits needed by the current lexer can be found with
.
+
These structures are defined to be exactly the same shape as the Win32 TEXTRANGE
and CHARRANGE
, so that older code that treats Scintilla as a RichEdit will
work.
-struct CharacterRange {
+struct Sci_CharacterRange {
long cpMin;
long cpMax;
};
-struct TextRange {
- struct CharacterRange chrg;
+struct Sci_TextRange {
+ struct Sci_CharacterRange chrg;
char *lpstrText;
};
@@ -535,7 +535,7 @@ struct TextRange {
or can be called from the container using direct access to the buffer contents through
.
SCI_FINDTEXT(int flags, TextToFind
+ SCI_FINDTEXT(int flags, Sci_TextToFind
*ttf)
SCI_SEARCHANCHOR
SCI_SEARCHNEXT(int searchFlags, const char
@@ -682,35 +682,35 @@ struct TextRange {
SCI_FINDTEXT(int searchFlags, TextToFind *ttf)
+ href="#Sci_TextToFind">Sci_TextToFind
*ttf)
This message searches for text in the document. It does not use or move the current selection.
The searchFlags
argument controls the
search type, which includes regular expression searches.
- The TextToFind
structure is defined in Scintilla.h
; set
+
The Sci_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 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
+ Set the lpstrText
member of Sci_TextToFind
to point at a zero terminated
+ text string holding the search pattern. If your language makes the use of Sci_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.
+ Sci_TextToFind
are filled in with the start and end positions of the found text.
See also:
- TextToFind
+
Sci_TextToFind
This structure is defined to have exactly the same shape as the Win32 structure
FINDTEXTEX
for old code that treated Scintilla as a RichEdit control.
-struct TextToFind {
- struct CharacterRange chrg; // range to search
+struct Sci_TextToFind {
+ struct Sci_CharacterRange chrg; // range to search
char *lpstrText; // the search pattern (zero terminated)
- struct CharacterRange chrgText; // returned as position of matching text
+ struct Sci_CharacterRange chrgText; // returned as position of matching text
};
@@ -4360,7 +4360,7 @@ struct TextToFind {
which can include a printer display context. Printed output shows text styling as on the
screen, but it hides all margins except a line number margin. All special marker effects are
removed and the selection and caret are hidden.
- SCI_FORMATRANGE(bool bDraw, RangeToFormat
+ SCI_FORMATRANGE(bool bDraw, Sci_RangeToFormat
*pfr)
SCI_SETPRINTMAGNIFICATION(int
magnification)
@@ -4371,7 +4371,7 @@ struct TextToFind {
SCI_GETPRINTWRAPMODE
- SCI_FORMATRANGE(bool bDraw, RangeToFormat *pfr)
+
SCI_FORMATRANGE(bool bDraw, Sci_RangeToFormat *pfr)
This call allows Windows users to render a range of text into a device context. If you use
this for printing, you will probably want to arrange a page header and footer; Scintilla does
not do this for you. See SciTEWin::Print()
in SciTEWinDlg.cxx
for an
@@ -4382,12 +4382,14 @@ struct TextToFind {
(for example, if you use this with MFC you will need to paginate in
OnBeginPrinting()
before you output each page.
-struct RangeToFormat {
- SurfaceID hdc; // The HDC (device context) we print to
- SurfaceID hdcTarget; // The HDC we use for measuring (may be same as hdc)
- PRectangle rc; // Rectangle in which to print
- PRectangle rcPage; // Physically printable page size
- CharacterRange chrg; // Range of characters to print
+struct Sci_Rectangle { int left; int top; int right; int bottom; };
+
+struct Sci_RangeToFormat {
+ Sci_SurfaceID hdc; // The HDC (device context) we print to
+ Sci_SurfaceID hdcTarget; // The HDC we use for measuring (may be same as hdc)
+ Sci_Rectangle rc; // Rectangle in which to print
+ Sci_Rectangle rcPage; // Physically printable page size
+ Sci_CharacterRange chrg; // Range of characters to print
};
--
cgit v1.2.3