git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5347
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
\membersection{wxHtmlCell::OnMouseClick}\label{wxhtmlcellonmouseclick}
\membersection{wxHtmlCell::OnMouseClick}\label{wxhtmlcellonmouseclick}
-\func{virtual void}{OnMouseClick}{\param{wxWindow* }{parent}, \param{int }{x}, \param{int }{y}, \param{bool }{left}, \param{bool }{middle}, \param{bool }{right}}
+\func{virtual void}{OnMouseClick}{\param{wxWindow* }{parent}, \param{int }{x}, \param{int }{y}, \param{const wxMouseEvent& }{event}}
This function is simple event handler. Each time user clicks mouse button over a cell
within \helpref{wxHtmlWindow}{wxhtmlwindow} this method of that cell is called. Default behavior is
This function is simple event handler. Each time user clicks mouse button over a cell
within \helpref{wxHtmlWindow}{wxhtmlwindow} this method of that cell is called. Default behavior is
-If you need more "advanced" behaviour (for example you'd like to catch mouse movement events or
-key events or whatsoever) you should use wxHtmlBinderCell instead.
+If you need more "advanced" event handling
+you should use wxHtmlBinderCell instead.
\membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
\membersection{wxHtmlWindow::OnLinkClicked}\label{wxhtmlwindowonlinkclicked}
-\func{virtual void}{OnLinkClicked}{\param{wxHtmlLinkInfo* }{link}}
+\func{virtual void}{OnLinkClicked}{\param{const wxHtmlLinkInfo& }{link}}
Called when user clicks on hypertext link. Default behaviour is to call
\helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
Called when user clicks on hypertext link. Default behaviour is to call
\helpref{LoadPage}{wxhtmlwindowloadpage} and do nothing else.
-void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y,
- bool WXUNUSED(left),
- bool WXUNUSED(middle),
- bool WXUNUSED(right))
+void wxHtmlCell::OnMouseClick(wxWindow *parent, int x, int y,
+ const wxMouseEvent& event)
{
wxHtmlLinkInfo *lnk = GetLink(x, y);
if (lnk != NULL)
{
wxHtmlLinkInfo *lnk = GetLink(x, y);
if (lnk != NULL)
- ((wxHtmlWindow*)parent) -> OnLinkClicked(lnk);
+ {
+ wxHtmlLinkInfo lnk2(*lnk);
+ lnk2.SetEvent(&event);
+ ((wxHtmlWindow*)parent) -> OnLinkClicked(lnk2);
// note : this overcasting is legal because parent is *always* wxHtmlWindow
// note : this overcasting is legal because parent is *always* wxHtmlWindow
-void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right)
+void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event)
{
if (m_Cells) {
wxHtmlCell *c = m_Cells;
{
if (m_Cells) {
wxHtmlCell *c = m_Cells;
(c -> GetPosY() <= y) &&
(c -> GetPosX() + c -> GetWidth() > x) &&
(c -> GetPosY() + c -> GetHeight() > y)) {
(c -> GetPosY() <= y) &&
(c -> GetPosX() + c -> GetWidth() > x) &&
(c -> GetPosY() + c -> GetHeight() > y)) {
- c -> OnMouseClick(parent, x - c -> GetPosX(), y - c -> GetPosY(), left, middle, right);
+ c -> OnMouseClick(parent, x - c -> GetPosX(), y - c -> GetPosY(), event);
break;
}
c = c -> GetNext();
break;
}
c = c -> GetNext();
-void wxHtmlWindow::OnLinkClicked(wxHtmlLinkInfo *link)
+void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
- LoadPage(link -> GetHref());
+ LoadPage(link.GetHref());
pos = event.GetPosition();
if (m_Cell)
pos = event.GetPosition();
if (m_Cell)
- m_Cell -> OnMouseClick(this, sx + pos.x, sy + pos.y, event.ButtonDown(1), event.ButtonDown(2), event.ButtonDown(3));
+ m_Cell -> OnMouseClick(this, sx + pos.x, sy + pos.y, event);