Merge pull request #1735 from suurjaak/numberctrl_properties

Added Value-property for IntCtrl and FloatSpin
This commit is contained in:
Robin Dunn
2020-07-20 10:40:20 -07:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -1204,6 +1204,9 @@ class FloatSpin(wx.Control):
return finite, snap_value
Value = property(GetValue, SetValue)
# Class FixedPoint, version 0.0.4.
# Released to the public domain 28-Mar-2001,
@@ -1763,6 +1766,7 @@ if __name__ == '__main__':
increment=0.01, value=0.1, agwStyle=FS_LEFT)
floatspin.SetFormat("%f")
floatspin.SetDigits(2)
floatspin.Value = 0.2
# our normal wxApp-derived class, as usual

View File

@@ -927,6 +927,9 @@ class IntCtrl(wx.TextCtrl):
wx.CallAfter(self.SetInsertionPoint, new_pos)
Value = property(GetValue, SetValue)
#===========================================================================
@@ -974,7 +977,7 @@ if __name__ == '__main__':
def OnClick(self, event):
dlg = myDialog(self.panel, -1, "test IntCtrl")
dlg.int_ctrl.SetValue(501)
dlg.int_ctrl.Value = 501
dlg.int_ctrl.SetInsertionPoint(1)
dlg.int_ctrl.SetSelection(1,2)
rc = dlg.ShowModal()