X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..0c05fdf3570e8066b8a9a16627562e544306a678:/include/wx/caret.h diff --git a/include/wx/caret.h b/include/wx/caret.h index 817f32b73e..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 @@ -187,7 +187,7 @@ protected: int m_countVisible; private: - DECLARE_NO_COPY_CLASS(wxCaretBase); + DECLARE_NO_COPY_CLASS(wxCaretBase) }; // --------------------------------------------------------------------------- @@ -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