diff options
| author | nyamatongwe <unknown> | 2000-10-05 12:20:59 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2000-10-05 12:20:59 +0000 | 
| commit | a2bc00fb8619d2a130500cfcfb458fa2f87c7ca9 (patch) | |
| tree | c80e2b4a5f9c9c89f72fed1ea652a39d45457510 /src/Editor.cxx | |
| parent | 64b89c25354dba83c93e8c05150d6db39f6219da (diff) | |
| download | scintilla-mirror-a2bc00fb8619d2a130500cfcfb458fa2f87c7ca9.tar.gz | |
SetCursor implemented.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 30 | 
1 files changed, 22 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; | 
