]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxGUITextEditor.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkWxGUITextEditor.h
index 0f08e15c7b09d2c5aa3ee2bb5e3fce3fa3c06325..e4dd052a77b3d64df7e27f0916f0bbf656438a87 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.h,v $
   Language:  C++
-  Date:      $Date: 2008/03/21 14:59:39 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/10/03 14:27:52 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -49,7 +49,8 @@ namespace bbtk
 {
 
   class WxTextCtrlGettingKeyEvents;
-  class WxGUITextEditor;
+//   typedef wxTextCtrl WxTextCtrlGettingKeyEvents;
+       class WxGUITextEditor;
  
 
   /// Abstract class which defines the callbacks invoked by WxGUITextEditor
@@ -57,7 +58,7 @@ namespace bbtk
   {
   public:
     WxGUITextEditorUser() {}
-    ~WxGUITextEditorUser() {}
+    virtual ~WxGUITextEditorUser() {}
     /// Callback invoked when the 'run' button is pressed
     virtual void WxGUITextEditorRun() {}
   };
@@ -73,6 +74,7 @@ namespace bbtk
     const std::string& GetPageName() const { return mName; }
 
     bool AskFilename() const { return mAskFilename; }
+    void SetAskFilename(bool a) { mAskFilename=a; }
 
     WxTextCtrlGettingKeyEvents* GetTextCtrl() { return mwxInputText; }
 
@@ -113,17 +115,17 @@ namespace bbtk
     void OnKeyDown(wxKeyEvent& event);
     void OnKeyUp(wxKeyEvent& event);
 
-    void OnButtonNew(wxCommandEvent& event);
-    void OnButtonOpen(wxCommandEvent& event);
-    void OnButtonSave(wxCommandEvent& event);
-    void OnButtonRun(wxCommandEvent& event);
-    //    void OnButtonQuit(wxCommandEvent& event);
+    void OnToolLeftClick(wxCommandEvent& event);
+    void OnToolRightClick(wxCommandEvent& event);
+
     void OnPageClose(wxAuiNotebookEvent& evt);
 
     void New();
     void Open();
     void Open(const std::string& filename);
-    void Save();
+    void SaveCurrentPage();
+    bool CloseCurrentPage();
+    bool CloseAllPages();
     //   void Run();
     //    void Quit();
 
@@ -140,17 +142,12 @@ namespace bbtk
   private:
     WxGUITextEditorUser* mUser;
 
-    wxAuiManager m_mgr;
-    wxAuiNotebook* mwxNotebook;
+//    wxAuiManager m_mgr;
+//    wxAuiNotebook*
+       wxNotebook* mwxNotebook;
  
-    //   Interpreter* mInterpreter;
-    //    wxSplitterWindow* mwxSplit;
-
-    wxButton *  mwxButtonNew; 
-    wxButton *  mwxButtonOpen; 
-    wxButton *  mwxButtonSave; 
-    wxButton *  mwxButtonRun; 
-    //    wxButton *  mwxButtonQuit; 
+    wxToolBar* mwxToolBar;
+
     wxStaticText* mwxPosition;
 
     std::string mFileNameFilter;
@@ -161,7 +158,9 @@ namespace bbtk
     {
       ID_ButtonNew,
       ID_ButtonOpen,
+      ID_ButtonClose,
       ID_ButtonSave,
+      ID_ButtonSaveAs,
       ID_ButtonRun
       //      ID_ButtonQuit
     };