]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxGUIConsole.h
=== MAJOR RELEASE ====
[bbtk.git] / kernel / src / bbtkWxGUIConsole.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkWxGUIConsole.h,v $
5   Language:  C++
6   Date:      $Date: 2008/04/18 12:59:16 $
7   Version:   $Revision: 1.3 $
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*//**
18  * \brief Short description in one line
19  * 
20  * Long description which 
21  * can span multiple lines
22  */
23 /**
24  * \file 
25  * \brief 
26  */
27 /**
28  * \class bbtk::
29  * \brief 
30  */
31
32
33 #ifdef _USE_WXWIDGETS_
34
35         
36 #ifndef __bbtkWxGUIConsole_h__
37 #define __bbtkWxGUIConsole_h__
38
39 #include <wx/aui/aui.h>
40 #include "bbtkWx.h"
41 #include <wx/notebook.h>
42 #include <wx/html/htmlwin.h>
43
44
45 #include "bbtkInterpreter.h"
46
47 #include "bbtkWxGUICommand.h"
48 #include "bbtkWxGUIOutputMessages.h"
49 #include "bbtkWxGUIHtmlBrowser.h"
50
51 namespace bbtk
52 {
53
54   /// A console in which user can enter commands
55   class BBTK_EXPORT WxGUIConsole : public wxFrame, 
56                                    public InterpreterUser,
57                                    public WxGUICommandUser
58   {
59   public:
60     WxGUIConsole( wxWindow *parent, wxString title, wxSize size);
61     ~WxGUIConsole();
62
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; }
69
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); }
74     
75     /// Puts the executer in "no exec" mode, 
76     /// which creates but does not execute pipelines.
77     void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
78
79         void SetDialogMode(Interpreter::DialogModeType t) 
80     { mInterpreter->SetDialogMode(t); }
81     
82     /// Runs the interpretation of a file
83     /// Returns false on error
84     bool InterpretFile( const std::string& filename);
85
86
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 OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
94    
95
96     void OnButtonRun(wxCommandEvent& WXUNUSED(event));
97
98     // Interpreter callbacks
99     bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
100     void InterpreterUserViewHtmlPage(const std::string&);
101
102     // WxGUICommand callbacks
103     void WxGUICommandEnter(const std::string&);
104
105   private:
106     wxAuiManager m_mgr;
107     Interpreter::Pointer mInterpreter;
108
109     
110 //EED    wxNotebook* mwxNotebook;
111     wxAuiNotebook* mwxNotebook;
112     wxPanel *mwxPageCommand, *mwxPageHelp;
113
114     WxGUICommand* mWxGUICommand;
115     WxGUIOutputMessages* mWxGUIOutputMessages;
116     WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
117     
118     wxButton* mwxButtonRun;
119
120   public:
121           
122  
123     DECLARE_EVENT_TABLE()
124         
125   };
126
127   
128 } // namespace bbtk
129
130
131 #endif // __bbtkWxGUIConsole_h__
132
133 #endif //_USE_WXWIDGETS_