X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..31ad423e4fb556ec225a63b161154d3bf3445c1b:/include/wx/caret.h diff --git a/include/wx/caret.h b/include/wx/caret.h index 817f32b73e..0967690a1b 100644 --- a/include/wx/caret.h +++ b/include/wx/caret.h @@ -5,7 +5,7 @@ // Modified by: // Created: 23.05.99 // RCS-ID: $Id$ -// Copyright: (c) wxWindows team +// Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -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