X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/27bb2c8cb78e39d8a4def1c349e0677fd32a2c06..982d7f931701e2d65182f798e9182139efd67ed7:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index c11346662e..e0d9dc6c37 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -80,12 +80,28 @@ WX_DECLARE_HASH_SET_WITH_DECL(int, wxIntegerHash, wxIntegerEqual, // globals // ---------------------------------------------------------------------------- +namespace +{ + //#define DEBUG_ATTR_CACHE #ifdef DEBUG_ATTR_CACHE static size_t gs_nAttrCacheHits = 0; static size_t gs_nAttrCacheMisses = 0; #endif +// this struct simply combines together the default header renderers +// +// as the renderers ctors are trivial, there is no problem with making them +// globals +struct DefaultHeaderRenderers +{ + wxGridColumnHeaderRendererDefault colRenderer; + wxGridRowHeaderRendererDefault rowRenderer; + wxGridCornerHeaderRendererDefault cornerRenderer; +} gs_defaultHeaderRenderers; + +} // anonymous namespace + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -191,14 +207,96 @@ wxGridCellWorker::~wxGridCellWorker() { } +// ---------------------------------------------------------------------------- +// wxGridHeaderLabelsRenderer and related classes +// ---------------------------------------------------------------------------- + +void wxGridHeaderLabelsRenderer::DrawLabel(const wxGrid& grid, + wxDC& dc, + const wxString& value, + const wxRect& rect, + int horizAlign, + int vertAlign, + int textOrientation) const +{ + dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); + dc.SetTextForeground(grid.GetLabelTextColour()); + dc.SetFont(grid.GetLabelFont()); + grid.DrawTextRectangle(dc, value, rect, horizAlign, vertAlign, textOrientation); +} + + +void wxGridRowHeaderRendererDefault::DrawBorder(const wxGrid& WXUNUSED(grid), + wxDC& dc, + wxRect& rect) const +{ + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW))); + dc.DrawLine(rect.GetRight(), rect.GetTop(), + rect.GetRight(), rect.GetBottom()); + dc.DrawLine(rect.GetLeft(), rect.GetTop(), + rect.GetLeft(), rect.GetBottom()); + dc.DrawLine(rect.GetLeft(), rect.GetBottom(), + rect.GetRight() + 1, rect.GetBottom()); + + dc.SetPen(*wxWHITE_PEN); + dc.DrawLine(rect.GetLeft() + 1, rect.GetTop(), + rect.GetLeft() + 1, rect.GetBottom()); + dc.DrawLine(rect.GetLeft() + 1, rect.GetTop(), + rect.GetRight(), rect.GetTop()); + + rect.Deflate(2); +} + +void wxGridColumnHeaderRendererDefault::DrawBorder(const wxGrid& WXUNUSED(grid), + wxDC& dc, + wxRect& rect) const +{ + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW))); + dc.DrawLine(rect.GetRight(), rect.GetTop(), + rect.GetRight(), rect.GetBottom()); + dc.DrawLine(rect.GetLeft(), rect.GetTop(), + rect.GetRight(), rect.GetTop()); + dc.DrawLine(rect.GetLeft(), rect.GetBottom(), + rect.GetRight() + 1, rect.GetBottom()); + + dc.SetPen(*wxWHITE_PEN); + dc.DrawLine(rect.GetLeft(), rect.GetTop() + 1, + rect.GetLeft(), rect.GetBottom()); + dc.DrawLine(rect.GetLeft(), rect.GetTop() + 1, + rect.GetRight(), rect.GetTop() + 1); + + rect.Deflate(2); +} + +void wxGridCornerHeaderRendererDefault::DrawBorder(const wxGrid& WXUNUSED(grid), + wxDC& dc, + wxRect& rect) const +{ + dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW))); + dc.DrawLine(rect.GetRight() - 1, rect.GetBottom() - 1, + rect.GetRight() - 1, rect.GetTop()); + dc.DrawLine(rect.GetRight() - 1, rect.GetBottom() - 1, + rect.GetLeft(), rect.GetBottom() - 1); + dc.DrawLine(rect.GetLeft(), rect.GetTop(), + rect.GetRight(), rect.GetTop()); + dc.DrawLine(rect.GetLeft(), rect.GetTop(), + rect.GetLeft(), rect.GetBottom()); + + dc.SetPen(*wxWHITE_PEN); + dc.DrawLine(rect.GetLeft() + 1, rect.GetTop() + 1, + rect.GetRight() - 1, rect.GetTop() + 1); + dc.DrawLine(rect.GetLeft() + 1, rect.GetTop() + 1, + rect.GetLeft() + 1, rect.GetBottom() - 1); + + rect.Deflate(2); +} + // ---------------------------------------------------------------------------- // wxGridCellAttr // ---------------------------------------------------------------------------- void wxGridCellAttr::Init(wxGridCellAttr *attrDefault) { - m_nRef = 1; - m_isReadOnly = Unset; m_renderer = NULL; @@ -645,30 +743,30 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol) { if ( attr ) { - // add the attribute - no need to do anything to reference count - // since we take ownership of the attribute. + // store the new attribute, taking its ownership m_rowsOrCols.Add(rowOrCol); m_attrs.Add(attr); } // nothing to remove } - else + else // we have an attribute for this row or column { size_t n = (size_t)i; - if ( m_attrs[n] == attr ) - // nothing to do - return; + + // notice that this code works correctly even when the old attribute is + // the same as the new one: as we own of it, we must call DecRef() on + // it in any case and this won't result in destruction of the new + // attribute if it's the same as old one because it must have ref count + // of at least 2 to be passed to us while we keep a reference to it too + m_attrs[n]->DecRef(); + if ( attr ) { - // change the attribute, handling reference count manually, - // taking ownership of the new attribute. - m_attrs[n]->DecRef(); + // replace the attribute with the new one m_attrs[n] = attr; } - else + else // remove the attribute { - // remove this attribute, handling reference count manually - m_attrs[n]->DecRef(); m_rowsOrCols.RemoveAt(n); m_attrs.RemoveAt(n); } @@ -861,6 +959,23 @@ void wxGridCellAttrProvider::UpdateAttrCols( size_t pos, int numCols ) } } +const wxGridColumnHeaderRenderer& +wxGridCellAttrProvider::GetColumnHeaderRenderer(int WXUNUSED(col)) +{ + return gs_defaultHeaderRenderers.colRenderer; +} + +const wxGridRowHeaderRenderer& +wxGridCellAttrProvider::GetRowHeaderRenderer(int WXUNUSED(row)) +{ + return gs_defaultHeaderRenderers.rowRenderer; +} + +const wxGridCornerHeaderRenderer& wxGridCellAttrProvider::GetCornerRenderer() +{ + return gs_defaultHeaderRenderers.cornerRenderer; +} + // ---------------------------------------------------------------------------- // wxGridTableBase // ---------------------------------------------------------------------------- @@ -1017,7 +1132,7 @@ wxString wxGridTableBase::GetColLabelValue( int col ) unsigned int i, n; for ( n = 1; ; n++ ) { - s += (wxChar) (_T('A') + (wxChar)(col % 26)); + s += (wxChar) (wxT('A') + (wxChar)(col % 26)); col = col / 26 - 1; if ( col < 0 ) break; @@ -1127,11 +1242,14 @@ IMPLEMENT_DYNAMIC_CLASS( wxGridStringTable, wxGridTableBase ) wxGridStringTable::wxGridStringTable() : wxGridTableBase() { + m_numCols = 0; } wxGridStringTable::wxGridStringTable( int numRows, int numCols ) : wxGridTableBase() { + m_numCols = numCols; + m_data.Alloc( numRows ); wxArrayString sa; @@ -1141,36 +1259,21 @@ wxGridStringTable::wxGridStringTable( int numRows, int numCols ) 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()), + wxCHECK_MSG( (row >= 0 && row < GetNumberRows()) && + (col >= 0 && col < GetNumberCols()), wxEmptyString, - _T("invalid row or column index in wxGridStringTable") ); + wxT("invalid row or column index in wxGridStringTable") ); return m_data[row][col]; } void wxGridStringTable::SetValue( int row, int col, const wxString& value ) { - wxCHECK_RET( (row < GetNumberRows()) && (col < GetNumberCols()), - _T("invalid row or column index in wxGridStringTable") ); + wxCHECK_RET( (row >= 0 && row < GetNumberRows()) && + (col >= 0 && col < GetNumberCols()), + wxT("invalid row or column index in wxGridStringTable") ); m_data[row][col] = value; } @@ -1327,6 +1430,8 @@ bool wxGridStringTable::InsertCols( size_t pos, size_t numCols ) } } + m_numCols += numCols; + if ( GetView() ) { wxGridTableMessage msg( this, @@ -1351,6 +1456,8 @@ bool wxGridStringTable::AppendCols( size_t numCols ) m_data[row].Add( wxEmptyString, numCols ); } + m_numCols += numCols; + if ( GetView() ) { wxGridTableMessage msg( this, @@ -1404,16 +1511,23 @@ bool wxGridStringTable::DeleteCols( size_t pos, size_t numCols ) 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() ) @@ -1811,7 +1925,7 @@ wxGrid::~wxGrid() #ifdef DEBUG_ATTR_CACHE size_t total = gs_nAttrCacheHits + gs_nAttrCacheMisses; - wxPrintf(_T("wxGrid attribute cache statistics: " + wxPrintf(wxT("wxGrid attribute cache statistics: " "total: %u, hits: %u (%u%%)\n"), total, gs_nAttrCacheHits, total ? (gs_nAttrCacheHits*100) / total : 0); @@ -2973,7 +3087,7 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event ) // 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; @@ -3319,7 +3433,7 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event ) // 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; @@ -3461,19 +3575,19 @@ void wxGrid::ChangeCursorMode(CursorMode mode, #if wxUSE_LOG_TRACE static const wxChar *cursorModes[] = { - _T("SELECT_CELL"), - _T("RESIZE_ROW"), - _T("RESIZE_COL"), - _T("SELECT_ROW"), - _T("SELECT_COL"), - _T("MOVE_COL"), + wxT("SELECT_CELL"), + wxT("RESIZE_ROW"), + wxT("RESIZE_COL"), + wxT("SELECT_ROW"), + wxT("SELECT_COL"), + wxT("MOVE_COL"), }; - wxLogTrace(_T("grid"), - _T("wxGrid cursor mode (mouse capture for %s): %s -> %s"), - win == m_colWindow ? _T("colLabelWin") - : win ? _T("rowLabelWin") - : _T("gridWin"), + wxLogTrace(wxT("grid"), + wxT("wxGrid cursor mode (mouse capture for %s): %s -> %s"), + win == m_colWindow ? wxT("colLabelWin") + : win ? wxT("rowLabelWin") + : wxT("gridWin"), cursorModes[m_cursorMode], cursorModes[mode]); #endif // wxUSE_LOG_TRACE @@ -3995,7 +4109,7 @@ void wxGrid::DoEndDragResizeRow(const wxMouseEvent& event) // 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) @@ -4003,7 +4117,7 @@ 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) @@ -4182,7 +4296,7 @@ wxGrid::DoAppendLines(bool (wxGridTableBase::*funcAppend)(size_t), // ---------------------------------------------------------------------------- void -wxGrid::SendSizeEvent(wxEventType type, +wxGrid::SendGridSizeEvent(wxEventType type, int row, int col, const wxMouseEvent& mouseEv) { @@ -4204,7 +4318,7 @@ wxGrid::SendSizeEvent(wxEventType type, // +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) { @@ -5327,32 +5441,25 @@ void wxGrid::DrawRowLabel( wxDC& dc, int row ) if ( GetRowHeight(row) <= 0 || m_rowLabelWidth <= 0 ) return; - wxRect rect; - - int rowTop = GetRowTop(row), - rowBottom = GetRowBottom(row) - 1; - - dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW))); - dc.DrawLine( m_rowLabelWidth - 1, rowTop, m_rowLabelWidth - 1, rowBottom ); - dc.DrawLine( 0, rowTop, 0, rowBottom ); - dc.DrawLine( 0, rowBottom, m_rowLabelWidth, rowBottom ); + wxGridCellAttrProvider * const + attrProvider = m_table ? m_table->GetAttrProvider() : NULL; - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( 1, rowTop, 1, rowBottom ); - dc.DrawLine( 1, rowTop, m_rowLabelWidth - 1, rowTop ); + // notice that an explicit static_cast is needed to avoid a compilation + // error with VC7.1 which, for some reason, tries to instantiate (abstract) + // wxGridRowHeaderRenderer class without it + const wxGridRowHeaderRenderer& + rend = attrProvider ? attrProvider->GetRowHeaderRenderer(row) + : static_cast + (gs_defaultHeaderRenderers.rowRenderer); - dc.SetBackgroundMode( wxBRUSHSTYLE_TRANSPARENT ); - dc.SetTextForeground( GetLabelTextColour() ); - dc.SetFont( GetLabelFont() ); + wxRect rect(0, GetRowTop(row), m_rowLabelWidth, GetRowHeight(row)); + rend.DrawBorder(*this, dc, rect); int hAlign, vAlign; - GetRowLabelAlignment( &hAlign, &vAlign ); + GetRowLabelAlignment(&hAlign, &vAlign); - rect.SetX( 2 ); - rect.SetY( GetRowTop(row) + 2 ); - rect.SetWidth( m_rowLabelWidth - 4 ); - rect.SetHeight( GetRowHeight(row) - 4 ); - DrawTextRectangle( dc, GetRowLabelValue( row ), rect, hAlign, vAlign ); + rend.DrawLabel(*this, dc, GetRowLabelValue(row), + rect, hAlign, vAlign, wxHORIZONTAL); } void wxGrid::UseNativeColHeader(bool native) @@ -5400,26 +5507,27 @@ void wxGrid::DrawColLabels( wxDC& dc,const wxArrayInt& cols ) void wxGrid::DrawCornerLabel(wxDC& dc) { + wxRect rect(wxSize(m_rowLabelWidth, m_colLabelHeight)); + if ( m_nativeColumnLabels ) { - wxRect rect(wxSize(m_rowLabelWidth, m_colLabelHeight)); rect.Deflate(1); wxRendererNative::Get().DrawHeaderButton(m_cornerLabelWin, dc, rect, 0); } else { - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW))); - dc.DrawLine( m_rowLabelWidth - 1, m_colLabelHeight - 1, - m_rowLabelWidth - 1, 0 ); - dc.DrawLine( m_rowLabelWidth - 1, m_colLabelHeight - 1, - 0, m_colLabelHeight - 1 ); - dc.DrawLine( 0, 0, m_rowLabelWidth, 0 ); - dc.DrawLine( 0, 0, 0, m_colLabelHeight ); + rect.width++; + rect.height++; + + wxGridCellAttrProvider * const + attrProvider = m_table ? m_table->GetAttrProvider() : NULL; + const wxGridCornerHeaderRenderer& + rend = attrProvider ? attrProvider->GetCornerRenderer() + : static_cast + (gs_defaultHeaderRenderers.cornerRenderer); - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( 1, 1, m_rowLabelWidth - 1, 1 ); - dc.DrawLine( 1, 1, 1, m_colLabelHeight - 1 ); + rend.DrawBorder(*this, dc, rect); } } @@ -5431,6 +5539,12 @@ void wxGrid::DrawColLabel(wxDC& dc, int col) int colLeft = GetColLeft(col); wxRect rect(colLeft, 0, GetColWidth(col), m_colLabelHeight); + wxGridCellAttrProvider * const + attrProvider = m_table ? m_table->GetAttrProvider() : NULL; + const wxGridColumnHeaderRenderer& + rend = attrProvider ? attrProvider->GetColumnHeaderRenderer(col) + : static_cast + (gs_defaultHeaderRenderers.colRenderer); if ( m_nativeColumnLabels ) { @@ -5446,34 +5560,18 @@ void wxGrid::DrawColLabel(wxDC& dc, int col) : wxHDR_SORT_ICON_DOWN : wxHDR_SORT_ICON_NONE ); + rect.Deflate(2); } else { - int colRight = GetColRight(col) - 1; - - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW))); - dc.DrawLine( colRight, 0, - colRight, m_colLabelHeight - 1 ); - dc.DrawLine( colLeft, 0, - colRight, 0 ); - dc.DrawLine( colLeft, m_colLabelHeight - 1, - colRight + 1, m_colLabelHeight - 1 ); - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( colLeft, 1, colLeft, m_colLabelHeight - 1 ); - dc.DrawLine( colLeft, 1, colRight, 1 ); + rend.DrawBorder(*this, dc, rect); } - dc.SetBackgroundMode( wxBRUSHSTYLE_TRANSPARENT ); - dc.SetTextForeground( GetLabelTextColour() ); - dc.SetFont( GetLabelFont() ); - int hAlign, vAlign; - GetColLabelAlignment( &hAlign, &vAlign ); + GetColLabelAlignment(&hAlign, &vAlign); const int orient = GetColLabelTextOrientation(); - rect.Deflate(2); - DrawTextRectangle(dc, GetColLabelValue(col), rect, hAlign, vAlign, orient); + rend.DrawLabel(*this, dc, GetColLabelValue(col), rect, hAlign, vAlign, orient); } // TODO: these 2 functions should be replaced with wxDC::DrawLabel() to which @@ -5483,7 +5581,7 @@ void wxGrid::DrawTextRectangle( wxDC& dc, const wxRect& rect, int horizAlign, int vertAlign, - int textOrientation ) + int textOrientation ) const { wxArrayString lines; @@ -5497,7 +5595,7 @@ void wxGrid::DrawTextRectangle(wxDC& dc, const wxRect& rect, int horizAlign, int vertAlign, - int textOrientation) + int textOrientation) const { if ( lines.empty() ) return; @@ -5716,7 +5814,7 @@ void wxGrid::EnableCellEditControl( bool enable ) return; // this should be checked by the caller! - wxASSERT_MSG( CanEnableCellControl(), _T("can't enable editing for this cell!") ); + wxASSERT_MSG( CanEnableCellControl(), wxT("can't enable editing for this cell!") ); // do it before ShowCellEditControl() m_cellEditCtrlEnabled = enable; @@ -6873,7 +6971,7 @@ int wxGrid::GetDefaultRowSize() const int wxGrid::GetRowSize( int row ) const { - wxCHECK_MSG( row >= 0 && row < m_numRows, 0, _T("invalid row index") ); + wxCHECK_MSG( row >= 0 && row < m_numRows, 0, wxT("invalid row index") ); return GetRowHeight(row); } @@ -6885,7 +6983,7 @@ int wxGrid::GetDefaultColSize() const int wxGrid::GetColSize( int col ) const { - wxCHECK_MSG( col >= 0 && col < m_numCols, 0, _T("invalid column index") ); + wxCHECK_MSG( col >= 0 && col < m_numCols, 0, wxT("invalid column index") ); return GetColWidth(col); } @@ -7165,8 +7263,8 @@ wxGridCellAttr *wxGrid::GetOrCreateCellAttr(int row, int col) const wxGridCellAttr *attr = NULL; bool canHave = ((wxGrid*)this)->CanHaveAttributes(); - wxCHECK_MSG( canHave, attr, _T("Cell attributes not allowed")); - wxCHECK_MSG( m_table, attr, _T("must have a table") ); + wxCHECK_MSG( canHave, attr, wxT("Cell attributes not allowed")); + wxCHECK_MSG( m_table, attr, wxT("must have a table") ); attr = m_table->GetAttr(row, col, wxGridCellAttr::Cell); if ( !attr ) @@ -7200,7 +7298,7 @@ void wxGrid::SetColFormatFloat(int col, int width, int precision) wxString typeName = wxGRID_VALUE_FLOAT; if ( (width != -1) || (precision != -1) ) { - typeName << _T(':') << width << _T(',') << precision; + typeName << wxT(':') << width << wxT(',') << precision; } SetColFormatCustom(col, typeName); @@ -7511,7 +7609,7 @@ void wxGrid::SetDefaultRowSize( int height, bool resizeExistingRows ) void wxGrid::SetRowSize( int row, int height ) { - wxCHECK_RET( row >= 0 && row < m_numRows, _T("invalid row index") ); + wxCHECK_RET( row >= 0 && row < m_numRows, wxT("invalid row index") ); // if < 0 then calculate new height from label if ( height < 0 ) @@ -7569,7 +7667,7 @@ void wxGrid::SetDefaultColSize( int width, bool resizeExistingCols ) void wxGrid::SetColSize( int col, int width ) { - wxCHECK_RET( col >= 0 && col < m_numCols, _T("invalid column index") ); + wxCHECK_RET( col >= 0 && col < m_numCols, wxT("invalid column index") ); // if < 0 then calculate new width from label if ( width < 0 ) @@ -8557,7 +8655,7 @@ int wxGridTypeRegistry::FindOrCloneDataType(const wxString& typeName) { // the first part of the typename is the "real" type, anything after ':' // are the parameters for the renderer - index = FindDataType(typeName.BeforeFirst(_T(':'))); + index = FindDataType(typeName.BeforeFirst(wxT(':'))); if ( index == wxNOT_FOUND ) { return wxNOT_FOUND; @@ -8574,7 +8672,7 @@ int wxGridTypeRegistry::FindOrCloneDataType(const wxString& typeName) editorOld->DecRef(); // do it even if there are no parameters to reset them to defaults - wxString params = typeName.AfterFirst(_T(':')); + wxString params = typeName.AfterFirst(wxT(':')); renderer->SetParameters(params); editor->SetParameters(params);