Skip to content
Browse files

HtmlOutputPane: Use new browser include.

  • Loading branch information...
1 parent 3e654a6 commit be5bc2b4244e38a9c41670de0b2847cdd0ffe7cc @adamv adamv committed
Showing with 16 additions and 41 deletions.
  1. +11 −26 src/HtmlOutputPane.cpp
  2. +5 −15 src/HtmlOutputPane.h
View
37 src/HtmlOutputPane.cpp
@@ -1,19 +1,12 @@
#include "HtmlOutputPane.h"
#include "IOpenTextmateURL.h"
#include "eDocumentPath.h"
+#include "eBrowser.h"
-#if defined (__WXMSW__)
- #include "IEHtmlWin.h"
-#elif defined (__WXGTK__)
- #ifdef FEAT_BROWSER
- #include "WebKitHtmlWnd.h"
- #endif
-#endif
-
-enum { ID_THE_BROWSER };
+enum { CTRL_BROWSER };
BEGIN_EVENT_TABLE(HtmlOutputPane, wxPanel)
- EVT_HTMLWND_BEFORE_LOAD(ID_THE_BROWSER, HtmlOutputPane::OnBeforeLoad)
+ EVT_HTMLWND_BEFORE_LOAD(CTRL_BROWSER, HtmlOutputPane::OnBeforeLoad)
END_EVENT_TABLE()
HtmlOutputPane::HtmlOutputPane(wxWindow *parent, IOpenTextmateURL& opener):
@@ -23,15 +16,7 @@ HtmlOutputPane::HtmlOutputPane(wxWindow *parent, IOpenTextmateURL& opener):
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
#ifdef FEAT_BROWSER
-
-#if defined (__WXMSW__)
- // IE Control
- m_browser = new wxIEHtmlWin(this, ID_THE_BROWSER);
-#elif defined (__WXGTK__)
- // WebKit control
- m_browser = new wxBrowser(this, ID_THE_BROWSER);
-#endif
-
+ m_browser = NewBrowser(this, CTRL_BROWSER);
mainSizer->Add(m_browser->GetWindow(), 1, wxEXPAND);
#endif // FEAT_BROWSER
@@ -76,13 +61,13 @@ void HtmlOutputPane::SetPage(const wxString& text) {
#endif //FEAT_BROWSER
}
-void HtmlOutputPane::AppendText(const wxString& html) {
-#ifdef FEAT_BROWSER
-#ifdef __WXMSW__
- m_browser->AppendString(html);
-#endif //__WXMSW__
-#endif //FEAT_BROWSER
-}
+//void HtmlOutputPane::AppendText(const wxString& html) {
+//#ifdef FEAT_BROWSER
+//#ifdef __WXMSW__
+// m_browser->AppendString(html);
+//#endif //__WXMSW__
+//#endif //FEAT_BROWSER
+//}
void HtmlOutputPane::OnBeforeLoad(IHtmlWndBeforeLoadEvent& event) {
const wxString url = event.GetURL();
View
20 src/HtmlOutputPane.h
@@ -3,14 +3,11 @@
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
- #include <wx/wx.h>
+#include <wx/wx.h>
#endif
-#include "IHtmlWnd.h"
-
-#ifdef __WXMSW__
-class wxIEHtmlWin;
-#endif
+class IHtmlWnd;
+class IHtmlWndBeforeLoadEvent;
class IOpenTextmateURL;
@@ -18,23 +15,16 @@ class HtmlOutputPane : public wxPanel {
public:
HtmlOutputPane(wxWindow *parent, IOpenTextmateURL& opener);
void SetPage(const wxString& html);
- void AppendText(const wxString& html);
+ //void AppendText(const wxString& html);
private:
static void DecodePath(wxString& path);
- // Event handlers
void OnBeforeLoad(IHtmlWndBeforeLoadEvent& event);
+ DECLARE_EVENT_TABLE()
IOpenTextmateURL& m_opener;
-
-#ifdef __WXMSW__
- wxIEHtmlWin* m_browser;
-#else
IHtmlWnd* m_browser;
-#endif
-
- DECLARE_EVENT_TABLE()
};
#endif

0 comments on commit be5bc2b

Please sign in to comment.
Something went wrong with that request. Please try again.