Mercurial > mercurial > hgweb_imcv.cgi
diff dndfile.h @ 0:ebc42d7a0010
First Release.
author | pyon@macmini |
---|---|
date | Fri, 24 Jan 2014 20:35:59 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dndfile.h Fri Jan 24 20:35:59 2014 +0900 @@ -0,0 +1,30 @@ +// Filename : dndfile.h +// Last Change: 16-Jan-2014. +// +#ifndef __DNDFILE_H__ +#define __DNDFILE_H__ + +#include "common.h" + +class DnDFile : public wxFileDropTarget +{ + public: + DnDFile( wxTextCtrl *textCtrl ) + { + m_textCtrl = textCtrl; + } + virtual bool OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames ) + { + size_t nFiles = filenames.GetCount(); + if ( nFiles != 1 ) return false; + m_textCtrl->SetValue( filenames[0] ); + + return true; + } + + private: + wxTextCtrl* m_textCtrl; +}; + +#endif //__DNDFILE_H__ +