-
- wxClientDC dc(this);
- PrepareDC( dc );
- dc.SetPen( *wxTRANSPARENT_PEN );
- dc.SetBrush( *wxRED_BRUSH );
- // int xx = m_cursorX*m_charWidth;
- int xx = PosToPixel( m_cursorY, m_cursorX );
- dc.DrawRectangle( xx+2, m_cursorY*m_lineHeight+2, 2, m_lineHeight );
+
+ if (FindFocus() == this)
+ {
+ wxClientDC dc(this);
+ PrepareDC( dc );
+ dc.SetPen( *wxTRANSPARENT_PEN );
+ //dc.SetBrush( *wxRED_BRUSH );
+ dc.SetBrush( *wxBLACK_BRUSH );
+ // int xx = m_cursorX*m_charWidth;
+ int xx = PosToPixel( m_cursorY, m_cursorX );
+ dc.DrawRectangle( xx+2, m_cursorY*m_lineHeight+2, 2, m_lineHeight );
+ }