X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4f6b4292aa62c370a006516b7fe24e89ecb181b7..537a0880d225ab023024f6f5fc8955666b7641b8:/src/msw/tbar95.cpp diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index d1079d550c..28f96b3f93 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -1211,11 +1211,14 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event) 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 {