OSDN Git Service

書庫名をMainFrame内に保持しておくよう変更。
[tpi/lychee.git] / src / frontend / cls_filedroptarget.cpp
1 /*******************************************************************************
2   TPI - flexible but useless plug-in framework.
3   Copyright (C) 2002-2009 Silky
4
5   This library is free software; you can redistribute it and/or modify it under
6   the terms of the GNU Lesser General Public License as published by the Free
7   Software Foundation; either version 2.1 of the License, or (at your option)
8   any later version.
9
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
12   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
13   for more details.
14
15   You should have received a copy of the GNU Lesser General Public License along
16   with this library; if not, write to the Free Software Foundation, Inc.,
17   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
19   $Id: cls_filedroptarget.cpp,v 1.2 2009/08/09 06:08:51 sirakaba Exp $
20 *******************************************************************************/
21
22 #include "frontend.h"
23
24 #include "frm_main.h"
25 #include "cls_filedroptarget.h"
26
27 //******************************************************************************
28 // myFileDropTarget
29 //******************************************************************************
30
31 myFileDropTarget::myFileDropTarget(MainFrame * mainFrame)
32 {
33         this->mainFrame = mainFrame;
34 }
35
36 //******************************************************************************
37 // Event handler.
38 //******************************************************************************
39
40 bool myFileDropTarget::OnDropFiles(wxCoord, wxCoord, const wxArrayString & asFiles)
41 {
42         wxCommandEvent e;
43
44         // \8f\91\8cÉ\82É\91Î\89\9e\82µ\82Ä\82¢\82é\82©\82Ç\82¤\82©\8am\94F\81B
45         if (asFiles.Count() == 1 && this->mainFrame->LoadTPI(asFiles[0]) != -1)
46         {
47                 // \8f\91\8cÉ\82ð\8aJ\82­\81B
48                 this->mainFrame->fnArchive = wxFileName(asFiles[0]);
49                 this->mainFrame->OnArcOpen(e);
50                 return true;
51         }
52
53         // \91Î\89\9e\82µ\82Ä\82¢\82È\82¢\8fê\8d\87\82Í\8ai\94[(or\92Ç\89Á\88³\8fk)\82ð\8e\8e\82Ý\82é\81B
54         wxArrayString as = asFiles;
55         e.SetClientData(& as);
56         this->mainFrame->OnArcCreate(e);
57
58         return true;
59 }