ScreenToClient() implemented correctly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-05-19 01:00:57 +00:00
parent 42e69d6b43
commit dabc0cd5c1
7 changed files with 35 additions and 29 deletions

View File

@@ -489,8 +489,25 @@ public:
const = 0;
// translate to/from screen/client coordinates (pointers may be NULL)
virtual void ClientToScreen( int *x, int *y ) const = 0;
virtual void ScreenToClient( int *x, int *y ) const = 0;
void ClientToScreen( int *x, int *y ) const
{ DoClientToScreen(x, y); }
void ScreenToClient( int *x, int *y ) const
{ DoScreenToClient(x, y); }
wxPoint ClientToScreen(const wxPoint& pt) const
{
int x = pt.x, y = pt.y;
DoClientToScreen(&x, &y);
return wxPoint(x, y);
}
wxPoint ScreenToClient(const wxPoint& pt) const
{
int x = pt.x, y = pt.y;
DoScreenToClient(&x, &y);
return wxPoint(x, y);
}
// misc
// ----
@@ -707,6 +724,10 @@ protected:
// overloaded Something()s in terms of DoSomething() which will be the
// only one to be virtual.
// coordinates translation
virtual void DoClientToScreen( int *x, int *y ) const = 0;
virtual void DoScreenToClient( int *x, int *y ) const = 0;
// retrieve the position/size of the window
virtual void DoGetPosition( int *x, int *y ) const = 0;
virtual void DoGetSize( int *width, int *height ) const = 0;