]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/Indicator.cxx
updates to correct build errors (new locations, etc.)
[wxWidgets.git] / src / stc / scintilla / src / Indicator.cxx
1 // Scintilla source code edit control
2 // Indicator.cxx - defines the style of indicators which are text decorations such as underlining
3 // Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
4 // The License.txt file describes the conditions under which this software may be distributed.
5
6 #include "Platform.h"
7
8 #include "Scintilla.h"
9 #include "Indicator.h"
10
11 void Indicator::Draw(Surface *surface, PRectangle &rc) {
12 surface->PenColour(fore.allocated);
13 int ymid = (rc.bottom + rc.top) / 2;
14 if (style == INDIC_SQUIGGLE) {
15 surface->MoveTo(rc.left, rc.top);
16 int x = rc.left + 2;
17 int y = 2;
18 while (x < rc.right) {
19 surface->LineTo(x, rc.top + y);
20 x += 2;
21 y = 2 - y;
22 }
23 surface->LineTo(rc.right, rc.top + y); // Finish the line
24 } else if (style == INDIC_TT) {
25 surface->MoveTo(rc.left, ymid);
26 int x = rc.left + 5;
27 while (x < rc.right) {
28 surface->LineTo(x, ymid);
29 surface->MoveTo(x-3, ymid);
30 surface->LineTo(x-3, ymid+2);
31 x++;
32 surface->MoveTo(x, ymid);
33 x += 5;
34 }
35 surface->LineTo(rc.right, ymid); // Finish the line
36 if (x - 3 <= rc.right) {
37 surface->MoveTo(x-3, ymid);
38 surface->LineTo(x-3, ymid+2);
39 }
40 } else { // Either INDIC_PLAIN or unknown
41 surface->MoveTo(rc.left, ymid);
42 surface->LineTo(rc.right, ymid);
43 }
44 }
45