diff options
| author | nyamatongwe <unknown> | 2000-11-30 05:16:11 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2000-11-30 05:16:11 +0000 | 
| commit | addb03472699d14c1cb219fcfbb75e4e0683ba2c (patch) | |
| tree | c911146f43ced616d58bf707eeb6159ff9f2c1a6 | |
| parent | e3b7c61c75ea812a18f90b0a5a782df8e3743e23 (diff) | |
| download | scintilla-mirror-addb03472699d14c1cb219fcfbb75e4e0683ba2c.tar.gz | |
Dragging shows no-go cursor if no good text format in drag.
| -rw-r--r-- | win32/ScintillaWin.cxx | 28 | 
1 files changed, 27 insertions, 1 deletions
| diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 17206906b..e86d23e33 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -99,6 +99,8 @@ class ScintillaWin :  	bool capturedMouse; +    bool hasOKText; +  	CLIPFORMAT cfColumnSelect;  	DropSource ds; @@ -190,6 +192,8 @@ ScintillaWin::ScintillaWin(HWND hwnd) {  	capturedMouse = false; +    hasOKText = false; +  	// There does not seem to be a real standard for indicating that the clipboard contains a rectangular  	// selection, so copy Developer Studio.  	cfColumnSelect = static_cast<CLIPFORMAT>( @@ -1328,8 +1332,25 @@ STDMETHODIMP_(ULONG) ScintillaWin::Release() {  }  // Implement IDropTarget -STDMETHODIMP ScintillaWin::DragEnter(LPDATAOBJECT, DWORD grfKeyState, +STDMETHODIMP ScintillaWin::DragEnter(LPDATAOBJECT pIDataSource, DWORD grfKeyState,                                       POINTL, PDWORD pdwEffect) { +	if (pIDataSource == NULL) +		return E_POINTER; +	if (IsUnicodeMode()) { +	    FORMATETC fmtu = {CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; +        HRESULT hrHasUText = pIDataSource->QueryGetData(&fmtu); +        hasOKText = hrHasUText == S_OK; +    } +    if (!hasOKText) { +	    FORMATETC fmte = {CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; +        HRESULT hrHasText = pIDataSource->QueryGetData(&fmte); +        hasOKText = hrHasText == S_OK; +    } +    if (!hasOKText) { +		*pdwEffect = DROPEFFECT_NONE; +        return S_OK; +    } +   	if (inDragDrop)	// Internal defaults to move  		*pdwEffect = DROPEFFECT_MOVE;  	else @@ -1342,6 +1363,11 @@ STDMETHODIMP ScintillaWin::DragEnter(LPDATAOBJECT, DWORD grfKeyState,  }  STDMETHODIMP ScintillaWin::DragOver(DWORD grfKeyState, POINTL pt, PDWORD pdwEffect) { +    if (!hasOKText) { +		*pdwEffect = DROPEFFECT_NONE; +        return S_OK; +    } +  	// These are the Wordpad semantics.  	if (inDragDrop)	// Internal defaults to move  		*pdwEffect = DROPEFFECT_MOVE; | 
