]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | /////////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/os2/dnd.h |
6dddc146 DW |
3 | // Purpose: declaration of the wxDropTarget class |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/21/99 | |
6dddc146 | 7 | // Copyright: (c) 1999 David Webster |
65571936 | 8 | // Licence: wxWindows licence |
0e320a79 DW |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
6dddc146 DW |
11 | |
12 | #ifndef __OS2DNDH__ | |
13 | #define __OS2DNDH__ | |
0e320a79 | 14 | |
6dddc146 DW |
15 | #if !wxUSE_DRAG_AND_DROP |
16 | #error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!" | |
17 | #endif //WX_DRAG_DROP | |
0e320a79 | 18 | |
20947e08 DW |
19 | #define INCL_WINSTDDRAG |
20 | #include <os2.h> | |
5b10a619 | 21 | #ifndef __EMX__ |
20947e08 | 22 | #include <pmstddlg.h> |
5b10a619 | 23 | #endif |
20947e08 | 24 | |
4fd899b6 DW |
25 | class CIDropTarget; |
26 | ||
0e320a79 | 27 | //------------------------------------------------------------------------- |
6dddc146 | 28 | // wxDropSource |
54da4255 DW |
29 | //------------------------------------------------------------------------- |
30 | ||
53a2db12 | 31 | class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase |
54da4255 | 32 | { |
54da4255 | 33 | public: |
6dddc146 | 34 | /* constructor. set data later with SetData() */ |
5dcec1d9 | 35 | wxDropSource(wxWindow* pWin); |
6dddc146 DW |
36 | |
37 | /* constructor for setting one data object */ | |
38 | wxDropSource( wxDataObject& rData, | |
e6ebb514 | 39 | wxWindow* pWin |
6dddc146 DW |
40 | ); |
41 | virtual ~wxDropSource(); | |
42 | ||
43 | /* start drag action */ | |
2245b2b2 | 44 | virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); |
4fd899b6 | 45 | virtual bool GiveFeedback(wxDragResult eEffect); |
6dddc146 DW |
46 | |
47 | protected: | |
48 | void Init(void); | |
6dddc146 | 49 | |
4fd899b6 DW |
50 | ULONG m_ulItems; |
51 | PDRAGINFO m_pDragInfo; | |
52 | DRAGIMAGE m_vDragImage; | |
53 | PDRAGITEM m_pDragItem; | |
54 | wxWindow* m_pWindow; | |
55 | }; // end of CLASS wxDropSource | |
54da4255 | 56 | |
0e320a79 | 57 | //------------------------------------------------------------------------- |
6dddc146 | 58 | // wxDropTarget |
0e320a79 DW |
59 | //------------------------------------------------------------------------- |
60 | ||
53a2db12 | 61 | class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase |
0e320a79 DW |
62 | { |
63 | public: | |
d3b9f782 | 64 | wxDropTarget(wxDataObject* pDataObject = NULL); |
6dddc146 | 65 | virtual ~wxDropTarget(); |
0e320a79 | 66 | |
4fd899b6 DW |
67 | // |
68 | // These functions are called when data is moved over position (x, y) and | |
69 | // may return either wxDragCopy, wxDragMove or wxDragNone depending on | |
70 | // what would happen if the data were dropped here. | |
71 | // | |
72 | // The last parameter is what would happen by default and is determined by | |
73 | // the platform-specific logic (for example, under Windows it's wxDragCopy | |
74 | // if Ctrl key is pressed and wxDragMove otherwise) except that it will | |
75 | // always be wxDragNone if the carried data is in an unsupported format. | |
76 | // | |
77 | // OnData must be implemented and other should be overridden by derived classes | |
78 | // | |
79 | virtual wxDragResult OnData( wxCoord vX | |
80 | ,wxCoord vY | |
81 | ,wxDragResult eResult | |
82 | ); | |
83 | virtual bool OnDrop( wxCoord vX | |
84 | ,wxCoord vY | |
85 | ); | |
86 | bool IsAcceptedData(PDRAGINFO pDataSource) const; | |
0e320a79 | 87 | |
6dddc146 | 88 | protected: |
4fd899b6 DW |
89 | virtual bool GetData(void); |
90 | wxDataFormat GetSupportedFormat(PDRAGINFO pDataSource) const; | |
91 | void Release(void); | |
0e320a79 | 92 | |
4fd899b6 DW |
93 | private: |
94 | CIDropTarget* m_pDropTarget; | |
95 | }; // end of CLASS wxDropTarget | |
0e320a79 | 96 | |
6dddc146 | 97 | #endif //__OS2DNDH__ |
0e320a79 | 98 |