X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f6bb2602bfbd09e6fed1759bdc0211fd6a68473..2a45803fc3877afd0ae3ce356dfe216505165882:/include/wx/event.h?ds=sidebyside diff --git a/include/wx/event.h b/include/wx/event.h index 99710b7d7c..df5cb310a5 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -33,11 +33,11 @@ #include "wx/meta/convertible.h" #endif -#include "wx/meta/removeref.h" +// Currently VC6 and VC7 are known to not be able to compile CallAfter() code, +// so disable it for them. +#if !defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(8) + #include "wx/meta/removeref.h" -#ifdef wxHAS_REMOVEREF - // CallAfter() implementation requires wxRemoveRef(), so just disable it - // for compilers too broken to not allow defining it. #define wxHAS_CALL_AFTER #endif @@ -1862,18 +1862,23 @@ public: // Find the position of the event void GetPosition(wxCoord *xpos, wxCoord *ypos) const { - if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; + if (xpos) + *xpos = GetX(); + if (ypos) + *ypos = GetY(); } + // This version if provided only for backwards compatiblity, don't use. void GetPosition(long *xpos, long *ypos) const { - if (xpos) *xpos = (long)m_x; - if (ypos) *ypos = (long)m_y; + if (xpos) + *xpos = GetX(); + if (ypos) + *ypos = GetY(); } wxPoint GetPosition() const - { return wxPoint(m_x, m_y); } + { return wxPoint(GetX(), GetY()); } // Get X position wxCoord GetX() const; @@ -1911,6 +1916,8 @@ public: } public: + // Do not use these fields directly, they are initialized on demand, so + // call GetX() and GetY() or GetPosition() instead. wxCoord m_x, m_y; long m_keyCode;