Add context menu enabling and disabling to wxWebView, all backends supported.
Closes #14789. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -63,6 +63,7 @@ public:
|
||||
virtual bool CanGoBack() const;
|
||||
virtual bool CanGoForward() const;
|
||||
virtual void ClearHistory();
|
||||
virtual void EnableContextMenu(bool enable = true);
|
||||
virtual void EnableHistory(bool enable = true);
|
||||
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
|
||||
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
|
||||
|
@@ -271,8 +271,9 @@ private:
|
||||
class DocHostUIHandler : public wxIDocHostUIHandler
|
||||
{
|
||||
public:
|
||||
DocHostUIHandler() {};
|
||||
DocHostUIHandler(wxWebView* browser) { m_browser = browser; }
|
||||
~DocHostUIHandler() {};
|
||||
|
||||
virtual HRESULT wxSTDCALL ShowContextMenu(DWORD dwID, POINT *ppt,
|
||||
IUnknown *pcmdtReserved,
|
||||
IDispatch *pdispReserved);
|
||||
@@ -319,6 +320,9 @@ public:
|
||||
IDataObject **ppDORet);
|
||||
//IUnknown
|
||||
DECLARE_IUNKNOWN_METHODS;
|
||||
|
||||
private:
|
||||
wxWebView* m_browser;
|
||||
};
|
||||
|
||||
class wxFindPointers
|
||||
|
@@ -103,6 +103,11 @@ extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewDefaultURLStr[];
|
||||
class WXDLLIMPEXP_WEBVIEW wxWebView : public wxControl
|
||||
{
|
||||
public:
|
||||
wxWebView()
|
||||
{
|
||||
m_showMenu = true;
|
||||
}
|
||||
|
||||
virtual ~wxWebView() {}
|
||||
|
||||
virtual bool Create(wxWindow* parent,
|
||||
@@ -124,12 +129,17 @@ public:
|
||||
const wxString& name = wxWebViewNameStr);
|
||||
|
||||
//General methods
|
||||
virtual void EnableContextMenu(bool enable = true)
|
||||
{
|
||||
m_showMenu = enable;
|
||||
}
|
||||
virtual wxString GetCurrentTitle() const = 0;
|
||||
virtual wxString GetCurrentURL() const = 0;
|
||||
// TODO: handle choosing a frame when calling GetPageSource()?
|
||||
virtual wxString GetPageSource() const = 0;
|
||||
virtual wxString GetPageText() const = 0;
|
||||
virtual bool IsBusy() const = 0;
|
||||
virtual bool IsContextMenuEnabled() const { return m_showMenu; }
|
||||
virtual bool IsEditable() const = 0;
|
||||
virtual void LoadURL(const wxString& url) = 0;
|
||||
virtual void Print() = 0;
|
||||
@@ -197,6 +207,9 @@ public:
|
||||
protected:
|
||||
virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0;
|
||||
|
||||
private:
|
||||
bool m_showMenu;
|
||||
|
||||
wxDECLARE_ABSTRACT_CLASS(wxWebView);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user