X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOWxGimmickTools.cpp;h=4c7f57a6b1faf6ce536ff5d213f929b9508e3450;hb=c08122ffc3af8809ead722968f26e01c24a15ed9;hp=44b6390c9e1241c812ae14afe5fb3b3b3aa47638;hpb=4ac76c07b4bfbdf3c69da3faa347e1f14c7c217c;p=creaImageIO.git diff --git a/src2/creaImageIOWxGimmickTools.cpp b/src2/creaImageIOWxGimmickTools.cpp index 44b6390..4c7f57a 100644 --- a/src2/creaImageIOWxGimmickTools.cpp +++ b/src2/creaImageIOWxGimmickTools.cpp @@ -6,66 +6,74 @@ namespace creaImageIO ** Begin of the threshold panel **/ WxGimmickTools::WxGimmickTools(wxWindow* parent, wxString mCurrentDirectory) - : wxPanel(parent, -1, wxDefaultPosition, wxSize(300,200), wxBORDER_SUNKEN) + : wxPanel(parent, -1, wxDefaultPosition, wxSize(300,250), wxBORDER_SUNKEN) { _currentDir = mCurrentDirectory; _addFiles = true; - - _inputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(150,30)); - _outputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(150,30)); - _addCheckBox = new wxCheckBox(this, -1, _T("Add Images to Database?") ); + + _inputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30)); + _outputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30)); + _addCheckBox = new wxCheckBox(this, -1, _T("Add Images to Database?") ); _addCheckBox->SetValue(_addFiles); - wxButton *inputDir = new wxButton(this,wxID_ANY,_T("Input Directory"), wxDefaultPosition, wxSize(150,30) ); - wxButton *outputDir = new wxButton(this,wxID_ANY,_T("Output Directory"), wxDefaultPosition, wxSize(150,30) ); + wxButton *inputDir = new wxButton(this,wxID_ANY,_T("Input Directory"), wxDefaultPosition, wxSize(140,30) ); + wxButton *outputDir = new wxButton(this,wxID_ANY,_T("Output Directory"), wxDefaultPosition, wxSize(140,30) ); - - Connect( inputDir->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxGimmickTools::onInputDir ); - Connect( outputDir->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxGimmickTools::onOutputDir ); + Connect( inputDir->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxGimmickTools::onInputDir ); + Connect( outputDir->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxGimmickTools::onOutputDir ); Connect( _addCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onAddToDatabase ); - wxFlexGridSizer * sizer = new wxFlexGridSizer(2,5); - sizer -> Add( _inputPath, 1, wxGROW, 10 ); - sizer -> Add( inputDir, 1, wxGROW, 10 ); - sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW, 10 ); - sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW, 10 ); - sizer -> Add( _outputPath, 1, wxGROW, 10 ); - sizer -> Add( outputDir, 1, wxGROW, 10 ); - sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW, 10 ); - sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW, 10 ); - sizer -> Add( _addCheckBox, 1, wxGROW, 10 ); - - this->SetSizer( sizer ); + wxFlexGridSizer *textSizer = new wxFlexGridSizer(1,2); + textSizer->Add( new wxStaticText(this, -1, _T("Transform a Bruker image into Dicom format.")), 1, wxGROW ); + textSizer->Add( new wxStaticText(this, -1, _T("If checkbox is selected images will be loaded into the DB.")), 1, wxGROW ); + + wxFlexGridSizer *sizer = new wxFlexGridSizer(2,5); + sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); + sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); + sizer->Add( _inputPath, 1, wxGROW ); + sizer->Add( inputDir, 1, wxGROW ); + sizer->Add( _outputPath, 1, wxGROW ); + sizer->Add( outputDir, 1, wxGROW ); + sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); + sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); + sizer->Add( _addCheckBox, 1, wxGROW ); + + wxFlexGridSizer *topSizer = new wxFlexGridSizer(1, 2); + topSizer->Add( textSizer, 1, wxGROW ); + topSizer->Add( sizer, 1, wxGROW ); + this->SetSizer( topSizer ); this->SetAutoLayout( true ); this->Layout(); } - WxGimmickTools::~WxGimmickTools(){ + WxGimmickTools::~WxGimmickTools() + { + } wxString WxGimmickTools::getInputDir() { - return _inputPath->GetLabel(); + return _inputPath->GetValue(); } - + wxString WxGimmickTools::getOutputDir() { - return _outputPath->GetLabel(); + return _outputPath->GetValue(); } - + bool WxGimmickTools::getCheckBoxValue() { return _addCheckBox->GetValue(); } - + void WxGimmickTools::onInputDir(wxCommandEvent& event) { long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST; wxDirDialog* FD = new wxDirDialog( 0, _T("Select the Input Directory"), _currentDir, style); - + if (FD->ShowModal()==wxID_OK) - { - _inputPath->SetLabel(FD->GetPath()); + { + _inputPath->SetValue(FD->GetPath()); } } @@ -76,7 +84,7 @@ namespace creaImageIO if (FD->ShowModal()==wxID_OK) { - _outputPath->SetLabel(FD->GetPath()); + _outputPath->SetValue(FD->GetPath()); } }