]> Creatis software - bbtk.git/commitdiff
icons bbStudio
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 15 Apr 2009 15:45:04 +0000 (15:45 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 15 Apr 2009 15:45:04 +0000 (15:45 +0000)
kernel/data/icons/wxart_graphdetail.xpm [new file with mode: 0644]
kernel/data/icons/wxart_graphsimple.xpm [new file with mode: 0644]
kernel/data/icons/wxart_run.xpm [new file with mode: 0644]
kernel/data/icons/wxart_runbbi.xpm [new file with mode: 0644]
kernel/src/bbtkWxGUIScriptingInterface.cxx
kernel/src/bbtkWxGUIScriptingInterface.h
kernel/src/bbtkWxGUITextEditor.cxx
kernel/src/bbtkWxGUITextEditor.h
packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx
packages/wx/src/bbwxLayoutSplit.cxx
packages/wxvtk/src/bbwxvtkViewer3D.cxx

diff --git a/kernel/data/icons/wxart_graphdetail.xpm b/kernel/data/icons/wxart_graphdetail.xpm
new file mode 100644 (file)
index 0000000..a84c29a
--- /dev/null
@@ -0,0 +1,21 @@
+/* XPM */
+static const char * wxart_graphdetail_xpm[] = {
+"16 15 3 1",
+"      c None",
+".     c #000000",
+"+     c #FFFFFF",
+"                ",
+"......    ......",
+".++++.    .++++.",
+".+..+......++++.",
+".++++.    .+..+.",
+".+..+.    .++++.",
+".++++......+..+.",
+".+..+.    .++++.",
+".++++.    .+..+.",
+".++++......++++.",
+"......    .+..+.",
+"          .++++.",
+"          ......",
+"                ",
+"                "};
diff --git a/kernel/data/icons/wxart_graphsimple.xpm b/kernel/data/icons/wxart_graphsimple.xpm
new file mode 100644 (file)
index 0000000..b887d75
--- /dev/null
@@ -0,0 +1,21 @@
+/* XPM */
+static const char * wxart_graphsimple_xpm[] = {
+"16 15 3 1",
+"      c None",
+".     c #000000",
+"+     c #FFFFFF",
+"                ",
+"                ",
+"  .....         ",
+"  .+++...       ",
+"  .+++. ...     ",
+"  .....   .     ",
+"          .     ",
+"        .....   ",
+"        .+++.   ",
+"        .+++.   ",
+"        .....   ",
+"                ",
+"                ",
+"                ",
+"                "};
diff --git a/kernel/data/icons/wxart_run.xpm b/kernel/data/icons/wxart_run.xpm
new file mode 100644 (file)
index 0000000..86155d0
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static const char * wxart_run_xpm[] = {
+"15 16 3 1",
+"      c None",
+".     c #000000",
+"+     c #FFFFFF",
+"               ",
+"               ",
+"        .      ",
+"        ..     ",
+"        .+.    ",
+" ........++.   ",
+" .++++++++++.  ",
+" .+++++++++++. ",
+" .+++++++++++. ",
+" .++++++++++.  ",
+" ........++.   ",
+"        .+.    ",
+"        ..     ",
+"        .      ",
+"               ",
+"               "};
diff --git a/kernel/data/icons/wxart_runbbi.xpm b/kernel/data/icons/wxart_runbbi.xpm
new file mode 100644 (file)
index 0000000..22a7839
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static const char * wxart_runbbi_xpm[] = {
+"15 16 3 1",
+"      c None",
+".     c #000000",
+"+     c #FF1B1B",
+"               ",
+"               ",
+"        .      ",
+"        ..     ",
+"        .+.    ",
+" ........++.   ",
+" .++++++++++.  ",
+" .+++++++++++. ",
+" .+++++++++++. ",
+" .++++++++++.  ",
+" ........++.   ",
+"        .+.    ",
+".   .   ..  .  ",
+"... ... .      ",
+". . . .     .  ",
+"... ...     .  "};
index f06b07eced988fe2dac3cc031f485b96e31f7fcb..4cb10db79bff0daccd28c7af3ba31cf30e133286 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/30 15:22:51 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2009/04/15 15:45:49 $
+  Version:   $Revision: 1.37 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -390,6 +390,52 @@ namespace bbtk
   }
   //================================================================
  
+       
+  //================================================================
+       void WxGUIScriptingInterface::WxGUITextEditorGraphSimple()
+       {
+               WxGUICommandEnter("exec freeze_no_error");
+               WxGUITextEditorRun();
+               WxGUICommandEnter("exec unfreeze");
+               WxGUICommandEnter("graph");
+       }
+  //================================================================
+       
+       //================================================================
+       void WxGUIScriptingInterface::WxGUITextEditorGraphDetail()
+       {
+               WxGUICommandEnter("exec freeze_no_error");
+               WxGUITextEditorRun();
+               WxGUICommandEnter("exec unfreeze");
+               WxGUICommandEnter("graph . 1");
+       }
+       //================================================================
+
+       
+       //================================================================
+       void WxGUIScriptingInterface::WxGUITextEditorRunBBI()
+       {
+         std::string separator = ConfigurationFile::GetInstance().Get_file_separator ();
+         std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
+         std::string filename = dir + separator + "tmp_bbtk.bbs";
+         mWxGUITextEditor->GetCurrentPage()->SaveFile(filename);
+       
+               std::string command = "\"";
+         command += ConfigurationFile::GetInstance().Get_bin_path();
+#ifdef MACOSX
+         command += separator + "bbi.app/Contents/MacOS/bbi\" ";
+#else 
+         command += separator + "bbi\" ";
+#endif
+         command += "\""+filename + "\"";
+         command += " & ";
+         
+         printf ("EED WxGUIScriptingInterface::WxGUITextEditorRunBBI %s \n" , command.c_str() );
+         system( command.c_str() );
+       }
+       //================================================================
+       
+       
   //================================================================
   void WxGUIScriptingInterface::WxGUITextEditorRun()
   {
@@ -572,7 +618,6 @@ namespace bbtk
        command += " " + pack + " -q";
     bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
 
-printf("EED WxGUIScriptingInterface::DoRegeneratePackageDoc %s",  command.c_str());      
 
     if ( ! system ( command.c_str() ) )
       {
index eae05453b058be794984701f0d86c2d1a7233fd4..8282731634991525f498237a062b0eb99fe932ac 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.h,v $
   Language:  C++
-  Date:      $Date: 2008/12/15 09:04:47 $
-  Version:   $Revision: 1.15 $
+  Date:      $Date: 2009/04/15 15:45:49 $
+  Version:   $Revision: 1.16 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -137,7 +137,10 @@ namespace bbtk
 
     // WxGUITextEditor callbacks
     void WxGUITextEditorRun();
-    
+       void WxGUITextEditorRunBBI();
+       void WxGUITextEditorGraphSimple();
+       void WxGUITextEditorGraphDetail();
+         
     // WxGUIHtmlBrowser callbacks
     bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target);
 
index 5f065ff9f4ff859f66bce3e46149ec806d233116..f970ec74f0241c584d61a00a19730804d99b2400 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:15 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2009/04/15 15:45:49 $
+  Version:   $Revision: 1.19 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
 #include "../data/icons/wxart_filesaveas.xpm"
 //#include "../data/icons/wxart_exefile.xpm"
 //#include "../data/icons/wxart_delete.xpm"
-#include "../data/icons/wxart_down.xpm"
+//#include "../data/icons/wxart_down.xpm"
+#include "../data/icons/wxart_run.xpm"
+#include "../data/icons/wxart_runbbi.xpm"
+#include "../data/icons/wxart_graphsimple.xpm"
+#include "../data/icons/wxart_graphdetail.xpm"
 #include "../data/icons/wxart_eldel.xpm"
 
 namespace bbtk
@@ -235,22 +239,21 @@ namespace bbtk
          } 
       }
     //    std::cout << "file [" << mName << "]" <<std::endl;
-    mwxInputText->SaveFile(std2wx(mName));
+//    mwxInputText->SaveFile(std2wx(mName));
+       SaveFile(mName);
     mwxInputText->SetModified(false);
   }
   //================================================================
   
 
-
-
-
-
-
-
-
-
-
-
+       //================================================================
+       void WxGUITextEditorPage::SaveFile(const std::string& filename)
+       {
+               mwxInputText->SaveFile( std2wx(filename) );
+       }
+       //================================================================
+       
+       
 
 
 
@@ -331,7 +334,10 @@ namespace bbtk
     wxBitmap bmp_close(eldel_xpm);
     wxBitmap bmp_save(filesave_xpm);
     wxBitmap bmp_saveas(filesaveas_xpm);
-    wxBitmap bmp_run(down_xpm);
+    wxBitmap bmp_run(wxart_run_xpm);
+    wxBitmap bmp_runbbi(wxart_runbbi_xpm);
+    wxBitmap bmp_graphsimple(wxart_graphsimple_xpm);
+       wxBitmap bmp_graphdetail(wxart_graphdetail_xpm);
 
     mwxToolBar = new wxToolBar(this, wxID_ANY, 
                               wxDefaultPosition, wxDefaultSize,
@@ -355,7 +361,22 @@ namespace bbtk
     mwxToolBar->AddTool(ID_ButtonRun, _T("Run"),
                      bmp_run, wxNullBitmap, wxITEM_NORMAL,
                      _T("Run file"), _T("Run current file"));
+
+         
+       mwxToolBar->AddTool(ID_ButtonGraphSimple, _T("Graph (simple)"),
+                                                 bmp_graphsimple, wxNullBitmap, wxITEM_NORMAL,
+                                                 _T("Graph simple"), _T("Simple graph of actual script"));
+
+       mwxToolBar->AddTool(ID_ButtonGraphDetail, _T("Graph (detail)"),
+                                                 bmp_graphdetail, wxNullBitmap, wxITEM_NORMAL,
+                                                 _T("Graph (detail)"), _T("Detail graph of actual script"));
+         
+       mwxToolBar->AddTool(ID_ButtonRunBBI, _T("Run external bbi "),
+                                                 bmp_runbbi, wxNullBitmap, wxITEM_NORMAL,
+                                                 _T("Run external bbi"), _T("Run external bbi"));
+         
+         
+         
     mwxToolBar->AddSeparator();
     mwxPosition = new wxStaticText ( mwxToolBar, -1, _T(""));
     mwxToolBar->AddControl(mwxPosition);
@@ -454,10 +475,29 @@ namespace bbtk
        SaveCurrentPage();
        break;
       case ID_ButtonRun :
-       if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) 
+       if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) 
          mUser->WxGUITextEditorRun();
        FocusOnCurrentPage();
        break;
+                         
+                 case ID_ButtonGraphSimple :
+                         if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) 
+                                 mUser->WxGUITextEditorGraphSimple();
+                         FocusOnCurrentPage();
+                         break;
+
+                 case ID_ButtonGraphDetail :
+                         if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) 
+                                 mUser->WxGUITextEditorGraphDetail();
+                         FocusOnCurrentPage();
+                         break;
+                         
+                 case ID_ButtonRunBBI :
+                         if ((mUser!=0) && (mwxNotebook->GetPageCount()>0)) 
+                                 mUser->WxGUITextEditorRunBBI();
+                         FocusOnCurrentPage();
+                         break;
+                         
       }
   }
   //================================================================  
index 77eac316e7f68b660a99be8e090bf8b5063721d4..166a46f02743f58412abb7badaa90ec127da8699 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.h,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:15 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2009/04/15 15:45:50 $
+  Version:   $Revision: 1.9 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -76,6 +76,10 @@ namespace bbtk
     virtual ~WxGUITextEditorUser() {}
     /// Callback invoked when the 'run' button is pressed
     virtual void WxGUITextEditorRun() {}
+    virtual void WxGUITextEditorRunBBI() {} 
+       virtual void WxGUITextEditorGraphSimple() {}
+       virtual void WxGUITextEditorGraphDetail() {}
+         
   };
 
   //================================================================
@@ -95,7 +99,9 @@ namespace bbtk
 
     void Load(const std::string& filename);
     void Save(const std::string& filter);
+       void SaveFile(const std::string& filename);
 
+         
     bool IsModified(); //{ return mwxInputText->IsModified(); }
    
     std::string GetText();
@@ -176,7 +182,10 @@ namespace bbtk
       ID_ButtonClose,
       ID_ButtonSave,
       ID_ButtonSaveAs,
-      ID_ButtonRun
+      ID_ButtonRun,
+         ID_ButtonRunBBI,
+         ID_ButtonGraphSimple,
+         ID_ButtonGraphDetail
       //      ID_ButtonQuit
     };
     
index ba4cb8c7e0f9583b1ae7a3765a2ab5954fcdc43b..a5dbdc15cd57de04b42e0408ca92bb0087a761d6 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkIsoSurfaceExtractor.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/23 12:55:52 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2009/04/15 15:45:52 $
+  Version:   $Revision: 1.12 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -94,7 +94,6 @@ namespace bbvtk
 
    void IsoSurfaceExtractor::DoProcess()
    {
-printf("EED IsoSurfaceExtractor::DoProcess() 0\n"); 
      marchingcubes->SetInput( bbGetInputIn() );
      marchingcubes->SetValue(0,  bbGetInputIsovalue() );
      marchingcubes->Update();
index 45e3ea58e3d46bf8b00e78b9a42b024c7117385b..642708530e1a2ac8e9fe9f810447d11f1f294fda 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxLayoutSplit.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/12 12:56:33 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2009/04/15 15:45:55 $
+  Version:   $Revision: 1.10 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -68,6 +68,7 @@ namespace bbwx
                                               wxSP_3D |
                                               wxSP_LIVE_UPDATE );
     w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+       w->SetMinimumPaneSize(2);
 /*
          wxWindow* w1 = bbGetInputWidget1();
     wxWindow* w2 = bbGetInputWidget2();
index fe71dd7b82cc961c5d2dd0da1e7e232703c3357d..056e4961e87ae3ddf85861c1a80cf0a9d10bcaff 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxvtkViewer3D.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/23 12:55:54 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2009/04/15 15:45:57 $
+  Version:   $Revision: 1.15 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -154,7 +154,6 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect )
 
   void Viewer3D::Process() 
   { 
-         printf("EED Viewer3D::Process() 0\n"); 
          
 //EED    
 //       Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
@@ -165,7 +164,6 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect )
     Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
          if ((firsttime==true) && (w!=NULL)){ 
                  firsttime=false;
-                 printf("EED Viewer3D::Process() 1\n"); 
                  
                  vtkRenderWindowInteractor *interactor = w->GetInteractor();
                  if (interactor!=NULL)
@@ -230,7 +228,6 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect )
    */ 
   void Viewer3D::CreateWidget(wxWindow* parent)
   {
-         printf("EED Viewer3D::CreateWidget() 0\n"); 
  
     bbtkDebugMessageInc("Core",9,"Viewer3D::CreateWidget()"<<std::endl);
 
@@ -250,7 +247,6 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect )
   // when window is shown
   void  Viewer3D::OnShowWidget()
   {
-          printf("EED Viewer3D::OnShowWidget() 0\n"); 
          
        //    Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
     //    if (w) w->Update();