]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxGimmickView.cpp
*** empty log message ***
[creaImageIO.git] / src2 / creaImageIOWxGimmickView.cpp
index 4fdf0fc3fc71b47227d11eeb20e2509d385b1908..3bae7d897aee13d336d07863a08e2e98393723cb 100644 (file)
@@ -686,13 +686,65 @@ namespace creaImageIO
   }
   //=================================================
 
-    //=================================================
+  //=================================================
+  //AndresDonadio
   void WxGimmickView::OnTools(wxCommandEvent& event)
   {
-         wxDialog* dial= new wxDialog (this,-1,"Tools",wxDefaultPosition, wxDefaultSize);
-         wxBoxSizer    *siz = new wxBoxSizer(wxVERTICAL);
-         dial->SetSizer(siz);
-         dial->ShowModal();
+               wxDialog* dial= new wxDialog (this,-1,"Tools",wxDefaultPosition, wxDefaultSize);
+               wxBoxSizer      *siz = new wxBoxSizer(wxVERTICAL);
+               
+               wxButton *inBtn = new wxButton(dial,-1,_T("Input Directory"), wxDefaultPosition, wxSize(200,30) );
+               wxButton *outBtn = new wxButton(dial,-1,_T("Output Directory"), wxDefaultPosition, wxSize(200,30) );
+
+               dial->SetSizer(siz);
+               dial->ShowModal();
+
+               /*
+                       mViewer->StopPlayer();
+               std::string name = crea::wx2std(mNotebook->GetCurrentPage()->GetName());
+               long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
+               wxDirDialog* FD = 
+               new wxDirDialog( 0, 
+                               _T("Select directory"),
+                               mCurrentDirectory,
+                               style);
+           
+               if (FD->ShowModal()==wxID_OK)
+               {
+
+               
+                       std::string dirname = wx2std (FD->GetPath());
+                       bool recurse =  isNeedRecursive(dirname);
+                       if (recurse)
+                       {
+                               recurse = wxMessageBox(_T("Recurse into sub-directories ?"),  _T("Scan directory"),      wxYES_NO,this ) == wxYES ? true : false;
+                       }
+                       
+                       wxBusyCursor busy;
+                       wxString title(_T("Adding directory"));
+                       if (recurse) 
+                       title = _T("Adding directory (recursive)");
+                       mProgressDialog = 
+                       new wxProgressDialog(_T("Adding directory"),
+                                               _T(""),
+                                               1000,
+                                               this,
+                                               wxPD_ELAPSED_TIME |
+                                               //                             wxPD_ESTIMATED_TIME | 
+                                               //                             wxPD_REMAINING_TIME |
+                                               wxPD_CAN_ABORT );
+                       
+                       mCurrentDirectory = FD->GetPath();  
+                       mGimmick->AddDir(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),dirname,recurse);
+                       mProgressDialog->Pulse(_T("Updating view..."));
+                       
+                       UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
+                       delete mProgressDialog;
+                       DisplayAddSummary();
+
+               }
+               mViewer->StartPlayer();
+               */
   }
   //=================================================