]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxGimmickReaderDialog.cpp
No newline at end of file
[creaImageIO.git] / src2 / creaImageIOWxGimmickReaderDialog.cpp
index b04c27e9b36eb191825baa2a8f34bd0587d334a5..e7cd5b8a94691fc5fbc9388afa7ff387b23d7d63 100644 (file)
@@ -11,6 +11,7 @@ namespace creaImageIO
                                               const wxSize& size,
                                               int min_dim,
                                                   int max_dim,
+                                                  int output_dim,
                                               int threads)
  :   wxDialog( parent, 
                  id, 
@@ -35,7 +36,7 @@ namespace creaImageIO
       
       mGimmick = new Gimmick();
       mGimmick->Initialize();
-     
+    
       
       mView = new WxGimmickView(mGimmick,
                                this,
@@ -46,6 +47,9 @@ namespace creaImageIO
                                max_dim,
                                threads);
       mView->Initialize();
+          // Connect the AddProgress callback
+      mView->ConnectValidationObserver
+      ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) );
     }
     catch (crea::Exception e)
     {
@@ -74,30 +78,28 @@ namespace creaImageIO
                        <<std::endl);
     if (mView) 
       {
-       delete mView;
+               delete mView;
       }
     if (mGimmick) 
       {
        mGimmick->Finalize();
        delete mGimmick;
       }
+
   }
 
   ///Callback method on a selection
-  void WxGimmickReaderDialog::OnValid(wxCommandEvent& event)
+  void WxGimmickReaderDialog::OnValid(bool t)
   {
-          if (event.GetInt()==0)
-          {mOkButton->Enable(true);}
-          else
-          {mOkButton->Enable(false);}
+    mOkButton->Enable(t);
   }
 
 
-  
+
   //================================================================
-  BEGIN_EVENT_TABLE(WxGimmickReaderDialog, wxDialog)
-       EVT_COMMAND(wxID_ANY, 0, WxGimmickReaderDialog::OnValid) 
-  END_EVENT_TABLE()
+  //BEGIN_EVENT_TABLE(WxGimmickReaderDialog, wxDialog)
+  //END_EVENT_TABLE()
   //================================================================