properly offset the mouse position for the label window clicks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-07-06 22:13:24 +00:00
parent 25ae9fb8ca
commit 2b73a34e1b

View File

@@ -6618,6 +6618,32 @@ int wxGrid::SendEvent( const wxEventType type,
claimed = GetEventHandler()->ProcessEvent(gridEvt);
vetoed = !gridEvt.IsAllowed();
}
else if ( type == wxEVT_GRID_LABEL_LEFT_CLICK ||
type == wxEVT_GRID_LABEL_LEFT_DCLICK ||
type == wxEVT_GRID_LABEL_RIGHT_CLICK ||
type == wxEVT_GRID_LABEL_RIGHT_DCLICK )
{
wxPoint pos = mouseEv.GetPosition();
if ( mouseEv.GetEventObject() == GetGridRowLabelWindow() )
pos.y += GetColLabelSize();
if ( mouseEv.GetEventObject() == GetGridColLabelWindow() )
pos.x += GetRowLabelSize();
wxGridEvent gridEvt( GetId(),
type,
this,
row, col,
pos.x,
pos.y,
false,
mouseEv.ControlDown(),
mouseEv.ShiftDown(),
mouseEv.AltDown(),
mouseEv.MetaDown() );
claimed = GetEventHandler()->ProcessEvent(gridEvt);
vetoed = !gridEvt.IsAllowed();
}
else
{
wxGridEvent gridEvt( GetId(),