]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxBrowser.h
wxSizer
[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
45     void OnBackButton(wxCommandEvent& );
46     void OnForwardButton(wxCommandEvent& );
47         void OnLinkClicked(wxHtmlLinkEvent& );
48     void OnURLEnter( wxCommandEvent&);
49     void UpdateURL();
50     //  void OnCell(wxHtmlCellEvent& );
51
52     void SetSize( wxSize );
53
54   private:
55     WxHtmlWindow* mwxHtmlWindow;
56     wxTextCtrl* mwxURL;
57     wxButton* mwxBackButton;
58     wxButton* mwxForwardButton;
59  
60    // any class wishing to process wxWidgets events must use this macro
61     DECLARE_EVENT_TABLE()  
62   };
63
64 }
65 #endif
66
67 #endif