+ wxPen pen( penOrig );
+ if ( m_selected.IsOk() &&
+ m_selected.GetDepth() == 1 &&
+ (pen != *wxTRANSPARENT_PEN) )
+ {
+ pen.SetColour( pen.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+
+ wxWindowDCImpl::SetPen( pen );
+}
+
+void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig )
+{
+ wxBrush brush( brushOrig );
+ if ( m_selected.IsOk() &&
+ 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.IsOk() &&
+ 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.IsOk() && m_selected.GetDepth() == 1 )
+ wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
+ else
+ wxWindowDCImpl::SetTextForeground( col );
+}
+
+void wxMemoryDCImpl::SetTextBackground( const wxColour &col )
+{
+ if (m_selected.IsOk() && 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.IsOk())