#include <creaImageIOWxGimmickView.h>
#include <creaImageIOWxTreeView.h>
#include <creaImageIOSystem.h>
-
+using namespace crea;
// Icons
#include "icons/accept.xpm"
#include "icons/add.xpm"
mNotebook = new wxNotebook(mSplitter,
-1,wxDefaultPosition, wxDefaultSize, 0);
+ //Gimmick
+ mGimmick=gimmick;
+
// Create the views
CreateTreeViews();
}
}
}
+
+
//=================================================
+ 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