drag & drop implemented
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -121,38 +121,29 @@ bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DATAOBJ
|
||||
class WXDLLEXPORT wxMetafileDataObject : public wxDataObject
|
||||
class WXDLLEXPORT wxMetafileDataObject : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxMetafileDataObject() { m_width = 0; m_height = 0; };
|
||||
wxMetafileDataObject(const wxMetafile& metafile, int width = 0, int height = 0):
|
||||
m_metafile(metafile), m_width(width), m_height(height) { }
|
||||
wxMetafileDataObject()
|
||||
: wxDataObjectSimple(wxDF_METAFILE) { };
|
||||
wxMetafileDataObject(const wxMetafile& metafile)
|
||||
: wxDataObjectSimple(wxDF_METAFILE), m_metafile(metafile) { }
|
||||
|
||||
void SetMetafile(const wxMetafile& metafile, int w = 0, int h = 0)
|
||||
{ m_metafile = metafile; m_width = w; m_height = h; }
|
||||
wxMetafile GetMetafile() const { return m_metafile; }
|
||||
int GetWidth() const { return m_width; }
|
||||
int GetHeight() const { return m_height; }
|
||||
// virtual functions which you may override if you want to provide data on
|
||||
// demand only - otherwise, the trivial default versions will be used
|
||||
virtual void SetMetafile(const wxMetafile& metafile)
|
||||
{ m_metafile = metafile; }
|
||||
virtual wxMetafile GetMetafile() const
|
||||
{ return m_metafile; }
|
||||
|
||||
virtual wxDataFormat GetFormat() const { return wxDF_METAFILE; }
|
||||
// implement base class pure virtuals
|
||||
virtual size_t GetDataSize() const;
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t len, const void *buf);
|
||||
|
||||
/* ??
|
||||
// implement base class pure virtuals
|
||||
virtual wxDataFormat GetPreferredFormat() const
|
||||
{ return (wxDataFormat) wxDataObject::Text; }
|
||||
virtual bool IsSupportedFormat(wxDataFormat format) const
|
||||
{ return format == wxDataObject::Text || format == wxDataObject::Locale; }
|
||||
virtual size_t GetDataSize() const
|
||||
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
|
||||
virtual void GetDataHere(void *pBuf) const
|
||||
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
|
||||
*/
|
||||
|
||||
private:
|
||||
protected:
|
||||
wxMetafile m_metafile;
|
||||
int m_width;
|
||||
int m_height;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user