+ COLORREF colFgOld = 0,
+ colBgOld = 0;
+
+ if (m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE)
+ {
+ colFgOld = ::GetTextColor(GetHdc());
+ colBgOld = ::GetBkColor(GetHdc());
+
+ if (m_textForegroundColour.Ok())
+ { //just the oposite from what is expected see help on pattern brush
+ // 1 in mask becomes bk color
+ ::SetBkColor(GetHdc(), m_textForegroundColour.GetPixel() );
+ }
+ if (m_textBackgroundColour.Ok())
+ { //just the oposite from what is expected
+ // 0 in mask becomes text color
+ ::SetTextColor(GetHdc(), m_textBackgroundColour.GetPixel() );
+ }
+
+ if (m_backgroundMode == wxTRANSPARENT)
+ SetBkMode(GetHdc(), TRANSPARENT);
+ else
+ SetBkMode(GetHdc(), OPAQUE);
+ }
+