1 /*=========================================================================
4 Module: $RCSfile: bbtkWxConsole.h,v $
6 Date: $Date: 2008/03/17 07:04:08 $
7 Version: $Revision: 1.8 $
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 __bbtkWxConsole_h__
37 #define __bbtkWxConsole_h__
39 #include <wx/aui/aui.h>
41 #include <wx/notebook.h>
42 #include <wx/html/htmlwin.h>
45 #include "bbtkInterpreter.h"
46 #include "bbtkWxBrowser.h"
51 class WxTextCtrlStreamRedirector;
53 /// A console in which user can enter commands
54 class BBTK_EXPORT WxConsole : public wxFrame
57 WxConsole( wxWindow *parent, wxString title, wxSize size);
60 // static WxConsole* GetInstance() { return mInstance; }
62 /// Returns the Interpreter used
63 /// ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT
64 /// (DIFFERENT WORKSPACES)
65 Interpreter* GetInterpreter() { return mInterpreter; }
66 /// Returns the Interpreter used (const)
67 const Interpreter* GetInterpreter() const { return mInterpreter; }
69 /// Sets the inputs of the workspace :
70 /// the map is passed as is to the Executer
71 void SetInputs(const std::map<std::string,std::string>& m)
72 { mInterpreter->SetInputs(m); }
74 /// Puts the executer in "no exec" mode,
75 /// which creates but does not execute pipelines.
76 void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
78 void SetDialogMode(Interpreter::DialogModeType t)
79 { mInterpreter->SetDialogMode(t); }
81 /// Runs the interpretation of a file
82 void InterpretFile( const std::string& filename)
83 { mInterpreter->InterpretFile(filename); }
85 void OnMenuQuit(wxCommandEvent& event);
86 void OnMenuAbout(wxCommandEvent& event);
87 void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
88 void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
89 void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
90 void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
91 void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
93 void OnBtnGo(wxCommandEvent& event);
94 void OnCommandEnter(wxCommandEvent& event);
95 void OnCommandChar(wxCommandEvent& event);
97 void OnBtnInclude(wxCommandEvent& event);
98 void OnBtnReset(wxCommandEvent& event);
99 void OnBtnConfig(wxCommandEvent& event);
100 void OnBtnGraphS(wxCommandEvent& event);
101 void OnBtnGraphD(wxCommandEvent& event);
102 void OnBtnHelp(wxCommandEvent& event);
105 void ShowHtmlPage(std::string&);
109 Interpreter* mInterpreter;
110 wxTextCtrl* mwxTextHistory;
111 //EED wxTextCtrl* mwxTextCommand;
112 wxComboBox* mwxTextCommand;
113 wxTextAttr* mwxTextHistoryAttr;
114 wxTextAttr* mwxTextCommandAttr;
115 //EED wxNotebook* mwxNotebook;
116 wxAuiNotebook* mwxNotebook;
117 wxPanel *mwxPageCommand, *mwxPageHelp;
118 WxTextCtrlStreamRedirector* mRedirect_cout;
119 WxTextCtrlStreamRedirector* mRedirect_cerr;
120 WxBrowser* mwxHtmlWindow;
121 // static WxConsole* mInstance;
123 wxPanel* CreateBtnsCtrlPanel(wxWindow *parent);
124 void CommandString(wxString line );
132 ID_Menu_CreatePackage,
133 ID_Menu_CreateBlackBox,
134 ID_Menu_ShowImageGraph,
141 DECLARE_EVENT_TABLE()
149 #endif // __bbtkWxConsole_h__
151 #endif //_USE_WXWIDGETS_