#include <bbtkWxGUIScriptingInterface.h>
Public Member Functions | |
WxGUIScriptingInterface (wxWindow *parent) | |
~WxGUIScriptingInterface () | |
Interpreter::Pointer | GetInterpreter () const |
void | SetInputs (const std::map< std::string, std::string > &m) |
void | SetNoExecMode (bool b) |
void | SetDialogMode (Interpreter::DialogModeType t) |
bool | InterpretFile (const std::string &filename) |
Runs the interpretation of a file. | |
void | Open (const std::string &filename) |
void | OnMenuQuit (wxCommandEvent &event) |
void | OnMenuAbout (wxCommandEvent &event) |
void | OnMenuEditConfig (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuCreatePackage (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuCreateBlackBox (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuShowImageGraph (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuRegeneratePackageDoc (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuRegenerateBoxesLists (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuRegenerateAll (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuPlugPackage (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuWindowsFiles (wxCommandEvent &event) |
void | OnMenuWindowsHelp (wxCommandEvent &event) |
void | OnMenuWindowsPackageBrowser (wxCommandEvent &event) |
void | OnMenuWindowsMessages (wxCommandEvent &event) |
void | OnMenuWindowsCommand (wxCommandEvent &event) |
void | OnMenuWindowsSave (wxCommandEvent &WXUNUSED(event)) |
void | OnMenuWindowsCheck (wxCommandEvent &event, wxWindow *w) |
void | OnPaneClose (wxAuiManagerEvent &evt) |
void | SavePerspective () |
void | LoadPerspective () |
bool | InterpreterUserHasOwnHtmlPageViewer () |
void | InterpreterUserViewHtmlPage (const std::string &) |
void | WxGUICommandEnter (const std::string &) |
Callback invoked when a command is entered in the WxGUICommand. | |
void | WxGUITextEditorRun () |
Callback invoked when the 'run' button is pressed. | |
bool | WxGUIHtmlBrowserUserOnLinkClicked (const std::string &target) |
void | DoRegeneratePackageDoc (const std::string &pack) |
void | DoRegenerateBoxesLists () |
Private Attributes | |
wxAuiManager | m_mgr |
Interpreter::Pointer | mInterpreter |
wxAuiNotebook * | mwxNotebook |
WxGUICommand * | mWxGUICommand |
WxGUIOutputMessages * | mWxGUIOutputMessages |
WxGUIHtmlBrowser * | mWxGUIHtmlBrowser |
WxGUITextEditor * | mWxGUITextEditor |
WxGUIPackageBrowser2 * | mWxGUIPackageBrowser2 |
wxMenuItem * | mwxMenuItemReset |
Definition at line 72 of file bbtkWxGUIScriptingInterface.h.
bbtk::WxGUIScriptingInterface::WxGUIScriptingInterface | ( | wxWindow * | parent | ) |
Definition at line 87 of file bbtkWxGUIScriptingInterface.cxx.
References _T, bbtk::WxGUIHtmlBrowser::GoHome(), bbtk::ID_Menu_About, bbtk::ID_Menu_CreateBlackBox, bbtk::ID_Menu_CreatePackage, bbtk::ID_Menu_EditConfig, bbtk::ID_Menu_PlugPackage, bbtk::ID_Menu_Quit, bbtk::ID_Menu_RegenerateAll, bbtk::ID_Menu_RegenerateBoxesLists, bbtk::ID_Menu_RegeneratePackageDoc, bbtk::ID_Menu_ShowImageGraph, bbtk::ID_Menu_Windows_Command, bbtk::ID_Menu_Windows_Files, bbtk::ID_Menu_Windows_Help, bbtk::ID_Menu_Windows_Messages, bbtk::ID_Menu_Windows_PackageBrowser, LoadPerspective(), m_mgr, mInterpreter, mWxGUICommand, mWxGUIHtmlBrowser, mWxGUIOutputMessages, mWxGUITextEditor, mwxMenuItemReset, mwxNotebook, and bbtk::WxGUITextEditor::SetFileNameFilter().
00088 : wxFrame((wxFrame *)parent, -1, _T("bbStudio"), 00089 wxDefaultPosition, wxSize(1200,800) ) 00090 { 00091 // m_mgr = new wxAuiManager(this); 00092 m_mgr.SetManagedWindow(this); 00093 00094 mInterpreter = bbtk::Interpreter::New(); 00095 mInterpreter->SetUser(this); 00096 mInterpreter->SetCommandLine(true); 00097 mInterpreter->SetThrow(true); 00098 00099 //============== 00100 // Menu 00101 wxInitAllImageHandlers(); 00102 00103 wxMenu *menuFile = new wxMenu; 00104 menuFile->Append( ID_Menu_EditConfig, _T("Open bbtk &Config file") ); 00105 menuFile->Append( ID_Menu_Quit, _T("&Quit") ); 00106 00107 wxMenu *menuAbout = new wxMenu; 00108 menuAbout->Append( ID_Menu_About, _T("&About...") ); 00109 00110 wxMenu *menuTools = new wxMenu; 00111 menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") ); 00112 menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &black box") ); 00113 menuTools->Append( ID_Menu_PlugPackage, _T("&Plug package") ); 00114 menuTools->AppendSeparator(); 00115 menuTools->Append( ID_Menu_RegeneratePackageDoc,_T("Regenerate package &doc") ); 00116 menuTools->Append( ID_Menu_RegenerateBoxesLists,_T("Regenerate boxes &lists") ); 00117 menuTools->Append( ID_Menu_RegenerateAll,_T("Regenerate &all") ); 00118 menuTools->AppendSeparator(); 00119 menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last graph") ); 00120 00121 wxMenu *menuWindows = new wxMenu; 00122 menuWindows->AppendCheckItem(ID_Menu_Windows_Files, 00123 _T("Show 'files' panel") )->Check(); 00124 menuWindows->AppendCheckItem(ID_Menu_Windows_Help, 00125 _T("Show 'help' panel") )->Check(); 00126 menuWindows->AppendCheckItem(ID_Menu_Windows_Messages, 00127 _T("Show 'messages' panel") )->Check(); 00128 menuWindows->AppendCheckItem(ID_Menu_Windows_Command, 00129 _T("Show 'command' panel") )->Check(); 00130 menuWindows->AppendSeparator(); 00131 menuWindows->Append( ID_Menu_Windows_PackageBrowser, _T("Start Package &Browser") ); 00132 00133 // menuWindows->AppendSeparator(); 00134 // menuWindows->Append ( ID_Menu_Windows_Save, _T("Save interface configuration")); 00135 00136 wxMenu *menuOptions = new wxMenu; 00137 mwxMenuItemReset = menuOptions->AppendCheckItem(-1, 00138 _T("Reset before running") ); 00139 mwxMenuItemReset->Check(); 00140 00141 wxMenuBar *menuBar = new wxMenuBar; 00142 menuBar->Append( menuFile, _T("&File") ); 00143 menuBar->Append( menuTools, _T("&Tools") ); 00144 menuBar->Append( menuOptions, _T("&Options") ); 00145 menuBar->Append( menuWindows, _T("&Windows") ); 00146 menuBar->Append( menuAbout, _T("About") ); 00147 00148 SetMenuBar( menuBar ); 00149 00150 //=== 00151 // Status bar 00152 CreateStatusBar(); 00153 SetStatusText( _T("Welcome to bbStudio !") ); 00154 00155 //=== 00156 // Panes (Files, Messages, Help, Command) 00157 mWxGUITextEditor = new WxGUITextEditor(this,this); 00158 mWxGUITextEditor->SetFileNameFilter("*.bbs"); 00159 00160 mWxGUIHtmlBrowser = new WxGUIHtmlBrowser(this,wxSize(200,0),this); 00161 00162 mWxGUIOutputMessages = new WxGUIOutputMessages(this); 00163 00164 mWxGUICommand = new WxGUICommand(this,this); 00165 00166 mWxGUICommand->SetFocus(); 00167 00168 00169 #if NOTEBOOK 00170 00171 mwxNotebook = new wxAuiNotebook(this, 00172 -1, 00173 wxPoint(0, 0), 00174 wxSize(500,500), 00175 wxAUI_NB_TAB_SPLIT 00176 | wxAUI_NB_TAB_MOVE 00177 | wxAUI_NB_TAB_EXTERNAL_MOVE 00178 //| wxAUI_NB_WINDOWLIST_BUTTON 00179 //|wxAUI_NB_SCROLL_BUTTONS 00180 // | wxAUI_NB_CLOSE_BUTTON 00181 //| wxAUI_NB_CLOSE_ON_ACTIVE_TAB 00182 //| wxAUI_NB_CLOSE_ON_ALL_TABS 00183 | wxNO_BORDER); 00184 00185 00186 mwxNotebook->AddPage(mWxGUITextEditor,_T("Files"),true); 00187 mwxNotebook->AddPage(mWxGUIHtmlBrowser,_T("Help"),true); 00188 00189 mwxNotebook->AddPage(mWxGUIOutputMessages,_T("Messages"),true); 00190 00191 mwxNotebook->AddPage(mWxGUICommand,_T("Command"),true); 00192 00193 00194 m_mgr.AddPane(mwxNotebook, 00195 wxAuiPaneInfo().Name(wxT("nb")) 00196 .CaptionVisible(false) 00197 .MinimizeButton(false) 00198 .MaximizeButton(false) 00199 .Center() 00200 // .MinSize(wxSize(100,100)) 00201 ); 00202 #else 00203 00204 // 00205 m_mgr.AddPane(mWxGUITextEditor, 00206 wxAuiPaneInfo().Name(wxT("editor_content")) 00207 .Caption(wxT("Files")) 00208 .MinimizeButton(true) 00209 .MaximizeButton(true) 00210 .Center() 00211 .MinSize(wxSize(100,100)) 00212 ); 00213 00214 m_mgr.AddPane(mWxGUIHtmlBrowser, 00215 wxAuiPaneInfo().Name(wxT("browser_content")) 00216 .Caption(wxT("Help")) 00217 .MinimizeButton(true) 00218 .MaximizeButton(true) 00219 .Right() 00220 .Layer(2) 00221 .MinSize(wxSize(400,100)) 00222 ); 00223 00224 m_mgr.AddPane(mWxGUIOutputMessages, 00225 wxAuiPaneInfo().Name(wxT("messages_content")) 00226 .Caption(wxT("Messages")) 00227 .MinimizeButton(true) 00228 .MaximizeButton(true) 00229 .Bottom() 00230 .MinSize(wxSize(100,100)) 00231 ); 00232 m_mgr.AddPane(mWxGUICommand, 00233 wxAuiPaneInfo().Name(wxT("command_content")) 00234 .Caption(wxT("Command")) 00235 .MinimizeButton(true) 00236 .MaximizeButton(true) 00237 .Bottom() 00238 .Layer(1) 00239 .MinSize(wxSize(100,100)) 00240 ); 00241 #endif 00242 00243 // parent window of all bbtk windows will be a child of this 00244 Wx::SetTopWindowParent(this); 00245 // Add the method OnWxSignal as a Wx::Signal observer 00246 //bbtkAddWxSignalObserver(WxGUIPackageBrowser2Window::OnWxSignal); 00247 00248 //.PaneBorder(false)); 00249 // Load the interface appearance saved on last closing 00250 LoadPerspective(); 00251 00252 // Done in LoadPerspective 00253 // m_mgr.Update(); 00254 00255 SetAutoLayout(true); 00256 Layout(); 00257 // mwxNotebook->SetSelection(1); 00258 mWxGUIHtmlBrowser->GoHome(); 00259 // Refresh(); 00260 m_mgr.Update(); 00261 // LoadPerspective(); 00262 00263 00264 wxTipWindow* tip = new wxTipWindow(this, 00265 _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); 00266 tip->CenterOnParent(); 00267 tip->Show(); 00268 }
bbtk::WxGUIScriptingInterface::~WxGUIScriptingInterface | ( | ) |
Definition at line 272 of file bbtkWxGUIScriptingInterface.cxx.
References m_mgr, and SavePerspective().
00273 { 00274 SavePerspective(); 00275 m_mgr.UnInit(); 00276 }
Interpreter::Pointer bbtk::WxGUIScriptingInterface::GetInterpreter | ( | ) | const [inline] |
Returns the Interpreter used ONLY ONE FOR THE MOMENT BUT IN THE FUTURE CAN BE DIFFERENT (DIFFERENT WORKSPACES)
Definition at line 85 of file bbtkWxGUIScriptingInterface.h.
00085 { return mInterpreter; }
void bbtk::WxGUIScriptingInterface::SetInputs | ( | const std::map< std::string, std::string > & | m | ) | [inline] |
Sets the inputs of the workspace : the map is passed as is to the Executer
Definition at line 89 of file bbtkWxGUIScriptingInterface.h.
00090 { mInterpreter->SetInputs(m); }
void bbtk::WxGUIScriptingInterface::SetNoExecMode | ( | bool | b | ) | [inline] |
Puts the executer in "no exec" mode, which creates but does not execute pipelines.
Definition at line 94 of file bbtkWxGUIScriptingInterface.h.
00094 { mInterpreter->SetNoExecMode(b); }
void bbtk::WxGUIScriptingInterface::SetDialogMode | ( | Interpreter::DialogModeType | t | ) | [inline] |
Definition at line 96 of file bbtkWxGUIScriptingInterface.h.
00097 { mInterpreter->SetDialogMode(t); }
bool bbtk::WxGUIScriptingInterface::InterpretFile | ( | const std::string & | filename | ) |
Runs the interpretation of a file.
Runs the interpretation of a file Returns false on error
Definition at line 322 of file bbtkWxGUIScriptingInterface.cxx.
References CATCH_MACRO, and mInterpreter.
00323 { 00324 try 00325 { 00326 mInterpreter->InterpretFile(filename); 00327 } 00328 CATCH_MACRO; 00329 return true; 00330 }
void bbtk::WxGUIScriptingInterface::Open | ( | const std::string & | filename | ) |
Definition at line 280 of file bbtkWxGUIScriptingInterface.cxx.
References mWxGUITextEditor, and bbtk::WxGUITextEditor::Open().
Referenced by OnMenuEditConfig().
00281 { 00282 mWxGUITextEditor->Open(filename); 00283 }
void bbtk::WxGUIScriptingInterface::OnMenuQuit | ( | wxCommandEvent & | event | ) |
void bbtk::WxGUIScriptingInterface::OnMenuAbout | ( | wxCommandEvent & | event | ) |
void bbtk::WxGUIScriptingInterface::OnMenuEditConfig | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 373 of file bbtkWxGUIScriptingInterface.cxx.
References Open().
00374 { 00375 std::string configFile = 00376 ConfigurationFile::GetInstance().Get_config_xml_full_path(); 00377 Open(configFile); 00378 }
void bbtk::WxGUIScriptingInterface::OnMenuCreatePackage | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 415 of file bbtkWxGUIScriptingInterface.cxx.
References bbtkMessage, mWxGUICommand, and bbtk::WxGUICommand::SendCommand().
00416 { 00417 /* 00418 std::string command("toolsbbtk/appli/GUICreatePackage"); 00419 bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl); 00420 00421 Interpreter::Pointer I = Interpreter::New(); 00422 I->InterpretFile(command); 00423 */ 00424 std::string command("reset"); 00425 mWxGUICommand->SendCommand(command); 00426 command = "include toolsbbtk/appli/GUICreatePackage"; 00427 bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl); 00428 mWxGUICommand->SendCommand(command); 00429 00430 }
void bbtk::WxGUIScriptingInterface::OnMenuCreateBlackBox | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 435 of file bbtkWxGUIScriptingInterface.cxx.
References bbtkMessage, mWxGUICommand, and bbtk::WxGUICommand::SendCommand().
00436 { 00437 /* 00438 std::string command("toolsbbtk/appli/GUICreateBlackBox"); 00439 bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl); 00440 00441 Interpreter::Pointer I = Interpreter::New(); 00442 I->InterpretFile(command); 00443 */ 00444 std::string command("reset"); 00445 mWxGUICommand->SendCommand(command); 00446 command = "include toolsbbtk/appli/GUICreateBlackBox"; 00447 bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl); 00448 mWxGUICommand->SendCommand(command); 00449 }
void bbtk::WxGUIScriptingInterface::OnMenuShowImageGraph | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 453 of file bbtkWxGUIScriptingInterface.cxx.
00454 { 00455 std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); 00456 00457 #if defined(WIN32) 00458 std::string strappli="start "; 00459 #else 00460 std::string strappli="gnome-open "; 00461 #endif 00462 std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png"; 00463 // std::cout << "system: " << strcommand << std::endl; 00464 system ( strcommand.c_str() ); 00465 00466 }
void bbtk::WxGUIScriptingInterface::OnMenuRegeneratePackageDoc | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 500 of file bbtkWxGUIScriptingInterface.cxx.
References _T, DoRegeneratePackageDoc(), and bbtk::wx2std().
00501 { 00502 wxString name = wxGetTextFromUser(_T("Enter package name (-a for all)"), 00503 _T("Regenerate package doc"), 00504 _T("")); 00505 if (name.IsEmpty()) return; 00506 std::string pack = bbtk::wx2std(name); 00507 00508 DoRegeneratePackageDoc(pack); 00509 }
void bbtk::WxGUIScriptingInterface::OnMenuRegenerateBoxesLists | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 542 of file bbtkWxGUIScriptingInterface.cxx.
References DoRegenerateBoxesLists().
00543 { 00544 DoRegenerateBoxesLists(); 00545 }
void bbtk::WxGUIScriptingInterface::OnMenuRegenerateAll | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 549 of file bbtkWxGUIScriptingInterface.cxx.
References DoRegenerateBoxesLists(), and DoRegeneratePackageDoc().
00550 { 00551 00552 DoRegeneratePackageDoc("-a"); 00553 DoRegenerateBoxesLists(); 00554 }
void bbtk::WxGUIScriptingInterface::OnMenuPlugPackage | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 559 of file bbtkWxGUIScriptingInterface.cxx.
References _T, bbtk::ConfigurationFile::AddPackagePathsAndWrite(), DoRegenerateBoxesLists(), DoRegeneratePackageDoc(), and bbtk::wx2std().
00560 { 00561 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST; 00562 wxDirDialog* FD = 00563 new wxDirDialog( 0, 00564 _T("Select package directory"), 00565 _T(""), 00566 style); 00567 00568 if (FD->ShowModal()==wxID_OK) 00569 { 00570 std::string path = wx2std (FD->GetPath()) ; 00571 std::string fname = path + "/bbtkPackage"; 00572 if ( ! Utilities::FileExists( fname ) ) 00573 { 00574 wxString err(_T("The directory does not contain a 'bbtkPackage' file")); 00575 wxMessageBox(err,_T("Plug package"),wxOK | wxICON_ERROR); 00576 return; 00577 } 00578 00579 std::ifstream f; 00580 f.open(fname.c_str()); 00581 std::string pname; 00582 f >> pname; 00583 f.close(); 00584 00585 00586 bbtk::ConfigurationFile::GetInstance().AddPackagePathsAndWrite( path ); 00587 00588 DoRegeneratePackageDoc(pname); 00589 DoRegenerateBoxesLists(); 00590 00591 } 00592 }
void bbtk::WxGUIScriptingInterface::OnMenuWindowsFiles | ( | wxCommandEvent & | event | ) |
Definition at line 647 of file bbtkWxGUIScriptingInterface.cxx.
References mWxGUITextEditor, and OnMenuWindowsCheck().
00648 { 00649 OnMenuWindowsCheck(event,mWxGUITextEditor); 00650 }
void bbtk::WxGUIScriptingInterface::OnMenuWindowsHelp | ( | wxCommandEvent & | event | ) |
Definition at line 654 of file bbtkWxGUIScriptingInterface.cxx.
References mWxGUIHtmlBrowser, and OnMenuWindowsCheck().
00655 { 00656 OnMenuWindowsCheck(event,mWxGUIHtmlBrowser); 00657 }
void bbtk::WxGUIScriptingInterface::OnMenuWindowsPackageBrowser | ( | wxCommandEvent & | event | ) |
void bbtk::WxGUIScriptingInterface::OnMenuWindowsMessages | ( | wxCommandEvent & | event | ) |
Definition at line 661 of file bbtkWxGUIScriptingInterface.cxx.
References mWxGUIOutputMessages, and OnMenuWindowsCheck().
00662 { 00663 OnMenuWindowsCheck(event,mWxGUIOutputMessages); 00664 }
void bbtk::WxGUIScriptingInterface::OnMenuWindowsCommand | ( | wxCommandEvent & | event | ) |
Definition at line 668 of file bbtkWxGUIScriptingInterface.cxx.
References mWxGUICommand, and OnMenuWindowsCheck().
00669 { 00670 OnMenuWindowsCheck(event,mWxGUICommand); 00671 }
void bbtk::WxGUIScriptingInterface::OnMenuWindowsSave | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Definition at line 675 of file bbtkWxGUIScriptingInterface.cxx.
References SavePerspective().
00676 { 00677 SavePerspective(); 00678 }
void bbtk::WxGUIScriptingInterface::OnMenuWindowsCheck | ( | wxCommandEvent & | event, | |
wxWindow * | w | |||
) |
Definition at line 632 of file bbtkWxGUIScriptingInterface.cxx.
References m_mgr.
Referenced by OnMenuWindowsCommand(), OnMenuWindowsFiles(), OnMenuWindowsHelp(), and OnMenuWindowsMessages().
00634 { 00635 bool checked = event.IsChecked(); 00636 bool shown = m_mgr.GetPane(w).IsShown(); 00637 // std::cout << "checked = "<<checked<<" - shown = "<<shown<<std::endl; 00638 if (checked ^ shown) 00639 { 00640 m_mgr.GetPane(w).Show(checked); 00641 m_mgr.Update(); 00642 } 00643 }
void bbtk::WxGUIScriptingInterface::OnPaneClose | ( | wxAuiManagerEvent & | evt | ) |
Definition at line 741 of file bbtkWxGUIScriptingInterface.cxx.
00742 { 00743 std::cout << "Closing panel '"<<evt.pane->name<<"'"<<std::endl; 00744 // TO DO : Uncheck 00745 // OnMenuWindowsCheck( wxCommandEvent& event, wxWindow* w); 00746 }
void bbtk::WxGUIScriptingInterface::SavePerspective | ( | ) |
Definition at line 682 of file bbtkWxGUIScriptingInterface.cxx.
References m_mgr, and bbtk::wx2std().
Referenced by OnMenuWindowsSave(), and ~WxGUIScriptingInterface().
00683 { 00684 // std::cout << "Saving configuration..."<<std::endl; 00685 std::string conf = wx2std(m_mgr.SavePerspective()); 00686 std::string fname = Utilities::MakeUserSettingsFullFileName("bbStudio.aui"); 00687 std::ofstream f; 00688 f.open(fname.c_str(), std::ios::out ); 00689 f << conf << std::endl; 00690 00691 // int x,y; 00692 // GetPosition(&x,&y); 00693 // f << x << " " << y << std::endl; 00694 00695 00696 int w,h; 00697 GetSize(&w,&h); 00698 00699 f << w << " " << h << std::endl; 00700 00701 f.close(); 00702 }
void bbtk::WxGUIScriptingInterface::LoadPerspective | ( | ) |
Definition at line 706 of file bbtkWxGUIScriptingInterface.cxx.
References m_mgr, and bbtk::std2wx().
Referenced by WxGUIScriptingInterface().
00707 { 00708 std::string fname = 00709 Utilities::MakeUserSettingsFullFileName("bbStudio.aui"); 00710 if ( Utilities::FileExists( fname )) 00711 { 00712 // std::cout << "Loading configuration..."<<std::endl; 00713 00714 std::ifstream f; 00715 f.open(fname.c_str()); 00716 std::string conf; 00717 f >> conf; 00718 00719 // int x,y; 00720 // f >> x >> y ; 00721 00722 int w,h; 00723 f >> w >> h ; 00724 00725 f.close(); 00726 00727 // std::cout << conf << std::endl; 00728 00729 // Move(x,y); 00730 SetSize(w,h); 00731 m_mgr.LoadPerspective(std2wx(conf)); 00732 } 00733 else 00734 { 00735 m_mgr.Update(); 00736 } 00737 }
bool bbtk::WxGUIScriptingInterface::InterpreterUserHasOwnHtmlPageViewer | ( | ) | [inline, virtual] |
Reimplemented from bbtk::InterpreterUser.
Definition at line 131 of file bbtkWxGUIScriptingInterface.h.
void bbtk::WxGUIScriptingInterface::InterpreterUserViewHtmlPage | ( | const std::string & | page | ) | [virtual] |
Reimplemented from bbtk::InterpreterUser.
Definition at line 596 of file bbtkWxGUIScriptingInterface.cxx.
References bbtk::WxGUIHtmlBrowser::GoTo(), and mWxGUIHtmlBrowser.
00597 { 00598 std::string s(page); 00599 // std::cout << "WxGUIScriptingInterface::ShowHtmlPage('"<<page<<"')"<<std::endl; 00600 if (mWxGUIHtmlBrowser->GoTo(s)) 00601 { 00602 //EED mwxNotebook->ChangeSelection(1); 00603 // mwxNotebook->SetSelection(1); 00604 } 00605 else 00606 { 00607 // std::cout << "ERROR html"<<std::endl; 00608 } 00609 }
void bbtk::WxGUIScriptingInterface::WxGUICommandEnter | ( | const std::string & | command | ) | [virtual] |
Callback invoked when a command is entered in the WxGUICommand.
Reimplemented from bbtk::WxGUICommandUser.
Definition at line 306 of file bbtkWxGUIScriptingInterface.cxx.
References CATCH_MACRO, mInterpreter, mWxGUIOutputMessages, and bbtk::WxGUIOutputMessages::Print().
Referenced by WxGUITextEditorRun().
00307 { 00308 std::string s("> "); 00309 s += command + "\n"; 00310 mWxGUIOutputMessages->Print(s,wxRED); 00311 00312 try 00313 { 00314 mInterpreter->InterpretLine( command ); 00315 } 00316 CATCH_MACRO; 00317 }
void bbtk::WxGUIScriptingInterface::WxGUITextEditorRun | ( | ) | [virtual] |
Callback invoked when the 'run' button is pressed.
Reimplemented from bbtk::WxGUITextEditorUser.
Definition at line 334 of file bbtkWxGUIScriptingInterface.cxx.
References CATCH_MACRO, bbtk::WxGUITextEditor::GetCurrentPage(), bbtk::WxGUITextEditorPage::GetText(), mInterpreter, mWxGUITextEditor, mwxMenuItemReset, and WxGUICommandEnter().
00335 { 00336 // wxString temp = mWxGUIHtmlBrowser->GetCurrentPage(); 00337 std::stringstream* buf = new std::stringstream; 00338 (*buf) << mWxGUITextEditor->GetCurrentPage()->GetText(); 00339 try 00340 { 00341 // std::cout << "RUN"<<std::endl; 00342 if (mwxMenuItemReset->IsChecked()) WxGUICommandEnter("reset"); 00343 mInterpreter->InterpretBuffer(buf); 00344 // std::cout << "EO RUN"<<std::endl; 00345 } 00346 CATCH_MACRO; 00347 // std::cout << "EO RUN 3"<<std::endl; 00348 }
bool bbtk::WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked | ( | const std::string & | target | ) | [virtual] |
Reimplemented from bbtk::WxGUIHtmlBrowserUser.
Definition at line 613 of file bbtkWxGUIScriptingInterface.cxx.
References mWxGUITextEditor, mwxNotebook, and bbtk::WxGUITextEditor::Open().
00614 { 00615 size_t s = target.length(); 00616 if ((s>3) && (target[s-1]=='s') 00617 && (target[s-2]=='b') 00618 && (target[s-3]=='b') 00619 && (target[s-4]=='.')) 00620 { 00621 mWxGUITextEditor->Open(target); 00622 #if NOTEBOOK 00623 mwxNotebook->SetSelection(0); 00624 #endif 00625 mWxGUITextEditor->SetFocus(); 00626 return false; 00627 } 00628 return true; 00629 }
void bbtk::WxGUIScriptingInterface::DoRegeneratePackageDoc | ( | const std::string & | pack | ) |
Definition at line 469 of file bbtkWxGUIScriptingInterface.cxx.
References _T, bbtkMessage, and bbtk::std2wx().
Referenced by OnMenuPlugPackage(), OnMenuRegenerateAll(), and OnMenuRegeneratePackageDoc().
00470 { 00471 std::string command; 00472 #if defined(WIN32) 00473 command = "\""; 00474 #endif 00475 command += ConfigurationFile::GetInstance().Get_bin_path(); 00476 command += ConfigurationFile::GetInstance().Get_file_separator(); 00477 command += "bbRegeneratePackageDoc"; 00478 #if defined(WIN32) 00479 command += "\""; 00480 #endif 00481 command += " " + pack + " -q"; 00482 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl); 00483 00484 00485 if ( ! system ( command.c_str() ) ) 00486 { 00487 wxMessageBox(_T("Done !"),_T("Regenerate package '")+std2wx(pack)+_T("' doc"), 00488 wxOK | wxICON_INFORMATION); 00489 } 00490 else 00491 { 00492 wxString err(_T("An error occured while running '")); 00493 err += bbtk::std2wx(command) + _T("'"); 00494 wxMessageBox(err,_T("Regenerate package doc"),wxOK | wxICON_ERROR); 00495 } 00496 }
void bbtk::WxGUIScriptingInterface::DoRegenerateBoxesLists | ( | ) |
Definition at line 513 of file bbtkWxGUIScriptingInterface.cxx.
References _T, bbtkMessage, and bbtk::std2wx().
Referenced by OnMenuPlugPackage(), OnMenuRegenerateAll(), and OnMenuRegenerateBoxesLists().
00514 { 00515 std::string command; 00516 #if defined(WIN32) 00517 command = "\""; 00518 #endif 00519 command += ConfigurationFile::GetInstance().Get_bin_path(); 00520 command += ConfigurationFile::GetInstance().Get_file_separator(); 00521 command += "bbRegenerateBoxesLists"; 00522 #if defined(WIN32) 00523 command += "\""; 00524 #endif 00525 command += " -q"; 00526 bbtkMessage("debug",1,"Executing system command '"<<command<<"'"<<std::endl); 00527 00528 if ( ! system ( command.c_str() ) ) 00529 { 00530 wxMessageBox(_T("Done !"),_T("Regenerate boxes lists"), 00531 wxOK | wxICON_INFORMATION); 00532 } 00533 else 00534 { 00535 wxString err(_T("An error occured while running '")); 00536 err += bbtk::std2wx(command) + _T("'"); 00537 wxMessageBox(err,_T("Regenerate boxes lists"),wxOK | wxICON_ERROR); 00538 } 00539 }
wxAuiManager bbtk::WxGUIScriptingInterface::m_mgr [private] |
Definition at line 147 of file bbtkWxGUIScriptingInterface.h.
Referenced by LoadPerspective(), OnMenuWindowsCheck(), SavePerspective(), WxGUIScriptingInterface(), and ~WxGUIScriptingInterface().
Interpreter::Pointer bbtk::WxGUIScriptingInterface::mInterpreter [private] |
Definition at line 148 of file bbtkWxGUIScriptingInterface.h.
Referenced by InterpretFile(), WxGUICommandEnter(), WxGUIScriptingInterface(), and WxGUITextEditorRun().
wxAuiNotebook* bbtk::WxGUIScriptingInterface::mwxNotebook [private] |
Definition at line 150 of file bbtkWxGUIScriptingInterface.h.
Referenced by WxGUIHtmlBrowserUserOnLinkClicked(), and WxGUIScriptingInterface().
WxGUICommand* bbtk::WxGUIScriptingInterface::mWxGUICommand [private] |
Definition at line 157 of file bbtkWxGUIScriptingInterface.h.
Referenced by OnMenuCreateBlackBox(), OnMenuCreatePackage(), OnMenuWindowsCommand(), and WxGUIScriptingInterface().
WxGUIOutputMessages* bbtk::WxGUIScriptingInterface::mWxGUIOutputMessages [private] |
Definition at line 158 of file bbtkWxGUIScriptingInterface.h.
Referenced by OnMenuWindowsMessages(), WxGUICommandEnter(), and WxGUIScriptingInterface().
WxGUIHtmlBrowser* bbtk::WxGUIScriptingInterface::mWxGUIHtmlBrowser [private] |
Definition at line 159 of file bbtkWxGUIScriptingInterface.h.
Referenced by InterpreterUserViewHtmlPage(), OnMenuWindowsHelp(), and WxGUIScriptingInterface().
WxGUITextEditor* bbtk::WxGUIScriptingInterface::mWxGUITextEditor [private] |
Definition at line 160 of file bbtkWxGUIScriptingInterface.h.
Referenced by OnMenuWindowsFiles(), Open(), WxGUIHtmlBrowserUserOnLinkClicked(), WxGUIScriptingInterface(), and WxGUITextEditorRun().
WxGUIPackageBrowser2* bbtk::WxGUIScriptingInterface::mWxGUIPackageBrowser2 [private] |
Definition at line 161 of file bbtkWxGUIScriptingInterface.h.
wxMenuItem* bbtk::WxGUIScriptingInterface::mwxMenuItemReset [private] |
Definition at line 163 of file bbtkWxGUIScriptingInterface.h.
Referenced by WxGUIScriptingInterface(), and WxGUITextEditorRun().