]> Creatis software - creaImageIO.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Mon, 27 Oct 2008 10:56:58 +0000 (10:56 +0000)
committerguigues <guigues>
Mon, 27 Oct 2008 10:56:58 +0000 (10:56 +0000)
appli/TestWxGimmickDialog/main.cxx
src/creaImageIOWxGimmick.cpp
src/creaImageIOWxGimmick.h
src/creaImageIOWxGimmickSettings.cpp
src/creaImageIOWxGimmickSettings.h

index b0ad1da522ff609659b88967b8d3afc0680b2356..1b5b95019faf97550449b012b653e0b1fa680469 100644 (file)
@@ -29,7 +29,7 @@ bool myApp::OnInit( )
 
    creaImageIO::WxGimmickDialog w(0,
                                  -1,
-                                 _T("WxGimmickDialog test"),
+                                 _T("Select image(s)        - Gimmick! (c) CREATIS-LRMN 2008"),
                                  wxDefaultPosition,
                                  wxSize(1200,800),
                                  image_type,
index 6a203a37d3d5bd05f5c92f5333d1829f38052259..3e744982e179fec219f04c1b232bd2090b9310f1 100644 (file)
@@ -334,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);
 
@@ -351,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);
@@ -400,7 +410,16 @@ namespace creaImageIO
 
     ShowImage(mReader.GetImage(""));
 
-    mJustStarted = true;
+    // Show help if no collection
+    if (GetDicomDatabaseList().size()==0)
+      {
+       mwxNotebook->SetSelection(1);
+      } 
+    else
+      {
+       mwxNotebook->SetSelection(0);
+      }
+    //    mJustStarted = true;
   }
   //================================================================
     
@@ -898,9 +917,11 @@ namespace creaImageIO
          }
       }
 
+    if (GetDicomDatabaseList().size()==0) mFieldsView->UpdateFields(db);
     GetDicomDatabaseList().push_back(db);
     UpdateDicomDatabaseView(db);
 
+
   }
   //================================================================
 
@@ -1435,7 +1456,7 @@ namespace creaImageIO
   void  WxGimmick::OnPopUpSettings(wxCommandEvent& event)
   {
     WxGimmickSettingsDialog* s = 
-      new WxGimmickSettingsDialog(this);
+      new WxGimmickSettingsDialog(this,&mSettings);
     s->ShowModal();
     delete s;
   }
@@ -2140,15 +2161,13 @@ namespace creaImageIO
   void  WxGimmick::OnInternalIdle()
   {
     ProcessImageEvents();
+    /*
     if (mJustStarted)
       {
-       // Show tip if no collection
-       if (GetDicomDatabaseList().size()==0)
-         {
-           ShowHelp();
-         }
+
        mJustStarted = false;
-      }
+       }
+    */
     //
   }
   //================================================================
@@ -2758,12 +2777,14 @@ namespace creaImageIO
     //====================================================================
     void WxGimmick::ShowHelp()
     {
+      /*
       if (mHelpWindow==0)
        {
          mHelpWindow = new WxGimmickHelpWindow(this);
        }
       mHelpWindow->CenterOnParent();
       mHelpWindow->ShowModal();
+      */
     }
     //====================================================================
 
index aceaa5e5cb4b4e13fef081119c8a7676e9ad8d6e..9673b5cca0f4086415ff0857d705a68691f15f75 100644 (file)
@@ -6,10 +6,11 @@
 #include <creaImageIODicomDatabase.h>
 
 // wx
-#include "wx/wx.h"
-#include "wx/image.h"
-#include "wx/imaglist.h"
+#include <creaWx.h>
+#include <wx/image.h>
+#include <wx/imaglist.h>
 #include <wx/splitter.h>
+#include <wx/notebook.h>
 #include "treelistctrl.h"
 
 // dicom fields view panel
@@ -141,7 +142,7 @@ namespace creaImageIO
 
 
     // Help 
-    WxGimmickHelpWindow* mHelpWindow;
+    WxGimmickHelp* mHelp;
     bool mJustStarted;
 
     int  mFirstDicomDatabaseIconIndex;
@@ -155,6 +156,8 @@ namespace creaImageIO
 
     WxGimmickFieldsView* mFieldsView;
 
+    wxNotebook* mwxNotebook;
+
     wxSplitterWindow           *mSplitter1;
     wxSplitterWindow           *mSplitter2;
     
index eefd4f5de6b0e6a290ab91d66bc3fc0b3a5302aa..683ec5e7af2d01c1c86076fdc82b06bbd1d874fe 100644 (file)
@@ -188,7 +188,8 @@ namespace creaImageIO
   //================================================================
 
   //================================================================
-  WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent)
+  WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent,
+                                                  WxGimmickSettings* settings)
     : 
     wxDialog( parent, 
              -1, 
@@ -201,10 +202,13 @@ namespace creaImageIO
              wxMAXIMIZE_BOX | 
              wxMINIMIZE_BOX | 
              wxCAPTION  
-             )
+             ),
+    mSettings(settings)
   {
     wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
     
+    
+
     wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK|wxCANCEL);
     mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
     mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
@@ -229,9 +233,10 @@ namespace creaImageIO
   //================================================================
 
   //================================================================
-  WxGimmickHelpWindow::WxGimmickHelpWindow(wxWindow *parent)
+  WxGimmickHelp::WxGimmickHelp(wxWindow *parent)
     : 
-    wxDialog( parent, 
+    wxPanel( parent, -1)
+                             /*
              -1, 
              _T("Gimmick! Help"),
              wxDefaultPosition,
@@ -252,8 +257,9 @@ namespace creaImageIO
              
 
              )
+                             */
   {
-    SetBackgroundColour(*wxBLUE);
+    //    SetBackgroundColour(*wxBLUE);
 
     wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
     
@@ -276,30 +282,30 @@ namespace creaImageIO
                                    wxFONTWEIGHT_NORMAL,
                                    false);
     
-    wxTextAttr mwxInputTextAttr;
-    mwxInputTextAttr.SetFont(*FixedFont);
-    mwxInputTextAttr.SetBackgroundColour(*wxBLUE);
-    mwxInputTextAttr.SetTextColour(*wxWHITE);
-    mText->SetDefaultStyle(mwxInputTextAttr);
-    mText->SetBackgroundColour(*wxBLUE);
+    //    wxTextAttr mwxInputTextAttr;
+    //    mwxInputTextAttr.SetFont(*FixedFont);
+    //    mwxInputTextAttr.SetBackgroundColour(*wxBLUE);
+    //    mwxInputTextAttr.SetTextColour(*wxWHITE);
+    //    mText->SetDefaultStyle(mwxInputTextAttr);
+    //    mText->SetBackgroundColour(*wxBLUE);
 
     std::string tip("\n");
-    tip += "                          Welcome to Gimmick !\n\n";
-    tip += "                   ( Give me my medical images quick ! )\n\n\n";
-    tip += "  You do not have any image collection yet\n\n";
-    tip += "  To create one :\n";
+    tip += "           Welcome to Gimmick !\n";
+    tip += "    ( Give me my medical images quick ! )\n\n\n";
+    tip += "  To start you must create a 'Collection' :\n";
     tip += "     1) Right click on 'Collection'\n";
     tip += "     2) Select 'New collection'\n";
     tip += "     3) Enter the collection file name and the collection name\n\n";
     tip += "  To add images to your collection :\n";
     tip += "     1) Right click on your collection\n";
     tip += "     2) Select 'Add image(s) to collection'\n";
-    tip += "     3) Select 'Scan Directory' to add all images of a directory or\n";
-    tip += "        Select 'Select File(s)' to add only some selected images\n";
+    tip += "     3) Select :\n";
+    tip += "        * 'Scan Directory' to add all images of a directory or\n";
+    tip += "        * 'Select File(s)' to add only some selected images\n";
     tip += "     4) Select the directory or the files to add\n";
     tip += "\n\n";
-    tip += "  Remember then that *ALL* actions in Gimmick! are accessible\n";
-    tip += "  by right clicking on the elements of the view\n";
+    tip += "  Remember then that *ALL ACTIONS* in Gimmick!\n";
+    tip += "  are done by right clicking on the DICOM tree elements\n";
     tip += "\n";
     tip += "                                Enjoy!\n";
 
@@ -308,12 +314,12 @@ namespace creaImageIO
 
     sizer->Add(mText,1,wxGROW);
  
-
+    /*
     wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK);
     mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
-
+    
     sizer->Add ( bsizer, 0, wxGROW );
-
+    */
 
     SetSizer(sizer);
     SetAutoLayout(true);
@@ -325,7 +331,7 @@ namespace creaImageIO
   //================================================================
     
   //================================================================
-  WxGimmickHelpWindow::~WxGimmickHelpWindow()
+  WxGimmickHelp::~WxGimmickHelp()
   {
   }
   //================================================================
index 0fd2165f03e8e7cf642dc334e81c8396699134bb..19b970eec26efde9c57ac7e52ccc25508394bfc7 100644 (file)
@@ -86,9 +86,10 @@ namespace creaImageIO
   class WxGimmickSettingsDialog : public wxDialog
   {
   public:
-    WxGimmickSettingsDialog(wxWindow *parent);
+    WxGimmickSettingsDialog(wxWindow *parent,WxGimmickSettings* settings);
     ~WxGimmickSettingsDialog();
     
+    WxGimmickSettings* mSettings;
     wxButton* mOkButton;
     wxButton* mCancelButton;
   
@@ -97,11 +98,11 @@ namespace creaImageIO
 
 
   //================================================================
-  class WxGimmickHelpWindow : public wxDialog
+  class WxGimmickHelp : public wxPanel
   {
   public:
-    WxGimmickHelpWindow(wxWindow *parent);
-    ~WxGimmickHelpWindow();
+    WxGimmickHelp(wxWindow *parent);
+    ~WxGimmickHelp();
     
     wxTextCtrl* mText;
     wxButton* mOkButton;