/*========================================================================= Program: bbtk Module: $RCSfile: bbtkWxGUIScriptingInterface.h,v $ Language: C++ Date: $Date: 2008/03/25 10:31:18 $ Version: $Revision: 1.3 $ 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 __bbtkWxGUIScriptingInterface_h__ #define __bbtkWxGUIScriptingInterface_h__ #include #include "bbtkWx.h" #include #include #include "bbtkInterpreter.h" #include "bbtkWxGUITextEditor.h" #include "bbtkWxGUICommand.h" #include "bbtkWxGUIOutputMessages.h" #include "bbtkWxGUIHtmlBrowser.h" namespace bbtk { /// A scripting interface window class BBTK_EXPORT WxGUIScriptingInterface : public wxFrame, public InterpreterUser, public WxGUICommandUser, public WxGUITextEditorUser, public WxGUIHtmlBrowserUser { public: WxGUIScriptingInterface( wxWindow *parent, wxString title, wxSize size); ~WxGUIScriptingInterface(); /// 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 Open(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 OnMenuWindowsFiles(wxCommandEvent& event); void OnMenuWindowsHelp(wxCommandEvent& event); void OnMenuWindowsMessages(wxCommandEvent& event); void OnMenuWindowsCommand(wxCommandEvent& event); void OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event)); void OnMenuWindowsCheck( wxCommandEvent& event, wxWindow* w); void OnPaneClose(wxAuiManagerEvent& evt); // void OnButtonRun(wxCommandEvent& WXUNUSED(event)); // Interpreter callbacks bool InterpreterUserHasOwnHtmlPageViewer() { return true; } void InterpreterUserViewHtmlPage(const std::string&); // WxGUICommand callbacks void WxGUICommandEnter(const std::string&); // WxGUITextEditor callbacks void WxGUITextEditorRun(); // WxGUIHtmlBrowser callbacks bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target); private: wxAuiManager m_mgr; Interpreter* mInterpreter; //EED wxNotebook* mwxNotebook; // wxAuiNotebook* mwxNotebook; // wxPanel *mwxPageCommand, *mwxPageHelp; WxGUICommand* mWxGUICommand; WxGUIOutputMessages* mWxGUIOutputMessages; WxGUIHtmlBrowser* mWxGUIHtmlBrowser; WxGUITextEditor* mWxGUITextEditor; // wxButton* mwxButtonRun; public: DECLARE_EVENT_TABLE() }; } // namespace bbtk #endif // __bbtkWxGUIScriptingInterface_h__ #endif //_USE_WXWIDGETS_