diff options
| -rw-r--r-- | src/Editor.cxx | 9 | ||||
| -rw-r--r-- | src/Editor.h | 3 | ||||
| -rw-r--r-- | win32/PlatWin.cxx | 4 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 28 | 
4 files changed, 33 insertions, 11 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 360e991e9..74c0b06ac 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -45,7 +45,8 @@ Editor::Editor() {  	hideSelection = false;  	inOverstrike = false;  	errorStatus = 0; - +	mouseDownCaptures = true; +	  	bufferedDraw = true;  	lastClickTime = 0; @@ -4292,6 +4293,12 @@ long Editor::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {  	case SCI_GETSTATUS:  		return errorStatus; +	case SCI_SETMOUSEDOWNCAPTURES: +		mouseDownCaptures = wParam; +	 +	case SCI_GETMOUSEDOWNCAPTURES: +		return mouseDownCaptures; +	  #ifdef MACRO_SUPPORT  	case SCI_STARTRECORD:  		recordingMacro = 1; diff --git a/src/Editor.h b/src/Editor.h index 3d1c48f4d..f51c1440b 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -66,7 +66,8 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	bool hideSelection;  	bool inOverstrike;  	int errorStatus; - +	bool mouseDownCaptures; +	  	// In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to   	// the screen. This avoids flashing but is about 30% slower.  	bool bufferedDraw; diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 654cf3a27..d2f76c916 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -880,8 +880,10 @@ void Platform::DebugPrintf(const char *, ...) {  static bool assertionPopUps = true; -void Platform::ShowAssertionPopUps(bool assertionPopUps_) { +bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { +	bool ret = assertionPopUps;  	assertionPopUps = assertionPopUps_; +	return ret;  }  void Platform::Assert(const char *c, const char *file, int line) { diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 00e127f98..bdbba762c 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -294,15 +294,18 @@ LRESULT ScintillaWin::WndPaint(unsigned long wParam) {  	//LARGE_INTEGER performanceFreq;  	//QueryPerformanceFrequency(&performanceFreq);  	//QueryPerformanceCounter(&perfStart); +	 +	// Redirect assertions to debug output and save current state  +	bool assertsPopup = Platform::ShowAssertionPopUps(false);  	paintState = painting;  	PAINTSTRUCT ps;  	PAINTSTRUCT* pps; -    bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains  +	bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains   								   // a PAINSTRUCT* from the OCX -	if(IsOcxCtrl) +	if (IsOcxCtrl) {  		pps = reinterpret_cast<PAINTSTRUCT*>(wParam); -	else{ +	} else {  		pps = &ps;  		BeginPaint(wMain.GetID(), pps);  	} @@ -326,6 +329,10 @@ LRESULT ScintillaWin::WndPaint(unsigned long wParam) {  		FullPaint();  	}  	paintState = notPainting; + +	// Restore debug output state  +	Platform::ShowAssertionPopUps(assertsPopup); +	  	//QueryPerformanceCounter(&perfEnd);  	//__int64 start = perfStart.QuadPart;  	//__int64 end = perfEnd.QuadPart; @@ -581,6 +588,10 @@ LRESULT ScintillaWin::WndProc(unsigned int iMessage, unsigned long wParam, long  	case WM_ERASEBKGND:          	return 1;   // Avoid any background erasure as whole window painted.  +    	case WM_CAPTURECHANGED: +		capturedMouse = false; +		return 0; +	          // These are not handled in Scintilla and its faster to dispatch them here.          // Also moves time out to here so profile doesn't count lots of empty message calls.      	case WM_MOVE: @@ -590,7 +601,6 @@ LRESULT ScintillaWin::WndProc(unsigned int iMessage, unsigned long wParam, long  	case WM_NCPAINT:      	case WM_NCMOUSEMOVE:      	case WM_NCLBUTTONDOWN: -    	case WM_CAPTURECHANGED:      	case WM_IME_SETCONTEXT:      	case WM_IME_NOTIFY:      	case WM_SYSCOMMAND: @@ -632,10 +642,12 @@ void ScintillaWin::SetTicking(bool on) {  }  void ScintillaWin::SetMouseCapture(bool on) { -	if (on) { -		::SetCapture(wMain.GetID()); -	} else { -		::ReleaseCapture(); +	if (mouseDownCaptures) { +		if (on) { +			::SetCapture(wMain.GetID()); +		} else { +			::ReleaseCapture(); +		}  	}  	capturedMouse = on;  } | 
