1999-07-29 05:11:30 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dnd.h
|
1999-10-22 04:37:39 +00:00
|
|
|
// Purpose: declaration of the wxDropTarget class
|
|
|
|
// Author: David Webster
|
|
|
|
// Modified by:
|
|
|
|
// Created: 10/21/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-22 04:37:39 +00:00
|
|
|
// Copyright: (c) 1999 David Webster
|
|
|
|
// Licence: wxWindows license
|
1999-07-29 05:11:30 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
|
|
|
|
#ifndef __OS2DNDH__
|
|
|
|
#define __OS2DNDH__
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-10-22 04:37:39 +00:00
|
|
|
#pragma interface
|
1999-07-29 05:11:30 +00:00
|
|
|
#endif
|
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
#if !wxUSE_DRAG_AND_DROP
|
|
|
|
#error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
|
|
|
|
#endif //WX_DRAG_DROP
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
1999-10-22 04:37:39 +00:00
|
|
|
// wxDropSource
|
1999-08-02 04:44:01 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
class WXDLLEXPORT wxDropSource: public wxDropSourceBase
|
1999-08-02 04:44:01 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-10-22 04:37:39 +00:00
|
|
|
/* constructor. set data later with SetData() */
|
1999-10-22 04:40:12 +00:00
|
|
|
wxDropSource(wxWindow* pWin);
|
1999-10-22 04:37:39 +00:00
|
|
|
|
|
|
|
/* constructor for setting one data object */
|
|
|
|
wxDropSource( wxDataObject& rData,
|
1999-10-24 15:57:35 +00:00
|
|
|
wxWindow* pWin
|
1999-10-22 04:37:39 +00:00
|
|
|
);
|
|
|
|
virtual ~wxDropSource();
|
|
|
|
|
|
|
|
/* start drag action */
|
|
|
|
virtual wxDragResult DoDragDrop(bool bAllowMove = FALSE);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init(void);
|
|
|
|
bool m_bLazyDrag;
|
|
|
|
|
|
|
|
DRAGIMAGE* m_pDragImage;
|
|
|
|
DRAGINFO* m_pDragInfo;
|
|
|
|
DRAGTRANSFER* m_pDragTransfer;
|
1999-08-02 04:44:01 +00:00
|
|
|
};
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
//-------------------------------------------------------------------------
|
1999-10-22 04:37:39 +00:00
|
|
|
// wxDropTarget
|
1999-07-29 05:11:30 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
class WXDLLEXPORT wxDropTarget: public wxDropTargetBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-10-22 04:37:39 +00:00
|
|
|
wxDropTarget(wxDataObject *dataObject = (wxDataObject*)NULL);
|
|
|
|
virtual ~wxDropTarget();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
void Register(WXHWND hwnd);
|
|
|
|
void Revoke(WXHWND hwnd);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
|
|
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
1999-10-25 02:41:20 +00:00
|
|
|
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult);
|
1999-10-22 04:37:39 +00:00
|
|
|
virtual bool GetData();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
// implementation
|
|
|
|
protected:
|
|
|
|
virtual bool IsAcceptable(DRAGINFO* pInfo);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
DRAGINFO* m_pDragInfo;
|
|
|
|
DRAGTRANSFER* m_pDragTransfer;
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
1999-10-22 04:37:39 +00:00
|
|
|
#endif //__OS2DNDH__
|
1999-07-29 05:11:30 +00:00
|
|
|
|