bbtkWxGUIConsole.h

Go to the documentation of this file.
00001 /*=========================================================================                                                                               
00002   Program:   bbtk
00003   Module:    $RCSfile: bbtkWxGUIConsole.h,v $
00004   Language:  C++
00005   Date:      $Date: 2008/10/17 08:18:15 $
00006   Version:   $Revision: 1.6 $
00007 =========================================================================*/
00008 
00009 /* ---------------------------------------------------------------------
00010 
00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
00013 *
00014 *  This software is governed by the CeCILL-B license under French law and 
00015 *  abiding by the rules of distribution of free software. You can  use, 
00016 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
00017 *  license as circulated by CEA, CNRS and INRIA at the following URL 
00018 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
00019 *  or in the file LICENSE.txt.
00020 *
00021 *  As a counterpart to the access to the source code and  rights to copy,
00022 *  modify and redistribute granted by the license, users are provided only
00023 *  with a limited warranty  and the software's author,  the holder of the
00024 *  economic rights,  and the successive licensors  have only  limited
00025 *  liability. 
00026 *
00027 *  The fact that you are presently reading this means that you have had
00028 *  knowledge of the CeCILL-B license and that you accept its terms.
00029 * ------------------------------------------------------------------------ */                                                                         
00030 
00031 
00048 #ifdef _USE_WXWIDGETS_
00049 
00050         
00051 #ifndef __bbtkWxGUIConsole_h__
00052 #define __bbtkWxGUIConsole_h__
00053 
00054 #include <wx/aui/aui.h>
00055 #include "bbtkWx.h"
00056 #include <wx/notebook.h>
00057 #include <wx/html/htmlwin.h>
00058 
00059 
00060 #include "bbtkInterpreter.h"
00061 
00062 #include "bbtkWxGUICommand.h"
00063 #include "bbtkWxGUIOutputMessages.h"
00064 #include "bbtkWxGUIHtmlBrowser.h"
00065 
00066 namespace bbtk
00067 {
00068 
00070   class BBTK_EXPORT WxGUIConsole : public wxFrame, 
00071                                    public InterpreterUser,
00072                                    public WxGUICommandUser
00073   {
00074   public:
00075     WxGUIConsole( wxWindow *parent, wxString title, wxSize size);
00076     ~WxGUIConsole();
00077 
00081     //Interpreter::Pointer GetInterpreter() { return mInterpreter; }
00083     Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
00084 
00087     void SetInputs(const std::map<std::string,std::string>& m)
00088     { mInterpreter->SetInputs(m); }
00089     
00092     void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
00093 
00094         void SetDialogMode(Interpreter::DialogModeType t) 
00095     { mInterpreter->SetDialogMode(t); }
00096     
00099     bool InterpretFile( const std::string& filename);
00100 
00101 
00102     void OnMenuQuit(wxCommandEvent& event);
00103     void OnMenuAbout(wxCommandEvent& event);
00104     void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
00105     void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
00106     void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
00107     void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
00108     void OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event));
00109     void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
00110    
00111 
00112     void OnButtonRun(wxCommandEvent& WXUNUSED(event));
00113 
00114     // Interpreter callbacks
00115     bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
00116     void InterpreterUserViewHtmlPage(const std::string&);
00117 
00118     // WxGUICommand callbacks
00119     void WxGUICommandEnter(const std::string&);
00120 
00121 
00122     // Overloaded Show method to handle bbtk::Wx::TopWindow auto-destruction
00123     virtual bool Show(bool show = true);
00124 
00125 
00126   private:
00127     wxAuiManager m_mgr;
00128     Interpreter::Pointer mInterpreter;
00129 
00130     
00131 //EED    wxNotebook* mwxNotebook;
00132     wxAuiNotebook* mwxNotebook;
00133     wxPanel *mwxPageCommand, *mwxPageHelp;
00134 
00135     WxGUICommand* mWxGUICommand;
00136     WxGUIOutputMessages* mWxGUIOutputMessages;
00137     WxGUIHtmlBrowser* mWxGUIHtmlBrowser;
00138     
00139     wxButton* mwxButtonRun;
00140 
00141   public:
00142     
00143     // Callback invoked by bbtk top window when something changes
00144     void OnWxSignal();
00145     DECLARE_EVENT_TABLE()
00146         
00147   };
00148 
00149   
00150 } // namespace bbtk
00151 
00152 
00153 #endif // __bbtkWxGUIConsole_h__
00154 
00155 #endif //_USE_WXWIDGETS_

Generated on Wed Nov 12 11:37:08 2008 for BBTK by  doxygen 1.5.6