Patch for context menu event for generic/Windows code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1148,7 +1148,7 @@ wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *c
|
|||||||
SetFlags(flags);
|
SetFlags(flags);
|
||||||
|
|
||||||
m_autosize = width < 0; // TODO
|
m_autosize = width < 0; // TODO
|
||||||
|
|
||||||
Init(width < 0 ? wxDVC_DEFAULT_WIDTH : width);
|
Init(width < 0 ? wxDVC_DEFAULT_WIDTH : width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3703,10 +3703,22 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// notify cell about right click
|
// notify cell about right click
|
||||||
// cell->...
|
wxVariant value;
|
||||||
|
model->GetValue( value, item, col->GetModelColumn() );
|
||||||
|
cell->SetValue( value );
|
||||||
|
wxRect cell_rect( xpos, current * m_lineHeight,
|
||||||
|
col->GetWidth(), m_lineHeight );
|
||||||
|
if (!cell->RightClick( event.GetPosition(), cell_rect, model, item, col->GetModelColumn()))
|
||||||
|
{
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
|
wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, parent->GetId());
|
||||||
|
le.SetItem( item );
|
||||||
|
le.SetEventObject(parent);
|
||||||
|
le.SetModel(GetOwner()->GetModel());
|
||||||
|
le.SetValue(value);
|
||||||
|
|
||||||
// Allow generation of context menu event
|
parent->GetEventHandler()->ProcessEvent(le);
|
||||||
event.Skip();
|
}
|
||||||
}
|
}
|
||||||
else if (event.MiddleDown())
|
else if (event.MiddleDown())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user