- wxASSERT_MSG( GetWindow(), _T("caret without window cannot be shown") );
- wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be shown") );
+ wxASSERT_MSG( GetWindow(), wxT("caret without window cannot be shown") );
+ wxASSERT_MSG( IsOk(), wxT("caret of zero size cannot be shown") );
+
+ // we might not have created the caret yet if we had got the focus first
+ // and the caret was shown later - so do it now if we have the focus but
+ // not the caret
+ if ( !m_hasCaret && (wxWindow::FindFocus() == GetWindow()) )
+ {
+ if ( MSWCreateCaret() )
+ {
+ DoMove();
+ }
+ }