Set mouse cursor correctly over image map links in wxHTML.

The cursor didn't change to a link one when the mouse was over link areas in
an image map.

Fix this by generalizing wxHtmlCell::GetMouseCursor() into GetMouseCursorAt().

Closes #15350.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-07-17 17:27:14 +00:00
parent 2767360fa8
commit e24c4e1238
5 changed files with 48 additions and 4 deletions

View File

@@ -196,7 +196,17 @@ wxCursor wxHtmlCell::GetCursor() const
}
#endif // WXWIN_COMPATIBILITY_2_6
wxCursor wxHtmlCell::GetMouseCursor(wxHtmlWindowInterface *window) const
wxCursor
wxHtmlCell::GetMouseCursor(wxHtmlWindowInterface* WXUNUSED(window)) const
{
// This is never called directly, only from GetMouseCursorAt() and we
// return an invalid cursor by default to let it delegate to the window.
return wxNullCursor;
}
wxCursor
wxHtmlCell::GetMouseCursorAt(wxHtmlWindowInterface *window,
const wxPoint& relPos) const
{
#if WXWIN_COMPATIBILITY_2_6
// NB: Older versions of wx used GetCursor() virtual method in place of
@@ -209,7 +219,11 @@ wxCursor wxHtmlCell::GetMouseCursor(wxHtmlWindowInterface *window) const
return cur;
#endif // WXWIN_COMPATIBILITY_2_6
if ( GetLink() )
const wxCursor curCell = GetMouseCursor(window);
if ( curCell.IsOk() )
return curCell;
if ( GetLink(relPos.x, relPos.y) )
{
return window->GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor_Link);
}

View File

@@ -206,7 +206,7 @@ void wxHtmlWindowMouseHelper::HandleIdle(wxHtmlCell *rootCell,
wxCursor cur;
if (cell)
cur = cell->GetMouseCursor(m_interface);
cur = cell->GetMouseCursorAt(m_interface, pos);
else
cur = m_interface->GetHTMLCursor(
wxHtmlWindowInterface::HTMLCursor_Default);
@@ -229,6 +229,11 @@ void wxHtmlWindowMouseHelper::HandleIdle(wxHtmlCell *rootCell,
{
if ( cell )
{
// A single cell can have different cursors for different positions,
// so update cursor for this case as well.
wxCursor cur = cell->GetMouseCursorAt(m_interface, pos);
m_interface->GetHTMLWindow()->SetCursor(cur);
OnCellMouseHover(cell, pos.x, pos.y);
}
}