X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ed9f8b2313b80158b44390fc6222f04f6130478..3b28ca6503fcd460d7de157ecf8b485590252156:/src/osx/uiaction_osx.cpp diff --git a/src/osx/uiaction_osx.cpp b/src/osx/uiaction_osx.cpp index 5c1bbade27..7c75e105e2 100644 --- a/src/osx/uiaction_osx.cpp +++ b/src/osx/uiaction_osx.cpp @@ -202,27 +202,34 @@ bool wxUIActionSimulator::MouseDblClick(int button) return true; } -bool wxUIActionSimulator::MouseClickAndDragTo(long x, long y, int button) +bool wxUIActionSimulator::MouseDragDrop(long x1, long y1, long x2, long y2, + int button) { + CGPoint pos1,pos2; + pos1.x = x1; + pos1.y = y1; + pos2.x = x2; + pos2.y = y2; + CGEventType downtype = CGEventTypeForMouseButton(button, true); CGEventType uptype = CGEventTypeForMouseButton(button, false); CGEventType dragtype = CGEventTypeForMouseDrag(button) ; wxCFRef event( - CGEventCreateMouseEvent(NULL, downtype, GetMousePosition(), CGButtonForMouseButton(button))); + CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, pos1, CGButtonForMouseButton(button))); if ( !event ) return false; + CGEventSetType(event,kCGEventMouseMoved); + CGEventPost(tap, event); + CGEventSetType(event,downtype); CGEventPost(tap, event); - CGPoint pos; - pos.x = x; - pos.y = y; CGEventSetType(event, dragtype); - CGEventSetLocation(event,pos); + CGEventSetLocation(event,pos2); CGEventPost(tap, event); CGEventSetType(event, uptype);