little tweaks and fixes for linux

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-10-11 00:41:10 +00:00
parent a11f9e73e1
commit e2f4f745f0
5 changed files with 20 additions and 8 deletions

View File

@@ -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)

View File

@@ -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', '()', """\

View File

@@ -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', '()', """\

View File

@@ -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;
}

View File

@@ -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