]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxConsole.h
Created a bbs editor : bbed
[bbtk.git] / kernel / src / bbtkWxConsole.h
index 5de4ea9d4eef5562f2c593b97d58e6aacd3c0ad3..87abef3e8df164c70445683c8f0237dc6eab4121 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.h,v $
   Language:  C++
-  Date:      $Date: 2008/01/22 15:02:00 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/03/18 12:51:26 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -36,7 +36,7 @@
 #ifndef __bbtkWxConsole_h__
 #define __bbtkWxConsole_h__
 
-
+#include <wx/aui/aui.h>
 #include "bbtkWx.h"
 #include <wx/notebook.h>
 #include <wx/html/htmlwin.h>
@@ -48,7 +48,7 @@
 namespace bbtk
 {
 
-  class WxTextCtrlStreamRedirector;
+  class WxStreamRedirector;
 
   /// A console in which user can enter commands
   class BBTK_EXPORT WxConsole : public wxFrame
@@ -57,7 +57,14 @@ namespace bbtk
     WxConsole( wxWindow *parent, wxString title, wxSize size);
     ~WxConsole();
 
-    static WxConsole* GetInstance() { return mInstance; }
+    //    static WxConsole* GetInstance() { return mInstance; }
+    
+    /// Returns the Interpreter used 
+    /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT 
+    /// (DIFFERENT WORKSPACES)
+    Interpreter* GetInterpreter() { return mInterpreter; }
+    /// Returns the Interpreter used (const)
+    const Interpreter* GetInterpreter() const { return mInterpreter; }
 
     /// Sets the inputs of the workspace : 
     /// the map is passed as is to the Executer
@@ -68,39 +75,67 @@ namespace bbtk
     /// which creates but does not execute pipelines.
     void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
 
-    void SetDialogMode(Interpreter::DialogModeType t) { mInterpreter->SetDialogMode(t); }
+    void SetDialogMode(Interpreter::DialogModeType t) 
+    { mInterpreter->SetDialogMode(t); }
     
     /// Runs the interpretation of a file
-    void InterpretFile( const std::string& filename, bool use_configuration_file = true
-    { mInterpreter->InterpretFile(filename,use_configuration_file, false); }
+    void InterpretFile( const std::string& filename) 
+    { mInterpreter->InterpretFile(filename); }
 
     void OnMenuQuit(wxCommandEvent& event);
     void OnMenuAbout(wxCommandEvent& event);
+    void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
+    void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
+    void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
+    void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
+    void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
+   
+    void OnBtnGo(wxCommandEvent& event);
     void OnCommandEnter(wxCommandEvent& event);
     void OnCommandChar(wxCommandEvent& event);
 
+    void OnBtnInclude(wxCommandEvent& event);
+    void OnBtnReset(wxCommandEvent& event);
+    void OnBtnConfig(wxCommandEvent& event);
+    void OnBtnGraphS(wxCommandEvent& event);
+    void OnBtnGraphD(wxCommandEvent& event);
+    void OnBtnHelp(wxCommandEvent& event);
+    
+    
     void ShowHtmlPage(std::string&);
 
   private:
+       wxAuiManager m_mgr;
     Interpreter* mInterpreter;
     wxTextCtrl* mwxTextHistory;
-    wxTextCtrl* mwxTextCommand;
+//EED    wxTextCtrl* mwxTextCommand;
+    wxComboBox* mwxTextCommand;
     wxTextAttr* mwxTextHistoryAttr;
     wxTextAttr* mwxTextCommandAttr;
-    wxNotebook* mwxNotebook;
+//EED    wxNotebook* mwxNotebook;
+   wxAuiNotebook* mwxNotebook;
     wxPanel *mwxPageCommand, *mwxPageHelp;
-    WxTextCtrlStreamRedirector* mRedirect_cout;
-    WxTextCtrlStreamRedirector* mRedirect_cerr;
-
+    WxStreamRedirector* mRedirect_cout;
+    WxStreamRedirector* mRedirect_cerr;
     WxBrowser* mwxHtmlWindow;
-
-    static WxConsole* mInstance;
+    // static WxConsole* mInstance;
+    
+    wxPanel*   CreateBtnsCtrlPanel(wxWindow *parent);
+    void               CommandString(wxString line );
   public:
          
      enum
     {
       ID_Menu_Quit = 1,
       ID_Menu_About,
+      ID_Menu_EditConfig,
+      ID_Menu_CreatePackage,
+      ID_Menu_CreateBlackBox,
+      ID_Menu_ShowImageGraph,
+      ID_Menu_CreateIndex,
+      ID_Text_Command,
+      ID_Text_History,
+
     };
     
     DECLARE_EVENT_TABLE()