diff options
| author | nyamatongwe <devnull@localhost> | 2002-08-05 06:48:27 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2002-08-05 06:48:27 +0000 | 
| commit | c8d0c32129aaaf7f56091ec267f86c0fec7267b0 (patch) | |
| tree | d29470a095456504b888e2779eb49a4b07f42db0 /src/Editor.cxx | |
| parent | 734741819ffb01a79faa13abe15462acb9054f37 (diff) | |
| download | scintilla-mirror-c8d0c32129aaaf7f56091ec267f86c0fec7267b0.tar.gz | |
Visible whitespace specifiable colours feature from Martin Alderson.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 9651b075d..5dce26649 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1830,8 +1830,12 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis  				}  				if (ll->chars[i] == '\t') {  					// Manage tab display +					if (!overrideBackground && vsDraw.whitespaceBackgroundSet && (vsDraw.viewWhitespace != wsInvisible) && (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) +						textBack = vsDraw.whitespaceBackground.allocated;  					surface->FillRectangle(rcSegment, textBack);  					if ((vsDraw.viewWhitespace != wsInvisible) || ((inIndentation && vsDraw.viewIndentationGuides))) { +						if (vsDraw.whitespaceForegroundSet) +							textFore = vsDraw.whitespaceForeground.allocated;  						surface->PenColour(textFore);  					}  					if (inIndentation && vsDraw.viewIndentationGuides) { @@ -1890,8 +1894,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis  						for (int cpos = 0; cpos <= i - startseg; cpos++) {  							if (ll->chars[cpos + startseg] == ' ') {  								if (vsDraw.viewWhitespace != wsInvisible) { +									if (vsDraw.whitespaceForegroundSet) +										textFore = vsDraw.whitespaceForeground.allocated;  									if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {  										int xmid = (ll->positions[cpos + startseg] + ll->positions[cpos + startseg + 1]) / 2; +										if (!overrideBackground && vsDraw.whitespaceBackgroundSet) { +											textBack = vsDraw.whitespaceBackground.allocated; +											PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top, ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom); +											surface->FillRectangle(rcSpace, textBack); +										}  										PRectangle rcDot(xmid + xStart  - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0, 0);  										rcDot.right = rcDot.left + 1;  										rcDot.bottom = rcDot.top + 1; @@ -2320,6 +2331,8 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {  	// Don't show the selection when printing  	vsPrint.selbackset = false;  	vsPrint.selforeset = false; +	vsPrint.whitespaceBackgroundSet = false; +	vsPrint.whitespaceForegroundSet = false;  	vsPrint.showCaretLineBackground = false;  	// Set colours for printing according to users settings @@ -5430,6 +5443,18 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  		InvalidateStyleRedraw();  		break; +	case SCI_SETWHITESPACEFORE: +		vs.whitespaceForegroundSet = wParam != 0; +		vs.whitespaceForeground.desired = ColourDesired(lParam); +		InvalidateStyleRedraw(); +		break; + +	case SCI_SETWHITESPACEBACK: +		vs.whitespaceBackgroundSet = wParam != 0; +		vs.whitespaceBackground.desired = ColourDesired(lParam); +		InvalidateStyleRedraw(); +		break; +  	case SCI_SETCARETFORE:  		vs.caretcolour.desired = ColourDesired(wParam);  		InvalidateStyleRedraw(); | 
