From 7af6f32725483589cd56b409368fe986f9b4e0d1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 17 May 1999 17:07:46 +0000 Subject: [PATCH] Added wxPoint ClientToScreen(const wxPoint& pt) wxPoint ScreenToClient(const wxPoint& pt) back into class wxWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/window.h | 10 +++++++--- include/wx/gtk1/window.h | 10 +++++++--- include/wx/msw/window.h | 4 ++++ include/wx/window.h | 6 +++--- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index beb38b7c4b..c4d7073bd2 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -88,6 +88,10 @@ public: 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 ); @@ -148,10 +152,10 @@ public: // creates a new widget style if none is there // and sets m_widgetStyle to this value. GtkStyle *GetWidgetStyle(); - + // called by SetFont() and SetXXXColour etc void SetWidgetStyle(); - + // overridden in many GTK widgets virtual void ApplyWidgetStyle(); @@ -193,7 +197,7 @@ public: bool m_isStaticBox:1; /* faster than IS_KIND_OF */ bool m_isFrame:1; /* faster than IS_KIND_OF */ bool m_acceptsFocus:1; /* ! wxStaticBox etc. */ - + // these are true if the style were set before the widget was realized // (typcally in the constructor) but the actual GTK style must not be set // before the widget has been "realized" diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index beb38b7c4b..c4d7073bd2 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -88,6 +88,10 @@ public: 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 ); @@ -148,10 +152,10 @@ public: // creates a new widget style if none is there // and sets m_widgetStyle to this value. GtkStyle *GetWidgetStyle(); - + // called by SetFont() and SetXXXColour etc void SetWidgetStyle(); - + // overridden in many GTK widgets virtual void ApplyWidgetStyle(); @@ -193,7 +197,7 @@ public: bool m_isStaticBox:1; /* faster than IS_KIND_OF */ bool m_isFrame:1; /* faster than IS_KIND_OF */ bool m_acceptsFocus:1; /* ! wxStaticBox etc. */ - + // these are true if the style were set before the widget was realized // (typcally in the constructor) but the actual GTK style must not be set // before the widget has been "realized" diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 643d79f01d..7d2e8bd7a3 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -116,6 +116,10 @@ public: 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 ); diff --git a/include/wx/window.h b/include/wx/window.h index b12fa1de05..78829524a6 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -611,7 +611,7 @@ public: virtual WXWidget GetHandle() const = 0; protected: - // the window id - a number which uniquely identifies a window among + // the window id - a number which uniquely identifies a window among // its siblings unless it is -1 wxWindowID m_windowId; @@ -763,8 +763,8 @@ inline wxWindow *wxWindowBase::GetGrandParent() const // global function // ---------------------------------------------------------------------------- -extern wxWindow* WXDLLEXPORT wxGetActiveWindow(); -inline int WXDLLEXPORT NewControlId() { return wxWindowBase::NewControlId(); } +WXDLLEXPORT extern wxWindow* wxGetActiveWindow(); +inline WXDLLEXPORT int NewControlId() { return wxWindowBase::NewControlId(); } #endif // _WX_WINDOW_H_BASE_ -- 2.47.2