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: bbtkWxGUIConsole.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.8 $
34 =========================================================================*/
40 * \brief Short description in one line
42 * Long description which
43 * can span multiple lines
55 #ifdef _USE_WXWIDGETS_
58 #ifndef __bbtkWxGUIConsole_h__
59 #define __bbtkWxGUIConsole_h__
61 #include <wx/aui/aui.h>
63 #include <wx/notebook.h>
64 #include <wx/html/htmlwin.h>
67 #include "bbtkInterpreter.h"
69 #include "bbtkWxGUICommand.h"
70 #include "bbtkWxGUIOutputMessages.h"
71 #include "bbtkWxGUIHtmlBrowser.h"
76 /// A console in which user can enter commands
77 class BBTK_EXPORT WxGUIConsole : public wxFrame,
78 public InterpreterUser,
79 public WxGUICommandUser
82 WxGUIConsole( wxWindow *parent, wxString title, wxSize size);
85 /// Returns the Interpreter used
86 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
87 /// (DIFFERENT WORKSPACES)
88 //Interpreter::Pointer GetInterpreter() { return mInterpreter; }
89 /// Returns the Interpreter used (const)
90 Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
92 /// Sets the inputs of the workspace :
93 /// the map is passed as is to the Executer
94 void SetInputs(const std::map<std::string,std::string>& m)
95 { mInterpreter->SetInputs(m); }
97 /// Puts the executer in "no exec" mode,
98 /// which creates but does not execute pipelines.
99 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
101 void SetDialogMode(Interpreter::DialogModeType t)
102 { mInterpreter->SetDialogMode(t); }
104 /// Runs the interpretation of a file
105 /// Returns false on error
106 bool InterpretFile( const std::string& filename);
109 void OnMenuQuit(wxCommandEvent& event);
110 void OnMenuAbout(wxCommandEvent& event);
111 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
112 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
113 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
114 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
115 void OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event));
116 void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
119 void OnButtonRun(wxCommandEvent& WXUNUSED(event));
121 // Interpreter callbacks
122 bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
123 void InterpreterUserViewHtmlPage(const std::string&);
125 // WxGUICommand callbacks
126 void WxGUICommandEnter(const std::string&);
129 // Overloaded Show method to handle bbtk::Wx::TopWindow auto-destruction
130 virtual bool Show(bool show = true);
132 void OnClose(wxCloseEvent& event);
137 Interpreter::Pointer mInterpreter;
140 //EED wxNotebook* mwxNotebook;
141 wxAuiNotebook* mwxNotebook;
142 wxPanel *mwxPageCommand, *mwxPageHelp;
144 WxGUICommand* mWxGUICommand;
145 WxGUIOutputMessages* mWxGUIOutputMessages;
146 WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
148 wxButton* mwxButtonRun;
152 // Callback invoked by bbtk top window when something changes
154 DECLARE_EVENT_TABLE()
162 #endif // __bbtkWxGUIConsole_h__
164 #endif //_USE_WXWIDGETS_