1 /*=========================================================================
3 Module: $RCSfile: bbtkWxGUIConsole.h,v $
5 Date: $Date: 2009/05/28 08:12:07 $
6 Version: $Revision: 1.7 $
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 __bbtkWxGUIConsole_h__
52 #define __bbtkWxGUIConsole_h__
54 #include <wx/aui/aui.h>
56 #include <wx/notebook.h>
57 #include <wx/html/htmlwin.h>
60 #include "bbtkInterpreter.h"
62 #include "bbtkWxGUICommand.h"
63 #include "bbtkWxGUIOutputMessages.h"
64 #include "bbtkWxGUIHtmlBrowser.h"
69 /// A console in which user can enter commands
70 class BBTK_EXPORT WxGUIConsole : public wxFrame,
71 public InterpreterUser,
72 public WxGUICommandUser
75 WxGUIConsole( wxWindow *parent, wxString title, wxSize size);
78 /// Returns the Interpreter used
79 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
80 /// (DIFFERENT WORKSPACES)
81 //Interpreter::Pointer GetInterpreter() { return mInterpreter; }
82 /// Returns the Interpreter used (const)
83 Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
85 /// Sets the inputs of the workspace :
86 /// the map is passed as is to the Executer
87 void SetInputs(const std::map<std::string,std::string>& m)
88 { mInterpreter->SetInputs(m); }
90 /// Puts the executer in "no exec" mode,
91 /// which creates but does not execute pipelines.
92 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
94 void SetDialogMode(Interpreter::DialogModeType t)
95 { mInterpreter->SetDialogMode(t); }
97 /// Runs the interpretation of a file
98 /// Returns false on error
99 bool InterpretFile( const std::string& filename);
102 void OnMenuQuit(wxCommandEvent& event);
103 void OnMenuAbout(wxCommandEvent& event);
104 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
105 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
106 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
107 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
108 void OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event));
109 void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
112 void OnButtonRun(wxCommandEvent& WXUNUSED(event));
114 // Interpreter callbacks
115 bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
116 void InterpreterUserViewHtmlPage(const std::string&);
118 // WxGUICommand callbacks
119 void WxGUICommandEnter(const std::string&);
122 // Overloaded Show method to handle bbtk::Wx::TopWindow auto-destruction
123 virtual bool Show(bool show = true);
125 void OnClose(wxCloseEvent& event);
130 Interpreter::Pointer mInterpreter;
133 //EED wxNotebook* mwxNotebook;
134 wxAuiNotebook* mwxNotebook;
135 wxPanel *mwxPageCommand, *mwxPageHelp;
137 WxGUICommand* mWxGUICommand;
138 WxGUIOutputMessages* mWxGUIOutputMessages;
139 WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
141 wxButton* mwxButtonRun;
145 // Callback invoked by bbtk top window when something changes
147 DECLARE_EVENT_TABLE()
155 #endif // __bbtkWxGUIConsole_h__
157 #endif //_USE_WXWIDGETS_