bbtkWxGUIScriptingInterface.h

Go to the documentation of this file.
00001 /*=========================================================================                                                                               
00002   Program:   bbtk
00003   Module:    $RCSfile: bbtkWxGUIScriptingInterface.h,v $
00004   Language:  C++
00005   Date:      $Date: 2008/10/17 08:18:15 $
00006   Version:   $Revision: 1.14 $
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 __bbtkWxGUIScriptingInterface_h__
00052 #define __bbtkWxGUIScriptingInterface_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 "bbtkWxGUITextEditor.h"
00063 #include "bbtkWxGUICommand.h"
00064 #include "bbtkWxGUIOutputMessages.h"
00065 #include "bbtkWxGUIHtmlBrowser.h"
00066 #include "bbtkWxGUIPackageBrowser2.h" 
00067 
00068 namespace bbtk
00069 {
00070 
00072   class BBTK_EXPORT WxGUIScriptingInterface : public wxFrame, 
00073                                               public InterpreterUser,
00074                                               public WxGUICommandUser,
00075                                               public WxGUITextEditorUser,
00076                                               public WxGUIHtmlBrowserUser
00077   {
00078   public:
00079     WxGUIScriptingInterface( wxWindow *parent );
00080     ~WxGUIScriptingInterface();
00081 
00085     Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
00086 
00089     void SetInputs(const std::map<std::string,std::string>& m)
00090     { mInterpreter->SetInputs(m); }
00091     
00094     void SetNoExecMode(bool b) { mInterpreter->SetNoExecMode(b); }
00095 
00096     void SetDialogMode(Interpreter::DialogModeType t) 
00097     { mInterpreter->SetDialogMode(t); }
00098     
00101     bool InterpretFile( const std::string& filename);
00102 
00103     void Open(const std::string& filename);
00104 
00105 
00106     void OnMenuQuit(wxCommandEvent& event);
00107     void OnMenuAbout(wxCommandEvent& event);
00108     void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
00109     void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
00110     void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
00111     void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
00112     void OnMenuRegeneratePackageDoc(wxCommandEvent& WXUNUSED(event));
00113     void OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event));
00114     void OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event));
00115     void OnMenuPlugPackage(wxCommandEvent& WXUNUSED(event));
00116     void OnMenuWindowsFiles(wxCommandEvent& event);
00117     void OnMenuWindowsHelp(wxCommandEvent& event);
00118     void OnMenuWindowsPackageBrowser(wxCommandEvent& event);
00119     void OnMenuWindowsMessages(wxCommandEvent& event);
00120     void OnMenuWindowsCommand(wxCommandEvent& event);
00121     void OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event));
00122     void OnMenuWindowsCheck( wxCommandEvent& event, 
00123                              wxWindow* w);
00124     void OnPaneClose(wxAuiManagerEvent& evt);
00125    
00126     void SavePerspective();
00127     void LoadPerspective();
00128     // void OnButtonRun(wxCommandEvent& WXUNUSED(event));
00129 
00130     // Interpreter callbacks
00131     bool InterpreterUserHasOwnHtmlPageViewer() { return true; }
00132     void InterpreterUserViewHtmlPage(const std::string&);
00133 
00134     // WxGUICommand callbacks
00135     void WxGUICommandEnter(const std::string&);
00136 
00137     // WxGUITextEditor callbacks
00138     void WxGUITextEditorRun();
00139     
00140     // WxGUIHtmlBrowser callbacks
00141     bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target);
00142 
00143 
00144         void DoRegeneratePackageDoc(const std::string& pack);
00145         void DoRegenerateBoxesLists();
00146   private:
00147     wxAuiManager m_mgr;
00148     Interpreter::Pointer mInterpreter;
00149  
00150     wxAuiNotebook* mwxNotebook;
00151 
00152     
00153 //EED    wxNotebook* mwxNotebook;
00154 //    wxAuiNotebook* mwxNotebook;
00155 //    wxPanel *mwxPageCommand, *mwxPageHelp;
00156 
00157     WxGUICommand                 *mWxGUICommand;
00158     WxGUIOutputMessages  *mWxGUIOutputMessages;
00159     WxGUIHtmlBrowser     *mWxGUIHtmlBrowser;
00160     WxGUITextEditor              *mWxGUITextEditor;
00161         WxGUIPackageBrowser2 *mWxGUIPackageBrowser2;
00162 
00163     wxMenuItem* mwxMenuItemReset;
00164     //    wxButton* mwxButtonRun;
00165 
00166   public:
00167           
00168  
00169     DECLARE_EVENT_TABLE()
00170         
00171   };
00172 
00173   
00174 } // namespace bbtk
00175 
00176 
00177 #endif // __bbtkWxGUIScriptingInterface_h__
00178 
00179 #endif //_USE_WXWIDGETS_

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