]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxGUITextEditor.cxx
icons bbStudio
[bbtk.git] / kernel / src / bbtkWxGUITextEditor.cxx
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;
+                         
       }
   }
   //================================================================