]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxGUIScriptingInterface.cxx
DEps
[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/09 14:38:57 $
7   Version:   $Revision: 1.25 $
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 (-a 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;
449     command = ConfigurationFile::GetInstance().Get_bin_path();
450     command += ConfigurationFile::GetInstance().Get_file_separator();
451     command += "bbRegeneratePackageDoc " + pack;
452     bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
453     
454     if ( ! system ( command.c_str() ) )
455       {
456         wxMessageBox(_T("Done !"),_T("Regenerate package '")+name+_T("' doc"),
457                      wxOK | wxICON_INFORMATION);
458       }
459     else 
460       {
461         wxString err(_T("An error occured while running '"));
462         err +=  bbtk::std2wx(command) + _T("'");
463         wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR);      
464       }
465   }
466   //================================================================
467
468   //================================================================
469   void WxGUIScriptingInterface::OnMenuRegenerateBoxesLists(wxCommandEvent& WXUNUSED(event))
470   {
471     std::string command;
472     command = ConfigurationFile::GetInstance().Get_bin_path();
473     command += ConfigurationFile::GetInstance().Get_file_separator();
474     command += "bbRegenerateBoxesLists";
475         bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
476
477         if ( ! system ( command.c_str() ) )
478     {
479        wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"),
480                     wxOK | wxICON_INFORMATION);
481      }
482    else 
483      {
484        wxString err(_T("An error occured while running '"));
485        err +=  bbtk::std2wx(command) + _T("'");
486        wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR);      
487      }
488   }
489   //================================================================
490
491   //================================================================
492   void WxGUIScriptingInterface::OnMenuRegenerateAll(wxCommandEvent& WXUNUSED(event))
493   {
494     std::string command;
495     command = ConfigurationFile::GetInstance().Get_bin_path();
496     command += ConfigurationFile::GetInstance().Get_file_separator();
497     command += "bbRegeneratePackageDoc -a && ";
498     command += ConfigurationFile::GetInstance().Get_bin_path();
499     command += ConfigurationFile::GetInstance().Get_file_separator();
500     command += "bbRegenerateBoxesLists";
501         bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl);
502
503         if ( ! system ( command.c_str() ) )
504     {
505        wxMessageBox(_T("Done !"),_T("Regenerate all"),
506                     wxOK | wxICON_INFORMATION);
507      }
508    else 
509      {
510        wxString err(_T("An error occured while running '"));
511        err +=  bbtk::std2wx(command) + _T("'");
512        wxMessageBox(err,_T("Regenerate all"),wxOK | wxICON_ERROR);      
513      }
514   }
515   //================================================================
516
517  
518
519   //================================================================
520   void WxGUIScriptingInterface::InterpreterUserViewHtmlPage(const std::string& page)
521   {
522     std::string s(page);
523     //  std::cout << "WxGUIScriptingInterface::ShowHtmlPage('"<<page<<"')"<<std::endl;
524     if (mWxGUIHtmlBrowser->GoTo(s)) 
525       {
526 //EED   mwxNotebook->ChangeSelection(1);
527 //      mwxNotebook->SetSelection(1);
528       }
529     else 
530       {
531          // std::cout << "ERROR html"<<std::endl;
532       }
533   } 
534   //================================================================  
535   
536   //================================================================  
537   bool WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
538   {
539     size_t s = target.length();
540     if ((s>3) && (target[s-1]=='s')
541         && (target[s-2]=='b')
542         && (target[s-3]=='b')
543         && (target[s-4]=='.'))
544       {
545         mWxGUITextEditor->Open(target);
546 #if NOTEBOOK
547         mwxNotebook->SetSelection(0);
548 #endif
549         mWxGUITextEditor->SetFocus();
550         return false;
551       }
552     return true;
553   }
554   //================================================================  
555
556   void WxGUIScriptingInterface::OnMenuWindowsCheck( wxCommandEvent& event, 
557                                                     wxWindow* w)
558   {
559     bool checked = event.IsChecked();
560     bool shown = m_mgr.GetPane(w).IsShown();
561     //    std::cout << "checked = "<<checked<<" - shown = "<<shown<<std::endl;
562     if (checked ^ shown) 
563       {
564         m_mgr.GetPane(w).Show(checked);
565         m_mgr.Update();
566       }
567   }
568
569
570   //================================================================  
571   void WxGUIScriptingInterface::OnMenuWindowsFiles(wxCommandEvent& event)
572   {
573     OnMenuWindowsCheck(event,mWxGUITextEditor);
574   }
575   //================================================================  
576
577   //================================================================  
578   void  WxGUIScriptingInterface::OnMenuWindowsHelp(wxCommandEvent& event)
579   {
580     OnMenuWindowsCheck(event,mWxGUIHtmlBrowser);
581   }
582   //================================================================  
583
584   //================================================================  
585   void  WxGUIScriptingInterface::OnMenuWindowsMessages(wxCommandEvent& event)
586   {
587     OnMenuWindowsCheck(event,mWxGUIOutputMessages);
588   }
589   //================================================================  
590
591   //================================================================  
592   void  WxGUIScriptingInterface::OnMenuWindowsCommand(wxCommandEvent& event)
593   {
594     OnMenuWindowsCheck(event,mWxGUICommand);
595   }
596   //================================================================  
597
598   //================================================================  
599   void WxGUIScriptingInterface::OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event))
600   {
601     SavePerspective();
602   }
603   //================================================================  
604
605   //================================================================  
606   void WxGUIScriptingInterface::SavePerspective()
607   {
608     //    std::cout  << "Saving configuration..."<<std::endl;
609     std::string conf = wx2std(m_mgr.SavePerspective());
610     std::string fname = Utilities::MakeUserSettingsFullFileName("bbStudio.aui");
611     std::ofstream f;
612     f.open(fname.c_str(), std::ios::out );
613     f << conf << std::endl;
614
615     //    int x,y;
616     //    GetPosition(&x,&y);
617     //    f << x << "  " << y << std::endl;
618
619
620     int w,h;
621     GetSize(&w,&h);
622
623     f << w << " " << h << std::endl;
624
625     f.close();
626   }
627   //================================================================  
628
629   //================================================================  
630   void WxGUIScriptingInterface::LoadPerspective()
631   {
632     std::string fname = 
633       Utilities::MakeUserSettingsFullFileName("bbStudio.aui");
634     if ( Utilities::FileExists( fname ))
635       {
636         //      std::cout  << "Loading configuration..."<<std::endl;
637
638         std::ifstream f;
639         f.open(fname.c_str());
640         std::string conf;
641         f >> conf;
642
643         //      int x,y;
644         //      f >> x >> y ;
645
646         int w,h;
647         f >> w >> h ;
648
649         f.close();
650         
651         //      std::cout << conf << std::endl;
652
653         //      Move(x,y);
654         SetSize(w,h);
655         m_mgr.LoadPerspective(std2wx(conf));
656       }
657     else 
658       {
659         m_mgr.Update();
660       }
661   }
662   //================================================================  
663
664   //================================================================  
665   void WxGUIScriptingInterface::OnPaneClose(wxAuiManagerEvent& evt)
666   {
667     std::cout  << "Closing panel '"<<evt.pane->name<<"'"<<std::endl;
668     // TO DO : Uncheck 
669     //    OnMenuWindowsCheck( wxCommandEvent& event, wxWindow* w);
670   }
671   //================================================================  
672
673   
674   //================================================================  
675   BEGIN_EVENT_TABLE(WxGUIScriptingInterface, wxFrame)
676     EVT_MENU(ID_Menu_Quit, WxGUIScriptingInterface::OnMenuQuit)
677     EVT_MENU(ID_Menu_About, WxGUIScriptingInterface::OnMenuAbout)
678     EVT_MENU(ID_Menu_EditConfig, WxGUIScriptingInterface::OnMenuEditConfig)
679     EVT_MENU(ID_Menu_CreatePackage, WxGUIScriptingInterface::OnMenuCreatePackage)
680     EVT_MENU(ID_Menu_CreateBlackBox, WxGUIScriptingInterface::OnMenuCreateBlackBox)
681     EVT_MENU(ID_Menu_ShowImageGraph, WxGUIScriptingInterface::OnMenuShowImageGraph)
682     EVT_MENU(ID_Menu_RegeneratePackageDoc, WxGUIScriptingInterface::OnMenuRegeneratePackageDoc)
683     EVT_MENU(ID_Menu_RegenerateBoxesLists, WxGUIScriptingInterface::OnMenuRegenerateBoxesLists)
684     EVT_MENU(ID_Menu_RegenerateAll, WxGUIScriptingInterface::OnMenuRegenerateAll)
685     EVT_MENU(ID_Menu_Windows_Files, WxGUIScriptingInterface::OnMenuWindowsFiles)
686     EVT_MENU(ID_Menu_Windows_Help, WxGUIScriptingInterface::OnMenuWindowsHelp)
687     EVT_MENU(ID_Menu_Windows_Messages, WxGUIScriptingInterface::OnMenuWindowsMessages)
688     EVT_MENU(ID_Menu_Windows_Command, WxGUIScriptingInterface::OnMenuWindowsCommand)
689     EVT_MENU(ID_Menu_Windows_Save, WxGUIScriptingInterface::OnMenuWindowsSave)
690     EVT_MENU(ID_Menu_Windows_PackageBrowser, WxGUIScriptingInterface::OnMenuWindowsPackageBrowser)
691     EVT_AUI_PANE_CLOSE(WxGUIScriptingInterface::OnPaneClose)
692   //    EVT_BUTTON(ID_Button_Run, WxGUIScriptingInterface::OnButtonRun )
693     END_EVENT_TABLE()
694   //================================================================
695
696 } // namespace bbtk
697
698
699 #endif //_USE_WXWIDGETS_