]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
1. some more tests in console
[wxWidgets.git] / src / generic / grid.cpp
index 7930995a2b45a2c2fb9bf7ab3f0ebafd99700529..5e8559b6c4e58c838b4c0df58dfadbe3eb664d0c 100644 (file)
@@ -1189,7 +1189,10 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid)
     if (grid->GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL))
         m_startValue = grid->GetTable()->GetValueAsBool(row, col);
     else
-        m_startValue = !!grid->GetTable()->GetValue(row, col);
+    {
+        wxString cellval( grid->GetTable()->GetValue(row, col) );
+        m_startValue = !( !cellval || (cellval == "0") );
+    }
     CBox()->SetValue(m_startValue);
     CBox()->SetFocus();
 }
@@ -1795,7 +1798,10 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid,
     if ( grid.GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL) )
         value = grid.GetTable()->GetValueAsBool(row, col);
     else
-        value = !!grid.GetTable()->GetValue(row, col);
+    {
+        wxString cellval( grid.GetTable()->GetValue(row, col) );
+        value = !( !cellval || (cellval == "0") );
+    }
 
     if ( value )
     {
@@ -3825,8 +3831,9 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
             wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider();
             if (attrProvider) {
                 attrProvider->UpdateAttrRows( pos, -((int)numRows) );
-// ifdef'd out following patch from Paul Gammans
-#if 0
+// ifdef'd out following patch from Paul Gammans                
+#if 0                
+                // No need to touch column attributes, unless we
                 // removed _all_ rows, in this case, we remove
                 // all column attributes.
                 // I hate to do this here, but the
@@ -3961,7 +3968,7 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
             if (attrProvider) {
                 attrProvider->UpdateAttrCols( pos, -((int)numCols) );
 // ifdef'd out following patch from Paul Gammans                
-#if 0
+#if 0                
                 // No need to touch row attributes, unless we
                 // removed _all_ columns, in this case, we remove
                 // all row attributes.
@@ -5595,7 +5602,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
         HideCellEditControl();
         DisableCellEditControl();
 
-        if ( IsVisible( m_currentCellCoords, FALSE ) )  // zzz
+        if ( IsVisible( m_currentCellCoords, FALSE ) )
         {
             wxRect r;
             r = BlockToDeviceRect(m_currentCellCoords, m_currentCellCoords);
@@ -6417,7 +6424,7 @@ void wxGrid::ShowCellEditControl()
     {
         if ( !IsVisible( m_currentCellCoords ) )
         {
-            m_cellEditCtrlEnabled = false;        
+            m_cellEditCtrlEnabled = FALSE;
             return;
         }
         else
@@ -7405,7 +7412,7 @@ void wxGrid::SetRowLabelValue( int row, const wxString& s )
             if ( rect.height > 0 )
             {
                 CalcScrolledPosition(0, rect.y, &rect.x, &rect.y);
-                rect.x = m_left;
+                rect.x = 0;
                 rect.width = m_rowLabelWidth;
                 m_rowLabelWin->Refresh( TRUE, &rect );
             }
@@ -7424,7 +7431,7 @@ void wxGrid::SetColLabelValue( int col, const wxString& s )
             if ( rect.width > 0 )
             {
                 CalcScrolledPosition(rect.x, 0, &rect.x, &rect.y);
-                rect.y = m_top;
+                rect.y = 0;
                 rect.height = m_colLabelHeight;
                 m_colLabelWin->Refresh( TRUE, &rect );
             }