]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/dnd.cpp
42b397d59031448a039532faf35f513a1b90976a
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDropTarget, wxDropSource, wxDataObject implementation
8 // Copyright: (c) 1998 AUTHOR
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "dnd.h"
17 #include "wx/window.h"
19 #include "wx/gdicmn.h"
21 #if wxUSE_DRAG_AND_DROP
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
31 wxDropTarget::wxDropTarget()
35 wxDropTarget::~wxDropTarget()
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 bool wxTextDropTarget::OnDrop( wxCoord x
, wxCoord y
, const void *pData
)
45 OnDropText( x
, y
, (const char*)pData
);
50 bool wxTextDropTarget::OnDropText( wxCoord x
, wxCoord y
, const wxString
&psz
)
52 printf( "Got dropped text: %s.\n", (char *)psz
);
53 printf( "At x: %d, y: %d.\n", (int)x
, (int)y
);
58 size_t wxTextDropTarget::GetFormatCount() const
63 wxDataFormat
wxTextDropTarget::GetFormat(size_t WXUNUSED(n
)) const
69 // ----------------------------------------------------------------------------
71 // ----------------------------------------------------------------------------
74 bool wxFileDropTarget::OnDropFiles( wxCoord x
, wxCoord y
, size_t nFiles
, const char * const WXUNUSED(aszFiles
)[] )
76 printf( "Got %d dropped files.\n", (int)nFiles
);
77 printf( "At x: %d, y: %d.\n", (int)x
, (int)y
);
82 bool wxFileDropTarget::OnDrop(wxCoord x
, wxCoord y
, const wxArrayString
& filenames
)
84 return OnDropFiles(x
, y
, 1, &filenames
);
88 size_t wxFileDropTarget::GetFormatCount() const
93 wxDataFormat
wxFileDropTarget::GetFormat(size_t WXUNUSED(n
)) const
99 //-------------------------------------------------------------------------
101 //-------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
106 wxDropSource::wxDropSource( wxWindow
*win
)
112 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
113 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
116 wxDropSource::wxDropSource( wxDataObject
&data
, wxWindow
*win
)
122 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
123 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
126 void wxDropSource::SetData( wxDataObject
&data
)
131 wxDropSource::~wxDropSource(void)
135 wxDragResult
wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove
) )