X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOWxGimmick.cpp;h=3ad5e81280ede7cdd930ffcaab3ae209e648a723;hb=26963d13f31f98807176a062b1d2c209df9c7869;hp=e58ec0eab4769cd38068359bb12783b8c245d197;hpb=a0e82d165951ac064a95dfa9360590db49bc8d77;p=creaImageIO.git diff --git a/src/creaImageIOWxGimmick.cpp b/src/creaImageIOWxGimmick.cpp index e58ec0e..3ad5e81 100644 --- a/src/creaImageIOWxGimmick.cpp +++ b/src/creaImageIOWxGimmick.cpp @@ -19,7 +19,8 @@ #include #include -#include +#include +//#include using namespace crea; @@ -209,18 +210,6 @@ namespace creaImageIO - //================================================================ - class WxGimmickSettingsDialog : public wxDialog - { - public: - WxGimmickSettingsDialog(wxWindow *parent); - ~WxGimmickSettingsDialog(); - - - }; - //================================================================ - - @@ -345,9 +334,15 @@ namespace creaImageIO // Image sizer wxBoxSizer *isizer = new wxBoxSizer(wxHORIZONTAL ); mPanelImage->SetSizer( isizer ); - + + // Notebook + mwxNotebook = new wxNotebook(mSplitter2, + -1,wxDefaultPosition, wxDefaultSize, 0); + + + // Fields view (bottom) - mFieldsView = new WxGimmickFieldsView(mSplitter2,-1, + mFieldsView = new WxGimmickFieldsView(mwxNotebook,-1, wxDefaultPosition, wxDefaultSize,0); @@ -362,16 +357,20 @@ namespace creaImageIO GetSettings().BgColour(DicomNode::Series), GetSettings().Colour(DicomNode::Image), GetSettings().BgColour(DicomNode::Image)); + mwxNotebook->AddPage( mFieldsView, _T("Dicom fields")); - - + // Help + mHelp = new WxGimmickHelp(mwxNotebook); + mwxNotebook->AddPage( mHelp, _T("Help")); + + // Splitting int wsize = size.GetWidth(); int hsize = size.GetHeight(); int previewhsize = 150; int previewwsize = 400; mSplitter2->SetMinimumPaneSize( previewhsize ); - mSplitter2->SplitHorizontally( mPanelImage, mFieldsView, + mSplitter2->SplitHorizontally( mPanelImage, mwxNotebook, //mFieldsView, hsize - previewhsize); rsizer->Add( mSplitter2,1,wxGROW ,0); @@ -411,6 +410,16 @@ namespace creaImageIO ShowImage(mReader.GetImage("")); + // Show help if no collection + if (GetDicomDatabaseList().size()==0) + { + mwxNotebook->SetSelection(1); + } + else + { + mwxNotebook->SetSelection(0); + } + // mJustStarted = true; } //================================================================ @@ -908,9 +917,11 @@ namespace creaImageIO } } + if (GetDicomDatabaseList().size()==0) mFieldsView->UpdateFields(db); GetDicomDatabaseList().push_back(db); UpdateDicomDatabaseView(db); + } //================================================================ @@ -921,7 +932,8 @@ namespace creaImageIO wxBusyCursor busy; // std::cout << "WxGimmick : Reading config"< Loading collections from '"< Loading collections from '"< ERROR opening collection '"< File does not exist. It will be created on exit (if you already ran Gimmick! and exited normally, this is not normal. Send a bug report)."); } @@ -1298,8 +1310,9 @@ namespace creaImageIO } if (data->IsDicomNode()) { - /* + // LG : BUGGY + /* std::string str("&Remove "); str += data->GetDicomNode()->GetTypeName(); menu.Append(PopUp_Remove, std2wx(str)); @@ -1434,7 +1447,7 @@ namespace creaImageIO // Pop up menu callbacks void WxGimmick::OnPopUpAbout(wxCommandEvent& event) { - wxMessageBox( _T("Give me my medical images quick ! \n\n (c) CREATIS-LRMN 2008\n"), + wxMessageBox( _T("Give me my medical images quick ! \n\n (c) CREATIS-LRMN 2008\n laurent.guigues@creatis.insa-lyon.fr"), _T("Gimmick!"), wxOK | wxICON_INFORMATION, this); } @@ -1444,7 +1457,7 @@ namespace creaImageIO void WxGimmick::OnPopUpSettings(wxCommandEvent& event) { WxGimmickSettingsDialog* s = - new WxGimmickSettingsDialog(this); + new WxGimmickSettingsDialog(this,&mSettings); s->ShowModal(); delete s; } @@ -2149,6 +2162,14 @@ namespace creaImageIO void WxGimmick::OnInternalIdle() { ProcessImageEvents(); + /* + if (mJustStarted) + { + + mJustStarted = false; + } + */ + // } //================================================================ @@ -2754,10 +2775,19 @@ namespace creaImageIO } - - - - + //==================================================================== + void WxGimmick::ShowHelp() + { + /* + if (mHelpWindow==0) + { + mHelpWindow = new WxGimmickHelpWindow(this); + } + mHelpWindow->CenterOnParent(); + mHelpWindow->ShowModal(); + */ + } + //==================================================================== @@ -2939,38 +2969,7 @@ namespace creaImageIO - //================================================================ - //================================================================ - //================================================================ - //================================================================ - - //================================================================ - WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent) - : - wxDialog( parent, - -1, - _T("Settings"), - wxDefaultPosition, - wxSize(400,400), - wxRESIZE_BORDER | - wxSYSTEM_MENU | - wxCLOSE_BOX | - wxMAXIMIZE_BOX | - wxMINIMIZE_BOX | - wxCAPTION - ) - { - } - //================================================================ - - //================================================================ - WxGimmickSettingsDialog::~WxGimmickSettingsDialog() - { - } - //================================================================ - - - +