Implement SetProxy() in wxWebViewChromium too

Update the documentation to mention that it supports it and add an
example showing how to call this function.
This commit is contained in:
Vadim Zeitlin 2023-09-07 01:38:46 +02:00
parent 80ce14910c
commit c109f7f593
3 changed files with 73 additions and 6 deletions

View file

@ -26,7 +26,7 @@ struct ImplData;
class WXDLLIMPEXP_WEBVIEW_CHROMIUM wxWebViewChromium : public wxWebView
{
public:
wxWebViewChromium() {}
wxWebViewChromium() { Init(); }
wxWebViewChromium(wxWindow* parent,
wxWindowID id,
@ -36,6 +36,8 @@ public:
long style = 0,
const wxString& name = wxWebViewNameStr)
{
Init();
Create(parent, id, url, pos, size, style, name);
}
@ -68,6 +70,7 @@ public:
virtual void EnableHistory(bool enable = true) override;
virtual void Stop() override;
virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) override;
virtual bool SetProxy(const wxString& proxy) override;
virtual wxString GetPageSource() const override;
virtual wxString GetPageText() const override;
@ -130,6 +133,9 @@ protected:
virtual void DoSetPage(const wxString& html, const wxString& baseUrl) override;
private:
// Common part of all ctors.
void Init();
// Actually create the browser: this can only be done once the window is
// created in wxGTK.
bool DoCreateBrowser(const wxString& url);