bbtkWxGUIHtmlBrowser.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00047 #ifdef _USE_WXWIDGETS_
00048
00049
00050 #ifndef __bbtkWxGUIHtmlBrowser_h_INCLUDED__
00051 #define __bbtkWxGUIHtmlBrowser_h_INCLUDED__
00052
00053 #include "bbtkWx.h"
00054 #include <wx/html/htmlwin.h>
00055
00056 namespace bbtk
00057 {
00058
00059 class WxGUIHtmlBrowser;
00060
00061
00062 class WxHtmlWindow : public virtual wxHtmlWindow
00063 {
00064 public:
00065 WxHtmlWindow( wxWindow *parent, int id, WxGUIHtmlBrowser* browser, wxSize size)
00066 : wxHtmlWindow(parent, id,
00067 wxDefaultPosition,
00068 size,
00069 wxHW_SCROLLBAR_AUTO,
00070 _T("bbtk::WxGUIHtmlBrowser")),
00071 mBrowser(browser)
00072 {
00073 std::cout << "ctor"<<std::endl;
00074 SetBorders(30);
00075 };
00076
00077
00078
00079
00080
00081
00082 private:
00083 WxGUIHtmlBrowser* mBrowser;
00084
00085
00086
00087
00088 };
00089
00090
00091
00092
00093 #define THE_HTML_WINDOW_CLASS wxHtmlWindow
00094
00096 class WxGUIHtmlBrowserUser
00097 {
00098 public :
00099 WxGUIHtmlBrowserUser() {}
00100 virtual ~WxGUIHtmlBrowserUser() {}
00101
00102 virtual bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
00103 { return true; }
00104 };
00105
00106
00107
00108
00109
00110
00111 class BBTK_EXPORT WxGUIHtmlBrowser : public wxPanel
00112 {
00113 public:
00114 WxGUIHtmlBrowser ( wxWindow *parent, wxSize size,
00115 WxGUIHtmlBrowserUser* = 0 );
00116
00117 bool GoTo(std::string&);
00118 void GoHome();
00119
00120 void OnBackButton(wxCommandEvent& );
00121 void OnForwardButton(wxCommandEvent& );
00122 void OnHomeButton(wxCommandEvent& );
00123 void OnReloadButton(wxCommandEvent& );
00124
00125 void OnLinkClicked(wxHtmlLinkEvent& );
00126 void OnLinkClicked2(const wxHtmlLinkInfo& );
00127 void OnURLEnter( wxCommandEvent&);
00128 void OnSize( wxSizeEvent&);
00129
00130 void UpdateURL();
00131
00132
00133 void SetSize( wxSize );
00134
00135 std::string GetCurrentPage();
00136
00137 private:
00138 THE_HTML_WINDOW_CLASS * mwxHtmlWindow;
00139 wxTextCtrl* mwxURL;
00140 wxButton* mwxBackButton;
00141 wxButton* mwxForwardButton;
00142 wxButton* mwxHomeButton;
00143 wxButton* mwxReloadButton;
00144
00145
00146 WxGUIHtmlBrowserUser* mUser;
00147
00148
00149 DECLARE_EVENT_TABLE()
00150 };
00151
00152 }
00153 #endif
00154
00155 #endif