// this is a magic incantation which must be done!
#include <wx/arrimpl.cpp>
-WX_DEFINE_OBJARRAY(wxGridStringArray);
+WX_DEFINE_OBJARRAY(wxGridStringArray)
IMPLEMENT_DYNAMIC_CLASS( wxGridStringTable, wxGridTableBase )
if ( m_table )
{
wxString s;
- s = ( value == wxEmptyString ? GetCellValue(m_currentCellCoords) : value );
+ if ( !value )
+ s = GetCellValue(m_currentCellCoords);
+ else
+ s = value;
if ( IsTopEditControlEnabled() )
{
//
if ( ok )
{
+ if ( m_numCols == 0 )
+ {
+ m_table->AppendCols( WXGRID_DEFAULT_NUMBER_COLS );
+ //
+ // TODO: perhaps instead of appending the default number of cols
+ // we should remember what the last non-zero number of cols was ?
+ //
+ }
+
+ if ( m_currentCellCoords == wxGridNoCellCoords )
+ {
+ // if we have just inserted cols into an empty grid the current
+ // cell will be undefined...
+ //
+ SelectCell( 0, 0 );
+ }
+
if ( !GetBatchCount() ) Refresh();
}
+
SetEditControlValue();
return ok;
}
if ( m_table && m_table->AppendRows( numRows ) )
{
+ if ( m_currentCellCoords == wxGridNoCellCoords )
+ {
+ // if we have just inserted cols into an empty grid the current
+ // cell will be undefined...
+ //
+ SelectCell( 0, 0 );
+ }
+
// the table will have sent the results of the append row
// operation to this view object as a grid table message
//
{
HideCellEditControl();
bool ok = m_table->InsertCols( pos, numCols );
+
+ // the table will have sent the results of the insert col
+ // operation to this view object as a grid table message
+ //
if ( ok )
{
- // the table will have sent the results of the insert col
- // operation to this view object as a grid table message
- //
+ if ( m_currentCellCoords == wxGridNoCellCoords )
+ {
+ // if we have just inserted cols into an empty grid the current
+ // cell will be undefined...
+ //
+ SelectCell( 0, 0 );
+ }
+
if ( !GetBatchCount() ) Refresh();
}
+
SetEditControlValue();
return ok;
}
// the table will have sent the results of the append col
// operation to this view object as a grid table message
//
+ if ( m_currentCellCoords == wxGridNoCellCoords )
+ {
+ // if we have just inserted cols into an empty grid the current
+ // cell will be undefined...
+ //
+ SelectCell( 0, 0 );
+ }
if ( !GetBatchCount() ) Refresh();
return TRUE;
}