]>
git.saurik.com Git - wxWidgets.git/blob - src/stubs/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 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
29 wxDropTarget::wxDropTarget()
33 wxDropTarget::~wxDropTarget()
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
41 bool wxTextDropTarget::OnDrop( long x
, long y
, const void *pData
)
43 OnDropText( x
, y
, (const char*)pData
);
47 bool wxTextDropTarget::OnDropText( long x
, long y
, const char *psz
)
49 printf( "Got dropped text: %s.\n", psz
);
50 printf( "At x: %d, y: %d.\n", (int)x
, (int)y
);
54 size_t wxTextDropTarget::GetFormatCount() const
59 wxDataFormat
wxTextDropTarget::GetFormat(size_t WXUNUSED(n
)) const
64 // ----------------------------------------------------------------------------
66 // ----------------------------------------------------------------------------
68 bool wxFileDropTarget::OnDropFiles( long x
, long y
, size_t nFiles
, const char * const WXUNUSED(aszFiles
)[] )
70 printf( "Got %d dropped files.\n", (int)nFiles
);
71 printf( "At x: %d, y: %d.\n", (int)x
, (int)y
);
75 bool wxFileDropTarget::OnDrop(long x
, long y
, const void *WXUNUSED(pData
) )
77 char *str
= "/this/is/a/path.txt";
79 return OnDropFiles(x
, y
, 1, &str
);
82 size_t wxFileDropTarget::GetFormatCount() const
87 wxDataFormat
wxFileDropTarget::GetFormat(size_t WXUNUSED(n
)) const
92 //-------------------------------------------------------------------------
94 //-------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
99 wxDropSource::wxDropSource( wxWindow
*win
)
105 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
106 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
109 wxDropSource::wxDropSource( wxDataObject
&data
, wxWindow
*win
)
115 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
116 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
119 void wxDropSource::SetData( wxDataObject
&data
)
124 wxDropSource::~wxDropSource(void)
128 wxDragResult
wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove
) )