diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 30 | ||||
| -rw-r--r-- | src/Editor.h | 2 | 
2 files changed, 24 insertions, 8 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index dbd5a3901..642faf5f4 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -40,7 +40,8 @@ Editor::Editor() {  	printMagnification = 0;  	printColourMode = SC_PRINT_NORMAL; - +	cursorMode = SC_CURSORNORMAL; +	  	hasFocus = false;  	hideSelection = false;  	inOverstrike = false; @@ -2470,13 +2471,19 @@ void Editor::SetDragPosition(int newPos) {  	}  } +void Editor::DisplayCursor(Window::Cursor c) { +	if (cursorMode == SC_CURSORNORMAL)  +		wDraw.SetCursor(c); +	else  +		wDraw.SetCursor(static_cast<Window::Cursor>(cursorMode)); +} +  void Editor::StartDrag() {  	// Always handled by subclasses  	//SetMouseCapture(true); -	//wDraw.SetCursor(Window::cursorArrow); +	//DisplayCursor(Window::cursorArrow);  } -  void Editor::DropAt(int position, const char *value, bool moving, bool rectangular) {  	//Platform::DebugPrintf("DropAt %d\n", inDragDrop);  	if (inDragDrop) @@ -2746,16 +2753,16 @@ void Editor::ButtonMove(Point pt) {  	} else {  		if (vs.fixedColumnWidth > 0) {	// There is a margin  			if (PointInSelMargin(pt)) { -				wDraw.SetCursor(Window::cursorReverseArrow); +				DisplayCursor(Window::cursorReverseArrow);  				return ; 	// No need to test for selection  			}  		}  		// Display regular (drag) cursor over selection  		if (PointInSelection(pt)) -			wDraw.SetCursor(Window::cursorArrow); +			DisplayCursor(Window::cursorArrow);  		else -			wDraw.SetCursor(Window::cursorText); +			DisplayCursor(Window::cursorText);  	}  } @@ -2764,9 +2771,9 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {  	//Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture());  	if (HaveMouseCapture()) {  		if (PointInSelMargin(pt)) { -			wDraw.SetCursor(Window::cursorReverseArrow); +			DisplayCursor(Window::cursorReverseArrow);  		} else { -			wDraw.SetCursor(Window::cursorText); +			DisplayCursor(Window::cursorText);  		}  		xEndSelect = pt.x - vs.fixedColumnWidth + xOffset;  		ptMouseLast = pt; @@ -4315,6 +4322,13 @@ long Editor::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {  	case SCI_GETMOUSEDOWNCAPTURES:  		return mouseDownCaptures; +	case SCI_SETCURSOR: +		cursorMode = wParam; +		break; +	 +	case SCI_GETCURSOR: +		return cursorMode; +	  #ifdef MACRO_SUPPORT  	case SCI_STARTRECORD:  		recordingMacro = 1; diff --git a/src/Editor.h b/src/Editor.h index f40b21576..4d0ceec37 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -61,6 +61,7 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	Palette palette;  	int printMagnification;  	int printColourMode; +	int cursorMode;  	bool hasFocus;  	bool hideSelection; @@ -273,6 +274,7 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	char *CopySelectionRange();  	void CopySelectionIntoDrag();  	void SetDragPosition(int newPos); +	void DisplayCursor(Window::Cursor c);  	virtual void StartDrag();  	void DropAt(int position, const char *value, bool moving, bool rectangular);  	// PositionInSelection returns 0 if position in selection, -1 if position before selection, and 1 if after. | 
