mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Merge pull request #67 from swt2c/add_window_coord_overloads
Add int* overloads for ClientToScreen/ScreenToClient overloads and ad…
This commit is contained in:
@@ -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']:
|
||||
|
||||
@@ -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)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user