Fixes #10247: wxDataViewCtrl - event is generated when clicking on a non existing row

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2008-12-16 21:57:40 +00:00
parent ddabd45b61
commit 5179bc0bca
3 changed files with 4 additions and 3 deletions

View File

@ -26,6 +26,7 @@
#include "wx/weakref.h"
#if !(defined(__WXGTK20__) || defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
//#if !(defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
#define wxHAS_GENERIC_DATAVIEWCTRL
#endif
@ -878,7 +879,7 @@ private:
long m_min,m_max;
};
#ifndef __WXGTK20__
#if defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(wxMAC)
// -------------------------------------
// wxDataViewChoiceRenderer

View File

@ -1275,7 +1275,7 @@ bool wxDataViewSpinRenderer::GetValue( wxVariant &value ) const
// wxDataViewChoiceRenderer
// -------------------------------------
#ifndef __WXGTK20__
#if defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(wxMAC)
wxDataViewChoiceRenderer::wxDataViewChoiceRenderer( const wxArrayString& choices, wxDataViewCellMode mode, int alignment ) :
wxDataViewCustomRenderer(wxT("string"), mode, alignment )

View File

@ -2906,7 +2906,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
wxDataViewRenderer *cell = col->GetRenderer();
unsigned int current = GetLineAt( y );
if ((current > GetRowCount()) || (x > GetEndOfLastCol()))
if ((current >= GetRowCount()) || (x > GetEndOfLastCol()))
{
// Unselect all if below the last row ?
return;