git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55646
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
}
bool wxGrid::CreateGrid( int numRows, int numCols,
}
bool wxGrid::CreateGrid( int numRows, int numCols,
- wxGrid::wxGridSelectionModes selmode )
+ wxGridSelectionModes selmode )
{
wxCHECK_MSG( !m_created,
false,
wxT("wxGrid::CreateGrid or wxGrid::SetTable called more than once") );
{
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 );
-
- CalcDimensions();
-
- m_created = true;
-
- return m_created;
+ return SetTable(new wxGridStringTable(numRows, numCols), true, selmode);
-void wxGrid::SetSelectionMode(wxGrid::wxGridSelectionModes selmode)
+void wxGrid::SetSelectionMode(wxGridSelectionModes selmode)
{
wxCHECK_RET( m_created,
wxT("Called wxGrid::SetSelectionMode() before calling CreateGrid()") );
{
wxCHECK_RET( m_created,
wxT("Called wxGrid::SetSelectionMode() before calling CreateGrid()") );
wxGrid::wxGridSelectionModes wxGrid::GetSelectionMode() const
{
wxGrid::wxGridSelectionModes wxGrid::GetSelectionMode() const
{
- wxCHECK_MSG( m_created, wxGrid::wxGridSelectCells,
+ wxCHECK_MSG( m_created, wxGridSelectCells,
wxT("Called wxGrid::GetSelectionMode() before calling CreateGrid()") );
return m_selection->GetSelectionMode();
}
wxT("Called wxGrid::GetSelectionMode() before calling CreateGrid()") );
return m_selection->GetSelectionMode();
}
-bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership,
- wxGrid::wxGridSelectionModes selmode )
+bool
+wxGrid::SetTable(wxGridTableBase *table,
+ bool takeOwnership,
+ wxGrid::wxGridSelectionModes selmode )
{
bool checkSelection = false;
if ( m_created )
{
bool checkSelection = false;
if ( m_created )