2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbwxDropFiles.h"
5 #include "bbwxPackage.h"
14 class WxDropFiles: public wxFileDropTarget
17 WxDropFiles(DropFiles *box): mbox(box){}
18 bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& arrFilenames);
23 bool WxDropFiles::OnDropFiles(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxArrayString& arrFilenames)
25 std::vector<std::string> tmpLst;
26 int i,sizeArrFilenames=arrFilenames.GetCount();
27 for( i=0 ; i<sizeArrFilenames ; i++ )
29 std::string ss=bbtk::wx2std( arrFilenames.Item(i) );
30 tmpLst.push_back( bbtk::wx2std( arrFilenames.Item(i) ) );
33 mbox->bbSetOutputLstPaths( tmpLst );
34 mbox->bbSignalOutputModification( );
39 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,DropFiles)
40 BBTK_BLACK_BOX_IMPLEMENTATION(DropFiles,bbtk::AtomicBlackBox);
42 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
44 void DropFiles::Process()
47 // THE MAIN PROCESSING METHOD BODY
48 // Here we simply set the input 'In' value to the output 'Out'
49 // And print out the output value
50 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
51 // void bbSet{Input|Output}NAME(const TYPE&)
52 // const TYPE& bbGet{Input|Output}NAME() const
54 // * NAME is the name of the input/output
55 // (the one provided in the attribute 'name' of the tag 'input')
56 // * TYPE is the C++ type of the input/output
57 // (the one provided in the attribute 'type' of the tag 'input')
59 // bbSetOutputOut( bbGetInputIn() );
60 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
62 if (bbGetInputWidget()!=NULL)
64 bbGetInputWidget()->SetDropTarget( new WxDropFiles(this) );
69 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
71 void DropFiles::bbUserSetDefaultValues()
74 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
75 // Here we initialize the input 'In' to 0
76 bbSetInputWidget(NULL);
80 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
82 void DropFiles::bbUserInitializeProcessing()
85 // THE INITIALIZATION METHOD BODY :
87 // but this is where you should allocate the internal/output pointers
93 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
95 void DropFiles::bbUserFinalizeProcessing()
98 // THE FINALIZATION METHOD BODY :
100 // but this is where you should desallocate the internal/output pointers