mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 03:50:06 +01:00
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:
@@ -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
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user