+ 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
+}
+
+// ----------------------------------------------------------------------------
+// handling the focus
+// ----------------------------------------------------------------------------
+
+void wxCaret::OnSetFocus()
+{
+ m_hasFocus = TRUE;
+
+ if ( IsVisible() )
+ Refresh();
+}
+
+void wxCaret::OnKillFocus()
+{
+ m_hasFocus = FALSE;
+
+ if ( IsVisible() )
+ {
+ // the caret must be shown - otherwise, if it is hidden now, it will
+ // stay so until the focus doesn't return because it won't blink any
+ // more
+
+ // hide it first if it isn't hidden ...
+ if ( !m_blinkedOut )
+ Blink();
+
+ // .. and show it in the new style