+ if ( IsVisible() )
+ {
+ if ( !m_blinkedOut )
+ {
+ // hide it right now and it will be shown the next time it blinks
+ Blink();
+
+ // but if the caret is not blinking, we should blink it back into
+ // visibility manually
+ if ( !m_timer.IsRunning() )
+ Blink();
+ }
+ }
+ //else: will be shown at the correct location when it is shown
+}
+
+void wxCaret::DoSize()
+{
+ int countVisible = m_countVisible;
+ if (countVisible > 0)
+ {
+ m_countVisible = 0;
+ DoHide();
+ }
+ // Change bitmap size
+ m_bmpUnderCaret = wxBitmap(m_width, m_height);
+ if (countVisible > 0)
+ {
+ m_countVisible = countVisible;
+ DoShow();
+ }
+}
+
+// ----------------------------------------------------------------------------
+// handling the focus
+// ----------------------------------------------------------------------------
+
+void wxCaret::OnSetFocus()
+{
+ m_hasFocus = true;
+
+ if ( IsVisible() )
+ Refresh();
+}
+
+void wxCaret::OnKillFocus()
+{
+ m_hasFocus = false;
+
+ if ( IsVisible() )