// 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;
}
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;
/**
Obtains the position (in client coordinates) at which the key was pressed.
- Notice that this position is simply the current mouse pointer position
- and has no special relationship to the key event itself.
+ Notice that under most platforms this position is simply the current
+ mouse pointer position and has no special relationship to the key event
+ itself.
+
+ @a x and @a y may be @NULL if the corresponding coordinate is not
+ needed.
*/
wxPoint GetPosition() const;
- void GetPosition(long* x, long* y) const;
+ void GetPosition(wxCoord* x, wxCoord* y) const;
//@}
/**