X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOWxGimmickReaderDialog.cpp;h=82c728d8f15d596a812c086e3b217c0a411be1ec;hb=011c2f926836abae60e9a525f819f9a66f03fac1;hp=fe84eff3fbbd18d570b93375ddc5db6e17ede9e1;hpb=a67d921cdc10d438852b48c2985f14d91320e016;p=creaImageIO.git diff --git a/src2/creaImageIOWxGimmickReaderDialog.cpp b/src2/creaImageIOWxGimmickReaderDialog.cpp index fe84eff..82c728d 100644 --- a/src2/creaImageIOWxGimmickReaderDialog.cpp +++ b/src2/creaImageIOWxGimmickReaderDialog.cpp @@ -1,44 +1,52 @@ #include #include +#include +#ifdef _DEBUG +#define new DEBUG_NEW +#endif +#ifdef _RELWITHDEBINFO +#define new DEBUG_NEW +#endif namespace creaImageIO { // CTor WxGimmickReaderDialog::WxGimmickReaderDialog(wxWindow *parent, wxWindowID id, + const std::string i_namedescp, + const std::string i_namedb, wxString title, const wxPoint& pos, const wxSize& size, int min_dim, - int max_dim, - int output_dim, + int max_dim, + int output_dim, // never used ?!? // JPR int threads) - : wxDialog( parent, + : wxDialog( parent, id, title, pos, size, wxRESIZE_BORDER | - wxSYSTEM_MENU | - wxCLOSE_BOX | - wxMAXIMIZE_BOX | - wxMINIMIZE_BOX | + wxSYSTEM_MENU | + wxCLOSE_BOX | + wxMAXIMIZE_BOX | + wxMINIMIZE_BOX | wxCAPTION ), - mGimmick(0), + // mGimmick(0), mView(0) { GimmickDebugMessage(1,"WxGimmickReaderDialog::WxGimmickReaderDialog" <Initialize(); - - + + mGimmick = boost::shared_ptr(new Gimmick()); + mGimmick->Initialize(i_namedescp,i_namedb); + mView = new WxGimmickView(mGimmick, this, TVID, @@ -50,7 +58,7 @@ namespace creaImageIO mView->Initialize(); // Connect the AddProgress callback mView->ConnectValidationObserver - ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) ); + ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) ); } catch (crea::Exception e) { @@ -60,15 +68,20 @@ namespace creaImageIO topsizer->Add( mView,1,wxGROW,0); - wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK|wxCANCEL); - mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this); - mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this); - + wxSizer* bsizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL); + /*mOkButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(170,50)); + mCancelButton = new wxButton(this, wxID_CANCEL, _T("CANCEL"), wxPoint(210,50)); + */ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this); + mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this); + mOkButton->Enable(false); - topsizer->Add ( bsizer, 0, wxGROW ); +topsizer->Add(mOkButton, 0, wxGROW); +topsizer->Add(mCancelButton, 0, wxGROW); + topsizer->Add ( bsizer, 0, wxGROW ); SetSizer( topsizer ); + Layout(); } @@ -79,14 +92,12 @@ namespace creaImageIO <Finalize(); - delete mGimmick; + mGimmick->Finalize(); } - } ///Callback method on a selection @@ -95,15 +106,10 @@ namespace creaImageIO mOkButton->Enable(t); } - - - //================================================================ //BEGIN_EVENT_TABLE(WxGimmickReaderDialog, wxDialog) //END_EVENT_TABLE() //================================================================ - } // EO namespace creaImageIO -