diff options
| author | nyamatongwe <devnull@localhost> | 2003-09-28 22:06:23 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2003-09-28 22:06:23 +0000 | 
| commit | e098d9e7420a8deec3db17df31d9d7bb4dbcf22b (patch) | |
| tree | 08e41dc38284608575f3bc1dbc375502ce65ecb5 /src/Editor.cxx | |
| parent | 11b58966dcd5909f1fbd22def7f9888893bdd16f (diff) | |
| download | scintilla-mirror-e098d9e7420a8deec3db17df31d9d7bb4dbcf22b.tar.gz | |
Hotspot improvements from Simon, including setting to
limit hotspots to a single line.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 19 | 
1 files changed, 13 insertions, 6 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index c764344b7..56acd900c 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1963,7 +1963,7 @@ ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackgroun  		        (i >= ll->edgeColumn) &&  		        !IsEOLChar(ll->chars[i]))  			return vsDraw.edgecolour.allocated; -		if (inHotspot) +		if (inHotspot && vsDraw.hotspotBackgroundSet)  			return vsDraw.hotspotBackground.allocated;  		if (overrideBackground)  			return background; @@ -4567,7 +4567,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b  		//Platform::DebugPrintf("Double click: %d - %d\n", anchor, currentPos);  		if (doubleClick) {  			NotifyDoubleClick(pt, shift); -			if (PositionIsHotspot(newPos)) +			if (PointIsHotspot(newPos))  				NotifyHotSpotDoubleClicked(newPos, shift, ctrl, alt);  		}  	} else {	// Single click @@ -4599,7 +4599,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b  			SetMouseCapture(true);  			selectionType = selLine;  		} else { -			if (PositionIsHotspot(newPos)) { +			if (PointIsHotspot(pt)) {  				NotifyHotSpotClicked(newPos, shift, ctrl, alt);  			}  			if (!shift) { @@ -4633,7 +4633,9 @@ bool Editor::PositionIsHotspot(int position) {  }  bool Editor::PointIsHotspot(Point pt) { -	int pos = PositionFromLocation(pt); +	int pos = PositionFromLocationClose(pt); +	if(pos == INVALID_POSITION) +		return false;  	return PositionIsHotspot(pos);  } @@ -4644,8 +4646,8 @@ void Editor::SetHotSpotRange(Point *pt) {  		// If we don't limit this to word characters then the  		// range can encompass more than the run range and then  		// the underline will not be drawn properly. -		int hsStart_ = pdoc->ExtendStyleRange(pos, -1); -		int hsEnd_ = pdoc->ExtendStyleRange(pos, 1); +		int hsStart_ = pdoc->ExtendStyleRange(pos, -1, vs.hotspotSingleLine); +		int hsEnd_ = pdoc->ExtendStyleRange(pos, 1, vs.hotspotSingleLine);  		// Only invalidate the range if the hotspot range has changed...  		if (hsStart_ != hsStart || hsEnd_ != hsEnd) { @@ -6532,6 +6534,11 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  		InvalidateStyleRedraw();  		break; +	case SCI_SETHOTSPOTSINGLELINE: +		vs.hotspotSingleLine = wParam != 0; +		InvalidateStyleRedraw(); +		break; +  	default:  		return DefWndProc(iMessage, wParam, lParam);  	} | 
