- public:
-
- wxDragSource( wxWindow *win );
- ~wxDragSource(void);
- void SetData( char *data, long size );
- void Start( int x, int y );
-
- public:
-
- void ConnectWindow(void);
- void UnconnectWindow(void);
- virtual void RegisterWindow(void) = 0;
- void UnregisterWindow(void);
-
- GtkWidget *m_widget;
- wxWindow *m_window;
- char *m_data;
- long m_size;
- wxCursor m_defaultCursor;
- wxCursor m_goaheadCursor;
+public:
+ // constructor. set data later with SetData()
+ wxDropSource( wxWindow *win = (wxWindow *)NULL,
+ const wxIcon © = wxNullIcon,
+ const wxIcon &move = wxNullIcon,
+ const wxIcon &none = wxNullIcon);
+
+ // constructor for setting one data object
+ wxDropSource( wxDataObject& data,
+ wxWindow *win,
+ const wxIcon © = wxNullIcon,
+ const wxIcon &move = wxNullIcon,
+ const wxIcon &none = wxNullIcon);
+
+ virtual ~wxDropSource();
+
+ // start drag action
+ virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
+
+ // GTK implementation
+ void RegisterWindow();
+ void UnregisterWindow();
+
+ void PrepareIcon( int action, GdkDragContext *context );
+
+ GtkWidget *m_widget;
+ GtkWidget *m_iconWindow;
+ GdkDragContext *m_dragContext;
+ wxWindow *m_window;
+
+ wxDragResult m_retValue;
+ wxIcon m_iconCopy,
+ m_iconMove,
+ m_iconNone;
+
+ bool m_waiting;
+
+private:
+ // common part of both ctors
+ void SetIcons(const wxIcon& copy,
+ const wxIcon& move,
+ const wxIcon& none);