From fdc473e497d27721441a9a9177354ea6e1fa15fc Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 12 Apr 2009 09:32:53 +0000 Subject: Annotations and text margins added. --- doc/ScintillaDoc.html | 195 +++++++++++++++++++++++++++++++++++++++++++++----- doc/annotations.png | 1 + doc/styledmargin.png | 1 + 3 files changed, 179 insertions(+), 18 deletions(-) create mode 100644 doc/annotations.png create mode 100644 doc/styledmargin.png (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 721e3a33c..28385d192 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -199,69 +199,71 @@ o Margins - o Other settings + o Annotations - o Brace highlighting + o Other settings + o Brace highlighting + o Tabs and Indentation Guides o Markers - - o Indicators - o Autocompletion + o Indicators - o User lists + o Autocompletion - o Call tips + o User lists - o Keyboard commands + o Call tips - o Key bindings + o Keyboard commands - o Popup edit menu + o Key bindings + o Popup edit menu + o Macro recording o Printing - - o Direct access + o Direct access + o Multiple views o Folding - - o Line wrapping + o Line wrapping + o Zooming o Long lines - - o Lexer + o Lexer + o Notifications o GTK+ - - o Deprecated messages + o Deprecated messages + o Edit messages never supported by Scintilla @@ -2369,6 +2371,10 @@ struct TextToFind { is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it is hidden. Of course, you can set the margins to be whatever you wish.

+ +

Styled text margins used to show revision and blame information:

+

Styled text margins used to show revision and blame information

+ SCI_SETMARGINTYPEN(int margin, int type)
SCI_GETMARGINTYPEN(int margin)
@@ -2390,6 +2396,15 @@ struct TextToFind { SCI_GETMARGINRIGHT
SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)
SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)
+ SCI_MARGINSETTEXT(int line, char *text)
+ SCI_MARGINGETTEXT(int line, char *text)
+ SCI_MARGINSETSTYLE(int line, int style)
+ SCI_MARGINGETSTYLE(int line)
+ SCI_MARGINSETSTYLES(int line, char *styles)
+ SCI_MARGINGETSTYLES(int line, char *styles)
+ SCI_MARGINTEXTCLEARALL
+ SCI_MARGINSETSTYLEOFFSET(int style)
+ SCI_MARGINGETSTYLEOFFSET

SCI_SETMARGINTYPEN(int margin, int iType)
@@ -2397,6 +2412,8 @@ struct TextToFind { These two routines set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4. You can use the predefined constants SC_MARGIN_SYMBOL (0) and SC_MARGIN_NUMBER (1) to set a margin as either a line number or a symbol margin. + A margin with application defined text may use SC_MARGIN_TEXT (4) or + SC_MARGIN_RTEXT (5) to right justify the text. By convention, margin 0 is used for line numbers and the next two are used for symbols. You can also use the constants SC_MARGIN_BACK (2) and SC_MARGIN_FORE (3) for symbol margins that set their background colour to match the STYLE_DEFAULT background and @@ -2460,6 +2477,128 @@ struct TextToFind { On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight colour to ::GetSysColor(COLOR_3DHIGHLIGHT).

+

+ SCI_MARGINSETTEXT(int line, char *text)
+ SCI_MARGINGETTEXT(int line, char *text)
+ SCI_MARGINSETSTYLE(int line, int style)
+ SCI_MARGINGETSTYLE(int line)
+ SCI_MARGINSETSTYLES(int line, char *styles)
+ SCI_MARGINGETSTYLES(int line, char *styles)
+ SCI_MARGINTEXTCLEARALL
+ Text margins are created with the type SC_MARGIN_TEXT or SC_MARGIN_RTEXT. + A different string may be set for each line with SCI_MARGINSETTEXT. + The whole of the text margin on a line may be displayed in a particular style with + SCI_MARGINSETSTYLE or each character may be individually styled with + SCI_MARGINSETSTYLES which uses an array of bytes with each byte setting the style + of the corresponding text byte simlar to SCI_SETSTYLINGEX. + Setting a text margin will cause a + SC_MOD_CHANGEMARGIN + notification to be sent. +

+

+ SCI_MARGINSETSTYLEOFFSET(int style)
+ SCI_MARGINGETSTYLEOFFSET
+ Margin styles may be completely separated from standard text styles by setting a style offset. For example, + SCI_MARGINSETSTYLEOFFSET(256) would allow the margin styles to be numbered from + 256 upto 511 so they do not overlap styles set by lexers. Each style number set with SCI_MARGINSETSTYLE + or SCI_MARGINSETSTYLES has the offset added before looking up the style. +

+ +

Annotations

+ +

Annotations are read-only lines of text underneath each line of editable text. + An annotation may consist of multiple lines separated by '\n'. + Annotations can be used to display an assembler version of code for debugging or to show diagnostic messages inline or to + line up different versions of text in a merge tool.

+

Annotations used for inline diagnostics:

+

Annotations used for inline diagnostics

+ + + SCI_ANNOTATIONSETTEXT(int line, char *text)
+ SCI_ANNOTATIONGETTEXT(int line, char *text)
+ SCI_ANNOTATIONSETSTYLE(int line, int style)
+ SCI_ANNOTATIONGETSTYLE(int line)
+ SCI_ANNOTATIONSETSTYLES(int line, char *styles)
+ SCI_ANNOTATIONGETSTYLES(int line, char *styles)
+ SCI_ANNOTATIONGETLINES(int line)
+ SCI_ANNOTATIONCLEARALL
+ SCI_ANNOTATIONSETVISIBLE(int visible)
+ SCI_ANNOTATIONGETVISIBLE
+ SCI_ANNOTATIONSETSTYLEOFFSET(int style)
+ SCI_ANNOTATIONGETSTYLEOFFSET
+
+ +

+ SCI_ANNOTATIONSETTEXT(int line, char *text)
+ SCI_ANNOTATIONGETTEXT(int line, char *text)
+ SCI_ANNOTATIONSETSTYLE(int line, int style)
+ SCI_ANNOTATIONGETSTYLE(int line)
+ SCI_ANNOTATIONSETSTYLES(int line, char *styles)
+ SCI_ANNOTATIONGETSTYLES(int line, char *styles)
+ SCI_ANNOTATIONGETLINES(int line)
+ SCI_ANNOTATIONCLEARALL
+ A different string may be set for each line with SCI_ANNOTATIONSETTEXT. + To clear annotations call SCI_ANNOTATIONSETTEXT with a NULL pointer. + The whole of the text ANNOTATION on a line may be displayed in a particular style with + SCI_ANNOTATIONSETSTYLE or each character may be individually styled with + SCI_ANNOTATIONSETSTYLES which uses an array of bytes with each byte setting the style + of the corresponding text byte simlar to SCI_SETSTYLINGEX. The text must be set first as it + specifies how long the annotation is so how many bytes of styling to read. + Setting an annotation will cause a + SC_MOD_CHANGEANNOTATION + notification to be sent. +

+

+ The number of lines annotating a line can be retrieved with SCI_ANNOTATIONGETLINES. + All the lines can be cleared of annotations with SCI_ANNOTATIONCLEARALL + which is equivalent to clearing each line (setting to 0) and then deleting other memory used for this feature. +

+

+ SCI_ANNOTATIONSETVISIBLE(int visible)
+ SCI_ANNOTATIONGETVISIBLE
+ Annotations can be made visible in a view and there is a choice of display style when visible. + The two messages set and get the annotation display mode. The visible + argument can be one of:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ANNOTATION_HIDDEN0Annotations are not displayed.
ANNOTATION_STANDARD1Annotations are drawn left justified with no adornment.
ANNOTATION_BOXED2Annotations are indented 40 pixels and are surrounded by a box.
+ +

+

+ SCI_ANNOTATIONSETSTYLEOFFSET(int style)
+ SCI_ANNOTATIONGETSTYLEOFFSET
+ Annotation styles may be completely separated from standard text styles by setting a style offset. For example, + SCI_ANNOTATIONSETSTYLEOFFSET(512) would allow the annotation styles to be numbered from + 512 upto 767 so they do not overlap styles set by lexers (or margins if margins offset is 256). + Each style number set with SCI_ANNOTATIONSETSTYLE + or SCI_ANNOTATIONSETSTYLES has the offset added before looking up the style. +

+

Other settings

SCI_SETUSEPALETTE(bool allowPaletteUse)
@@ -5202,6 +5341,26 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber); line + + SC_MOD_CHANGEMARGIN + + 0x10000 + + A text margin has changed. + + line + + + + SC_MOD_CHANGEANNOTATION + + 0x20000 + + An annotation has changed. + + line + + SC_MULTILINEUNDOREDO diff --git a/doc/annotations.png b/doc/annotations.png new file mode 100644 index 000000000..f1ad7558e --- /dev/null +++ b/doc/annotations.png @@ -0,0 +1 @@ +‰PNG diff --git a/doc/styledmargin.png b/doc/styledmargin.png new file mode 100644 index 000000000..f1ad7558e --- /dev/null +++ b/doc/styledmargin.png @@ -0,0 +1 @@ +‰PNG -- cgit v1.2.3