From: Václav Slavík Date: Tue, 11 Jan 2000 23:30:02 +0000 (+0000) Subject: added mouse event member into wxHtmlLinkInfo. wxHtmlWindow::OnLinkClicked now takes... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1be096c9f94235324fffa16ba024e346b32091f8 added mouse event member into wxHtmlLinkInfo. wxHtmlWindow::OnLinkClicked now takes const wxHtmlLinkInfo& argument and wxHtmlCell::OnMouseClicked takes wxMouseEvent instead of three bools git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h index f839504b53..0b9e167830 100644 --- a/include/wx/html/htmlcell.h +++ b/include/wx/html/htmlcell.h @@ -89,7 +89,7 @@ class WXDLLEXPORT wxHtmlCell : public wxObject // Example : m_Cell -> Find(wxHTML_COND_ISANCHOR, "news"); // returns pointer to anchor news - virtual void OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right); + virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event); // This function is called when mouse button is clicked over the cell. // left, middle, right are flags indicating whether the button was or wasn't // pressed. @@ -226,7 +226,7 @@ class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;} virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const; virtual const wxHtmlCell* Find(int condition, const void* param) const; - virtual void OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right); + virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event); wxHtmlCell* GetFirstCell() {return m_Cells;} // returns pointer to the first cell in container or NULL @@ -312,19 +312,23 @@ class WXDLLEXPORT wxHtmlLinkInfo : public wxObject { public: wxHtmlLinkInfo() : wxObject() - { m_Href = m_Target = wxEmptyString; } + { m_Href = m_Target = wxEmptyString; m_Event = NULL; } wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject() - { m_Href = href; m_Target = target; } + { m_Href = href; m_Target = target; m_Event = NULL; } wxHtmlLinkInfo(const wxHtmlLinkInfo& l) - { m_Href = l.m_Href, m_Target = l.m_Target; } + { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; } wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l) - { m_Href = l.m_Href, m_Target = l.m_Target; return *this; } + { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; return *this; } + + void SetEvent(const wxMouseEvent *e) { m_Event = e; } wxString GetHref() const { return m_Href; } wxString GetTarget() const { return m_Target; } + const wxMouseEvent* GetEvent() const { return m_Event; } private: wxString m_Href, m_Target; + const wxMouseEvent *m_Event; }; diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index f394d69680..df896b6f5e 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -136,11 +136,11 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow static void AddFilter(wxHtmlFilter *filter); // Adds input filter - virtual void OnLinkClicked(wxHtmlLinkInfo *link); + virtual void OnLinkClicked(const wxHtmlLinkInfo& link); // called when users clicked on hypertext link. Default behavior is to // call LoadPage(loc) - static void CleanUpStatics(); + static void CleanUpStatics(); // cleans static variables wxHtmlWinParser *GetParser() const { return m_Parser; } @@ -163,7 +163,7 @@ class WXDLLEXPORT wxHtmlWindow : public wxScrolledWindow void OnIdle(wxIdleEvent& event); void OnKeyDown(wxKeyEvent& event); - virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} + virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} // returns new filter (will be stored into m_DefaultFilter variable)