mProgressDialog(NULL),
mConstructed(false)
{
- mViewer = NULL;
+
+ mViewer = NULL;
GimmickDebugMessage(1,"WxGimmickView::WxGimmickView" <<std::endl);
// Sets the current directory to the home dir
mCurrentDirectory = std2wx(gimmick->GetHomeDirectory());
// Connect the AddProgress callback
gimmick->ConnectAddProgressObserver( boost::bind( &WxGimmickView::OnAddProgress , this, _1 ) );
+
// Create the list of icons (mIcon)
CreateIconList();
+
// Global sizer
msizer = new wxBoxSizer(wxVERTICAL);
+
// Create the tool bar
- CreateToolBar();
+ CreateToolBar( );
msizer->Add( mToolBar, 0, wxGROW, 0);
+
// Split part below toolbar into notebook for views and panel
// for preview, messages...
mSplitter = new wxSplitterWindow( this , -1);
mSelectionMinDimension = min_dim;
// Create the views
+
CreateTreeViews();
// Bottom panel
mbottom_sizer->Add(mViewer,1,wxGROW,1);
+
+
// mViewer->Show();
mText = new wxStaticText(mBottomPanel, wxID_ANY, wxT("Welcome to Gimmick!"));
mProgressDialog=NULL;
SetSizer( msizer );
SetAutoLayout(true);
+
Layout();
//mListener=new Listener();
//mListener->ConnectObserver(boost::bind( &WxGimmickView::OnDriveMount, this, _1 ) );
//if(mListener->IsAlive()) { mListener->Delete(); }
}
//======================================================================
-
+
+
+
+void WxGimmickView::AddBtnTool(wxPanel *panel, wxBoxSizer *sizerH, int id, wxString label, int idBitmap, wxString tooltip )
+{
+ wxBoxSizer *sizer;
+ wxBitmapButton *btn;
+ wxBitmap bitmap;
+
+ bitmap = mIcon->GetBitmap(idBitmap);
+ btn = new wxBitmapButton(mToolBar, id, bitmap, wxDefaultPosition, wxSize(50,50) , wxBU_BOTTOM );
+ btn->SetToolTip( tooltip );
+ sizer = new wxBoxSizer(wxVERTICAL);
+ sizer->Add(btn,1,wxGROW,0);
+ sizer->Add(new wxStaticText(mToolBar,-1,label) , 0, wxALL | wxALIGN_CENTER, 3);
+ sizerH->Add( sizer ,1,wxGROW,0);
+}
+
//======================================================================
/// Creates the tool bar
void WxGimmickView::CreateToolBar()
{
+ mToolBar = new wxPanel(this,-1, wxDefaultPosition, wxSize(80,80) );
+ wxBoxSizer *sizerH = new wxBoxSizer(wxHORIZONTAL);
+
+ AddBtnTool(mToolBar, sizerH, TOOL_ADDFILES_ID , _T("Add file(s)") , Icon_page_down , _T("Add one or more file to database") );
+ AddBtnTool(mToolBar, sizerH, TOOL_ADDDIR_ID , _T("Add folder") , Icon_folder_down , _T("Add the content of a folder to database") );
+ AddBtnTool(mToolBar, sizerH, TOOL_ADDDATABASE_ID , _T("Open database") , Icon_database_add , _T("Open a local or distant database") );
+ AddBtnTool(mToolBar, sizerH, TOOL_REMOVE_ID , _T("Remove") , Icon_remove , _T("Remove selected items") );
+ AddBtnTool(mToolBar, sizerH, TOOL_SYNCHRONIZE_ID , _T("Synchronize") , Icon_synchronize , _T("Synchronizes the database with disk") );
+ AddBtnTool(mToolBar, sizerH, TOOL_HELP_ID , _T("Help") , Icon_help , _T("Open help window") );
+ AddBtnTool(mToolBar, sizerH, TOOL_SETTINGS_ID , _T("System settings") , Icon_settings , _T("Allows the modification of various system settings") );
+ AddBtnTool(mToolBar, sizerH, TOOL_TOOLS_ID , _T("Tools") , Icon_tools , _T("Applies tools to images") );
+ AddBtnTool(mToolBar, sizerH, TOOL_CREATEDB_ID , _T("Create database") , Icon_create_database , _T("Create DB from an Attributes Descriptor file") );
+ #if defined(BUILD_PACS)
+ AddBtnTool(mToolBar, sizerH, TOOL_PACS_ID , _T("PACS Connection,"), Icon_create_database , _T("Echo, Find and Get to a PACS") );
+ #endif
+ mToolBar->SetSizer( sizerH );
+ mToolBar->Layout();
+
+/* EED 2021-12-17
+ The wxToolBar depends from wxFrame, in this code it is not the case. In Mac Os is not working !
+ Change the mechanisme from wcToolBar to normal Buttons
long style = wxTB_HORIZONTAL | wxNO_BORDER | wxTB_TEXT;
- mToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,
- style);
+ mToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,style);
- mToolAddFile = mToolBar->AddTool( TOOL_ADDFILES_ID,
+ mToolAddFile = mToolBar->AddTool( TOOL_ADDFILES_ID,
_T("Add file(s)"),
mIcon->GetBitmap(Icon_page_down),
_T("Add one or more file to database")
);
- mToolAddDir = mToolBar->AddTool( TOOL_ADDDIR_ID,
+ mToolAddDir = mToolBar->AddTool( TOOL_ADDDIR_ID,
_T("Add folder"),
mIcon->GetBitmap(Icon_folder_down),
_T("Add the content of a folder to database")
);
#endif
//const wxBitmap& bitmap1, const wxString& shortHelpString = "", wxItemKind kind = wxITEM_NORMAL)
+ mToolBar->Realize();
- mToolBar->Realize();
+ */
}
//======================================================================
void WxGimmickView::getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> i_attr,
bool mult, const std::string out_model)
{
-printf("EED WxGimmickView::getSelectedFiles Start\n");
-
// First we select the files
std::vector<std::string> files;
-printf("EED WxGimmickView::getSelectedFiles 1.1\n");
std::string db_name = crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()));
-printf("EED WxGimmickView::getSelectedFiles 1.2\n");
GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(files);
-printf("EED WxGimmickView::getSelectedFiles 1.3\n");
std::string asking;
std::string dim;
-printf("EED WxGimmickView::getSelectedFiles 1.3.1\n");
bool bsingle = isSingle( files.front() );
-printf("EED WxGimmickView::getSelectedFiles 1.3.2\n");
int i_dim_out;
-printf("EED WxGimmickView::getSelectedFiles 1.4\n");
mGimmick->GetSetting(SETTINGS_OUTPUT_ASK, asking);
-printf("EED WxGimmickView::getSelectedFiles 1.5\n");
mGimmick->GetSetting(SETTINGS_OUTPUT_DIM, dim);
-printf("EED WxGimmickView::getSelectedFiles 1.6\n");
-
if (asking == "true")
{
// display the output dialog box
// get dim
int idim;
sscanf(dim.c_str(),"%d",&idim);
-printf("EED WxGimmickView::getSelectedFiles 1.7\n");
WxOutputDlg *dlg = new WxOutputDlg(this,files, idim -1, bsingle);
-printf("EED WxGimmickView::getSelectedFiles 1.8\n");
if (dlg->ShowModal() == wxID_OK)
{
dim = dlg->getDim();
}
sscanf(dim.c_str(),"%d",&i_dim_out);
-printf("EED WxGimmickView::getSelectedFiles 2\n");
-
-
// Next we create the structure for dicom output infos
OutputAttr Oattr;
//EED 01/09/2014
// Now we read and create the waiting output (vtkImageData * or OutGimmickData *)
readImages(outG, sort_files, Oattr, i_dim_out, zspacing);
-printf("EED WxGimmickView::getSelectedFiles End\n");
-
}
//=================================================
//=================================================
+
+BEGIN_EVENT_TABLE(WxGimmickView, wxPanel)
+ EVT_BUTTON(TOOL_CREATEDB_ID, WxGimmickView::OnCreateDB)
+ EVT_BUTTON(TOOL_ADDFILES_ID, WxGimmickView::OnAddFiles)
+ EVT_BUTTON(TOOL_ADDDIR_ID, WxGimmickView::OnAddDir)
+ EVT_BUTTON(TOOL_ADDDATABASE_ID, WxGimmickView::OnAddDB)
+ EVT_BUTTON(TOOL_REMOVE_ID, WxGimmickView::OnRemove)
+ EVT_BUTTON(TOOL_SYNCHRONIZE_ID, WxGimmickView::OnSynchronize)
+ EVT_BUTTON(TOOL_SETTINGS_ID, WxGimmickView::OnSettings)
+ EVT_BUTTON(TOOL_TOOLS_ID, WxGimmickView::OnTools)
+END_EVENT_TABLE()
+
+
+/*
BEGIN_EVENT_TABLE(WxGimmickView, wxPanel)
EVT_TOOL(TOOL_CREATEDB_ID, WxGimmickView::OnCreateDB)
EVT_TOOL(TOOL_ADDFILES_ID, WxGimmickView::OnAddFiles)
EVT_TOOL(TOOL_SETTINGS_ID, WxGimmickView::OnSettings)
EVT_TOOL(TOOL_TOOLS_ID, WxGimmickView::OnTools)
END_EVENT_TABLE()
+*/
//=================================================
} // EO namespace creaImageIO