20#ifndef WEBVIEW_PANEL_H
21#define WEBVIEW_PANEL_H
24#include <wx/webview.h>
36 explicit WEBVIEW_PANEL( wxWindow* parent, wxWindowID
id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
const int style = 0,
43 void LoadURL(
const wxString& url );
44 void SetPage(
const wxString& htmlContent );
52 void RunScriptAsync(
const wxString& aScript,
void* aClientData =
nullptr )
const
54 m_browser->RunScriptAsync( aScript, aClientData );
67 void OnError( wxWebViewEvent& evt );
WEBVIEW_PANEL(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const int style=0, TOOL_MANAGER *aToolManager=nullptr, TOOL_BASE *aTool=nullptr)
TOOL_MANAGER * m_toolManager
void OnScriptMessage(wxWebViewEvent &evt)
void OnNewWindow(wxWebViewEvent &evt)
std::map< wxString, MESSAGE_HANDLER > m_msgHandlers
void SetPage(const wxString &htmlContent)
void OnWebViewLoaded(wxWebViewEvent &evt)
bool HasLoadError() const
void OnNavigationRequest(wxWebViewEvent &evt)
void SetHandleExternalLinks(bool aHandle)
void ClearMessageHandlers()
bool AddMessageHandler(const wxString &name, MESSAGE_HANDLER handler)
void RunScriptAsync(const wxString &aScript, void *aClientData=nullptr) const
bool m_handleExternalLinks
std::function< void(const wxString &)> MESSAGE_HANDLER
bool GetHandleExternalLinks() const
void OnScriptResult(wxWebViewEvent &evt)
wxWebView * GetWebView() const
void OnError(wxWebViewEvent &evt)
~WEBVIEW_PANEL() override
void LoadURL(const wxString &url)