Added wxPrivateDropTarget
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -138,11 +138,9 @@ class wxPrivateDataObject : public wxDataObject
|
||||
|
||||
public:
|
||||
|
||||
wxPrivateDataObject()
|
||||
{ m_size = 0; m_data = (char*) NULL; }
|
||||
wxPrivateDataObject();
|
||||
|
||||
~wxPrivateDataObject()
|
||||
{ if (m_data) delete[] m_data; }
|
||||
~wxPrivateDataObject();
|
||||
|
||||
virtual wxDataFormat GetFormat() const
|
||||
{ return wxDF_PRIVATE; }
|
||||
|
@@ -43,6 +43,7 @@ class wxWindow;
|
||||
class wxDropTarget;
|
||||
class wxTextDropTarget;
|
||||
class wxFileDropTarget;
|
||||
class wxPrivateDropTarget;
|
||||
|
||||
class wxDropSource;
|
||||
|
||||
@@ -90,6 +91,36 @@ class wxTextDropTarget: public wxDropTarget
|
||||
virtual wxDataFormat GetFormat(size_t n) const;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxPrivateDropTarget
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxPrivateDropTarget: public wxDropTarget
|
||||
{
|
||||
public:
|
||||
|
||||
wxPrivateDropTarget();
|
||||
|
||||
// you have to override OnDrop to get at the data
|
||||
|
||||
// the string ID identifies the format of clipboard or DnD data. a word
|
||||
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
|
||||
// to the clipboard - the latter with the Id "WXWORD_FORMAT".
|
||||
|
||||
void SetId( const wxString& id )
|
||||
{ m_id = id; }
|
||||
|
||||
wxString GetId()
|
||||
{ return m_id; }
|
||||
|
||||
private:
|
||||
|
||||
virtual size_t GetFormatCount() const;
|
||||
virtual wxDataFormat GetFormat(size_t n) const;
|
||||
|
||||
wxString m_id;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// A drop target which accepts files (dragged from File Manager or Explorer)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user