]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxGUIHtmlBrowser.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkWxGUIHtmlBrowser.cxx
index abc4835e484acf84178adc03529c096e4f753a27..4cfe254f3e6a9752f4d4144f81cfe4ee4cfd2bb1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIHtmlBrowser.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/20 15:27:57 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/03/21 14:59:39 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -88,10 +88,11 @@ namespace bbtk
 
 
   //========================================================================
-    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;
@@ -292,11 +293,24 @@ namespace bbtk
 
   //========================================================================
   void WxGUIHtmlBrowser::OnLinkClicked(wxHtmlLinkEvent& e)
-  {
-    mwxHtmlWindow->LoadPage( e.GetLinkInfo().GetHref() );
+  { 
+    std::cout << "BrOnLink"<<std::endl; 
+  
+    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() );
+   }
   //========================================================================