]> Creatis software - creaImageIO.git/commitdiff
Added Status Bar
authorcaballero <caballero>
Wed, 25 Feb 2009 10:23:55 +0000 (10:23 +0000)
committercaballero <caballero>
Wed, 25 Feb 2009 10:23:55 +0000 (10:23 +0000)
src2/creaImageIOWxGimmickReaderDialog.cpp
src2/creaImageIOWxGimmickView.cpp
src2/creaImageIOWxGimmickView.h
src2/creaImageIOWxTreeView.cpp

index b04c27e9b36eb191825baa2a8f34bd0587d334a5..9d95315faf97b145b8155e2560e533dfa5679dc3 100644 (file)
@@ -86,6 +86,7 @@ namespace creaImageIO
   ///Callback method on a selection
   void WxGimmickReaderDialog::OnValid(wxCommandEvent& event)
   {
+         mView->SetMessage(event.GetString());
           if (event.GetInt()==0)
           {mOkButton->Enable(true);}
           else
index 99a007751758d8c6129b1fc7ce13280937b308f5..6f38c234655efc63f20e61160838873fc6e9669c 100644 (file)
@@ -107,10 +107,11 @@ namespace creaImageIO
 
     // Bottom panel 
     mBottomPanel = new wxPanel(mSplitter,-1);
-
+       mText = new wxStaticText(mBottomPanel, wxID_ANY, wxT("Status: Welcome to Gimmick!"));
+       
     // Splitting
     int hsize = size.GetHeight();
-    int bottom_minsize = 200;
+    int bottom_minsize = 20;
 
     mSplitter->SetMinimumPaneSize( bottom_minsize );
     mSplitter->SplitHorizontally( mNotebook, mBottomPanel, 
@@ -349,6 +350,14 @@ namespace creaImageIO
   }
   //=================================================
 
+  //=================================================
+  void WxGimmickView::SetMessage(wxString& mess)
+  {      
+    wxBusyCursor busy;
+       mText->SetLabel("Status: "+mess);
+   }
+  //=================================================
+
    //=================================================
   void WxGimmickView::OnRemove(wxCommandEvent& event)
   {
@@ -413,7 +422,7 @@ namespace creaImageIO
     EVT_TOOL(TOOL_ADDFILES_ID, WxGimmickView::OnAddFiles)
     EVT_TOOL(TOOL_ADDDIR_ID, WxGimmickView::OnAddDir)
        EVT_TOOL(TOOL_REMOVE_ID, WxGimmickView::OnRemove)
-    END_EVENT_TABLE()
+  END_EVENT_TABLE()
   //=================================================
 
 } // EO namespace creaImageIO
index ac816a07ea5ad162c45c3057fbb38a90dca7ccb2..250f5a8e5a43604d5ebe8997f59bdd90d547898a 100644 (file)
@@ -42,6 +42,8 @@ namespace creaImageIO
       /// Returns the selected Images so that they comply with the given parameter(4D)
       //(overloaded from GimmickView)
          void GetSelectedImages(std::vector<vtkImageData*>& s, int dim);
+         /// Sets the message state
+         void SetMessage(wxString& mess);
 
     protected:
       /// Creates the tool bar
@@ -63,6 +65,7 @@ namespace creaImageIO
 
       wxSplitterWindow* mSplitter;
       wxPanel*          mBottomPanel;
+         wxStaticText *    mText;
       wxNotebook*       mNotebook;
 
       /// The list of icons 
@@ -76,12 +79,13 @@ namespace creaImageIO
       void OnAddDir(wxCommandEvent& event);
          /// Callback for removing files
       void OnRemove(wxCommandEvent& event);
-      /// Display a message box with the last addition statistics
+         /// Display a message box with the last addition statistics
       void DisplayAddSummary();
 
 
       /// AddProgress Gimmick callback
       void OnAddProgress( Gimmick::AddProgress& );
+     
       /// Progress dialog
       wxProgressDialog* mProgressDialog;
          //The selection's maximum dimension
index 829549a2212feca51e2c8847897be80b15bde201..b4af0d9f6f502800c45ab1655a70ea977271ab75 100644 (file)
@@ -457,6 +457,7 @@ namespace creaImageIO
        int level=mLevelList.size();
        std::vector<tree::Node*> sel=GetSelected(level+1);
        bool valid=true;
+       std::string mess;
        if(sel.size()>0)
        {
                std::vector<tree::Node*>::iterator i;
@@ -464,6 +465,7 @@ namespace creaImageIO
                std::string col;
                std::string plane;
                
+               
                //Validation between image sizes
                for (i=sel.begin(); i!=sel.end() && valid; ++i)
                {
@@ -479,17 +481,12 @@ namespace creaImageIO
                                        ((*i)->GetAttribute(mLevelList[level-1].key[2]))!=col ||
                                        ((*i)->GetAttribute(mLevelList[level-1].key[3]))!=plane)
                                        {
+                                               mess="The selected images are not compatible.";
                                                valid=false;
                                        }
                        }
                }
 
-               GimmickMessage(1,
-                       "State check: Planes:" 
-                       <<plane<<" Cols: "
-                       <<col<<" Rows:"
-                               <<row<<" "
-                               << std::endl);
                //Dimention validation
                //Compatibility with maximum 
                        if(valid)
@@ -516,37 +513,38 @@ namespace creaImageIO
                            
                                if (dim == 0) 
                                {
-                               GimmickMessage(1,
-                                       "Unknown image dimension : cannot select !" 
-                                       <<dim<<" "
-                                       <<plane<<" "
-                                       <<col<<" "
-                                       <<row<<" "
-                                       << std::endl);
+                                       mess="Unknown image dimension : cannot select !";
                                        valid= false;
                                }
                                else if (dim>GetMaxDimension())
                                {
-                                       GimmickMessage(1,"Selecting "<<dim<<"D images is not allowed !" 
-                                       << std::endl);
+                                       mess="Selecting ";
+                                       mess+=dim;
+                                       mess+="D images is not allowed !";
                                        valid= false;
                                }
                                if ( dim == GetMaxDimension() )
                                {
-                                       GimmickMessage(1,"Cannot add this image to selection : would result in a "
-                                                                       <<dim+1<<"D image !" << std::endl);
+                                       mess="Cannot add this image to selection : would result in a ";
+                                       mess+=(dim+1);
+                                       mess+="D image!";
+                                       
                                        valid= false;
                                }
                                if ( dim < GetMinDimension() && sel.size()<2 )
                                {
-                                       GimmickMessage(1,"Cannot build the selection as it would result in a "
-                                                                       <<dim<<"D image, and the minimum is"<<GetMinDimension()<<"D!" << std::endl);
+                                       mess="Cannot build the selection as it would result in a ";
+                                       mess+=dim;
+                                       mess+="D image, and the minimum is ";
+                                       mess+=GetMinDimension();
+                                       mess+="D!";
                                        valid= false;
                                }
                        }
          }
        else
        {
+               mess="Cannot have 0 images selected";
                GimmickMessage(1,"Cannot have 0 images selected"<< std::endl);
                valid=false;
        }
@@ -555,9 +553,13 @@ namespace creaImageIO
                wxCommandEvent event( 0, GetId() );
                event.SetEventObject( this );
                if(valid)
-               {event.SetInt(0);}
+               {
+                       mess="Selection OK !";
+                       event.SetInt(0);
+               }
                else
                {event.SetInt(1);}
+               event.SetString(wxT(mess));
                GetEventHandler()->ProcessEvent( event );