X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c589ad076cb531a3ef7808aaedadc03c8286942..ef609210f1656775cbbd09e45d36e2abb90e47d5:/src/msw/caret.cpp diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp index 08bc7e5389..dec7d89ea5 100644 --- a/src/msw/caret.cpp +++ b/src/msw/caret.cpp @@ -60,10 +60,14 @@ int wxCaretBase::GetBlinkTime() //static void wxCaretBase::SetBlinkTime(int milliseconds) { +#ifdef __WIN16__ + ::SetCaretBlinkTime(milliseconds) ; +#else if ( !::SetCaretBlinkTime(milliseconds) ) { wxLogLastError("SetCaretBlinkTime"); } +#endif } // --------------------------------------------------------------------------- @@ -72,11 +76,15 @@ void wxCaretBase::SetBlinkTime(int milliseconds) bool wxCaret::MSWCreateCaret() { - wxASSERT_MSG( GetWindow(), "caret without window cannot be created" ); - wxASSERT_MSG( IsOk(), "caret of zero size cannot be created" ); + wxASSERT_MSG( GetWindow(), _T("caret without window cannot be created") ); + wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be created") ); if ( !m_hasCaret ) { +#ifdef __WIN16__ + ::CreateCaret(GetWinHwnd(GetWindow()), 0, m_width, m_height) ; + m_hasCaret = TRUE; +#else if ( !::CreateCaret(GetWinHwnd(GetWindow()), 0, m_width, m_height) ) { wxLogLastError("CreateCaret"); @@ -85,6 +93,7 @@ bool wxCaret::MSWCreateCaret() { m_hasCaret = TRUE; } +#endif } return m_hasCaret; @@ -112,10 +121,14 @@ void wxCaret::OnKillFocus() { m_hasCaret = FALSE; +#ifdef __WIN16__ + ::DestroyCaret() ; +#else if ( !::DestroyCaret() ) { wxLogLastError("DestroyCaret"); } +#endif } } @@ -125,28 +138,36 @@ void wxCaret::OnKillFocus() void wxCaret::DoShow() { - wxASSERT_MSG( GetWindow(), "caret without window cannot be shown" ); - wxASSERT_MSG( IsOk(), "caret of zero size cannot be shown" ); + wxASSERT_MSG( GetWindow(), _T("caret without window cannot be shown") ); + wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be shown") ); if ( !m_hasCaret ) { (void)MSWCreateCaret(); } +#ifdef __WIN16__ + ::ShowCaret(GetWinHwnd(GetWindow())) ; +#else if ( !::ShowCaret(GetWinHwnd(GetWindow())) ) { wxLogLastError("ShowCaret"); } +#endif } void wxCaret::DoHide() { if ( m_hasCaret ) { +#ifdef __WIN16__ + ::HideCaret(GetWinHwnd(GetWindow())) ; +#else if ( !::HideCaret(GetWinHwnd(GetWindow())) ) { wxLogLastError("HideCaret"); } +#endif } } @@ -158,10 +179,14 @@ void wxCaret::DoMove() { if ( m_hasCaret ) { +#ifdef __WIN16__ + ::SetCaretPos(m_x, m_y) ; +#else if ( !::SetCaretPos(m_x, m_y) ) { wxLogLastError("SetCaretPos"); } +#endif } //else: we don't have caret right now, nothing to do (this does happen) }