- (void)setImplementation: (wxDropSource *)dropSource;
- (BOOL)finished;
- (NSDragOperation)code;
+- (void)draggedImage:(NSImage *)anImage movedTo:(NSPoint)aPoint;
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation;
@end
return resultCode;
}
+- (void)draggedImage:(NSImage *)anImage movedTo:(NSPoint)aPoint
+{
+ bool optionDown = GetCurrentKeyModifiers() & optionKey;
+ wxDragResult result = optionDown ? wxDragCopy : wxDragMove;
+
+ if (wxDropSource* source = impl)
+ {
+ if (!source->GiveFeedback(result))
+ {
+ wxStockCursor cursorID = wxCURSOR_NONE;
+
+ switch (result)
+ {
+ case wxDragCopy:
+ cursorID = wxCURSOR_COPY_ARROW;
+ break;
+
+ case wxDragMove:
+ cursorID = wxCURSOR_ARROW;
+ break;
+
+ case wxDragNone:
+ cursorID = wxCURSOR_NO_ENTRY;
+ break;
+
+ case wxDragError:
+ case wxDragLink:
+ case wxDragCancel:
+ default:
+ // put these here to make gcc happy
+ ;
+ }
+
+ if (cursorID != wxCURSOR_NONE)
+ {
+ wxCursor cursor( cursorID );
+ cursor.MacInstall();
+ }
+ }
+ }
+}
+
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
resultCode = operation;
result = wxDragCopy;
else if ( sourceDragMask & NSDragOperationMove )
result = wxDragMove;
-
- // FIXME: This doesn't seem the right place for the code, as GiveFeedback
- // will only get called when the drop target is inside the app itself
- // but at least some cases will work now.
- if (wxDropSource* source = wxDropSource::GetCurrentDropSource())
- {
- if (!source->GiveFeedback(result))
- {
- wxStockCursor cursorID = wxCURSOR_NONE;
-
- switch (result)
- {
- case wxDragCopy:
- cursorID = wxCURSOR_COPY_ARROW;
- break;
-
- case wxDragMove:
- cursorID = wxCURSOR_ARROW;
- break;
-
- case wxDragNone:
- cursorID = wxCURSOR_NO_ENTRY;
- break;
-
- case wxDragError:
- case wxDragLink:
- case wxDragCancel:
- default:
- // put these here to make gcc happy
- ;
- }
-
- if (cursorID != wxCURSOR_NONE)
- {
- wxCursor cursor( cursorID );
- cursor.MacInstall();
- }
- }
- }
PasteboardRef pboardRef;
PasteboardCreate((CFStringRef)[pboard name], &pboardRef);