mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 03:20:08 +01:00
Transfer ownership of arg in AddPrivateChild.
This commit is contained in:
@@ -111,7 +111,7 @@ class IntProperty2(wxpg.PGProperty):
|
|||||||
# wxPGVFBFlags work properly.
|
# wxPGVFBFlags work properly.
|
||||||
oldvfb__ = validationInfo.GetFailureBehavior()
|
oldvfb__ = validationInfo.GetFailureBehavior()
|
||||||
|
|
||||||
# Mark the cell if validaton failred
|
# Mark the cell if validation failed
|
||||||
validationInfo.SetFailureBehavior(wxpg.PG_VFB_MARK_CELL)
|
validationInfo.SetFailureBehavior(wxpg.PG_VFB_MARK_CELL)
|
||||||
|
|
||||||
if value < -10000 or value > 10000:
|
if value < -10000 or value > 10000:
|
||||||
@@ -147,17 +147,12 @@ class SizeProperty(wxpg.PGProperty):
|
|||||||
def _ConvertValue(self, value):
|
def _ConvertValue(self, value):
|
||||||
""" Utility convert arbitrary value to a real wx.Size.
|
""" Utility convert arbitrary value to a real wx.Size.
|
||||||
"""
|
"""
|
||||||
from operator import isSequenceType
|
import collections
|
||||||
if isinstance(value, wx.Point):
|
if isinstance(value, collections.Sequence) or hasattr(value, '__getitem__'):
|
||||||
value = wx.Size(value.x, value.y)
|
|
||||||
elif isSequenceType(value):
|
|
||||||
value = wx.Size(*value)
|
value = wx.Size(*value)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def ChildChanged(self, thisValue, childIndex, childValue):
|
def ChildChanged(self, thisValue, childIndex, childValue):
|
||||||
# FIXME: This does not work yet. ChildChanged needs be fixed "for"
|
|
||||||
# wxPython in wxWidgets SVN trunk, and that has to wait for
|
|
||||||
# 2.9.1, as wxPython 2.9.0 uses WX_2_9_0_BRANCH.
|
|
||||||
size = self._ConvertValue(self.m_value)
|
size = self._ConvertValue(self.m_value)
|
||||||
if childIndex == 0:
|
if childIndex == 0:
|
||||||
size.x = childValue
|
size.x = childValue
|
||||||
@@ -751,7 +746,7 @@ class TestPanel( wx.Panel ):
|
|||||||
|
|
||||||
pg.Append( wxpg.PropertyCategory("4 - Additional Properties") )
|
pg.Append( wxpg.PropertyCategory("4 - Additional Properties") )
|
||||||
#pg.Append( wxpg.PointProperty("Point",value=panel.GetPosition()) )
|
#pg.Append( wxpg.PointProperty("Point",value=panel.GetPosition()) )
|
||||||
#pg.Append( SizeProperty("Size",value=panel.GetSize()) )
|
pg.Append( SizeProperty("Size", value=panel.GetSize()) )
|
||||||
#pg.Append( wxpg.FontDataProperty("FontData") )
|
#pg.Append( wxpg.FontDataProperty("FontData") )
|
||||||
pg.Append( wxpg.IntProperty("IntWithSpin",value=256) )
|
pg.Append( wxpg.IntProperty("IntWithSpin",value=256) )
|
||||||
pg.SetPropertyEditor("IntWithSpin","SpinCtrl")
|
pg.SetPropertyEditor("IntWithSpin","SpinCtrl")
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ def run():
|
|||||||
self.SetAttribute(name, value)
|
self.SetAttribute(name, value)
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
c.find('AddPrivateChild.prop').transfer = True
|
||||||
|
c.find('AddChild.prop').transfer = True
|
||||||
|
|
||||||
|
|
||||||
c = module.find('wxPGChoicesData')
|
c = module.find('wxPGChoicesData')
|
||||||
tools.ignoreConstOverloads(c)
|
tools.ignoreConstOverloads(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user