]> git.saurik.com Git - wxWidgets.git/commitdiff
pass correct tool id (and not always -1) to EVT_TOOL_RCLICKED() handler
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 2 Jan 2005 22:46:52 +0000 (22:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 2 Jan 2005 22:46:52 +0000 (22:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/tbar95.cpp

index 4b701423c5d9c2d1addf05e28dd1376845147f49..46b34a48adfcb68e0c60dcc40cae764b62e29079 100644 (file)
@@ -80,6 +80,7 @@ wxMSW:
 - fixed enhanced metafiles loading from files (Andreas Goebel)
 - wxRadioButtons no longer have to be consecutive in a group
 - fixed spurious selection of combobox text during resize
 - fixed enhanced metafiles loading from files (Andreas Goebel)
 - wxRadioButtons no longer have to be consecutive in a group
 - fixed spurious selection of combobox text during resize
+- pass correct tool id (and not always -1) to EVT_TOOL_RCLICKED() handler
 
 wxWinCE:
 - Added support for MS Handheld PC 2000. This was done before 2.5.4,
 
 wxWinCE:
 - Added support for MS Handheld PC 2000. This was done before 2.5.4,
index d1079d550c28934adfec34c216e52ef5c2179f76..28f96b3f93bb5fb7860bb127cfb6d47ab2ef2ff1 100644 (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
-        // try finding the tool.
-        OnRightClick((int)-1, event.GetX(), event.GetY());
+        // find the tool under the mouse
+        wxCoord x,y;
+        event.GetPosition(&x, &y);
+
+        wxToolBarToolBase *tool = FindToolForPosition(x, y);
+        OnRightClick(tool ? tool->GetId() : -1, x, y);
     }
     else
     {
     }
     else
     {