Add wxWebViewEvent::IsError()
This commit is contained in:
@@ -300,6 +300,7 @@ public:
|
||||
m_actionFlags(flags), m_messageHandler(messageHandler)
|
||||
{}
|
||||
|
||||
bool IsError() const { return GetInt() == 0; }
|
||||
|
||||
const wxString& GetURL() const { return m_url; }
|
||||
const wxString& GetTarget() const { return m_target; }
|
||||
|
@@ -1345,6 +1345,14 @@ public:
|
||||
@since 3.1.5
|
||||
*/
|
||||
const wxString& GetMessageHandler() const;
|
||||
|
||||
/**
|
||||
Returns true the script execution failed. Only valid for events of type
|
||||
@c wxEVT_WEBVIEW_SCRIPT_RESULT
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
bool IsError() const;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -932,7 +932,10 @@ void WebFrame::OnScriptMessage(wxWebViewEvent& evt)
|
||||
|
||||
void WebFrame::OnScriptResult(wxWebViewEvent& evt)
|
||||
{
|
||||
wxLogMessage("Async script result received; value = %s", evt.GetString());
|
||||
if (evt.IsError())
|
||||
wxLogError("Async script execution failed: %s", evt.GetString());
|
||||
else
|
||||
wxLogMessage("Async script result received; value = %s", evt.GetString());
|
||||
}
|
||||
|
||||
void WebFrame::OnSetPage(wxCommandEvent& WXUNUSED(evt))
|
||||
|
Reference in New Issue
Block a user