X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0facad09d3633455d338cba9036df6922c98cb4..33f3e2b31ed781ba1446b49ec6d3e226c0a5c652:/include/wx/event.h?ds=inline diff --git a/include/wx/event.h b/include/wx/event.h index 6e4805549c..5aad5c465f 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -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; @@ -4347,11 +4354,11 @@ WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor); #define DECLARE_EVENT_TABLE() wxDECLARE_EVENT_TABLE(); #define BEGIN_EVENT_TABLE(a,b) wxBEGIN_EVENT_TABLE(a,b) #define BEGIN_EVENT_TABLE_TEMPLATE1(a,b,c) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c) -#define BEGIN_EVENT_TABLE_TEMPLATE2(a,b,c,d) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c,d) -#define BEGIN_EVENT_TABLE_TEMPLATE3(a,b,c,d,e) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c,d,e) -#define BEGIN_EVENT_TABLE_TEMPLATE4(a,b,c,d,e,f) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c,d,e,f) -#define BEGIN_EVENT_TABLE_TEMPLATE5(a,b,c,d,e,f,g) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c,d,e,f,g) -#define BEGIN_EVENT_TABLE_TEMPLATE6(a,b,c,d,e,f,g,h) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c,d,e,f,g,h) +#define BEGIN_EVENT_TABLE_TEMPLATE2(a,b,c,d) wxBEGIN_EVENT_TABLE_TEMPLATE2(a,b,c,d) +#define BEGIN_EVENT_TABLE_TEMPLATE3(a,b,c,d,e) wxBEGIN_EVENT_TABLE_TEMPLATE3(a,b,c,d,e) +#define BEGIN_EVENT_TABLE_TEMPLATE4(a,b,c,d,e,f) wxBEGIN_EVENT_TABLE_TEMPLATE4(a,b,c,d,e,f) +#define BEGIN_EVENT_TABLE_TEMPLATE5(a,b,c,d,e,f,g) wxBEGIN_EVENT_TABLE_TEMPLATE5(a,b,c,d,e,f,g) +#define BEGIN_EVENT_TABLE_TEMPLATE6(a,b,c,d,e,f,g,h) wxBEGIN_EVENT_TABLE_TEMPLATE6(a,b,c,d,e,f,g,h) #define END_EVENT_TABLE() wxEND_EVENT_TABLE() // other obsolete event declaration/definition macros; we don't need them any longer