native drop target method for cocoa
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f31c06b39e
commit
14de8214d6
@ -105,6 +105,8 @@ public :
|
||||
void CaptureMouse();
|
||||
void ReleaseMouse();
|
||||
|
||||
void SetDropTarget(wxDropTarget* target);
|
||||
|
||||
wxInt32 GetValue() const;
|
||||
void SetValue( wxInt32 v );
|
||||
wxBitmap GetBitmap() const;
|
||||
|
@ -2072,6 +2072,23 @@ bool wxWidgetCocoaImpl::SetFocus()
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::SetDropTarget(wxDropTarget* target)
|
||||
{
|
||||
[m_osxView unregisterDraggedTypes];
|
||||
|
||||
if ( target == NULL )
|
||||
return;
|
||||
|
||||
wxDataObject* dobj = target->GetDataObject();
|
||||
|
||||
if( dobj )
|
||||
{
|
||||
CFMutableArrayRef typesarray = CFArrayCreateMutable(kCFAllocatorDefault,0,&kCFTypeArrayCallBacks);
|
||||
|
||||
[m_osxView registerForDraggedTypes:(NSArray*)typesarray];
|
||||
CFRelease(typesarray);
|
||||
}
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::RemoveFromParent()
|
||||
{
|
||||
@ -2534,10 +2551,6 @@ wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WX
|
||||
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
|
||||
wxNSView* v = [[wxNSView alloc] initWithFrame:r];
|
||||
|
||||
// temporary hook for dnd
|
||||
[v registerForDraggedTypes:[NSArray arrayWithObjects:
|
||||
NSStringPboardType, NSFilenamesPboardType, (NSString*) kPasteboardTypeFileURLPromise, NSTIFFPboardType, NSPICTPboardType, NSPDFPboardType, nil]];
|
||||
|
||||
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v, false, true );
|
||||
return c;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user