Merge branch 'stahta01-clang64_found_issue'

This commit is contained in:
Robin Dunn
2022-05-17 17:24:51 -07:00
2 changed files with 24 additions and 17 deletions

View File

@@ -47,13 +47,16 @@ def run():
c.find('GetLabelFromText').ignore()
# These are MSW only. Make them be empty stubs for the other ports
c.find('GetBackgroundColour').type = 'const wxColour*'
# These are MSW only. Make them be empty stubs for the other ports. Several
# have incorrect details in the interface docs, so we need to tweak their
# return types too.
c.find('GetBackgroundColour').type = 'wxColour*'
c.find('GetBackgroundColour').factory = True
c.find('GetBackgroundColour').setCppCode("""\
#ifdef __WXMSW__
return &self->GetBackgroundColour();
return new wxColor(self->GetBackgroundColour());
#else
return &wxNullColour;
return new wxColour;
#endif
""")
@@ -63,12 +66,13 @@ def run():
#endif
""")
c.find('GetFont').type = 'const wxFont*'
c.find('GetFont').type = 'wxFont*'
c.find('GetFont').factory = True
c.find('GetFont').setCppCode("""\
#ifdef __WXMSW__
return &self->GetFont();
return new wxFont(self->GetFont());
#else
return &wxNullFont;
return new wxFont;
#endif
""")
@@ -92,12 +96,13 @@ def run():
#endif
""")
c.find('GetTextColour').type = 'const wxColour*'
c.find('GetTextColour').type = 'wxColour*'
c.find('GetTextColour').factory = True
c.find('GetTextColour').setCppCode("""\
#ifdef __WXMSW__
return &self->GetTextColour();
return new wxColour(self->GetTextColour());
#else
return &wxNullColour;
return new wxColour;
#endif
""")
@@ -108,13 +113,13 @@ def run():
""")
c.find('GetBitmap').type = 'const wxBitmap*'
c.find('GetBitmap').transferBack = True
c.find('GetBitmap').type = 'wxBitmap*'
c.find('GetBitmap').factory = True
c.find('GetBitmap').setCppCode("""\
#ifdef __WXMSW__
return new wxBitmap(self->GetBitmap(checked));
#else
return new wxBitmap(self->GetBitmap());
return new wxBitmap(self->GetBitmap()); // no checked arg in this case
#endif
""")
@@ -135,12 +140,13 @@ def run():
""")
c.find('GetDisabledBitmap').type = 'const wxBitmap*'
c.find('GetDisabledBitmap').type = 'wxBitmap*'
c.find('GetDisabledBitmap').factory = True
c.find('GetDisabledBitmap').setCppCode("""\
#ifdef __WXMSW__
return &self->GetDisabledBitmap();
return new wxBitmap(self->GetDisabledBitmap());
#else
return &wxNullBitmap;
return new wxBitmap;
#endif
""")
@@ -150,6 +156,7 @@ def run():
#endif
""")
c.addAutoProperties()
c.addItem(etgtools.PropertyDef('Enabled', 'IsEnabled', 'Enable'))

View File

@@ -12,7 +12,7 @@ class menuitem_Tests(wtc.WidgetTestCase):
def test_menuitemCtor(self):
m1 = wx.MenuItem()
m2 = wx.MenuItem(None, -1, "Menu Item", "Help text", wx.ITEM_NORMAL)
m2.SetBitmap(wx.Bitmap(pngFile))
m2.SetBitmap(wx.BitmapBundle(wx.Bitmap(pngFile)))
def test_menuitemProperties(self):