1 /*=========================================================================
3 Module: $RCSfile: bbtkWxGUIScriptingInterface.h,v $
5 Date: $Date: 2008/10/17 08:18:15 $
6 Version: $Revision: 1.14 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
33 * \brief Short description in one line
35 * Long description which
36 * can span multiple lines
48 #ifdef _USE_WXWIDGETS_
51 #ifndef __bbtkWxGUIScriptingInterface_h__
52 #define __bbtkWxGUIScriptingInterface_h__
54 #include <wx/aui/aui.h>
56 #include <wx/notebook.h>
57 #include <wx/html/htmlwin.h>
60 #include "bbtkInterpreter.h"
62 #include "bbtkWxGUITextEditor.h"
63 #include "bbtkWxGUICommand.h"
64 #include "bbtkWxGUIOutputMessages.h"
65 #include "bbtkWxGUIHtmlBrowser.h"
66 #include "bbtkWxGUIPackageBrowser2.h"
71 /// A scripting interface window
72 class BBTK_EXPORT WxGUIScriptingInterface : public wxFrame,
73 public InterpreterUser,
74 public WxGUICommandUser,
75 public WxGUITextEditorUser,
76 public WxGUIHtmlBrowserUser
79 WxGUIScriptingInterface( wxWindow *parent );
80 ~WxGUIScriptingInterface();
82 /// Returns the Interpreter used
83 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
84 /// (DIFFERENT WORKSPACES)
85 Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
87 /// Sets the inputs of the workspace :
88 /// the map is passed as is to the Executer
89 void SetInputs(const std::map<std::string,std::string>& m)
90 { mInterpreter->SetInputs(m); }
92 /// Puts the executer in "no exec" mode,
93 /// which creates but does not execute pipelines.
94 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
96 void SetDialogMode(Interpreter::DialogModeType t)
97 { mInterpreter->SetDialogMode(t); }
99 /// Runs the interpretation of a file
100 /// Returns false on error
101 bool InterpretFile( const std::string& filename);
103 void Open(const std::string& filename);
106 void OnMenuQuit(wxCommandEvent& event);
107 void OnMenuAbout(wxCommandEvent& event);
108 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
109 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
110 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
111 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
112 void OnMenuRegeneratePackageDoc(wxCommandEvent& WXUNUSED(event));
113 void OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event));
114 void OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event));
115 void OnMenuPlugPackage(wxCommandEvent& WXUNUSED(event));
116 void OnMenuWindowsFiles(wxCommandEvent& event);
117 void OnMenuWindowsHelp(wxCommandEvent& event);
118 void OnMenuWindowsPackageBrowser(wxCommandEvent& event);
119 void OnMenuWindowsMessages(wxCommandEvent& event);
120 void OnMenuWindowsCommand(wxCommandEvent& event);
121 void OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event));
122 void OnMenuWindowsCheck( wxCommandEvent& event,
124 void OnPaneClose(wxAuiManagerEvent& evt);
126 void SavePerspective();
127 void LoadPerspective();
128 // void OnButtonRun(wxCommandEvent& WXUNUSED(event));
130 // Interpreter callbacks
131 bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
132 void InterpreterUserViewHtmlPage(const std::string&);
134 // WxGUICommand callbacks
135 void WxGUICommandEnter(const std::string&);
137 // WxGUITextEditor callbacks
138 void WxGUITextEditorRun();
140 // WxGUIHtmlBrowser callbacks
141 bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target);
144 void DoRegeneratePackageDoc(const std::string& pack);
145 void DoRegenerateBoxesLists();
148 Interpreter::Pointer mInterpreter;
150 wxAuiNotebook* mwxNotebook;
153 //EED wxNotebook* mwxNotebook;
154 // wxAuiNotebook* mwxNotebook;
155 // wxPanel *mwxPageCommand, *mwxPageHelp;
157 WxGUICommand *mWxGUICommand;
158 WxGUIOutputMessages *mWxGUIOutputMessages;
159 WxGUIHtmlBrowser *mWxGUIHtmlBrowser;
160 WxGUITextEditor *mWxGUITextEditor;
161 WxGUIPackageBrowser2 *mWxGUIPackageBrowser2;
163 wxMenuItem* mwxMenuItemReset;
164 // wxButton* mwxButtonRun;
169 DECLARE_EVENT_TABLE()
177 #endif // __bbtkWxGUIScriptingInterface_h__
179 #endif //_USE_WXWIDGETS_