1 /*=========================================================================
4 Module: $RCSfile: bbtkWxGUIConsole.h,v $
6 Date: $Date: 2008/04/24 12:56:39 $
7 Version: $Revision: 1.5 $
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 __bbtkWxGUIConsole_h__
37 #define __bbtkWxGUIConsole_h__
39 #include <wx/aui/aui.h>
41 #include <wx/notebook.h>
42 #include <wx/html/htmlwin.h>
45 #include "bbtkInterpreter.h"
47 #include "bbtkWxGUICommand.h"
48 #include "bbtkWxGUIOutputMessages.h"
49 #include "bbtkWxGUIHtmlBrowser.h"
54 /// A console in which user can enter commands
55 class BBTK_EXPORT WxGUIConsole : public wxFrame,
56 public InterpreterUser,
57 public WxGUICommandUser
60 WxGUIConsole( wxWindow *parent, wxString title, wxSize size);
63 /// Returns the Interpreter used
64 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
65 /// (DIFFERENT WORKSPACES)
66 //Interpreter::Pointer GetInterpreter() { return mInterpreter; }
67 /// Returns the Interpreter used (const)
68 Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
70 /// Sets the inputs of the workspace :
71 /// the map is passed as is to the Executer
72 void SetInputs(const std::map<std::string,std::string>& m)
73 { mInterpreter->SetInputs(m); }
75 /// Puts the executer in "no exec" mode,
76 /// which creates but does not execute pipelines.
77 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
79 void SetDialogMode(Interpreter::DialogModeType t)
80 { mInterpreter->SetDialogMode(t); }
82 /// Runs the interpretation of a file
83 /// Returns false on error
84 bool InterpretFile( const std::string& filename);
87 void OnMenuQuit(wxCommandEvent& event);
88 void OnMenuAbout(wxCommandEvent& event);
89 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
90 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
91 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
92 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
93 void OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event));
94 void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
97 void OnButtonRun(wxCommandEvent& WXUNUSED(event));
99 // Interpreter callbacks
100 bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
101 void InterpreterUserViewHtmlPage(const std::string&);
103 // WxGUICommand callbacks
104 void WxGUICommandEnter(const std::string&);
107 // Overloaded Show method to handle bbtk::Wx::TopWindow auto-destruction
108 virtual bool Show(bool show = true);
113 Interpreter::Pointer mInterpreter;
116 //EED wxNotebook* mwxNotebook;
117 wxAuiNotebook* mwxNotebook;
118 wxPanel *mwxPageCommand, *mwxPageHelp;
120 WxGUICommand* mWxGUICommand;
121 WxGUIOutputMessages* mWxGUIOutputMessages;
122 WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
124 wxButton* mwxButtonRun;
128 // Callback invoked by bbtk top window when something changes
130 DECLARE_EVENT_TABLE()
138 #endif // __bbtkWxGUIConsole_h__
140 #endif //_USE_WXWIDGETS_