1 /*=========================================================================
4 Module: $RCSfile: bbtkWxGUIScriptingInterface.h,v $
6 Date: $Date: 2008/03/21 11:46:41 $
7 Version: $Revision: 1.1 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*//**
18 * \brief Short description in one line
20 * Long description which
21 * can span multiple lines
33 #ifdef _USE_WXWIDGETS_
36 #ifndef __bbtkWxGUIScriptingInterface_h__
37 #define __bbtkWxGUIScriptingInterface_h__
39 #include <wx/aui/aui.h>
41 #include <wx/notebook.h>
42 #include <wx/html/htmlwin.h>
45 #include "bbtkInterpreter.h"
47 #include "bbtkWxGUITextEditor.h"
48 #include "bbtkWxGUICommand.h"
49 #include "bbtkWxGUIOutputMessages.h"
50 #include "bbtkWxGUIHtmlBrowser.h"
55 /// A scripting interface window
56 class BBTK_EXPORT WxGUIScriptingInterface : public wxFrame,
57 public InterpreterUser,
58 public WxGUICommandUser
61 WxGUIScriptingInterface( wxWindow *parent, wxString title, wxSize size);
62 ~WxGUIScriptingInterface();
64 /// Returns the Interpreter used
65 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
66 /// (DIFFERENT WORKSPACES)
67 Interpreter* GetInterpreter() { return mInterpreter; }
68 /// Returns the Interpreter used (const)
69 const Interpreter* GetInterpreter() const { return mInterpreter; }
71 /// Sets the inputs of the workspace :
72 /// the map is passed as is to the Executer
73 void SetInputs(const std::map<std::string,std::string>& m)
74 { mInterpreter->SetInputs(m); }
76 /// Puts the executer in "no exec" mode,
77 /// which creates but does not execute pipelines.
78 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
80 void SetDialogMode(Interpreter::DialogModeType t)
81 { mInterpreter->SetDialogMode(t); }
83 /// Runs the interpretation of a file
84 /// Returns false on error
85 bool InterpretFile( const std::string& filename);
87 void Open(const std::string& filename);
90 void OnMenuQuit(wxCommandEvent& event);
91 void OnMenuAbout(wxCommandEvent& event);
92 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
93 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
94 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
95 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
96 void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
99 void OnButtonRun(wxCommandEvent& WXUNUSED(event));
101 // Interpreter callbacks
102 bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
103 void InterpreterUserViewHtmlPage(const std::string&);
105 // WxGUICommand callbacks
106 void WxGUICommandEnter(const std::string&);
110 Interpreter* mInterpreter;
113 //EED wxNotebook* mwxNotebook;
114 wxAuiNotebook* mwxNotebook;
115 wxPanel *mwxPageCommand, *mwxPageHelp;
117 WxGUICommand* mWxGUICommand;
118 WxGUIOutputMessages* mWxGUIOutputMessages;
119 WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
120 WxGUITextEditor* mWxGUITextEditor;
122 wxButton* mwxButtonRun;
127 DECLARE_EVENT_TABLE()
135 #endif // __bbtkWxGUIScriptingInterface_h__
137 #endif //_USE_WXWIDGETS_