Permalink
Browse files

[wxhaskell-from-cvs @ 2003-11-07 10:33:50 by dleijen]

Added ClientToScreen call.

darcs-hash:20031107103352-deb31-6eea5dd8a74ae3c2ac6ffa262b4e12fb7a35d08e.gz
  • Loading branch information...
1 parent f11ea8c commit 100555fb52e66d5ee5e833e752ea750ce98c680b dleijen committed Nov 7, 2003
Showing with 13 additions and 4 deletions.
  1. +1 −0 wxc/include/wxc.h
  2. +8 −0 wxc/src/extra.cpp
  3. +4 −4 wxcore/src/Graphics/UI/WXCore/Frame.hs
View
@@ -64,6 +64,7 @@ void wxWindow_ConvertPixelsToDialogEx( TSelf(wxWindow) _obj, TPoint(x,y), TPoin
void wxWindow_GetVirtualSize( TSelf(wxWindow) _obj, TSizeOut(_w,_h) );
void wxWindow_SetVirtualSize( TSelf(wxWindow) _obj, TSize(w,h) );
void wxWindow_FitInside(TSelf(wxWindow) _obj);
+void wxWindow_ClientToScreen(TSelf(wxWindow) self, TPoint(x,y), TPointOut(sx,sy));
/* wxString helpers */
TClass(wxString) wxString_Create( TString buffer );
View
@@ -1439,6 +1439,14 @@ EWXWEXPORT(void, wxWindow_FitInside)(void* _obj)
}
+EWXWEXPORT(void, wxWindow_ClientToScreen)(wxWindow* self, int x, int y, int* sx, int* sy)
+{
+ wxPoint pt = self->ClientToScreen( wxPoint(x,y) );
+ if (sx) *sx = pt.x;
+ if (sy) *sy = pt.y;
+}
+
+
EWXWEXPORT(void, wxcGetMousePosition)( int* x, int* y )
{
wxPoint pt = wxGetMousePosition();
@@ -98,10 +98,10 @@ windowGetMousePosition w
windowScreenToRelativePosition w p
-- | Translate a screen position to a position relative to a window.
-windowScreenToRelativePosition :: Window a -> Point -> IO Point
-windowScreenToRelativePosition w p
- = do sp <- windowGetScreenPosition w
- return (pointSub p sp)
+windowScreenToClient :: Window a -> Point -> IO Point
+windowScreenToClient w sp
+ = do sp0 <- windowClientToScreen w pointZero
+ return (pointSub sp sp0)
-- | Get the window position relative to the origin of the display.
windowGetScreenPosition :: Window a -> IO Point

0 comments on commit 100555f

Please sign in to comment.