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