X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUIHtmlBrowser.cxx;h=df91b754af2957265758b386adb723e4a12385c5;hb=cf155931d4fded21cd2aaaeb0f3ead82067d2bef;hp=4cfe254f3e6a9752f4d4144f81cfe4ee4cfd2bb1;hpb=fc399c5aab38ad24ea5d57552701411b4d805181;p=bbtk.git diff --git a/kernel/src/bbtkWxGUIHtmlBrowser.cxx b/kernel/src/bbtkWxGUIHtmlBrowser.cxx index 4cfe254..df91b75 100644 --- a/kernel/src/bbtkWxGUIHtmlBrowser.cxx +++ b/kernel/src/bbtkWxGUIHtmlBrowser.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxGUIHtmlBrowser.cxx,v $ Language: C++ - Date: $Date: 2008/03/21 14:59:39 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/10/15 09:31:20 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -73,6 +73,17 @@ namespace bbtk */ +//EED2 BEGIN_EVENT_TABLE(WxHtmlWindow, wxPanel) +//EED2 EVT_SIZE(WxHtmlWindow::OnSize) +//EED2 END_EVENT_TABLE() + +//EED2 void WxHtmlWindow::OnSize( wxSizeEvent& ) +//EED2 { +//EED2 printf("EED WxHtmlWindow::OnSize \n" ); +//EED2 Scroll(10,500); +//EED2 } + + //======================================================================== BEGIN_EVENT_TABLE(WxGUIHtmlBrowser, wxPanel) @@ -83,6 +94,8 @@ namespace bbtk // EVT_BUTTON(include_id, WxGUIHtmlBrowser::OnIncludeFileButton ) EVT_TEXT_ENTER(url_id, WxGUIHtmlBrowser::OnURLEnter ) EVT_HTML_LINK_CLICKED(html_id, WxGUIHtmlBrowser::OnLinkClicked) + EVT_SIZE(WxGUIHtmlBrowser::OnSize) + END_EVENT_TABLE() //======================================================================== @@ -180,8 +193,6 @@ namespace bbtk //======================================================================== bool WxGUIHtmlBrowser::GoTo(std::string& file) { - // std::cout << "goto"<LoadPage(std2wx(file)); UpdateURL(); return r; @@ -191,7 +202,6 @@ namespace bbtk //======================================================================== void WxGUIHtmlBrowser::OnBackButton(wxCommandEvent& ) { - // std::cout << "back"<HistoryBack(); UpdateURL(); } @@ -200,7 +210,6 @@ namespace bbtk //======================================================================== void WxGUIHtmlBrowser::OnForwardButton(wxCommandEvent& ) { - // std::cout << "forward"<HistoryForward(); UpdateURL(); } @@ -210,23 +219,8 @@ namespace bbtk void WxGUIHtmlBrowser::GoHome() { std::string url = ConfigurationFile::GetInstance().Get_doc_path(); - url += "/bbtkWebSite/menu.html"; - GoTo(url); - - mwxURL->Clear(); - mwxURL->AppendText(std2wx(url)); - - -/*EED - if (Utilities::FileExists(url)) - { - GoTo(url); - } - else - { - // what ? - } -*/ + url += "/help_contents.html"; + GoTo(url); } //======================================================================== @@ -294,26 +288,47 @@ namespace bbtk //======================================================================== void WxGUIHtmlBrowser::OnLinkClicked(wxHtmlLinkEvent& e) { - std::cout << "BrOnLink"<GetValue()); file += std2wx(ConfigurationFile::GetInstance().Get_file_separator()); file += e.GetLinkInfo().GetHref(); - go = mUser->WxGUIHtmlBrowserUserOnLinkClicked( wx2std( file ) ); + */ + wxString file = e.GetLinkInfo().GetHref(); + go = mUser->WxGUIHtmlBrowserUserOnLinkClicked( wx2std( file ) ); } if (go) { mwxHtmlWindow->LoadPage( e.GetLinkInfo().GetHref() ); UpdateURL(); - } + // OnURLEnter(e); + // mwxHtmlWindow->LoadPage(mwxURL->GetValue()); + } + // mwxHtmlWindow->LoadPage( mwxURL->GetValue() ); } //======================================================================== + //======================================================================== + void WxGUIHtmlBrowser::OnSize(wxSizeEvent& e) + { + mwxHtmlWindow->EnableScrolling(true,true); + if ( mwxURL->GetValue()!=wxString(_T("")) ) + { +// ?????????? No funciona ....????? +//EED2 mwxHtmlWindow->LoadPage(mwxURL->GetValue()); +// printf("EED WxGUIHtmlBrowser::OnSize %s \n", mwxURL->GetValue().c_str() ); +//EED2 mwxHtmlWindow->Scroll( 10, 500); + } else { +// GoHome(); + } + e.Skip(true); + } + /* void WxGUIHtmlBrowser::OnCell(wxHtmlCellEvent& ) {