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()
46 // THE MAIN PROCESSING METHOD BODY
47 // Here we simply set the input 'In' value to the output 'Out'
48 // And print out the output value
49 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
50 // void bbSet{Input|Output}NAME(const TYPE&)
51 // const TYPE& bbGet{Input|Output}NAME() const
53 // * NAME is the name of the input/output
54 // (the one provided in the attribute 'name' of the tag 'input')
55 // * TYPE is the C++ type of the input/output
56 // (the one provided in the attribute 'type' of the tag 'input')
58 // bbSetOutputOut( bbGetInputIn() );
59 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
60 if (bbGetInputWidget()!=NULL)
62 bbGetInputWidget()->SetDropTarget( new WxDropFiles(this) );
64 bbSetOutputLstPaths( bbGetInputLstPaths() );
68 // 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)
70 void DropFiles::bbUserSetDefaultValues()
72 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
73 // Here we initialize the input 'In' to 0
74 bbSetInputWidget(NULL);
78 // 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)
80 void DropFiles::bbUserInitializeProcessing()
82 // THE INITIALIZATION METHOD BODY :
84 // but this is where you should allocate the internal/output pointers
89 // 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)
91 void DropFiles::bbUserFinalizeProcessing()
93 // THE FINALIZATION METHOD BODY :
95 // but this is where you should desallocate the internal/output pointers