diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 4c6fc6fa8f..167d3bc338 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -86,13 +86,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; - virtual void ClientToScreen( int *x, int *y ) const; - virtual void ScreenToClient( int *x, int *y ) const; - wxPoint ClientToScreen(const wxPoint& pt) const - { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } - wxPoint ScreenToClient(const wxPoint& pt) const - { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } - virtual bool PopupMenu( wxMenu *menu, int x, int y ); virtual void SetScrollbar( int orient, int pos, int thumbVisible, @@ -215,6 +208,8 @@ public: wxInsertChildFunction m_insertCallback; // implement the base class pure virtuals + virtual void DoClientToScreen( int *x, int *y ) const; + virtual void DoScreenToClient( int *x, int *y ) const; virtual void DoGetPosition( int *x, int *y ) const; virtual void DoGetSize( int *width, int *height ) const; virtual void DoGetClientSize( int *width, int *height ) const; diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index 4c6fc6fa8f..167d3bc338 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -86,13 +86,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; - virtual void ClientToScreen( int *x, int *y ) const; - virtual void ScreenToClient( int *x, int *y ) const; - wxPoint ClientToScreen(const wxPoint& pt) const - { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } - wxPoint ScreenToClient(const wxPoint& pt) const - { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } - virtual bool PopupMenu( wxMenu *menu, int x, int y ); virtual void SetScrollbar( int orient, int pos, int thumbVisible, @@ -215,6 +208,8 @@ public: wxInsertChildFunction m_insertCallback; // implement the base class pure virtuals + virtual void DoClientToScreen( int *x, int *y ) const; + virtual void DoScreenToClient( int *x, int *y ) const; virtual void DoGetPosition( int *x, int *y ) const; virtual void DoGetSize( int *width, int *height ) const; virtual void DoGetClientSize( int *width, int *height ) const; diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index febe2c9b2e..73f3856f0d 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -110,13 +110,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; - virtual void ClientToScreen( int *x, int *y ) const; - virtual void ScreenToClient( int *x, int *y ) const; - wxPoint ClientToScreen(const wxPoint& pt) const - { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } - wxPoint ScreenToClient(const wxPoint& pt) const - { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } - virtual bool PopupMenu( wxMenu *menu, int x, int y ); virtual void SetScrollbar( int orient, int pos, int thumbVisible, @@ -403,6 +396,8 @@ protected: wxButton *m_btnDefault; // implement the base class pure virtuals + virtual void DoClientToScreen( int *x, int *y ) const; + virtual void DoScreenToClient( int *x, int *y ) const; virtual void DoGetPosition( int *x, int *y ) const; virtual void DoGetSize( int *width, int *height ) const; virtual void DoGetClientSize( int *width, int *height ) const; diff --git a/include/wx/window.h b/include/wx/window.h index 99f192fc7e..8aa851a82a 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -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; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index cff51e599d..1d6581c0bd 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2129,7 +2129,7 @@ void wxWindow::DoGetPosition( int *x, int *y ) const if (y) (*y) = m_y; } -void wxWindow::ClientToScreen( int *x, int *y ) const +void wxWindow::DoClientToScreen( int *x, int *y ) const { wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); @@ -2158,7 +2158,7 @@ void wxWindow::ClientToScreen( int *x, int *y ) const if (y) *y += org_y; } -void wxWindow::ScreenToClient( int *x, int *y ) const +void wxWindow::DoScreenToClient( int *x, int *y ) const { wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index cff51e599d..1d6581c0bd 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2129,7 +2129,7 @@ void wxWindow::DoGetPosition( int *x, int *y ) const if (y) (*y) = m_y; } -void wxWindow::ClientToScreen( int *x, int *y ) const +void wxWindow::DoClientToScreen( int *x, int *y ) const { wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); @@ -2158,7 +2158,7 @@ void wxWindow::ClientToScreen( int *x, int *y ) const if (y) *y += org_y; } -void wxWindow::ScreenToClient( int *x, int *y ) const +void wxWindow::DoScreenToClient( int *x, int *y ) const { wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); diff --git a/src/msw/window.cpp b/src/msw/window.cpp index de806ac65f..88a43b6b33 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1099,7 +1099,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const *y = point.y; } -void wxWindow::ScreenToClient(int *x, int *y) const +void wxWindow::DoScreenToClient(int *x, int *y) const { POINT pt; if ( x ) @@ -1116,7 +1116,7 @@ void wxWindow::ScreenToClient(int *x, int *y) const *y = pt.y; } -void wxWindow::ClientToScreen(int *x, int *y) const +void wxWindow::DoClientToScreen(int *x, int *y) const { POINT pt; if ( x )