Reorder the SetPropertyValue overloads and constrain the bool and double overloads.

This avoids choosing the int overload for anything that can be implicitly converted to an integer.
This commit is contained in:
Robin Dunn
2017-09-14 19:56:09 -07:00
parent fc2c6cda57
commit 90be887af6
2 changed files with 31 additions and 5 deletions

View File

@@ -16,6 +16,19 @@ class propgridiface_Tests(wtc.WidgetTestCase):
iface = pg.PropertyGridInterface()
def test_propgridiface03(self):
# Ensure SetPropertyValue doesn't truncate floats
pgrid = pg.PropertyGrid(self.frame)
pgrid.Append(pg.FloatProperty('Float', value=123.456))
value = pgrid.GetPropertyValue('Float')
assert type(value) is float
assert value == 123.456
pgrid.SetPropertyValue('Float', 654.321)
value = pgrid.GetPropertyValue('Float')
assert type(value) is float
assert value == 654.321
#---------------------------------------------------------------------------