2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbtkWxGUIScriptingInterface.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.18 $
34 =========================================================================*/
40 * \brief Short description in one line
42 * Long description which
43 * can span multiple lines
55 #ifdef _USE_WXWIDGETS_
58 #ifndef __bbtkWxGUIScriptingInterface_h__
59 #define __bbtkWxGUIScriptingInterface_h__
61 #include <wx/aui/aui.h>
63 #include <wx/notebook.h>
64 #include <wx/html/htmlwin.h>
67 #include "bbtkInterpreter.h"
69 #include "bbtkWxGUITextEditor.h"
70 #include "bbtkWxGUICommand.h"
71 #include "bbtkWxGUIOutputMessages.h"
72 #include "bbtkWxGUIHtmlBrowser.h"
73 #include "bbtkWxGUIPackageBrowser2.h"
78 /// A scripting interface window
79 class BBTK_EXPORT WxGUIScriptingInterface : public wxFrame,
80 public InterpreterUser,
81 public WxGUICommandUser,
82 public WxGUITextEditorUser,
83 public WxGUIHtmlBrowserUser
86 WxGUIScriptingInterface( wxWindow *parent );
87 ~WxGUIScriptingInterface();
89 /// Returns the Interpreter used
90 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
91 /// (DIFFERENT WORKSPACES)
92 Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
94 /// Sets the inputs of the workspace :
95 /// the map is passed as is to the Executer
96 void SetInputs(const std::map<std::string,std::string>& m)
97 { mInterpreter->SetInputs(m); }
99 /// Puts the executer in "no exec" mode,
100 /// which creates but does not execute pipelines.
101 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
103 void SetDialogMode(Interpreter::DialogModeType t)
104 { mInterpreter->SetDialogMode(t); }
106 /// Runs the interpretation of a file
107 /// Returns false on error
108 bool InterpretFile( const std::string& filename);
110 void Open(const std::string& filename);
113 void OnMenuQuit(wxCommandEvent& event);
114 void OnMenuAbout(wxCommandEvent& event);
115 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
116 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
117 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
118 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
119 void OnMenuRegeneratePackageDoc(wxCommandEvent& WXUNUSED(event));
120 void OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event));
121 void OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event));
122 void OnMenuPlugPackage(wxCommandEvent& WXUNUSED(event));
123 void OnMenuWindowsFiles(wxCommandEvent& event);
124 void OnMenuWindowsHelp(wxCommandEvent& event);
125 void OnMenuWindowsPackageBrowser(wxCommandEvent& event);
126 void OnMenuWindowsMessages(wxCommandEvent& event);
127 void OnMenuWindowsCommand(wxCommandEvent& event);
128 void OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event));
129 void OnMenuWindowsCheck( wxCommandEvent& event,
131 void OnPaneClose(wxAuiManagerEvent& evt);
133 void SavePerspective();
134 void LoadPerspective();
135 // void OnButtonRun(wxCommandEvent& WXUNUSED(event));
137 // Interpreter callbacks
138 bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
139 void InterpreterUserViewHtmlPage(const std::string&);
140 // void InterpreterUserOnBreak();
142 // WxGUICommand callbacks
143 void WxGUICommandEnter(const std::string&);
145 // WxGUITextEditor callbacks
146 void WxGUITextEditorRun();
147 void WxGUITextEditorRunBBI();
148 void WxGUITextEditorGraphSimple();
149 void WxGUITextEditorGraphDetail();
151 // WxGUIHtmlBrowser callbacks
152 bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target);
155 void DoRegeneratePackageDoc(const std::string& pack);
156 void DoRegenerateBoxesLists();
158 void OnClose(wxCloseEvent& event);
161 Interpreter::Pointer mInterpreter;
163 wxAuiNotebook* mwxNotebook;
166 //EED wxNotebook* mwxNotebook;
167 // wxAuiNotebook* mwxNotebook;
168 // wxPanel *mwxPageCommand, *mwxPageHelp;
170 WxGUICommand *mWxGUICommand;
171 WxGUIOutputMessages *mWxGUIOutputMessages;
172 WxGUIHtmlBrowser *mWxGUIHtmlBrowser;
173 WxGUITextEditor *mWxGUITextEditor;
174 WxGUIPackageBrowser2 *mWxGUIPackageBrowser2;
176 wxMenuItem* mwxMenuItemReset;
177 // wxButton* mwxButtonRun;
184 DECLARE_EVENT_TABLE()
192 #endif // __bbtkWxGUIScriptingInterface_h__
194 #endif //_USE_WXWIDGETS_