Fix clicking on activatable toggle column in generic wxDataViewCtrl.
Call PrepareForItem() after calling GetLineStart() as the latter calls PrepareForItem() for other items internally, undoing the effects of the first call. Closes #16132. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4493,13 +4493,17 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
||||
if ( IsCellEditableInMode(item, col, wxDATAVIEW_CELL_ACTIVATABLE) )
|
||||
{
|
||||
// notify cell about click
|
||||
cell->PrepareForItem(model, item, col->GetModelColumn());
|
||||
|
||||
wxRect cell_rect( xpos + itemOffset,
|
||||
GetLineStart( current ),
|
||||
col->GetWidth() - itemOffset,
|
||||
GetLineHeight( current ) );
|
||||
|
||||
// Note that PrepareForItem() should be called after GetLineStart()
|
||||
// call in cell_rect initialization above as GetLineStart() calls
|
||||
// PrepareForItem() for other items from inside it.
|
||||
cell->PrepareForItem(model, item, col->GetModelColumn());
|
||||
|
||||
// Report position relative to the cell's custom area, i.e.
|
||||
// not the entire space as given by the control but the one
|
||||
// used by the renderer after calculation of alignment etc.
|
||||
|
Reference in New Issue
Block a user