/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbtkWxEditor.h,v $
+ Module: $RCSfile: bbtkWxGUITextEditor.h,v $
Language: C++
- Date: $Date: 2008/03/20 09:51:29 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/03/21 11:46:41 $
+ Version: $Revision: 1.1 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifdef _USE_WXWIDGETS_
-#ifndef __bbtkWxEditor_h__
-#define __bbtkWxEditor_h__
+#ifndef __bbtkWxGUITextEditor_h__
+#define __bbtkWxGUITextEditor_h__
#include "bbtkWx.h"
#include "bbtkInterpreter.h"
#include <wx/splitter.h>
+#include <wx/aui/aui.h>
#include "bbtkWxGUICommand.h"
namespace bbtk
{
- class WxStreamRedirector;
class WxTextCtrlGettingKeyEvents;
+ class WxGUITextEditorPage;
/// A bbs editor panel
- class BBTK_EXPORT WxEditor : public wxPanel
+ class BBTK_EXPORT WxGUITextEditor : public wxPanel
{
public:
- WxEditor( wxWindow *parent );
- ~WxEditor();
+ WxGUITextEditor( wxWindow *parent );
+ ~WxGUITextEditor();
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 OnButtonRun(wxCommandEvent& event);
+ // void OnButtonQuit(wxCommandEvent& event);
+ void OnPageClose(wxAuiNotebookEvent& evt);
void New();
void Open();
void Open(const std::string& filename);
- bool AskSave();
void Save();
- void Run();
- void Quit();
+ // void Run();
+ // void Quit();
void HighlightSyntax();
- void UpdatePosition();
+ void UpdateInfo();
+ void NewPage(const std::string& filename);
+ WxGUITextEditorPage* GetCurrentPage();
+ void FocusOnCurrentPage();
+
+ void SetFileNameFilter(const std::string& filter)
+ { mFileNameFilter = filter; }
private:
- Interpreter* mInterpreter;
- wxSplitterWindow* mwxSplit;
- WxTextCtrlGettingKeyEvents* mwxInputText;
- wxTextAttr* mwxInputTextAttr;
- WxTextCtrlGettingKeyEvents* mwxOutputText;
- wxTextAttr* mwxOutputTextAttr;
+ wxAuiManager m_mgr;
+ wxAuiNotebook* mwxNotebook;
+
+ // Interpreter* mInterpreter;
+ // wxSplitterWindow* mwxSplit;
+
wxButton * mwxButtonNew;
wxButton * mwxButtonOpen;
wxButton * mwxButtonSave;
- wxButton * mwxButtonRun;
- wxButton * mwxButtonQuit;
+ // wxButton * mwxButtonRun;
+ // wxButton * mwxButtonQuit;
wxStaticText* mwxPosition;
- WxStreamRedirector* mRedirect_cout;
- WxStreamRedirector* mRedirect_cerr;
+
+ std::string mFileNameFilter;
+
public:
enum
{
- ID_InputText,
- ID_OutputText,
ID_ButtonNew,
ID_ButtonOpen,
- ID_ButtonSave,
- ID_ButtonRun,
- ID_ButtonQuit
+ ID_ButtonSave
+ // ID_ButtonRun,
+ // ID_ButtonQuit
};
DECLARE_EVENT_TABLE()
};
-
+
/// Editor in a frame
- class BBTK_EXPORT WxEditorWindow : public wxFrame, public WxGUICommandUser
+ class BBTK_EXPORT WxGUITextEditorWindow : public wxFrame
+ //, public WxGUICommandUser
{
public:
- WxEditorWindow( wxWindow *parent, wxString title, wxSize size);
- ~WxEditorWindow();
+ WxGUITextEditorWindow( wxWindow *parent, wxString title, wxSize size);
+ ~WxGUITextEditorWindow();
void Open(const std::string& filename) { mEditor->Open(filename); }
- void WxGUICommandEnter(const std::string& s);
+ // void WxGUICommandEnter(const std::string& s);
private :
- WxEditor* mEditor;
+ WxGUITextEditor* mEditor;
};
+
} // namespace bbtk
-#endif // __bbtkWxEditor_h__
+#endif // __bbtkWxGUITextEditor_h__
#endif //_USE_WXWIDGETS_