]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
don't set virtual size of the window to (0, 0) if scrollbars are removed from it
[wxWidgets.git] / src / generic / grid.cpp
index 65d60341f891cb0e476b1368abaff5b4dd0b5d56..47190211460c7e982582c7540dd204315a7c9a30 100644 (file)
@@ -552,7 +552,7 @@ void wxGridCellEditor::HandleReturn(wxKeyEvent& event)
 bool wxGridCellEditor::IsAcceptedKey(wxKeyEvent& event)
 {
     // accept the simple key presses, not anything with Ctrl/Alt/Meta
-    return !(event.ControlDown() || event.AltDown());
+    return !(event.ControlDown() || event.AltDown() || event.GetKeyCode() == WXK_SHIFT);
 }
 
 void wxGridCellEditor::StartingKey(wxKeyEvent& event)
@@ -2431,7 +2431,8 @@ void wxGridCellAttrData::UpdateAttrRows( size_t pos, int numRows )
                 else
                 {
                     // ...or remove the attribute
-                    m_attrs[n].attr->DecRef();
+                    // No need to DecRef the attribute itself since this is
+                    // done be wxGridCellWithAttr's destructor!
                     m_attrs.RemoveAt(n);
                     n--; count--;
                 }
@@ -2465,7 +2466,8 @@ void wxGridCellAttrData::UpdateAttrCols( size_t pos, int numCols )
                 else
                 {
                     // ...or remove the attribute
-                    m_attrs[n].attr->DecRef();
+                    // No need to DecRef the attribute itself since this is
+                    // done be wxGridCellWithAttr's destructor!
                     m_attrs.RemoveAt(n);
                     n--; count--;
                 }
@@ -7522,6 +7524,16 @@ void wxGrid::ForceRefresh()
     EndBatch();
 }
 
+bool wxGrid::Enable(bool enable)
+{
+    if ( !wxScrolledWindow::Enable(enable) )
+        return false;
+
+    // redraw in the new state
+    m_gridWin->Refresh();
+
+    return true;
+}
 
 //
 // ------ Edit control functions
@@ -10184,7 +10196,7 @@ wxRect wxGrid::BlockToDeviceRect( const wxGridCellCoords &topLeft,
     }
     else
     {
-        rect = wxRect( 0, 0, 0, 0 );
+        rect = wxRect(0,0,0,0);
     }
 
     cellRect = CellToRect( bottomRight );
@@ -10259,7 +10271,7 @@ wxRect wxGrid::BlockToDeviceRect( const wxGridCellCoords &topLeft,
     m_gridWin->GetClientSize( &cw, &ch );
 
     if (right < 0 || bottom < 0 || left > cw || top > ch)
-        return wxRect( 0, 0, 0, 0);
+        return wxRect(0,0,0,0);
 
     rect.SetLeft( wxMax(0, left) );
     rect.SetTop( wxMax(0, top) );