]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Added chapter on collection and container classes to contents
[wxWidgets.git] / src / generic / grid.cpp
index d643c0ff7c60405e645991c31da66f894185e772..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