]> git.saurik.com Git - wxWidgets.git/blame - src/mac/dnd.cpp
Eats EVT_CHAR events for WXK_ESCAPE, WXK_TAB, and WXK_RETURN since
[wxWidgets.git] / src / mac / dnd.cpp
CommitLineData
e9576ca5
SC
1///////////////////////////////////////////////////////////////////////////////
2// Name: dnd.cpp
3// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) 1998 AUTHOR
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "dnd.h"
14#endif
15
16#include "wx/dnd.h"
17#include "wx/window.h"
18#include "wx/app.h"
19#include "wx/gdicmn.h"
20
21// ----------------------------------------------------------------------------
22// global
23// ----------------------------------------------------------------------------
24
25// ----------------------------------------------------------------------------
26// wxDropTarget
27// ----------------------------------------------------------------------------
28
29wxDropTarget::wxDropTarget()
30{
31};
32
33wxDropTarget::~wxDropTarget()
34{
35};
36
37// ----------------------------------------------------------------------------
38// wxTextDropTarget
39// ----------------------------------------------------------------------------
40
41bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
42{
43 OnDropText( x, y, (const char*)pData );
44 return TRUE;
45};
46
47bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
48{
49 printf( "Got dropped text: %s.\n", psz );
50 printf( "At x: %d, y: %d.\n", (int)x, (int)y );
51 return TRUE;
52};
53
54size_t wxTextDropTarget::GetFormatCount() const
55{
56 return 1;
57}
58
59wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
60{
61 return wxDF_TEXT;
62}
63
64// ----------------------------------------------------------------------------
65// wxFileDropTarget
66// ----------------------------------------------------------------------------
67
68bool wxFileDropTarget::OnDropFiles( long x, long y, size_t nFiles, const char * const WXUNUSED(aszFiles)[] )
69{
70 printf( "Got %d dropped files.\n", (int)nFiles );
71 printf( "At x: %d, y: %d.\n", (int)x, (int)y );
72 return TRUE;
73}
74
75bool wxFileDropTarget::OnDrop(long x, long y, const void *WXUNUSED(pData) )
76{
77 char *str = "/this/is/a/path.txt";
78
79 return OnDropFiles(x, y, 1, &str );
80}
81
82size_t wxFileDropTarget::GetFormatCount() const
83{
84 return 1;
85}
86
87wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
88{
89 return wxDF_FILENAME;
90}
91
92//-------------------------------------------------------------------------
93// wxDropSource
94//-------------------------------------------------------------------------
95
96//-----------------------------------------------------------------------------
97// drag request
98
99wxDropSource::wxDropSource( wxWindow *win )
100{
101 // TODO
102 // m_window = win;
103 m_data = NULL;
104
105 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
106 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
107};
108
109wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
110{
111 // TODO
112 // m_window = win;
113 m_data = &data;
114
115 // m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
116 // m_goaheadCursor = wxCursor( wxCURSOR_HAND );
117};
118
119void wxDropSource::SetData( wxDataObject &data )
120{
121 m_data = &data;
122};
123
124wxDropSource::~wxDropSource(void)
125{
126};
127
128wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
129{
130 // TODO
131 return wxDragError;
132};
133