pass correct tool id (and not always -1) to EVT_TOOL_RCLICKED() handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-01-02 22:46:52 +00:00
parent b181a50500
commit 2334fef6ea
2 changed files with 8 additions and 4 deletions

View File

@@ -80,6 +80,7 @@ wxMSW:
- fixed enhanced metafiles loading from files (Andreas Goebel) - fixed enhanced metafiles loading from files (Andreas Goebel)
- wxRadioButtons no longer have to be consecutive in a group - wxRadioButtons no longer have to be consecutive in a group
- fixed spurious selection of combobox text during resize - fixed spurious selection of combobox text during resize
- pass correct tool id (and not always -1) to EVT_TOOL_RCLICKED() handler
wxWinCE: wxWinCE:
- Added support for MS Handheld PC 2000. This was done before 2.5.4, - Added support for MS Handheld PC 2000. This was done before 2.5.4,

View File

@@ -1211,11 +1211,14 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event)
return; return;
} }
if (event.RightDown()) if ( event.RightDown() )
{ {
// For now, we don't have an id. Later we could // find the tool under the mouse
// try finding the tool. wxCoord x,y;
OnRightClick((int)-1, event.GetX(), event.GetY()); event.GetPosition(&x, &y);
wxToolBarToolBase *tool = FindToolForPosition(x, y);
OnRightClick(tool ? tool->GetId() : -1, x, y);
} }
else else
{ {