0
|
1 // Filename : dndfile.h
|
|
2 // Last Change: 16-Jan-2014.
|
|
3 //
|
|
4 #ifndef __DNDFILE_H__
|
|
5 #define __DNDFILE_H__
|
|
6
|
|
7 #include "common.h"
|
|
8
|
|
9 class DnDFile : public wxFileDropTarget
|
|
10 {
|
|
11 public:
|
|
12 DnDFile( wxTextCtrl *textCtrl )
|
|
13 {
|
|
14 m_textCtrl = textCtrl;
|
|
15 }
|
|
16 virtual bool OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames )
|
|
17 {
|
|
18 size_t nFiles = filenames.GetCount();
|
|
19 if ( nFiles != 1 ) return false;
|
|
20 m_textCtrl->SetValue( filenames[0] );
|
|
21
|
|
22 return true;
|
|
23 }
|
|
24
|
|
25 private:
|
|
26 wxTextCtrl* m_textCtrl;
|
|
27 };
|
|
28
|
|
29 #endif //__DNDFILE_H__
|
|
30
|