+ }
+ //================================================================
+ */
+
+ //================================================================
+ bool WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
+ {
+ size_t s = target.length();
+ if ((s>3) && (target[s-1]=='s')
+ && (target[s-2]=='b')
+ && (target[s-3]=='b')
+ && (target[s-4]=='.'))
+ {
+ mWxGUITextEditor->Open(target);
+ #if NOTEBOOK
+ mwxNotebook->SetSelection(0);
+ #endif
+ mWxGUITextEditor->SetFocus();
+ return false;
+ }
+
+ if ((s>3) && (target[s-1]=='f')
+ && (target[s-2]=='d')
+ && (target[s-3]=='p')
+ && (target[s-4]=='.'))
+ {
+
+ // Open pdf in linux
+ // gnome-open target
+
+ // Open pdf in macOS
+
+ // Open pdf in windows
+ int size=target.size();
+ int pos=target.rfind("\\");
+ std::string commandStart("start ");
+ std::string commandPath("/D \""+target.substr(0,pos) +"\"");
+ std::string commandPDF( target.substr(pos+1,size-pos+1) );
+
+ printf("EED WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked cc %s \n",commandPath.c_str() );
+ // cleanning path
+ while (commandPath.rfind("\\\\")!=-1 )
+ {
+ commandPath.erase( commandPath.rfind("\\\\") , 1 );
+ printf("EED WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked cc %s \n",commandPath.c_str() );
+ }
+
+ std::string command = commandStart+commandPath+" "+commandPDF;
+ printf("EED WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked BB %s \n",command.c_str() );
+ system( command.c_str() );
+ return false;
+ }
+ return true;
+ }
+ //================================================================
+
+ void WxGUIScriptingInterface::OnMenuWindowsCheck( wxCommandEvent& event,
+ wxWindow* w)
+ {
+ bool checked = event.IsChecked();
+ bool shown = m_mgr.GetPane(w).IsShown();
+ // std::cout << "checked = "<<checked<<" - shown = "<<shown<<std::endl;
+ if (checked ^ shown)
+ {
+ m_mgr.GetPane(w).Show(checked);
+ m_mgr.Update();
+ }
+ }
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuWindowsFiles(wxCommandEvent& event)
+ {
+ OnMenuWindowsCheck(event,mWxGUITextEditor);
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuWindowsHelp(wxCommandEvent& event)
+ {
+ OnMenuWindowsCheck(event,mWxGUIHtmlBrowser);
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuWindowsMessages(wxCommandEvent& event)
+ {
+ OnMenuWindowsCheck(event,mWxGUIOutputMessages);
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuWindowsCommand(wxCommandEvent& event)
+ {
+ OnMenuWindowsCheck(event,mWxGUICommand);
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::OnMenuWindowsSave( wxCommandEvent& WXUNUSED(event))
+ {
+ SavePerspective();
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::SavePerspective()
+ {
+ // std::cout << "Saving configuration..."<<std::endl;
+ std::string conf = wx2std(m_mgr.SavePerspective());
+ std::string fname = Utilities::MakeUserSettingsFullFileName("bbStudio.aui");
+ std::ofstream f;
+ f.open(fname.c_str(), std::ios::out );
+ f << conf << std::endl;
+
+ // int x,y;
+ // GetPosition(&x,&y);
+ // f << x << " " << y << std::endl;
+
+
+ int w,h;
+ GetSize(&w,&h);
+
+ f << w << " " << h << std::endl;
+
+ f.close();
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::LoadPerspective()
+ {
+ std::string fname =
+ Utilities::MakeUserSettingsFullFileName("bbStudio.aui");
+ if ( Utilities::FileExists( fname ))
+ {
+ // std::cout << "Loading configuration..."<<std::endl;
+
+ std::ifstream f;
+ f.open(fname.c_str());
+ std::string conf;
+ f >> conf;
+
+ // int x,y;
+ // f >> x >> y ;
+
+ int w,h;
+ f >> w >> h ;
+
+ f.close();
+
+ // std::cout << conf << std::endl;
+
+ // Move(x,y);
+ SetSize(w,h);
+ m_mgr.LoadPerspective(std2wx(conf));
+ }
+ else
+ {
+ m_mgr.Update();
+ }
+ }
+ //================================================================
+
+ //================================================================
+ void WxGUIScriptingInterface::OnPaneClose(wxAuiManagerEvent& evt)
+ {
+ std::cout << "Closing panel '"<<evt.pane->name<<"'"<<std::endl;
+ // TO DO : Uncheck
+ // OnMenuWindowsCheck( wxCommandEvent& event, wxWindow* w);
+ }
+ //================================================================
+
+