X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a0d517ea4dbcef61ba9b0868318f686e97618bb..0c05fdf3570e8066b8a9a16627562e544306a678:/include/wx/caret.h diff --git a/include/wx/caret.h b/include/wx/caret.h index f7d91c76f8..f8e547bc38 100644 --- a/include/wx/caret.h +++ b/include/wx/caret.h @@ -16,7 +16,7 @@ #if wxUSE_CARET -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "caret.h" #endif @@ -212,18 +212,25 @@ 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) }; #endif // wxUSE_CARET