diff --git a/etg/frame.py b/etg/frame.py index 4f263d3a..0d3bc956 100644 --- a/etg/frame.py +++ b/etg/frame.py @@ -46,12 +46,13 @@ def run(): c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') - - # TODO: should these go into a tools.addFrameVirtuals function? + tools.fixTopLevelWindowClass(c) + + # Add back the virtual flag for these methods. + # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True - tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/pen.py b/etg/pen.py index d252277f..227b3372 100644 --- a/etg/pen.py +++ b/etg/pen.py @@ -34,6 +34,9 @@ def run(): assert isinstance(c, etgtools.ClassDef) tools.removeVirtuals(c) + # The stipple bitmap ctor is not implemented on wxGTK + c.find('wxPen').findOverload('wxBitmap').ignore() + c.find('GetDashes').ignore() c.find('SetDashes').ignore() c.addCppMethod('wxArrayInt*', 'GetDashes', '()', """\ diff --git a/etg/window.py b/etg/window.py index 3fb1e90d..4b8e116f 100644 --- a/etg/window.py +++ b/etg/window.py @@ -85,7 +85,7 @@ def run(): m.find('descent').out = True m.find('externalLeading').out = True - c.find('GetHandle').type = 'void*' + c.find('GetHandle').type = 'unsigned long' c.find('GetHandle').setCppCode("return wxPyGetWinHandle(self);") c.addCppMethod('void*', 'GetGtkWidget', '()', """\ diff --git a/src/window_ex.cpp b/src/window_ex.cpp index d111067e..a9e3c907 100644 --- a/src/window_ex.cpp +++ b/src/window_ex.cpp @@ -15,16 +15,16 @@ -void* wxPyGetWinHandle(wxWindow* win) +wxUIntPtr wxPyGetWinHandle(wxWindow* win) { #ifdef __WXMSW__ - return (void*)win->GetHandle(); + return (wxUIntPtr)win->GetHandle(); #endif #if defined(__WXGTK__) || defined(__WXX11__) - return (void*)GetXWindow(win); + return (wxUIntPtr)GetXWindow(win); #endif #ifdef __WXMAC__ - return (void*)win->GetHandle(); + return (wxUIntPtr)win->GetHandle(); #endif return 0; } diff --git a/unittests/test_window.py b/unittests/test_window.py index 86afd01a..350b7c7e 100644 --- a/unittests/test_window.py +++ b/unittests/test_window.py @@ -12,6 +12,14 @@ class WindowTests(wtc.WidgetTestCase): self.assertTrue(w.GetWindowStyle() == wx.BORDER_SIMPLE|wx.VSCROLL) self.assertTrue(w.Parent is self.frame) + def test_windowHandle(self): + w = wx.Window(self.frame, -1, (10,10), (50,50)) + hdl = w.GetHandle() + self.assertTrue(isinstance(hdl, (int, long))) + + + def test_windowProperties(self): + w = wx.Window(self.frame, -1, (10,10), (50,50)) # Just test that these properties exist for now. More tests can be # added later to ensure that they work correctly. w.AcceleratorTable