X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa06b433fc7ed4137d7fe5195cbbec88a10291af..0d1903dbda864780eec30efdc4e91776bdbfd21b:/src/msw/caret.cpp diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp index ee761165a1..677cf5c339 100644 --- a/src/msw/caret.cpp +++ b/src/msw/caret.cpp @@ -1,11 +1,10 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/caret.cpp +// Name: src/msw/caret.cpp // Purpose: MSW implementation of wxCaret // Author: Vadim Zeitlin // Modified by: // Created: 23.05.99 -// RCS-ID: $Id$ -// Copyright: (c) wxWindows team +// Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -17,10 +16,6 @@ // headers // --------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "caret.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -35,21 +30,19 @@ #include "wx/caret.h" +#if wxUSE_CARET + #include "wx/msw/private.h" // --------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- -// under Win16 the caret APIs are void but under Win32 they may return an -// error code which we want to check - this macro does just this -#ifdef __WIN16__ - #define CALL_CARET_API(api, args) api args -#else // Win32 - #define CALL_CARET_API(api, args) \ - if ( !api args ) \ - wxLogLastError(_T(#api)) -#endif // Win16/32 +#define CALL_CARET_API(api, args) \ + if ( !api args ) \ + { \ + wxLogLastError(wxT(#api)); \ + } // =========================================================================== // implementation @@ -91,7 +84,7 @@ bool wxCaret::MSWCreateCaret() CALL_CARET_API(CreateCaret, (GetWinHwnd(GetWindow()), 0, m_width, m_height)); - m_hasCaret = TRUE; + m_hasCaret = true; } return m_hasCaret; @@ -117,7 +110,7 @@ void wxCaret::OnKillFocus() { if ( m_hasCaret ) { - m_hasCaret = FALSE; + m_hasCaret = false; CALL_CARET_API(DestroyCaret, ()); } @@ -186,9 +179,11 @@ void wxCaret::DoSize() { if ( m_hasCaret ) { - m_hasCaret = FALSE; + m_hasCaret = false; CALL_CARET_API(DestroyCaret, ()); MSWCreateCaret(); OnSetFocus(); } } + +#endif