+ wxWindowDCImpl::SetPen( pen );
+}
+
+void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig )
+{
+ wxBrush brush( brushOrig );
+ if ( m_selected.Ok() &&
+ m_selected.GetDepth() == 1 &&
+ (brush != *wxTRANSPARENT_BRUSH) )
+ {
+ brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE);
+ }
+
+ wxWindowDCImpl::SetBrush( brush );
+}
+
+void wxMemoryDCImpl::SetBackground( const wxBrush& brushOrig )
+{
+ wxBrush brush(brushOrig);
+
+ if ( m_selected.Ok() &&
+ m_selected.GetDepth() == 1 &&
+ (brush != *wxTRANSPARENT_BRUSH) )
+ {
+ brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+
+ wxWindowDCImpl::SetBackground( brush );
+}
+
+void wxMemoryDCImpl::SetTextForeground( const wxColour& col )
+{
+ if ( m_selected.Ok() && m_selected.GetDepth() == 1 )
+ wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
+ else
+ wxWindowDCImpl::SetTextForeground( col );
+}
+
+void wxMemoryDCImpl::SetTextBackground( const wxColour &col )
+{
+ if (m_selected.Ok() && m_selected.GetDepth() == 1)
+ wxWindowDCImpl::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
+ else
+ wxWindowDCImpl::SetTextBackground( col );
+}
+
+void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
+{
+ if (m_selected.Ok())
+ {
+ if (width) (*width) = m_selected.GetWidth();
+ if (height) (*height) = m_selected.GetHeight();
+ }
+ else
+ {
+ if (width) (*width) = 0;
+ if (height) (*height) = 0;
+ }
+}
+
+wxBitmap wxMemoryDCImpl::DoGetAsBitmap(const wxRect *subrect) const
+{
+ wxBitmap bmp = GetSelectedBitmap();
+ return subrect ? bmp.GetSubBitmap(*subrect) : bmp;
+}
+
+const wxBitmap& wxMemoryDCImpl::GetSelectedBitmap() const
+{
+ return m_selected;
+}
+
+wxBitmap& wxMemoryDCImpl::GetSelectedBitmap()
+{
+ return m_selected;
+}