X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12028905135250524409f1e7b9bfa9c55e5ce16b..3684ade82ec6f5fb7ff72341e26060b6ea0793c8:/include/wx/caret.h diff --git a/include/wx/caret.h b/include/wx/caret.h index 266f6d278d..f8e547bc38 100644 --- a/include/wx/caret.h +++ b/include/wx/caret.h @@ -212,18 +212,23 @@ public: wxCaretSuspend(wxWindow *win) { m_caret = win->GetCaret(); - if ( m_caret ) + m_show = FALSE; + if ( m_caret && m_caret->IsVisible() ) + { m_caret->Hide(); + m_show = TRUE; + } } ~wxCaretSuspend() { - if ( m_caret ) + if ( m_caret && m_show ) m_caret->Show(); } private: wxCaret *m_caret; + bool m_show; DECLARE_NO_COPY_CLASS(wxCaretSuspend) };