/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxGUIConsole.h,v $ Language: C++ Date: $Date: 2008/03/25 06:22:53 $ Version: $Revision: 1.2 $ 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 __bbtkWxGUIConsole_h__ #define __bbtkWxGUIConsole_h__ #include #include "bbtkWx.h" #include #include #include "bbtkInterpreter.h" #include "bbtkWxGUICommand.h" #include "bbtkWxGUIOutputMessages.h" #include "bbtkWxGUIHtmlBrowser.h" namespace bbtk { /// A console in which user can enter commands class BBTK_EXPORT WxGUIConsole : public wxFrame, public InterpreterUser, public WxGUICommandUser { public: WxGUIConsole( wxWindow *parent, wxString title, wxSize size); ~WxGUIConsole(); /// 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 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 /// Returns false on error bool InterpretFile( const std::string& 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 OnButtonRun(wxCommandEvent& WXUNUSED(event)); // Interpreter callbacks bool InterpreterUserHasOwnHtmlPageViewer() { return true; } void InterpreterUserViewHtmlPage(const std::string&); // WxGUICommand callbacks void WxGUICommandEnter(const std::string&); private: wxAuiManager m_mgr; Interpreter* mInterpreter; //EED wxNotebook* mwxNotebook; wxAuiNotebook* mwxNotebook; wxPanel *mwxPageCommand, *mwxPageHelp; WxGUICommand* mWxGUICommand; WxGUIOutputMessages* mWxGUIOutputMessages; WxGUIHtmlBrowser* mWxGUIHtmlBrowser; wxButton* mwxButtonRun; public: DECLARE_EVENT_TABLE() }; } // namespace bbtk #endif // __bbtkWxGUIConsole_h__ #endif //_USE_WXWIDGETS_