mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 19:40:12 +01:00
Set the parameters of GetColourScheme as output args.
Get rid of PyGetColourScheme
This commit is contained in:
@@ -32,36 +32,22 @@ def run():
|
||||
#-----------------------------------------------------------------
|
||||
# Tweak the parsed meta objects in the module object as needed for
|
||||
# customizing the generated code and docstrings.
|
||||
|
||||
c = module.find('wxRibbonArtProvider')
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
c.find('Clone').factory = True
|
||||
|
||||
m = c.find('GetColourScheme')
|
||||
etgtools.appendText(m.detailedDoc, ".. seealso:: :meth:`PyGetColourScheme`")
|
||||
for klass in ['wxRibbonArtProvider',
|
||||
'wxRibbonMSWArtProvider',
|
||||
'wxRibbonAUIArtProvider']:
|
||||
c = module.find(klass)
|
||||
assert isinstance(c, etgtools.ClassDef)
|
||||
c.find('Clone').factory = True
|
||||
|
||||
c.addPyMethod('PyGetColourScheme', '(self)',
|
||||
doc="""\
|
||||
A more Python friendly version of :meth:`GetColourScheme`.\n
|
||||
This method returns a tuple of the 3 colours instead of requiring
|
||||
that you provide three :class:`wx.Colour` objects to be filled in
|
||||
by the API.
|
||||
""",
|
||||
body="""\
|
||||
primary = wx.Colour()
|
||||
secondary = wx.Colour()
|
||||
tertiary = wx.Colour()
|
||||
self.GetColourScheme(primary, secondary, tertiary)
|
||||
return (primary, secondary, tertiary)
|
||||
""")
|
||||
|
||||
|
||||
c = module.find('wxRibbonMSWArtProvider')
|
||||
c.find('Clone').factory = True
|
||||
|
||||
|
||||
c = module.find('wxRibbonAUIArtProvider')
|
||||
c.find('Clone').factory = True
|
||||
m = c.findItem('GetColourScheme')
|
||||
if m:
|
||||
m.find('primary').out = True
|
||||
m.find('secondary').out = True
|
||||
m.find('tertiary').out = True
|
||||
etgtools.appendText(m.detailedDoc,
|
||||
".. note:: The Python version of this method returns the three"
|
||||
" scheme colours as a tuple of :class:`wx.Colour` objects.")
|
||||
|
||||
|
||||
module.addPyCode("""\
|
||||
|
||||
@@ -173,7 +173,7 @@ class ribbon_art_Tests(wtc.WidgetTestCase):
|
||||
def test_ribbon_art7(self):
|
||||
bar = wx.ribbon.RibbonBar(self.frame)
|
||||
art = bar.GetArtProvider()
|
||||
p, s, t = art.PyGetColourScheme()
|
||||
p, s, t = art.GetColourScheme()
|
||||
|
||||
assert isinstance(p, wx.Colour)
|
||||
assert isinstance(s, wx.Colour)
|
||||
|
||||
Reference in New Issue
Block a user