Patch from Will Sadkin
## Version 1.3 ## 1. Made it possible to configure grouping, decimal and shift-decimal characters, ## to make controls more usable internationally. ## 2. Added code to smart "adjust" value strings presented to .SetValue() ## for right-aligned numeric format controls if they are shorter than ## than the control width, prepending the missing portion, prepending control ## template left substring for the missing characters, so that setting ## numeric values is easier. ## 3. Renamed SetMaskParameters SetCtrlParameters() (with old name preserved ## for b-c), as this makes more sense. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,7 +58,7 @@ class demoMixin:
|
||||
else: value = notchecked_value
|
||||
kwargs = {parameter: value}
|
||||
for control in self.editList:
|
||||
control.SetMaskParameters(**kwargs)
|
||||
control.SetCtrlParameters(**kwargs)
|
||||
control.Refresh()
|
||||
self.Refresh()
|
||||
|
||||
@@ -470,8 +470,14 @@ the value of the above float control:""")
|
||||
|
||||
def OnNumberSelect( self, event ):
|
||||
value = event.GetString()
|
||||
|
||||
# Format choice to fit into format for #{9}.#{2}, with sign position reserved:
|
||||
# (ordinal + fraction == 11 + decimal point + sign == 13)
|
||||
#
|
||||
# Note: since self.floatctrl a right-aligned control, you could also just use
|
||||
# "%.2f", but this wouldn't work properly for a left-aligned control.
|
||||
# (See .SetValue() documentation in Overview.)
|
||||
#
|
||||
if value:
|
||||
floattext = "%13.2f" % float(value)
|
||||
else:
|
||||
|
Reference in New Issue
Block a user