]> Creatis software - creaImageIO.git/blobdiff - src/creaImageIOWxGimmick.cpp
-------------------------------------------------------------
[creaImageIO.git] / src / creaImageIOWxGimmick.cpp
index 1acf88872f4d2abb91e1cb04ddbf861526247ef0..6a203a37d3d5bd05f5c92f5333d1829f38052259 100644 (file)
@@ -19,7 +19,8 @@
 #include <vtkCamera.h>
 #include <vtkRenderer.h>
 
-#include<wx/filefn.h>
+#include <wx/filefn.h>
+//#include <wx/tipwin.h>
 
 using namespace crea;
 
@@ -209,18 +210,6 @@ namespace creaImageIO
 
 
 
-  //================================================================
-  class WxGimmickSettingsDialog : public wxDialog
-  {
-  public:
-    WxGimmickSettingsDialog(wxWindow *parent);
-    ~WxGimmickSettingsDialog();
-    
-    
-  };
-  //================================================================
-
-
 
 
 
@@ -381,7 +370,7 @@ namespace creaImageIO
     rpanel->Layout(); 
   
     // previewer
-    mInteractor = new wxVTKRenderWindowInteractor(mPanelImage,-1);
+       mInteractor = new crea::creawxVTKRenderWindowInteractor(mPanelImage,-1);
     mInteractor->UseCaptureMouseOn();  
   
     mViewer    = vtkImageViewer2::New();
@@ -411,6 +400,7 @@ namespace creaImageIO
 
     ShowImage(mReader.GetImage(""));
 
+    mJustStarted = true;
   }
   //================================================================
     
@@ -859,6 +849,9 @@ namespace creaImageIO
        boost::filesystem::change_extension(filepath,GetDatabaseExtension());
        if ( boost::filesystem::exists(filepath) )
          {
+                 boost::filesystem::remove(filepath);  
+                         /* 
+                         LG : works on Linux but not Windows :
            if ( ! boost::filesystem::remove(filepath) )
              {
                wxMessageBox(_T("Could not overwrite ")
@@ -866,8 +859,10 @@ namespace creaImageIO
                             _T("Error"),
                             wxOK,this);
                return;
+               
        
              }
+                 */
          }
       }
     
@@ -1293,8 +1288,9 @@ namespace creaImageIO
          }
        if (data->IsDicomNode())
          {
-           /*
+           
            //      LG : BUGGY
+           /*
            std::string str("&Remove ");
            str += data->GetDicomNode()->GetTypeName();
            menu.Append(PopUp_Remove, std2wx(str));
@@ -1429,7 +1425,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);
   }
@@ -2144,6 +2140,16 @@ namespace creaImageIO
   void  WxGimmick::OnInternalIdle()
   {
     ProcessImageEvents();
+    if (mJustStarted)
+      {
+       // Show tip if no collection
+       if (GetDicomDatabaseList().size()==0)
+         {
+           ShowHelp();
+         }
+       mJustStarted = false;
+      }
+    //
   }
   //================================================================
  
@@ -2749,10 +2755,17 @@ namespace creaImageIO
     }
 
 
-
-
-
-
+    //====================================================================
+    void WxGimmick::ShowHelp()
+    {
+      if (mHelpWindow==0)
+       {
+         mHelpWindow = new WxGimmickHelpWindow(this);
+       }
+      mHelpWindow->CenterOnParent();
+      mHelpWindow->ShowModal();
+    }
+    //====================================================================
 
 
 
@@ -2934,38 +2947,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()
-               {
-               }
-             //================================================================
-
-    
-
+