X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d929eddf3a3dbb04f37624d255f4e24e07595ca1..6f026b5b63fe7ccb025e84509886f74772b9df13:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 771f35032e..38c1b9f92c 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4,7 +4,6 @@ // Author: Michael Bedward (based on code by Julian Smart, Robin Dunn) // Modified by: Robin Dunn, Vadim Zeitlin, Santiago Palacios // Created: 1/08/1999 -// RCS-ID: $Id$ // Copyright: (c) Michael Bedward (mbedward@ozemail.com.au) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -2159,6 +2158,7 @@ BEGIN_EVENT_TABLE( wxGrid, wxScrolledWindow ) EVT_KEY_UP( wxGrid::OnKeyUp ) EVT_CHAR ( wxGrid::OnChar ) EVT_ERASE_BACKGROUND( wxGrid::OnEraseBackground ) + EVT_COMMAND(wxID_ANY, wxEVT_GRID_HIDE_EDITOR, wxGrid::OnHideEditor ) END_EVENT_TABLE() bool wxGrid::Create(wxWindow *parent, wxWindowID id, @@ -2944,8 +2944,6 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) int numCols = msg.GetCommandInt(); int oldNumCols = m_numCols; m_numCols += numCols; - if ( m_useNativeHeader ) - GetGridColHeader()->SetColumnCount(m_numCols); if ( !m_colAt.IsEmpty() ) { @@ -2977,6 +2975,12 @@ bool wxGrid::Redimension( wxGridTableMessage& msg ) } } + // Notice that this must be called after updating m_colWidths above + // as the native grid control will check whether the new columns + // are shown which results in accessing m_colWidths array. + if ( m_useNativeHeader ) + GetGridColHeader()->SetColumnCount(m_numCols); + if ( m_currentCellCoords == wxGridNoCellCoords ) { // if we have just inserted cols into an empty grid the current @@ -6553,6 +6557,11 @@ void wxGrid::SaveEditControlValue() } } +void wxGrid::OnHideEditor(wxCommandEvent& WXUNUSED(event)) +{ + DisableCellEditControl(); +} + // // ------ Grid location functions // Note that all of these functions work with the logical coordinates of