X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf2227623a889dd0a5f36288d346fc6bf64b55fa..2a45803fc3877afd0ae3ce356dfe216505165882:/include/wx/event.h?ds=sidebyside diff --git a/include/wx/event.h b/include/wx/event.h index e28d5c2970..df5cb310a5 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -33,7 +33,13 @@ #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" + + #define wxHAS_CALL_AFTER +#endif // ---------------------------------------------------------------------------- // forward declarations @@ -1276,6 +1282,8 @@ private: // done asynchronously, i.e. at some later time, instead of immediately when // the event object is constructed. +#ifdef wxHAS_CALL_AFTER + // This is a base class used to process all method calls. class wxAsyncMethodCallEvent : public wxEvent { @@ -1423,6 +1431,9 @@ private: const ParamType2 m_param2; }; +#endif // wxHAS_CALL_AFTER + + #if wxUSE_GUI @@ -1851,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; @@ -1900,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; @@ -3294,6 +3312,7 @@ public: // NOTE: uses AddPendingEvent(); call only from secondary threads #endif +#ifdef wxHAS_CALL_AFTER // Asynchronous method calls: these methods schedule the given method // pointer for a later call (during the next idle event loop iteration). // @@ -3311,7 +3330,7 @@ public: } // Notice that we use P1 and not T1 for the parameter to allow passing - // parameters that are only convertible to the type taken by the method + // parameters that are convertible to the type taken by the method // instead of being exactly the same, to be closer to the usual method call // semantics. template @@ -3331,6 +3350,7 @@ public: static_cast(this), method, x1, x2) ); } +#endif // wxHAS_CALL_AFTER // Connecting and disconnecting