mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 13:00:07 +01:00
Merge pull request #1735 from suurjaak/numberctrl_properties
Added Value-property for IntCtrl and FloatSpin
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user