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 class WxHtmlWindow : public virtual wxHtmlWindow
00062 {
00063 public:
00064 WxHtmlWindow( wxWindow *parent, int id, WxGUIHtmlBrowser* browser, wxSize size)
00065 : wxHtmlWindow(parent, id,
00066 wxDefaultPosition,
00067 size,
00068 wxHW_SCROLLBAR_AUTO,
00069 _T("bbtk::WxGUIHtmlBrowser")),
00070 mBrowser(browser)
00071 {
00072 SetBorders(30);
00073 };
00074
00075
00076
00077
00078
00079
00080 private:
00081 WxGUIHtmlBrowser* mBrowser;
00082
00083
00084
00085
00086 };
00087
00088
00090 class WxGUIHtmlBrowserUser
00091 {
00092 public :
00093 WxGUIHtmlBrowserUser() {}
00094 virtual ~WxGUIHtmlBrowserUser() {}
00095
00096 virtual bool WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
00097 { return true; }
00098 };
00099
00100
00101
00102
00103
00104
00105 class BBTK_EXPORT WxGUIHtmlBrowser : public wxPanel
00106 {
00107 public:
00108 WxGUIHtmlBrowser ( wxWindow *parent, wxSize size,
00109 WxGUIHtmlBrowserUser* = 0 );
00110
00111 bool GoTo(std::string&);
00112 void GoHome();
00113
00114 void OnBackButton(wxCommandEvent& );
00115 void OnForwardButton(wxCommandEvent& );
00116 void OnHomeButton(wxCommandEvent& );
00117 void OnReloadButton(wxCommandEvent& );
00118
00119 void OnLinkClicked(wxHtmlLinkEvent& );
00120 void OnURLEnter( wxCommandEvent&);
00121 void OnSize( wxSizeEvent&);
00122
00123 void UpdateURL();
00124
00125
00126 void SetSize( wxSize );
00127
00128 std::string GetCurrentPage();
00129
00130 private:
00131 WxHtmlWindow* mwxHtmlWindow;
00132 wxTextCtrl* mwxURL;
00133 wxButton* mwxBackButton;
00134 wxButton* mwxForwardButton;
00135 wxButton* mwxHomeButton;
00136 wxButton* mwxReloadButton;
00137
00138
00139 WxGUIHtmlBrowserUser* mUser;
00140
00141
00142 DECLARE_EVENT_TABLE()
00143 };
00144
00145 }
00146 #endif
00147
00148 #endif