X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c71a1386d70836180f8e78346d9f38c74980f11..1ffc8d7a55af1c253ca363bb0fbdda26bb4c9c65:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 623586fbe1..a921b3817c 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1341,7 +1341,19 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid) else { wxString cellval( grid->GetTable()->GetValue(row, col) ); - m_startValue = !( !cellval || (cellval == wxT("0")) ); + + if ( cellval == ms_stringValues[false] ) + m_startValue = false; + else if ( cellval == ms_stringValues[true] ) + m_startValue = true; + else + { + // do not try to be smart here and convert it to true or false + // because we'll still overwrite it with something different and + // this risks to be very surprising for the user code, let them + // know about it + wxFAIL_MSG( _T("invalid value for a cell with bool editor!") ); + } } CBox()->SetValue(m_startValue); @@ -4151,7 +4163,7 @@ wxGrid::wxGrid( wxWindow *parent, m_rowMinHeights(GRID_HASH_SIZE) { Create(); - SetBestFittingSize(size); + SetInitialSize(size); } bool wxGrid::Create(wxWindow *parent, wxWindowID id, @@ -4166,7 +4178,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id, m_rowMinHeights = wxLongToLongHashMap(GRID_HASH_SIZE); Create(); - SetBestFittingSize(size); + SetInitialSize(size); return true; } @@ -7696,10 +7708,10 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) int i, j, cell_rows, cell_cols; wxRect rect; - for (j=topRow; j 1) || (cell_cols > 1))