]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxGUIScriptingInterface.cxx
1b48a2c9ab44a6e07cbf17c44b4e4f0be58b0a30
[bbtk.git] / kernel / src / bbtkWxGUIScriptingInterface.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
5   Language:  C++
6   Date:      $Date: 2008/10/08 12:19:56 $
7   Version:   $Revision: 1.23 $
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 #include <iostream>     
36 #include "bbtkWxGUIScriptingInterface.h"
37 #include "bbtkWxBlackBox.h"
38 #include "bbtkConfigurationFile.h"
39 #include "bbtkWxStreamRedirector.h"
40 #include "bbtkUtilities.h"
41
42 #include <wx/tipwin.h>
43
44 //#include "icons/cc_run.xpm"
45
46 namespace bbtk
47 {
48
49     enum
50     {
51       ID_Menu_Quit = 1,
52       ID_Menu_About,
53       ID_Menu_EditConfig,
54       ID_Menu_CreatePackage,
55       ID_Menu_CreateBlackBox,
56       ID_Menu_ShowImageGraph,
57       ID_Menu_RegeneratePackageDoc,
58       ID_Menu_RegenerateBoxesLists,
59       ID_Menu_RegenerateAll,
60       ID_Menu_Windows_Files,
61       ID_Menu_Windows_Help,
62       ID_Menu_Windows_Messages,
63       ID_Menu_Windows_Command,
64       ID_Menu_Windows_Save,
65       ID_Menu_Windows_PackageBrowser
66       //      ID_Button_Run
67     };
68     
69   
70   //================================================================
71   WxGUIScriptingInterface::WxGUIScriptingInterface( wxWindow *parent )
72     : wxFrame((wxFrame *)parent, -1, _T("bbStudio"), 
73               wxDefaultPosition, wxSize(1200,800) )
74   {     
75     //    m_mgr = new wxAuiManager(this);
76     m_mgr.SetManagedWindow(this);
77     
78     mInterpreter = bbtk::Interpreter::New();
79     mInterpreter->SetUser(this);
80     mInterpreter->SetCommandLine(true);
81     mInterpreter->SetThrow(true);
82     
83     //==============
84     // Menu
85     wxInitAllImageHandlers();
86     
87     wxMenu *menuFile = new wxMenu;
88     menuFile->Append( ID_Menu_EditConfig, _T("Open bbtk &Config file") );
89     menuFile->Append( ID_Menu_Quit, _T("&Quit") );
90     
91     wxMenu *menuAbout = new wxMenu;
92     menuAbout->Append( ID_Menu_About, _T("&About...") );
93
94     wxMenu *menuTools = new wxMenu;
95     menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") );
96     menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &black box") );
97     menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last image graph") );
98     menuTools->AppendSeparator();
99     menuTools->Append( ID_Menu_RegeneratePackageDoc,_T("&Regenerate package doc") );
100     menuTools->Append( ID_Menu_RegenerateBoxesLists,_T("&Regenerate boxes lists") );
101     menuTools->Append( ID_Menu_RegenerateAll,_T("&Regenerate all") );
102
103
104     wxMenu *menuWindows = new wxMenu;
105     menuWindows->AppendCheckItem(ID_Menu_Windows_Files,
106                                  _T("Show 'files' panel") )->Check();
107     menuWindows->AppendCheckItem(ID_Menu_Windows_Help,
108                                  _T("Show 'help' panel") )->Check();
109     menuWindows->AppendCheckItem(ID_Menu_Windows_Messages,
110                                  _T("Show 'messages' panel") )->Check();
111     menuWindows->AppendCheckItem(ID_Menu_Windows_Command,
112                                  _T("Show 'command' panel") )->Check();
113     menuWindows->AppendSeparator();
114     menuWindows->Append( ID_Menu_Windows_PackageBrowser, _T("Launch Package &Browser") );
115     
116     //    menuWindows->AppendSeparator();
117     //    menuWindows->Append ( ID_Menu_Windows_Save, _T("Save interface configuration"));
118
119     wxMenu *menuOptions = new wxMenu;
120     mwxMenuItemReset = menuOptions->AppendCheckItem(-1,
121                                                     _T("Reset before running") );
122     mwxMenuItemReset->Check();
123
124     wxMenuBar *menuBar = new wxMenuBar;
125     menuBar->Append( menuFile, _T("&File") );
126     menuBar->Append( menuTools, _T("&Tools") );
127     menuBar->Append( menuOptions, _T("&Options") );
128     menuBar->Append( menuWindows, _T("&Windows") );
129     menuBar->Append( menuAbout, _T("About") );
130     
131     SetMenuBar( menuBar );
132     
133     //=== 
134     // Status bar
135     CreateStatusBar();
136     SetStatusText( _T("Welcome to bbStudio !") );
137     
138     //===
139     // Panes (Files, Messages, Help, Command)
140     mWxGUITextEditor = new WxGUITextEditor(this,this);
141     mWxGUITextEditor->SetFileNameFilter("*.bbs");
142         
143     mWxGUIHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0),this);
144
145     mWxGUIOutputMessages = new WxGUIOutputMessages(this);
146
147     mWxGUICommand = new WxGUICommand(this,this);
148    
149     mWxGUICommand->SetFocus();
150
151  
152 #if NOTEBOOK
153
154     mwxNotebook = new wxAuiNotebook(this,  
155                                     -1,
156                                     wxPoint(0, 0),
157                                     wxSize(500,500),
158                                     wxAUI_NB_TAB_SPLIT 
159                                     | wxAUI_NB_TAB_MOVE
160                                     | wxAUI_NB_TAB_EXTERNAL_MOVE
161                                     //| wxAUI_NB_WINDOWLIST_BUTTON
162                                     //|wxAUI_NB_SCROLL_BUTTONS
163                                     // | wxAUI_NB_CLOSE_BUTTON 
164                                     //| wxAUI_NB_CLOSE_ON_ACTIVE_TAB
165                                     //| wxAUI_NB_CLOSE_ON_ALL_TABS
166                                     | wxNO_BORDER);
167   
168
169     mwxNotebook->AddPage(mWxGUITextEditor,_T("Files"),true);
170     mwxNotebook->AddPage(mWxGUIHtmlBrowser,_T("Help"),true);
171
172     mwxNotebook->AddPage(mWxGUIOutputMessages,_T("Messages"),true);
173
174     mwxNotebook->AddPage(mWxGUICommand,_T("Command"),true);
175
176
177     m_mgr.AddPane(mwxNotebook,
178                   wxAuiPaneInfo().Name(wxT("nb"))
179                   .CaptionVisible(false)
180                   .MinimizeButton(false)
181                   .MaximizeButton(false)
182                   .Center()
183                   //              .MinSize(wxSize(100,100))
184                   );   
185 #else 
186
187     //
188     m_mgr.AddPane(mWxGUITextEditor,
189                   wxAuiPaneInfo().Name(wxT("editor_content"))
190                   .Caption(wxT("Files"))
191                   .MinimizeButton(true)
192                   .MaximizeButton(true)
193                   .Center()
194                   .MinSize(wxSize(100,100))
195                   );   
196   
197     m_mgr.AddPane(mWxGUIHtmlBrowser,
198                   wxAuiPaneInfo().Name(wxT("browser_content"))
199                   .Caption(wxT("Help"))
200                   .MinimizeButton(true)
201                   .MaximizeButton(true)
202                   .Right()
203                   .Layer(2)
204                   .MinSize(wxSize(400,100))
205                   );
206
207     m_mgr.AddPane(mWxGUIOutputMessages,
208                   wxAuiPaneInfo().Name(wxT("messages_content"))
209                   .Caption(wxT("Messages"))
210                   .MinimizeButton(true)
211                   .MaximizeButton(true)
212                   .Bottom()
213                   .MinSize(wxSize(100,100))
214                   );
215     m_mgr.AddPane(mWxGUICommand,
216                   wxAuiPaneInfo().Name(wxT("command_content"))
217                   .Caption(wxT("Command"))
218                   .MinimizeButton(true)
219                   .MaximizeButton(true)
220                   .Bottom()
221                   .Layer(1)
222                   .MinSize(wxSize(100,100))
223                   );     
224 #endif
225
226     // parent window of all bbtk windows will be a child of this
227     Wx::SetTopWindowParent(this);
228     // Add the method OnWxSignal as a Wx::Signal observer 
229     //bbtkAddWxSignalObserver(WxGUIPackageBrowser2Window::OnWxSignal);
230
231     //.PaneBorder(false)); 
232     // Load the interface appearance saved on last closing
233     LoadPerspective();
234
235     // Done in LoadPerspective
236     //    m_mgr.Update();
237         
238     SetAutoLayout(true);
239     Layout();
240     //    mwxNotebook->SetSelection(1);
241     mWxGUIHtmlBrowser->GoHome();
242 //    Refresh();
243     m_mgr.Update();
244     //   LoadPerspective();
245
246
247     wxTipWindow* tip = new wxTipWindow(this,
248                                        _T("\n                  Welcome to bbStudio !\n\n   To run a demo or example:\n     1. click on the 'Demos' or 'Examples' link\n     2. select a demo or example\n     3. click on the '[source]' link : the source file is loaded in bbStudio\n     4. click on the 'Run' button (the arrow at the bottom right of the source file)   \n"),1000);
249     tip->CenterOnParent();
250     tip->Show();
251   }
252   //================================================================
253
254  //================================================================
255   WxGUIScriptingInterface::~WxGUIScriptingInterface()
256   {
257     SavePerspective();
258     m_mgr.UnInit();
259   }
260   //================================================================
261
262   //================================================================
263   void WxGUIScriptingInterface::Open(const std::string& filename)
264   {
265     mWxGUITextEditor->Open(filename);
266   }
267   //================================================================
268   
269 #define CATCH_MACRO                                                     \
270   catch (QuitException e)                                               \
271     {                                                                   \
272       std::cout << "* quit exception caught"<<std::endl;                \
273     }                                                                   \
274   catch (InterpreterError e)                                            \
275     {                                                                   \
276       std::cerr << "* IERROR : "<<e.GetErrorMessage()<<std::endl;               \
277       if (e.IsInScriptFile())                                           \
278         std::cerr << "* FILE   : '"<<e.GetScriptFile()<<"'"<<std::endl; \
279       std::cerr << "* LINE   : "<<e.GetScriptLine()<<std::endl;         \
280       int lev = bbtk::MessageManager::GetMessageLevel("Error");         \
281       if (lev > 0) {                                                    \
282         std::cerr << "* Exception thrown : "<<std::endl;                \
283         std::cerr << "*  OBJECT : " <<e.GetObject()<<std::endl;         \
284         std::cerr << "*  FILE   : " <<e.GetSourceFile()<<std::endl;     \
285       }                                                                 \
286     }
287   
288   //================================================================
289   void WxGUIScriptingInterface::WxGUICommandEnter(const std::string& command)
290   {
291     std::string s("> ");
292     s += command + "\n";
293     mWxGUIOutputMessages->Print(s,wxRED);
294     
295     try
296       {
297         mInterpreter->InterpretLine( command );
298       }
299     CATCH_MACRO;
300   }
301   //================================================================
302   
303   //================================================================
304   /// Runs the interpretation of a file
305   bool WxGUIScriptingInterface::InterpretFile( const std::string& filename) 
306   { 
307     try
308       {
309         mInterpreter->InterpretFile(filename);
310       }
311     CATCH_MACRO;
312     return true;
313   }
314   //================================================================
315  
316   //================================================================
317   void WxGUIScriptingInterface::WxGUITextEditorRun()
318   {
319     //    wxString temp = mWxGUIHtmlBrowser->GetCurrentPage();
320     std::stringstream* buf = new std::stringstream;
321     (*buf) << mWxGUITextEditor->GetCurrentPage()->GetText();
322     try 
323       {
324         //      std::cout << "RUN"<<std::endl;
325         if (mwxMenuItemReset->IsChecked()) WxGUICommandEnter("reset");
326         mInterpreter->InterpretBuffer(buf);
327         //      std::cout << "EO RUN"<<std::endl;
328       }
329     CATCH_MACRO;
330     //    std::cout << "EO RUN 3"<<std::endl;
331   }
332   //================================================================  
333
334   //================================================================
335   void WxGUIScriptingInterface::OnMenuQuit(wxCommandEvent& WXUNUSED(event))
336   {
337     if (!mWxGUITextEditor->CloseAllPages()) return;
338     Close(true);
339   }
340   //================================================================
341
342
343   //================================================================
344   void WxGUIScriptingInterface::OnMenuAbout(wxCommandEvent& WXUNUSED(event))
345   {
346     m_mgr.Update();
347         Refresh();
348     wxMessageBox(_T("  bbStudio\nThe Black Box Toolkit Development Studio\n(c) CREATIS-LRMN 2008"),
349                  _T("About ..."), wxOK | wxICON_INFORMATION,
350                  this);
351   }
352   //================================================================
353
354
355   //================================================================
356   void WxGUIScriptingInterface::OnMenuEditConfig(wxCommandEvent& WXUNUSED(event))
357   {
358     std::string configFile = 
359       ConfigurationFile::GetInstance().Get_config_xml_full_path();
360     Open(configFile);
361   }
362   //================================================================
363
364   //================================================================
365   void WxGUIScriptingInterface::OnMenuWindowsPackageBrowser(wxCommandEvent& WXUNUSED(event))
366   {
367     wxBusyCursor wait;
368     WxGUIPackageBrowser2Window *helpbrowser = new
369       WxGUIPackageBrowser2Window(this,_T("Package Browser"), wxSize(600,600) );
370     helpbrowser->Show();
371     
372     /*
373     wxBusyCursor wait;
374     WxGUIPackageBrowser2 *browser = new WxGUIPackageBrowser2(this);
375     browser->IncludeAll();
376     */
377 #if NOTEBOOK
378     //     mwxNotebook->AddPage(browser,_T("Package Browser"),true);
379 #else
380      /*
381      m_mgr.AddPane(browser,
382                    wxAuiPaneInfo().Name(wxT("package_brower"))
383                    .Caption(wxT("Package browser"))
384                    .MinimizeButton(true)
385                    .MaximizeButton(true)
386                    .Bottom()
387                    .Position(1)
388                    .MinSize(wxSize(100,100))
389                    );     
390      */
391 #endif
392   }
393   //================================================================
394
395
396
397   //================================================================
398   void WxGUIScriptingInterface::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
399   {
400
401     std::string command("toolsbbtk/appli/GUICreatePackage");
402     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
403     
404     Interpreter::Pointer I = Interpreter::New();    
405     I->InterpretFile(command);
406
407   }
408   //================================================================
409
410
411   //================================================================
412   void WxGUIScriptingInterface::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
413   {
414     std::string command("toolsbbtk/appli/GUICreateBlackBox");
415     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
416     
417     Interpreter::Pointer I = Interpreter::New();    
418     I->InterpretFile(command);
419   }
420   //================================================================
421   
422   //================================================================
423   void WxGUIScriptingInterface::OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event))
424   {
425     std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
426
427 #if defined(WIN32)
428     std::string strappli="start ";
429 #else
430     std::string strappli="gnome-open ";
431 #endif
432     std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png";
433     //  std::cout << "system: " << strcommand << std::endl;
434     system ( strcommand.c_str() );
435
436   }
437   //================================================================
438
439   //================================================================
440   void WxGUIScriptingInterface::OnMenuRegeneratePackageDoc(wxCommandEvent& WXUNUSED(event))
441   {
442     wxString name = wxGetTextFromUser(_T("Enter package name (* for all)"),
443                              _T("Regenerate package doc"),
444                              _T(""));
445         if (name.IsEmpty()) return;
446         std::string pack = bbtk::wx2std(name);
447
448         std::string command("cd \"");
449         command += ConfigurationFile::GetInstance().Get_bin_path();
450     command += "\" && bbRegeneratePackageDoc " + pack;
451         bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
452         
453         if ( ! system ( command.c_str() ) )
454     {
455        wxMessageBox(_T("Done !"),_T("Regenerate package '")+name+_T("' doc"),
456                     wxOK | wxICON_INFORMATION);
457      }
458    else 
459      {
460        wxString err(_T("An error occured while running '"));
461        err +=  bbtk::std2wx(command) + _T("'");
462        wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);      
463      }
464   }
465   //================================================================
466
467   //================================================================
468   void WxGUIScriptingInterface::OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event))
469   {
470         std::string command("cd \"");
471         command += ConfigurationFile::GetInstance().Get_bin_path();
472     command += "\" && bbRegenerateBoxesLists";
473         bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
474
475         if ( ! system ( command.c_str() ) )
476     {
477        wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
478                     wxOK | wxICON_INFORMATION);
479      }
480    else 
481      {
482        wxString err(_T("An error occured while running '"));
483        err +=  bbtk::std2wx(command) + _T("'");
484        wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);      
485      }
486   }
487   //================================================================
488
489   //================================================================
490   void WxGUIScriptingInterface::OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event))
491   {
492         std::string command("cd \"");
493         command += ConfigurationFile::GetInstance().Get_bin_path();
494     command += "\" && bbRegeneratePackageDoc * && bbRegenerateBoxesLists";
495         bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
496
497         if ( ! system ( command.c_str() ) )
498     {
499        wxMessageBox(_T("Done !"),_T("Regenerate all"),
500                     wxOK | wxICON_INFORMATION);
501      }
502    else 
503      {
504        wxString err(_T("An error occured while running '"));
505        err +=  bbtk::std2wx(command) + _T("'");
506        wxMessageBox(err,_T("Regenerate all"),wxOK | wxICON_ERROR);      
507      }
508   }
509   //================================================================
510
511  
512
513   //================================================================
514   void WxGUIScriptingInterface::InterpreterUserViewHtmlPage(const std::string& page)
515   {
516     std::string s(page);
517     //  std::cout << "WxGUIScriptingInterface::ShowHtmlPage('"<<page<<"')"<<std::endl;
518     if (mWxGUIHtmlBrowser->GoTo(s)) 
519       {
520 //EED   mwxNotebook->ChangeSelection(1);
521 //      mwxNotebook->SetSelection(1);
522       }
523     else 
524       {
525          // std::cout << "ERROR html"<<std::endl;
526       }
527   } 
528   //================================================================  
529   
530   //================================================================  
531   bool WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
532   {
533     size_t s = target.length();
534     if ((s>3) && (target[s-1]=='s')
535         && (target[s-2]=='b')
536         && (target[s-3]=='b')
537         && (target[s-4]=='.'))
538       {
539         mWxGUITextEditor->Open(target);
540 #if NOTEBOOK
541         mwxNotebook->SetSelection(0);
542 #endif
543         mWxGUITextEditor->SetFocus();
544         return false;
545       }
546     return true;
547   }
548   //================================================================  
549
550   void WxGUIScriptingInterface::OnMenuWindowsCheck( wxCommandEvent& event, 
551                                                     wxWindow* w)
552   {
553     bool checked = event.IsChecked();
554     bool shown = m_mgr.GetPane(w).IsShown();
555     //    std::cout << "checked = "<<checked<<" - shown = "<<shown<<std::endl;
556     if (checked ^ shown) 
557       {
558         m_mgr.GetPane(w).Show(checked);
559         m_mgr.Update();
560       }
561   }
562
563
564   //================================================================  
565   void WxGUIScriptingInterface::OnMenuWindowsFiles(wxCommandEvent& event)
566   {
567     OnMenuWindowsCheck(event,mWxGUITextEditor);
568   }
569   //================================================================  
570
571   //================================================================  
572   void  WxGUIScriptingInterface::OnMenuWindowsHelp(wxCommandEvent& event)
573   {
574     OnMenuWindowsCheck(event,mWxGUIHtmlBrowser);
575   }
576   //================================================================  
577
578   //================================================================  
579   void  WxGUIScriptingInterface::OnMenuWindowsMessages(wxCommandEvent& event)
580   {
581     OnMenuWindowsCheck(event,mWxGUIOutputMessages);
582   }
583   //================================================================  
584
585   //================================================================  
586   void  WxGUIScriptingInterface::OnMenuWindowsCommand(wxCommandEvent& event)
587   {
588     OnMenuWindowsCheck(event,mWxGUICommand);
589   }
590   //================================================================  
591
592   //================================================================  
593   void WxGUIScriptingInterface::OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event))
594   {
595     SavePerspective();
596   }
597   //================================================================  
598
599   //================================================================  
600   void WxGUIScriptingInterface::SavePerspective()
601   {
602     //    std::cout  << "Saving configuration..."<<std::endl;
603     std::string conf = wx2std(m_mgr.SavePerspective());
604     std::string fname = Utilities::MakeUserSettingsFullFileName("bbStudio.aui");
605     std::ofstream f;
606     f.open(fname.c_str(), std::ios::out );
607     f << conf << std::endl;
608
609     //    int x,y;
610     //    GetPosition(&x,&y);
611     //    f << x << "  " << y << std::endl;
612
613
614     int w,h;
615     GetSize(&w,&h);
616
617     f << w << " " << h << std::endl;
618
619     f.close();
620   }
621   //================================================================  
622
623   //================================================================  
624   void WxGUIScriptingInterface::LoadPerspective()
625   {
626     std::string fname = 
627       Utilities::MakeUserSettingsFullFileName("bbStudio.aui");
628     if ( Utilities::FileExists( fname ))
629       {
630         //      std::cout  << "Loading configuration..."<<std::endl;
631
632         std::ifstream f;
633         f.open(fname.c_str());
634         std::string conf;
635         f >> conf;
636
637         //      int x,y;
638         //      f >> x >> y ;
639
640         int w,h;
641         f >> w >> h ;
642
643         f.close();
644         
645         //      std::cout << conf << std::endl;
646
647         //      Move(x,y);
648         SetSize(w,h);
649         m_mgr.LoadPerspective(std2wx(conf));
650       }
651     else 
652       {
653         m_mgr.Update();
654       }
655   }
656   //================================================================  
657
658   //================================================================  
659   void WxGUIScriptingInterface::OnPaneClose(wxAuiManagerEvent& evt)
660   {
661     std::cout  << "Closing panel '"<<evt.pane->name<<"'"<<std::endl;
662     // TO DO : Uncheck 
663     //    OnMenuWindowsCheck( wxCommandEvent& event, wxWindow* w);
664   }
665   //================================================================  
666
667   
668   //================================================================  
669   BEGIN_EVENT_TABLE(WxGUIScriptingInterface, wxFrame)
670     EVT_MENU(ID_Menu_Quit, WxGUIScriptingInterface::OnMenuQuit)
671     EVT_MENU(ID_Menu_About, WxGUIScriptingInterface::OnMenuAbout)
672     EVT_MENU(ID_Menu_EditConfig, WxGUIScriptingInterface::OnMenuEditConfig)
673     EVT_MENU(ID_Menu_CreatePackage, WxGUIScriptingInterface::OnMenuCreatePackage)
674     EVT_MENU(ID_Menu_CreateBlackBox, WxGUIScriptingInterface::OnMenuCreateBlackBox)
675     EVT_MENU(ID_Menu_ShowImageGraph, WxGUIScriptingInterface::OnMenuShowImageGraph)
676     EVT_MENU(ID_Menu_RegeneratePackageDoc, WxGUIScriptingInterface::OnMenuRegeneratePackageDoc)
677     EVT_MENU(ID_Menu_RegenerateBoxesLists, WxGUIScriptingInterface::OnMenuRegenerateBoxesLists)
678     EVT_MENU(ID_Menu_RegenerateAll, WxGUIScriptingInterface::OnMenuRegenerateAll)
679     EVT_MENU(ID_Menu_Windows_Files, WxGUIScriptingInterface::OnMenuWindowsFiles)
680     EVT_MENU(ID_Menu_Windows_Help, WxGUIScriptingInterface::OnMenuWindowsHelp)
681     EVT_MENU(ID_Menu_Windows_Messages, WxGUIScriptingInterface::OnMenuWindowsMessages)
682     EVT_MENU(ID_Menu_Windows_Command, WxGUIScriptingInterface::OnMenuWindowsCommand)
683     EVT_MENU(ID_Menu_Windows_Save, WxGUIScriptingInterface::OnMenuWindowsSave)
684     EVT_MENU(ID_Menu_Windows_PackageBrowser, WxGUIScriptingInterface::OnMenuWindowsPackageBrowser)
685     EVT_AUI_PANE_CLOSE(WxGUIScriptingInterface::OnPaneClose)
686   //    EVT_BUTTON(ID_Button_Run, WxGUIScriptingInterface::OnButtonRun )
687     END_EVENT_TABLE()
688   //================================================================
689
690 } // namespace bbtk
691
692
693 #endif //_USE_WXWIDGETS_