- RgnHandle tempRgn = NewRgn() ;
-
- EventRecord* ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ;
- const short dragRegionOuterBoundary = 10 ;
- const short dragRegionInnerBoundary = 9 ;
-
- SetRectRgn( dragRegion , ev->where.h - dragRegionOuterBoundary ,
- ev->where.v - dragRegionOuterBoundary ,
- ev->where.h + dragRegionOuterBoundary ,
- ev->where.v + dragRegionOuterBoundary ) ;
-
- SetRectRgn( tempRgn , ev->where.h - dragRegionInnerBoundary ,
- ev->where.v - dragRegionInnerBoundary ,
- ev->where.h + dragRegionInnerBoundary ,
- ev->where.v + dragRegionInnerBoundary ) ;
-
- DiffRgn( dragRegion , tempRgn , dragRegion ) ;
- DisposeRgn( tempRgn ) ;
-
- // TODO:work with promises in order to return data only when drag
- // was successfully completed
-
- gTrackingGlobals.m_currentSource = this ;
- result = TrackDrag(theDrag, ev , dragRegion);
- DisposeRgn(dragRegion);
- DisposeDrag(theDrag);
- gTrackingGlobals.m_currentSource = NULL ;
-
- return wxDragCopy ;
+ RgnHandle tempRgn = NewRgn();
+
+ EventRecord* ev = NULL;
+
+#if !TARGET_CARBON // TODO
+ ev = (EventRecord*) wxTheApp->MacGetCurrentEvent();
+#else
+ EventRecord rec;
+ ev = &rec;
+ wxMacConvertEventToRecord( (EventRef) wxTheApp->MacGetCurrentEvent(), &rec );
+#endif
+
+ const short dragRegionOuterBoundary = 10;
+ const short dragRegionInnerBoundary = 9;
+
+ SetRectRgn(
+ dragRegion,
+ ev->where.h - dragRegionOuterBoundary,
+ ev->where.v - dragRegionOuterBoundary,
+ ev->where.h + dragRegionOuterBoundary,
+ ev->where.v + dragRegionOuterBoundary );
+
+ SetRectRgn(
+ tempRgn,
+ ev->where.h - dragRegionInnerBoundary,
+ ev->where.v - dragRegionInnerBoundary,
+ ev->where.h + dragRegionInnerBoundary,
+ ev->where.v + dragRegionInnerBoundary );
+
+ DiffRgn( dragRegion, tempRgn, dragRegion );
+ DisposeRgn( tempRgn );
+
+ // TODO: work with promises in order to return data
+ // only when drag was successfully completed
+
+ gTrackingGlobals.m_currentSource = this;
+ gTrackingGlobals.m_result = wxDragNone;
+ gTrackingGlobals.m_flags = flags;
+
+ TrackDrag( theDrag, ev, dragRegion );
+ DisposeRgn( dragRegion );
+ DisposeDrag( theDrag );
+ gTrackingGlobals.m_currentSource = NULL;
+
+ return gTrackingGlobals.m_result;
+}
+
+bool wxDropSource::MacInstallDefaultCursor(wxDragResult effect)
+{
+ const wxCursor& cursor = GetCursor(effect);
+ bool result = cursor.Ok();
+
+ if ( result )
+ cursor.MacInstall();
+
+ return result;