Program: bbtk
Module: $RCSfile: bbtkWxGUIHtmlBrowser.cxx,v $
Language: C++
- Date: $Date: 2008/03/20 15:27:57 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/04/22 14:30:25 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//========================================================================
- WxGUIHtmlBrowser::WxGUIHtmlBrowser ( wxWindow *parent, wxSize size )
+ WxGUIHtmlBrowser::WxGUIHtmlBrowser ( wxWindow *parent, wxSize size,
+ WxGUIHtmlBrowserUser* user)
:
- wxPanel ( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
- // , mWxGUIConsole(0)
+ wxPanel ( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+ mUser(user)
{
wxPanel* panel = this;
//========================================================================
bool WxGUIHtmlBrowser::GoTo(std::string& file)
{
- // std::cout << "goto"<<std::endl;
-
bool r = mwxHtmlWindow->LoadPage(std2wx(file));
UpdateURL();
return r;
//========================================================================
void WxGUIHtmlBrowser::OnBackButton(wxCommandEvent& )
{
- // std::cout << "back"<<std::endl;
mwxHtmlWindow->HistoryBack();
UpdateURL();
}
//========================================================================
void WxGUIHtmlBrowser::OnForwardButton(wxCommandEvent& )
{
- // std::cout << "forward"<<std::endl;
mwxHtmlWindow->HistoryForward();
UpdateURL();
}
//========================================================================
void WxGUIHtmlBrowser::OnLinkClicked(wxHtmlLinkEvent& e)
- {
- mwxHtmlWindow->LoadPage( e.GetLinkInfo().GetHref() );
+ {
+
+ bool go = true;
+ if (mUser)
+ {
+ wxString file = wxPathOnly(mwxURL->GetValue());
+ file += std2wx(ConfigurationFile::GetInstance().Get_file_separator());
+ file += e.GetLinkInfo().GetHref();
+ go = mUser->WxGUIHtmlBrowserUserOnLinkClicked( wx2std( file ) );
+ }
+ if (go)
+ {
+ mwxHtmlWindow->LoadPage( e.GetLinkInfo().GetHref() );
UpdateURL();
- mwxHtmlWindow->LoadPage( mwxURL->GetValue() );
- }
+ }
+ // mwxHtmlWindow->LoadPage( mwxURL->GetValue() );
+ }
//========================================================================