]> Creatis software - bbtk.git/blob - kernel/src/bbtkWxBrowser.h
8f1c3b153ee3a0ad2db2c6854bc10ead81ea27d9
[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 //EED    virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
30
31   private: 
32     WxBrowser* mBrowser;
33
34
35   };
36
37  
38
39   class WxConsole;
40
41   class WxBrowser : public wxPanel
42   {
43   public:
44     WxBrowser ( wxWindow *parent, wxSize size );
45  
46     bool GoTo(std::string&);
47     void GoHome();
48
49     void OnBackButton(wxCommandEvent& );
50     void OnForwardButton(wxCommandEvent& );
51     void OnHomeButton(wxCommandEvent& );
52     void OnReloadButton(wxCommandEvent& );
53     void OnIncludeFileButton(wxCommandEvent& );
54     void OnLinkClicked(wxHtmlLinkEvent& );
55     void OnURLEnter( wxCommandEvent&);
56     void UpdateURL();
57     //  void OnCell(wxHtmlCellEvent& );
58
59     void SetSize( wxSize );
60
61     void SetWxConsole( WxConsole* c ) { mWxConsole = c; }
62
63   private:
64     WxHtmlWindow* mwxHtmlWindow;
65     wxTextCtrl* mwxURL;
66     wxButton* mwxBackButton;
67     wxButton* mwxForwardButton;
68     wxButton* mwxHomeButton;
69     wxButton* mwxReloadButton;
70     wxButton* mwxIncludeFileButton;
71     
72     WxConsole* mWxConsole;
73     
74    // any class wishing to process wxWidgets events must use this macro
75     DECLARE_EVENT_TABLE()  
76   };
77
78 }
79 #endif
80
81 #endif