X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/18fc605924327cb4e9b3beb994c607cf28a08560..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/src/html.i diff --git a/wxPython/src/html.i b/wxPython/src/html.i index dbb1870820..28afc3d5fb 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -293,7 +293,7 @@ IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlTagHandler, wxHtmlTagHandler, HandleTag); %rename(HtmlTagHandler) wxPyHtmlTagHandler; class wxPyHtmlTagHandler : public wxObject { public: - %pythonAppend wxPyHtmlTagHandler "self._setCallbackInfo(self, HtmlTagHandler)" + %pythonAppend wxPyHtmlTagHandler setCallbackInfo(HtmlTagHandler) wxPyHtmlTagHandler(); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -334,7 +334,7 @@ IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, HandleT %rename(HtmlWinTagHandler) wxPyHtmlWinTagHandler; class wxPyHtmlWinTagHandler : public wxPyHtmlTagHandler { public: - %pythonAppend wxPyHtmlWinTagHandler "self._setCallbackInfo(self, HtmlWinTagHandler)" + %pythonAppend wxPyHtmlWinTagHandler setCallbackInfo(HtmlWinTagHandler) wxPyHtmlWinTagHandler(); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -798,7 +798,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyHtmlFilter, wxHtmlFilter); %rename(HtmlFilter) wxPyHtmlFilter; class wxPyHtmlFilter : public wxObject { public: - %pythonAppend wxPyHtmlFilter "self._setCallbackInfo(self, HtmlFilter)" + %pythonAppend wxPyHtmlFilter setCallbackInfo(HtmlFilter) wxPyHtmlFilter(); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -996,7 +996,7 @@ class wxPyHtmlWindow : public wxScrolledWindow //, // public wxHtmlWindowMouseHelper { public: - %pythonAppend wxPyHtmlWindow "self._setCallbackInfo(self, HtmlWindow); self._setOORInfo(self)" + %pythonAppend wxPyHtmlWindow "self._setOORInfo(self);" setCallbackInfo(HtmlWindow) %pythonAppend wxPyHtmlWindow() "" %typemap(out) wxPyHtmlWindow*; // turn off this typemap @@ -1546,7 +1546,7 @@ public: void RefreshLists(); // Gets the HTML window - wxHtmlWindow* GetHtmlWindow() const; + wxPyHtmlWindow* GetHtmlWindow() const; // Gets the splitter window wxSplitterWindow* GetSplitterWindow(); @@ -1569,20 +1569,47 @@ public: %property(TreeCtrl, GetTreeCtrl, doc="See `GetTreeCtrl`"); }; +//--------------------------------------------------------------------------- + + +%constant wxEventType wxEVT_COMMAND_HTML_CELL_CLICKED; +%constant wxEventType wxEVT_COMMAND_HTML_CELL_HOVER; +%constant wxEventType wxEVT_COMMAND_HTML_LINK_CLICKED; + -class wxHtmlWindowEvent: public wxNotifyEvent +class wxHtmlCellEvent : public wxCommandEvent { public: - wxHtmlWindowEvent(wxEventType commandType = wxEVT_NULL, int id = 0): - wxNotifyEvent(commandType, id); + wxHtmlCellEvent(wxEventType commandType, int id, + wxHtmlCell *cell, const wxPoint &pt, + const wxMouseEvent &ev); - void SetURL(const wxString& url); - const wxString& GetURL() const; + wxHtmlCell* GetCell() const; + wxPoint GetPoint() const; + wxMouseEvent GetMouseEvent() const; - %property(URL, GetURL, SetURL, doc="See `GetURL` and `SetURL`"); + void SetLinkClicked(bool linkclicked); + bool GetLinkClicked() const; }; +class wxHtmlLinkEvent : public wxCommandEvent +{ +public: + wxHtmlLinkEvent(int id, const wxHtmlLinkInfo &linkinfo); + + const wxHtmlLinkInfo &GetLinkInfo() const; +}; + + +%pythoncode { + EVT_HTML_CELL_CLICKED = wx.PyEventBinder( wxEVT_COMMAND_HTML_CELL_CLICKED, 1 ) + EVT_HTML_CELL_HOVER = wx.PyEventBinder( wxEVT_COMMAND_HTML_CELL_HOVER, 1 ) + EVT_HTML_LINK_CLICKED = wx.PyEventBinder( wxEVT_COMMAND_HTML_LINK_CLICKED, 1 ) +} + +//--------------------------------------------------------------------------- + MustHaveApp(wxHtmlHelpFrame);