1999-07-29 01:11:30 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dnd.h
|
1999-10-22 00:37:39 -04:00
|
|
|
// Purpose: declaration of the wxDropTarget class
|
|
|
|
// Author: David Webster
|
|
|
|
// Modified by:
|
|
|
|
// Created: 10/21/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-22 00:37:39 -04:00
|
|
|
// Copyright: (c) 1999 David Webster
|
|
|
|
// Licence: wxWindows license
|
1999-07-29 01:11:30 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
|
|
|
|
#ifndef __OS2DNDH__
|
|
|
|
#define __OS2DNDH__
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-22 00:37:39 -04: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 01:11:30 -04:00
|
|
|
|
1999-11-22 00:27:57 -05:00
|
|
|
#define INCL_WINSTDDRAG
|
|
|
|
#include <os2.h>
|
2000-01-14 18:04:16 -05:00
|
|
|
#ifndef __EMX__
|
1999-11-22 00:27:57 -05:00
|
|
|
#include <pmstddlg.h>
|
2000-01-14 18:04:16 -05:00
|
|
|
#endif
|
1999-11-22 00:27:57 -05:00
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
//-------------------------------------------------------------------------
|
1999-10-22 00:37:39 -04:00
|
|
|
// wxDropSource
|
1999-08-02 00:44:01 -04:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
class WXDLLEXPORT wxDropSource: public wxDropSourceBase
|
1999-08-02 00:44:01 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-22 00:37:39 -04:00
|
|
|
/* constructor. set data later with SetData() */
|
1999-10-22 00:40:12 -04:00
|
|
|
wxDropSource(wxWindow* pWin);
|
1999-10-22 00:37:39 -04:00
|
|
|
|
|
|
|
/* constructor for setting one data object */
|
|
|
|
wxDropSource( wxDataObject& rData,
|
1999-10-24 11:57:35 -04:00
|
|
|
wxWindow* pWin
|
1999-10-22 00:37:39 -04:00
|
|
|
);
|
|
|
|
virtual ~wxDropSource();
|
|
|
|
|
|
|
|
/* start drag action */
|
2002-04-28 10:30:54 -04:00
|
|
|
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
|
1999-10-22 00:37:39 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init(void);
|
|
|
|
bool m_bLazyDrag;
|
|
|
|
|
|
|
|
DRAGIMAGE* m_pDragImage;
|
|
|
|
DRAGINFO* m_pDragInfo;
|
|
|
|
DRAGTRANSFER* m_pDragTransfer;
|
1999-08-02 00:44:01 -04:00
|
|
|
};
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
//-------------------------------------------------------------------------
|
1999-10-22 00:37:39 -04:00
|
|
|
// wxDropTarget
|
1999-07-29 01:11:30 -04:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
class WXDLLEXPORT wxDropTarget: public wxDropTargetBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-22 00:37:39 -04:00
|
|
|
wxDropTarget(wxDataObject *dataObject = (wxDataObject*)NULL);
|
|
|
|
virtual ~wxDropTarget();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
void Register(WXHWND hwnd);
|
|
|
|
void Revoke(WXHWND hwnd);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
|
|
|
virtual bool OnDrop(wxCoord x, wxCoord y);
|
1999-10-24 22:41:20 -04:00
|
|
|
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult vResult);
|
1999-10-22 00:37:39 -04:00
|
|
|
virtual bool GetData();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
// implementation
|
|
|
|
protected:
|
|
|
|
virtual bool IsAcceptable(DRAGINFO* pInfo);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
DRAGINFO* m_pDragInfo;
|
|
|
|
DRAGTRANSFER* m_pDragTransfer;
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
|
1999-10-22 00:37:39 -04:00
|
|
|
#endif //__OS2DNDH__
|
1999-07-29 01:11:30 -04:00
|
|
|
|