diff options
| author | nyamatongwe <unknown> | 2007-04-23 02:26:06 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2007-04-23 02:26:06 +0000 | 
| commit | bde8aef4ff5e6bd93c3b2bbd8fd7de80bccbbdb8 (patch) | |
| tree | 7799078040df57b7f5ce1072d768e476a7187041 | |
| parent | 7baad7314df72e0c2f548482df1c288a2587d3cd (diff) | |
| download | scintilla-mirror-bde8aef4ff5e6bd93c3b2bbd8fd7de80bccbbdb8.tar.gz | |
Added setting to allow each indicator to be drawn either under or
over text.
| -rw-r--r-- | doc/ScintillaDoc.html | 6 | ||||
| -rw-r--r-- | include/Scintilla.h | 2 | ||||
| -rw-r--r-- | include/Scintilla.iface | 6 | ||||
| -rw-r--r-- | src/Editor.cxx | 12 | ||||
| -rw-r--r-- | src/Indicator.h | 3 | ||||
| -rw-r--r-- | src/ViewStyle.cxx | 3 | 
6 files changed, 30 insertions, 2 deletions
| diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 5f550aa72..6ded35d2c 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -3036,6 +3036,12 @@ struct TextToFind {       <code>SCI_INDICSETFORE(1, 0xff0000);</code> (light blue)<br />       <code>SCI_INDICSETFORE(2, 0x0000ff);</code> (light red)</p> +    <p><b id="SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</b><br /> +     <b id="SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</b><br /> +     These two messages set and get whether an indicator is drawn under text or over(default). +     Drawing under text works only for modern indicators when <a class="message" href="#SCI_SETTWOPHASEDRAW">two phase drawing</a> +     is enabled.</p> +      <h3 id="Modern Indicators">Modern Indicators</h3>      <p>Modern indicators are stored in a format similar to run length encoding which is efficient in both diff --git a/include/Scintilla.h b/include/Scintilla.h index 74cc6c98e..e7730b68c 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -245,6 +245,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,  #define SCI_INDICGETSTYLE 2081  #define SCI_INDICSETFORE 2082  #define SCI_INDICGETFORE 2083 +#define SCI_INDICSETUNDER 2510 +#define SCI_INDICGETUNDER 2511  #define SCI_SETWHITESPACEFORE 2084  #define SCI_SETWHITESPACEBACK 2085  #define SCI_SETSTYLEBITS 2090 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 0ccd578ea..85d45780e 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -554,6 +554,12 @@ set void IndicSetFore=2082(int indic, colour fore)  # Retrieve the foreground colour of an indicator.  get colour IndicGetFore=2083(int indic,) +# Set an indicator to draw under text or over(default). +set void IndicSetUnder=2510(int indic, bool under) + +# Retrieve whether indicator drawn under or over text. +get bool IndicGetUnder=2511(int indic,) +  # Set the foreground colour of all whitespace and whether to use this setting.  fun void SetWhitespaceFore=2084(bool useSetting, colour fore) diff --git a/src/Editor.cxx b/src/Editor.cxx index 2a1018252..addfedf6e 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2356,7 +2356,7 @@ void Editor::DrawIndicators(Surface *surface, ViewStyle &vsDraw, int line, int x  	}  	for (Decoration *deco=pdoc->decorations.root; deco; deco = deco->next) { -		if (under == (deco->indicator >= 16)) { +		if (under == vsDraw.indicators[deco->indicator].under) {  			int startPos = posLineStart + subLineStart;  			if (!deco->rs.ValueAt(startPos)) {  				startPos = deco->rs.EndRun(startPos); @@ -7138,6 +7138,16 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  	case SCI_INDICGETFORE:  		return (wParam <= INDIC_MAX) ? vs.indicators[wParam].fore.desired.AsLong() : 0; +	case SCI_INDICSETUNDER: +		if (wParam <= INDIC_MAX) { +			vs.indicators[wParam].under = lParam != 0; +			InvalidateStyleRedraw(); +		} +		break; + +	case SCI_INDICGETUNDER: +		return (wParam <= INDIC_MAX) ? vs.indicators[wParam].under : 0; +  	case SCI_SETINDICATORCURRENT:  		pdoc->decorations.SetCurrentIndicator(wParam);  		break; diff --git a/src/Indicator.h b/src/Indicator.h index 716db1051..cebc22d80 100644 --- a/src/Indicator.h +++ b/src/Indicator.h @@ -13,8 +13,9 @@  class Indicator {  public:  	int style; +	bool under;  	ColourPair fore; -	Indicator() : style(INDIC_PLAIN), fore(ColourDesired(0,0,0)) { +	Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)) {  	}  	void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine);  }; diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 403d17a3a..6611439f5 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -129,10 +129,13 @@ void ViewStyle::Init() {  	ResetDefaultStyle();  	indicators[0].style = INDIC_SQUIGGLE; +	indicators[0].under = false;  	indicators[0].fore = ColourDesired(0, 0x7f, 0);  	indicators[1].style = INDIC_TT; +	indicators[1].under = false;  	indicators[1].fore = ColourDesired(0, 0, 0xff);  	indicators[2].style = INDIC_PLAIN; +	indicators[2].under = false;  	indicators[2].fore = ColourDesired(0xff, 0, 0);  	lineHeight = 1; | 
