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:
@@ -105,6 +105,8 @@ public :
|
|||||||
void CaptureMouse();
|
void CaptureMouse();
|
||||||
void ReleaseMouse();
|
void ReleaseMouse();
|
||||||
|
|
||||||
|
void SetDropTarget(wxDropTarget* target);
|
||||||
|
|
||||||
wxInt32 GetValue() const;
|
wxInt32 GetValue() const;
|
||||||
void SetValue( wxInt32 v );
|
void SetValue( wxInt32 v );
|
||||||
wxBitmap GetBitmap() const;
|
wxBitmap GetBitmap() const;
|
||||||
|
@@ -2072,6 +2072,23 @@ bool wxWidgetCocoaImpl::SetFocus()
|
|||||||
return true;
|
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()
|
void wxWidgetCocoaImpl::RemoveFromParent()
|
||||||
{
|
{
|
||||||
@@ -2534,10 +2551,6 @@ wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WX
|
|||||||
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
|
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
|
||||||
wxNSView* v = [[wxNSView alloc] initWithFrame:r];
|
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 );
|
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v, false, true );
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user