X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..4bd87101b398ea89795bae4012bbb03866b7e0f5:/src/msw/caret.cpp diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp index 55cd4242c9..cacc6801f5 100644 --- a/src/msw/caret.cpp +++ b/src/msw/caret.cpp @@ -81,8 +81,8 @@ void wxCaretBase::SetBlinkTime(int milliseconds) bool wxCaret::MSWCreateCaret() { - wxASSERT_MSG( GetWindow(), T("caret without window cannot be created") ); - wxASSERT_MSG( IsOk(), T("caret of zero size cannot be created") ); + wxASSERT_MSG( GetWindow(), wxT("caret without window cannot be created") ); + wxASSERT_MSG( IsOk(), wxT("caret of zero size cannot be created") ); if ( !m_hasCaret ) { @@ -127,8 +127,8 @@ void wxCaret::OnKillFocus() void wxCaret::DoShow() { - 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") ); if ( m_hasCaret ) { @@ -153,10 +153,26 @@ void wxCaret::DoMove() { if ( m_hasCaret ) { - wxWindow *winFocus = wxWindow::FindFocus(); - wxASSERT_MSG( winFocus == GetWindow(), T("how did we lose focus?") ); + wxASSERT_MSG( wxWindow::FindFocus() == GetWindow(), + wxT("how did we lose focus?") ); CALL_CARET_API(SetCaretPos, (m_x, m_y)); } //else: we don't have caret right now, nothing to do (this does happen) } + + +// --------------------------------------------------------------------------- +// resizing the caret +// --------------------------------------------------------------------------- + +void wxCaret::DoSize() +{ + if ( m_hasCaret ) + { + m_hasCaret = FALSE; + CALL_CARET_API(DestroyCaret, ()); + MSWCreateCaret(); + DoMove(); + } +}