Skip to content

Commit

Permalink
[wxhaskell-from-cvs @ 2003-11-07 10:33:50 by dleijen]
Browse files Browse the repository at this point in the history
Added ClientToScreen call.

darcs-hash:20031107103352-deb31-6eea5dd8a74ae3c2ac6ffa262b4e12fb7a35d08e.gz
  • Loading branch information
dleijen committed Nov 7, 2003
1 parent f11ea8c commit 100555f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions wxc/include/wxc.h
Expand Up @@ -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 );
Expand Down
8 changes: 8 additions & 0 deletions wxc/src/extra.cpp
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions wxcore/src/Graphics/UI/WXCore/Frame.hs
Expand Up @@ -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
Expand Down

0 comments on commit 100555f

Please sign in to comment.