X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22f3361e1cf25c52a2da8fdfc5cb081809e18fb9..553c5bcc3ab65e8b8a002dc6d5f51cba4f39292c:/include/wx/caret.h diff --git a/include/wx/caret.h b/include/wx/caret.h index e34ed29d12..f8e547bc38 100644 --- a/include/wx/caret.h +++ b/include/wx/caret.h @@ -16,7 +16,7 @@ #if wxUSE_CARET -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "caret.h" #endif @@ -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) };