]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxGimmickView.cpp
Added Add DataBase event.
[creaImageIO.git] / src2 / creaImageIOWxGimmickView.cpp
index 5b87845400cd574b220c6011c5294055a1d05f05..70c845c9a611c0442fbc666812734b1b5c3301da 100644 (file)
@@ -637,6 +637,35 @@ namespace creaImageIO
     mess << times;
     */
     wxMessageBox(std2wx(mess.str()),_T("Addition result"),wxOK,this);
+  }
+
+  void WxGimmickView::OnAddDB(wxCommandEvent& event)
+  {
+    
+         //Select DB
+         long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
+         std::string wc("*.sqlite3*");
+         wxFileDialog* FD = new wxFileDialog( 0, 
+                                        _T("Select file"),
+                                        _T(""),
+                                        _T(""),
+                                        crea::std2wx(wc),
+                                        style,
+                                        wxDefaultPosition);
+    
+    if (FD->ShowModal()==wxID_OK)
+       {
+               wxBusyCursor busy;
+               wxArrayString files;
+               FD->GetPaths(files);
+               for(int i = 0; i< files.size(); i++)
+               {
+               //      gimmick->addDB("remote_" + i.c_str(),files[i]);
+               //      AddTreeHandler(gimmick->getTreeHandlerMap("remote_" + i.c_str()));
+               }
+       }
+    
+               
   }
 
    //=================================================
@@ -646,6 +675,7 @@ namespace creaImageIO
     EVT_TOOL(TOOL_ADDFILES_ID, WxGimmickView::OnAddFiles)
     EVT_TOOL(TOOL_ADDDIR_ID, WxGimmickView::OnAddDir)
        EVT_TOOL(TOOL_REMOVE_ID, WxGimmickView::OnRemove)
+       EVT_TOOL(TOOL_ADDDATABASE_ID, WxGimmickView::OnAddDB)
   END_EVENT_TABLE()
   //=================================================