wxGridStringTable::wxGridStringTable()
: wxGridTableBase()
{
+ m_numCols = 0;
}
wxGridStringTable::wxGridStringTable( int numRows, int numCols )
: wxGridTableBase()
{
+ m_numCols = numCols;
+
m_data.Alloc( numRows );
wxArrayString sa;
m_data.Add( sa, numRows );
}
-wxGridStringTable::~wxGridStringTable()
-{
-}
-
-int wxGridStringTable::GetNumberRows()
-{
- return m_data.GetCount();
-}
-
-int wxGridStringTable::GetNumberCols()
-{
- if ( m_data.GetCount() > 0 )
- return m_data[0].GetCount();
- else
- return 0;
-}
-
wxString wxGridStringTable::GetValue( int row, int col )
{
wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()),
}
}
+ m_numCols += numCols;
+
if ( GetView() )
{
wxGridTableMessage msg( this,
m_data[row].Add( wxEmptyString, numCols );
}
+ m_numCols += numCols;
+
if ( GetView() )
{
wxGridTableMessage msg( this,
m_colLabels.RemoveAt( colID, nToRm );
}
- for ( row = 0; row < curNumRows; row++ )
+ if ( numCols >= curNumCols )
{
- if ( numCols >= curNumCols )
+ for ( row = 0; row < curNumRows; row++ )
{
m_data[row].Clear();
}
- else
+
+ m_numCols = 0;
+ }
+ else // something will be left
+ {
+ for ( row = 0; row < curNumRows; row++ )
{
m_data[row].RemoveAt( colID, numCols );
}
+
+ m_numCols -= numCols;
}
if ( GetView() )
// TODO: generate RESIZING event, see #10754
AutoSizeRowLabelSize( row );
- SendSizeEvent(wxEVT_GRID_ROW_SIZE, row, -1, event);
+ SendGridSizeEvent(wxEVT_GRID_ROW_SIZE, row, -1, event);
ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, GetColLabelWindow());
m_dragLastPos = -1;
// TODO: generate RESIZING event, see #10754
AutoSizeColLabelSize( colEdge );
- SendSizeEvent(wxEVT_GRID_COL_SIZE, -1, colEdge, event);
+ SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, colEdge, event);
ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, GetColLabelWindow());
m_dragLastPos = -1;
// TODO: generate RESIZING event, see #10754
if ( DoEndDragResizeLine(wxGridRowOperations()) )
- SendSizeEvent(wxEVT_GRID_ROW_SIZE, m_dragRowOrCol, -1, event);
+ SendGridSizeEvent(wxEVT_GRID_ROW_SIZE, m_dragRowOrCol, -1, event);
}
void wxGrid::DoEndDragResizeCol(const wxMouseEvent& event)
// TODO: generate RESIZING event, see #10754
if ( DoEndDragResizeLine(wxGridColumnOperations()) )
- SendSizeEvent(wxEVT_GRID_COL_SIZE, -1, m_dragRowOrCol, event);
+ SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, m_dragRowOrCol, event);
}
void wxGrid::DoStartMoveCol(int col)
// ----------------------------------------------------------------------------
void
-wxGrid::SendSizeEvent(wxEventType type,
+wxGrid::SendGridSizeEvent(wxEventType type,
int row, int col,
const wxMouseEvent& mouseEv)
{
// +1 if the event was processed (but not vetoed)
// 0 if the event wasn't handled
int
-wxGrid::SendEvent(wxEventType type,
+wxGrid::SendEvent(const wxEventType type,
int row, int col,
const wxMouseEvent& mouseEv)
{