view dndfile.h @ 3:cc1f1fa544a4

for wxWidgets 3.1
author pyon@macmini
date Sun, 27 Nov 2016 20:15:37 +0900
parents ebc42d7a0010
children
line wrap: on
line source

// 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__