2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbtkWxGUIHtmlBrowser.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.8 $
34 =========================================================================*/
40 * \brief Short description in one line
42 * Long description which
43 * can span multiple lines
54 #ifdef _USE_WXWIDGETS_
57 #ifndef __bbtkWxGUIHtmlBrowser_h_INCLUDED__
58 #define __bbtkWxGUIHtmlBrowser_h_INCLUDED__
61 #include <wx/html/htmlwin.h>
66 class WxGUIHtmlBrowser;
69 class WxHtmlWindow : public virtual wxHtmlWindow
72 WxHtmlWindow( wxWindow *parent, int id, WxGUIHtmlBrowser* browser, wxSize size)
73 : wxHtmlWindow(parent, id,
77 _T("bbtk::WxGUIHtmlBrowser")),
80 std::cout << "ctor"<<std::endl;
83 // wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,const wxString& url, wxString *redirect);
84 // virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
86 //EED2 void OnSize( wxSizeEvent&);
90 WxGUIHtmlBrowser* mBrowser;
92 // any class wishing to process wxWidgets events must use this macro
93 //EED2 DECLARE_EVENT_TABLE()
97 // typedef wxHtmlWindow WxHtmlWindow;
100 #define THE_HTML_WINDOW_CLASS wxHtmlWindow
102 /// Abstract class which defines the callbacks invoked by WxGUIHtmlBrowser
103 class WxGUIHtmlBrowserUser
106 WxGUIHtmlBrowserUser() {}
107 virtual ~WxGUIHtmlBrowserUser() {}
109 virtual bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
115 // class WxGUIConsole;
118 class BBTK_EXPORT WxGUIHtmlBrowser : public wxPanel
121 WxGUIHtmlBrowser ( wxWindow *parent, wxSize size,
122 WxGUIHtmlBrowserUser* = 0 );
124 bool GoTo(std::string&);
127 void OnBackButton(wxCommandEvent& );
128 void OnForwardButton(wxCommandEvent& );
129 void OnHomeButton(wxCommandEvent& );
130 void OnReloadButton(wxCommandEvent& );
131 // void OnRunButton(wxCommandEvent& );
132 void OnLinkClicked(wxHtmlLinkEvent& );
133 void OnLinkClicked2(const wxHtmlLinkInfo& );
134 void OnURLEnter( wxCommandEvent&);
135 void OnSize( wxSizeEvent&);
138 // void OnCell(wxHtmlCellEvent& );
140 void SetSize( wxSize );
142 std::string GetCurrentPage();
145 THE_HTML_WINDOW_CLASS * mwxHtmlWindow;
147 wxButton* mwxBackButton;
148 wxButton* mwxForwardButton;
149 wxButton* mwxHomeButton;
150 wxButton* mwxReloadButton;
151 // wxButton* mwxRunButton;
153 WxGUIHtmlBrowserUser* mUser;
155 // any class wishing to process wxWidgets events must use this macro
156 DECLARE_EVENT_TABLE()