From c80b9af4d7e4e3cc358ac381544322deb82e2ec1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 15 Oct 2000 19:47:44 +0000 Subject: [PATCH] fixed bug when the caret wasn't shown if it was hidden when the window got focus the last time git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/caret.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp index 6dd4f3ccec..f1fd767110 100644 --- a/src/msw/caret.cpp +++ b/src/msw/caret.cpp @@ -132,6 +132,17 @@ void wxCaret::DoShow() 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(); + } + } + if ( m_hasCaret ) { CALL_CARET_API(ShowCaret, (GetWinHwnd(GetWindow())));