/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxConsole.h,v $ Language: C++ Date: $Date: 2008/01/22 15:02:00 $ Version: $Revision: 1.1.1.1 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*//** * \brief Short description in one line * * Long description which * can span multiple lines */ /** * \file * \brief */ /** * \class bbtk:: * \brief */ #ifdef _USE_WXWIDGETS_ #ifndef __bbtkWxConsole_h__ #define __bbtkWxConsole_h__ #include "bbtkWx.h" #include #include #include "bbtkInterpreter.h" #include "bbtkWxBrowser.h" namespace bbtk { class WxTextCtrlStreamRedirector; /// A console in which user can enter commands class BBTK_EXPORT WxConsole : public wxFrame { public: WxConsole( wxWindow *parent, wxString title, wxSize size); ~WxConsole(); static WxConsole* GetInstance() { return mInstance; } /// Sets the inputs of the workspace : /// the map is passed as is to the Executer void SetInputs(const std::map& m) { mInterpreter->SetInputs(m); } /// Puts the executer in "no exec" mode, /// which creates but does not execute pipelines. void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); } 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 OnMenuQuit(wxCommandEvent& event); void OnMenuAbout(wxCommandEvent& event); void OnCommandEnter(wxCommandEvent& event); void OnCommandChar(wxCommandEvent& event); void ShowHtmlPage(std::string&); private: Interpreter* mInterpreter; wxTextCtrl* mwxTextHistory; wxTextCtrl* mwxTextCommand; wxTextAttr* mwxTextHistoryAttr; wxTextAttr* mwxTextCommandAttr; wxNotebook* mwxNotebook; wxPanel *mwxPageCommand, *mwxPageHelp; WxTextCtrlStreamRedirector* mRedirect_cout; WxTextCtrlStreamRedirector* mRedirect_cerr; WxBrowser* mwxHtmlWindow; static WxConsole* mInstance; public: enum { ID_Menu_Quit = 1, ID_Menu_About, }; DECLARE_EVENT_TABLE() }; } // namespace bbtk #endif // __bbtkWxConsole_h__ #endif //_USE_WXWIDGETS_