Mercurial > mercurial > hgweb_iv.cgi
diff include/dndfile.h @ 0:3334ef689214 default tip
start develop.
author | pyon@macmini |
---|---|
date | Fri, 14 Aug 2020 03:15:53 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/dndfile.h Fri Aug 14 03:15:53 2020 +0900 @@ -0,0 +1,26 @@ +// Filename : dndfile.h +// Last Change: 2020-08-13 木 12:16:35. +// + +#pragma once + +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; +}; +