]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Fixed a problem with borders being set wrong sometimes on wxMSW, XP, VC++ 7
[wxWidgets.git] / src / generic / grid.cpp
index a286e3706e38dce9110cc106a994952f4db82ec2..2f12b4028e4fa2befab24167fec0a82e3aff4b55 100644 (file)
@@ -203,6 +203,8 @@ public:
 
     void ScrollWindow( int dx, int dy, const wxRect *rect );
 
+    wxGrid* GetOwner() { return m_owner; }
+
 private:
     wxGrid                   *m_owner;
     wxGridRowLabelWindow     *m_rowLabelWin;
@@ -446,6 +448,10 @@ void wxGridCellEditor::PaintBackground(const wxRect& rectCell,
 {
     // erase the background because we might not fill the cell
     wxClientDC dc(m_control->GetParent());
+    wxGridWindow* gridWindow = wxDynamicCast(m_control->GetParent(), wxGridWindow);
+    if (gridWindow)
+        gridWindow->GetOwner()->PrepareDC(dc);
+    
     dc.SetPen(*wxTRANSPARENT_PEN);
     dc.SetBrush(wxBrush(attr->GetBackgroundColour(), wxSOLID));
     dc.DrawRectangle(rectCell);