]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/multicell.cpp
fix for preserving the clip rgn (control redraws missing after switch to faster redra...
[wxWidgets.git] / contrib / src / gizmos / multicell.cpp
index a7a9020b381cbfe50c709a1f86e96dc5db8521e8..49ece0103f2be182c5ca237f52e97cc65d581cb3 100644 (file)
@@ -632,17 +632,14 @@ wxMultiCellCanvas :: wxMultiCellCanvas(wxWindow *par, int numRows, int numCols)
        m_minCellSize = wxSize(5, 5);
 }
 //---------------------------------------------------------------------------
        m_minCellSize = wxSize(5, 5);
 }
 //---------------------------------------------------------------------------
-wxString itoa(int x)
-{
-       char    bfr[255];
-       sprintf(bfr, "%d", x);
-       return bfr;
-}
-//---------------------------------------------------------------------------
 void wxMultiCellCanvas :: Add(wxWindow *win, unsigned int row, unsigned int col)
 {
 void wxMultiCellCanvas :: Add(wxWindow *win, unsigned int row, unsigned int col)
 {
-       wxASSERT_MSG(row >= 0 && row < m_maxRows, wxString("Row ") + itoa(row) + " out of bounds (" + itoa(m_maxRows) + ")");
-       wxASSERT_MSG(col >= 0 && col < m_maxCols, wxString("Column ") + itoa(col) + " out of bounds (" + itoa(m_maxCols) + ")");
+  // thanks to unsigned data row and col are always >= 0
+       wxASSERT_MSG( /* row >= 0 && */ row < m_maxRows,
+                 wxString::Format(_T("Row %d out of bounds (0..%d)"), row, m_maxRows) );
+       wxASSERT_MSG( /* col >= 0 && */ col < m_maxCols,
+                 wxString::Format(_T("Column %d out of bounds (0..%d)"), col, m_maxCols) );
+
        wxASSERT_MSG(m_cells[CELL_LOC(row, col)] == NULL, wxT("Cell already occupied"));
 
        wxCell *newCell = new wxCell(win);
        wxASSERT_MSG(m_cells[CELL_LOC(row, col)] == NULL, wxT("Cell already occupied"));
 
        wxCell *newCell = new wxCell(win);
@@ -659,7 +656,7 @@ void wxMultiCellCanvas :: CalculateConstraints()
                        if (!m_cells[CELL_LOC(row, col)])
                        {
                                // Create an empty static text field as a placeholder
                        if (!m_cells[CELL_LOC(row, col)])
                        {
                                // Create an empty static text field as a placeholder
-                               m_cells[CELL_LOC(row, col)] = new wxCell(new wxStaticText(m_parent, -1, ""));
+                               m_cells[CELL_LOC(row, col)] = new wxCell(new wxStaticText(m_parent, -1, wxT("")));
                        }
                        wxFlexGridSizer::Add(m_cells[CELL_LOC(row, col)]->m_window);
                }
                        }
                        wxFlexGridSizer::Add(m_cells[CELL_LOC(row, col)]->m_window);
                }
@@ -667,3 +664,4 @@ void wxMultiCellCanvas :: CalculateConstraints()
 }
 
 /*** End of File ***/
 }
 
 /*** End of File ***/
+