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