diff --git a/etg/window.py b/etg/window.py index e63157d4..222c805b 100644 --- a/etg/window.py +++ b/etg/window.py @@ -66,11 +66,14 @@ def run(): c.find('GetChildren').noCopy = True for name in ['GetVirtualSize', 'GetPosition', - 'GetScreenPosition', - 'ClientToScreen', - 'ScreenToClient', ]: + 'GetScreenPosition']: c.find(name).findOverload('int *').ignore() + # Fix ClientToScreen/ScreenToClient int * overloads + for name in ['ClientToScreen', 'ScreenToClient']: + c.find(name).findOverload('int *').find('x').inOut = True + c.find(name).findOverload('int *').find('y').inOut = True + # Like the above, but these also need to transplant the docs from the # ignored item to the non-ignored overload. for name in ['GetClientSize', 'GetSize']: diff --git a/unittests/test_window.py b/unittests/test_window.py index 015d3059..7299523c 100644 --- a/unittests/test_window.py +++ b/unittests/test_window.py @@ -90,6 +90,16 @@ class WindowTests(wtc.WidgetTestCase): self.assertEqual(wx.FindWindowById(self.frame.GetId()), self.frame) + def test_windowCoordConvFunctions(self): + w = wx.Window(self.frame, -1, (10,10), (50,50)) + a = w.ClientToScreen(0, 0) + b = w.ClientToScreen((0, 0)) + c = w.ScreenToClient(0, 0) + d = w.ScreenToClient((0, 0)) + self.assertEqual(a[0], b.x) + self.assertEqual(a[1], b.y) + self.assertEqual(c[0], d.x) + self.assertEqual(c[1], d.y) #---------------------------------------------------------------------------