]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxBrowser.h
26238df30e5190fd96494c7552e3d76d548e321e
[bbtk.git] / kernel / src / bbtkWxBrowser.h
1 #ifdef _USE_WXWIDGETS_
2
3
4 #ifndef __bbtkWxBrowser_h_INCLUDED__
5 #define __bbtkWxBrowser_h_INCLUDED__
6
7 #include "bbtkWx.h"
8 #include <wx/html/htmlwin.h>
9
10 namespace bbtk
11 {
12
13   class WxBrowser;
14
15   class WxHtmlWindow : public virtual wxHtmlWindow
16   {
17   public:
18     WxHtmlWindow( wxWindow *parent, int id, WxBrowser* browser, wxSize size) 
19       : wxHtmlWindow(parent, id, 
20                      wxDefaultPosition, 
21                      size,
22                      wxHW_SCROLLBAR_AUTO, 
23                   _T("bbtk::WxBrowser")),
24               mBrowser(browser)
25     {
26      
27     }
28     //    wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,const wxString& url, wxString *redirect);
29     virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
30
31   private: 
32     WxBrowser* mBrowser;
33
34
35   };
36
37  
38   class WxBrowser : public wxPanel
39   {
40   public:
41     WxBrowser ( wxWindow *parent, wxSize size );
42  
43     bool GoTo(std::string&);
44     void GoHome();
45
46     void OnBackButton(wxCommandEvent& );
47     void OnForwardButton(wxCommandEvent& );
48     void OnHomeButton(wxCommandEvent& );
49     void OnReloadButton(wxCommandEvent& );
50     void OnIncludeFileButton(wxCommandEvent& );
51     void OnLinkClicked(wxHtmlLinkEvent& );
52     void OnURLEnter( wxCommandEvent&);
53     void UpdateURL();
54     //  void OnCell(wxHtmlCellEvent& );
55
56     void SetSize( wxSize );
57
58   private:
59     WxHtmlWindow* mwxHtmlWindow;
60     wxTextCtrl* mwxURL;
61     wxButton* mwxBackButton;
62     wxButton* mwxForwardButton;
63     wxButton* mwxHomeButton;
64     wxButton* mwxReloadButton;
65     wxButton* mwxIncludeFileButton;
66  
67    // any class wishing to process wxWidgets events must use this macro
68     DECLARE_EVENT_TABLE()  
69   };
70
71 }
72 #endif
73
74 #endif