From d66093c7b60e78900b924fd7ae6baffd748c2034 Mon Sep 17 00:00:00 2001 From: Michael Bedward Date: Fri, 12 May 2000 11:05:30 +0000 Subject: [PATCH] Check for multiple calls to wxGrid::CreateGrid Changed number format for wxGridCellFloatEditor from f to g git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/grid.h | 2 +- src/generic/grid.cpp | 29 +++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 4b66e98288..60373fe49e 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -465,7 +465,7 @@ public: protected: // string representation of m_valueOld wxString GetString() const - { return wxString::Format(_T("%f"), m_valueOld); } + { return wxString::Format(_T("%g"), m_valueOld); } private: double m_valueOld; diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index aefbee2dda..3e3404ed20 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -3181,23 +3181,20 @@ void wxGrid::Create() bool wxGrid::CreateGrid( int numRows, int numCols, wxGrid::wxGridSelectionModes selmode ) { - if ( m_created ) - { - wxFAIL_MSG( wxT("wxGrid::CreateGrid or wxGrid::SetTable called more than once") ); - return FALSE; - } - else - { - m_numRows = numRows; - m_numCols = numCols; + wxCHECK_MSG( !m_created, + FALSE, + wxT("wxGrid::CreateGrid or wxGrid::SetTable called more than once") ); + + m_numRows = numRows; + m_numCols = numCols; + + m_table = new wxGridStringTable( m_numRows, m_numCols ); + m_table->SetView( this ); + m_ownTable = TRUE; + m_selection = new wxGridSelection( this, selmode ); + Init(); + m_created = TRUE; - m_table = new wxGridStringTable( m_numRows, m_numCols ); - m_table->SetView( this ); - m_ownTable = TRUE; - m_selection = new wxGridSelection( this, selmode ); - Init(); - m_created = TRUE; - } return m_created; }