- 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;
- }
+ wxBrush brush( brushOrig );
+ if ( m_selected.Ok() &&
+ m_selected.GetBitmap() &&
+ (brush != *wxTRANSPARENT_BRUSH) )
+ {
+ brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE);
+ }
+
+ wxWindowDC::SetBrush( brush );
+}
+
+void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
+{
+ wxBrush brush(brushOrig);
+
+ if ( m_selected.Ok() &&
+ m_selected.GetBitmap() &&
+ (brush != *wxTRANSPARENT_BRUSH) )
+ {
+ brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+
+ wxWindowDC::SetBackground( brush );
+}
+
+void wxMemoryDC::SetTextForeground( const wxColour& col )
+{
+ if ( m_selected.Ok() && m_selected.GetBitmap() )
+ {
+ wxWindowDC::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
+ }
+ else
+ {
+ wxWindowDC::SetTextForeground( col );
+ }
+}
+
+void wxMemoryDC::SetTextBackground( const wxColour &col )
+{
+ if (m_selected.Ok() && m_selected.GetBitmap())
+ {
+ wxWindowDC::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+ else
+ {
+ wxWindowDC::SetTextBackground( col );
+ }
+}
+
+void wxMemoryDC::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;
+ }