]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxGimmickView.cpp
Corrected ggo to work in win32.
[creaImageIO.git] / src2 / creaImageIOWxGimmickView.cpp
index aee84ab259825fb6e95ad153b274d6f5c39ca157..7e79bc320c94b25983120a56ab82a33f1c660b6c 100644 (file)
@@ -1,7 +1,7 @@
 #include <creaImageIOWxGimmickView.h>
 #include <creaImageIOWxTreeView.h>
 #include <creaImageIOSystem.h>
-
+using namespace crea;
 // Icons
 #include "icons/accept.xpm"
 #include "icons/add.xpm"
@@ -87,6 +87,9 @@ namespace creaImageIO
     mNotebook = new wxNotebook(mSplitter,
                               -1,wxDefaultPosition, wxDefaultSize, 0);
 
+       //Gimmick
+       mGimmick=gimmick;
+
     // Create the views
     CreateTreeViews();
 
@@ -216,9 +219,66 @@ namespace creaImageIO
          }
       }
   }
+
+
   //=================================================
+  void WxGimmickView::OnAddFile(wxCommandEvent& event)
+  {
+   long style = wxOPEN | wxFILE_MUST_EXIST | wxFD_MULTIPLE;
+    std::string wc("*.*");
+    wxFileDialog* FD = new wxFileDialog( 0, 
+                                        _T("Select file"),
+                                        "",
+                                        _T(""),
+                                        std2wx(wc),
+                                        style,
+                                        wxDefaultPosition);
+    
+    if (FD->ShowModal()==wxID_OK)
+      {
 
+       wxArrayString files;
+       FD->GetPaths(files);
+       unsigned int i;
+       std::vector<std::string> filenames;
+       for (i=0;i<files.GetCount();++i)
+       {
+         filenames.push_back(wx2std(files[i]));
+         GimmickMessage(2,"Adding File "<<files[i]<<"."<<std::endl);
+       }
+
+       
+    /*   
+       TreeItemData *data = 
+         (TreeItemData *)
+         mTreeListCtrl->GetItemData(mItemOfMenu);
+       DicomDatabase* db = data->GetDicomNode()->GetDicomDatabase();
+       DicomDatabase::UpdateSummary summary;
+       wxProgressDialog* progress = 
+         new wxProgressDialog(_T("Adding file(s)"),
+                              _T(""),
+                              1000,
+                              this,
+                              wxPD_ELAPSED_TIME |
+                              wxPD_ESTIMATED_TIME | 
+                              wxPD_REMAINING_TIME |
+                              wxPD_CAN_ABORT );
+       
+       db->AddFiles(filenames,progress,summary);
+       
+       progress->Pulse(_T("Updating view..."));
+       UpdateDicomDatabaseView(db);
+       delete progress;
+       DisplayUpdateSummary(summary,this);
+       */
+      }
+       
+  }
+  //=================================================
 
+  BEGIN_EVENT_TABLE(WxGimmickView, wxPanel)
+  EVT_TOOL(TOOL_ADDFILE_ID, WxGimmickView::OnAddFile)
+  END_EVENT_TABLE()
 
 } // EO namespace creaImageIO