]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/dnd.cpp
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( long x
, long y
, const void *pData
)
45 OnDropText( x
, y
, (const char*)pData
);
49 bool wxTextDropTarget::OnDropText( long x
, long y
, const char *psz
)
51 printf( "Got dropped text: %s.\n", psz
);
52 printf( "At x: %d, y: %d.\n", (int)x
, (int)y
);
56 size_t wxTextDropTarget::GetFormatCount() const
61 wxDataFormat
wxTextDropTarget::GetFormat(size_t WXUNUSED(n
)) const
66 // ----------------------------------------------------------------------------
68 // ----------------------------------------------------------------------------
70 bool wxFileDropTarget::OnDropFiles( long x
, long y
, size_t nFiles
, const char * const WXUNUSED(aszFiles
)[] )
72 printf( "Got %d dropped files.\n", (int)nFiles
);
73 printf( "At x: %d, y: %d.\n", (int)x
, (int)y
);
77 bool wxFileDropTarget::OnDrop(long x
, long y
, const void *WXUNUSED(pData
) )
79 char *str
= "/this/is/a/path.txt";
81 return OnDropFiles(x
, y
, 1, &str
);
84 size_t wxFileDropTarget::GetFormatCount() const
89 wxDataFormat
wxFileDropTarget::GetFormat(size_t WXUNUSED(n
)) const
94 //-------------------------------------------------------------------------
96 //-------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
101 wxDropSource::wxDropSource( wxWindow
*win
)
107 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
108 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
111 wxDropSource::wxDropSource( wxDataObject
&data
, wxWindow
*win
)
117 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
118 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
121 void wxDropSource::SetData( wxDataObject
&data
)
126 wxDropSource::~wxDropSource(void)
130 wxDragResult
wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove
) )