diff options
| author | nyamatongwe <devnull@localhost> | 2000-03-08 01:43:56 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2000-03-08 01:43:56 +0000 | 
| commit | d9633124c20ad762ac16a9eb692d6e388fe75a11 (patch) | |
| tree | 3ea3c536f04e88499b86ed82e8a9a457f96b4978 /src/Indicator.cxx | |
| parent | 25019a2eed18227eea1db18f6d52d4c5c44a2283 (diff) | |
| download | scintilla-mirror-d9633124c20ad762ac16a9eb692d6e388fe75a11.tar.gz | |
Initial revision
Diffstat (limited to 'src/Indicator.cxx')
| -rw-r--r-- | src/Indicator.cxx | 45 | 
1 files changed, 45 insertions, 0 deletions
| diff --git a/src/Indicator.cxx b/src/Indicator.cxx new file mode 100644 index 000000000..fb6ad0915 --- /dev/null +++ b/src/Indicator.cxx @@ -0,0 +1,45 @@ +// Scintilla source code edit control +// Indicator.cxx - defines the style of indicators which are text decorations such as underlining +// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> +// The License.txt file describes the conditions under which this software may be distributed. + +#include "Platform.h" + +#include "Scintilla.h" +#include "Indicator.h" + +void Indicator::Draw(Surface *surface, PRectangle &rc) { +	surface->PenColour(fore.allocated); +	int ymid = (rc.bottom + rc.top) / 2; +	if (style == INDIC_SQUIGGLE) { +		surface->MoveTo(rc.left, rc.top); +		int x = rc.left + 2; +		int y = 2; +		while (x < rc.right) { +			surface->LineTo(x, rc.top + y); +			x += 2; +			y = 2 - y; +		} +		surface->LineTo(rc.right, rc.top + y);	// Finish the line +	} else if (style == INDIC_TT) { +		surface->MoveTo(rc.left, ymid); +		int x = rc.left + 5; +		while (x < rc.right) { +			surface->LineTo(x, ymid); +			surface->MoveTo(x-3, ymid); +			surface->LineTo(x-3, ymid+2); +			x++; +			surface->MoveTo(x, ymid); +			x += 5; +		} +		surface->LineTo(rc.right, ymid);	// Finish the line +		if (x - 3 <= rc.right) { +			surface->MoveTo(x-3, ymid); +			surface->LineTo(x-3, ymid+2); +		} +	} else {	// Either INDIC_PLAIN or unknown +		surface->MoveTo(rc.left, ymid); +		surface->LineTo(rc.right, ymid); +	} +} + | 
