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/branches/WX_3_0_BRANCH@76212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-03-29 16:52:54 +00:00
parent d274b4a5cf
commit 35bd8dbde8
2 changed files with 6 additions and 1 deletions

View File

@@ -650,6 +650,7 @@ wxMSW:
- Disable the use of new style wxDirDialog under Vista to work around a bug in
its implementation under this system (jtrauntvein).
- Fix wxExecute() keeping open too many thread handles for too long (dannchr).
- Fix clicking on togglable columns in wxDataViewCtrl (Laurent Poujoulat).
- Fix expander in non left-most position in wxDataViewCtrl (Laurent Poujoulat).
wxOSX:

View File

@@ -4398,13 +4398,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.