Being derived from masked.TextCtrl, the control only allows fixed-point notation. That is, it has a fixed (though reconfigurable) maximum width for the integer portion and optional fixed width fractional portion.
Here’s the API:
from wx.lib.masked import NumCtrl
NumCtrl(
parent, id = -1,
value = 0,
pos = wx.DefaultPosition,
size = wx.DefaultSize,
style = 0,
validator = wx.DefaultValidator,
name = "masked.number",
integerWidth = 10,
fractionWidth = 0,
allowNone = False,
allowNegative = True,
useParensForNegatives = False,
groupDigits = False,
groupChar = ',',
decimalChar = '.',
min = None,
max = None,
limited = False,
limitOnFieldChange = False,
selectOnEntry = True,
foregroundColour = "Black",
signedForegroundColour = "Red",
emptyBackgroundColour = "White",
validBackgroundColour = "White",
invalidBackgroundColour = "Yellow",
autoSize = ``True`` )
False
and bounds are set, out-of-bounds values will
result in a background colored with the current invalidBackgroundColour.True
by default.
<I>Note:</I> Setting this to False
will produce seemingly odd
behavior unless the control is large enough to hold the maximum
specified value given the widths and the sign positions; if not,
the control will appear to “jump around” as the contents scroll.
(ie. autoSize is highly recommended.)Resets the minimum value of the control. If a value of <I>None</I>
is provided, then the control will have no explicit minimum value.
If the value specified is greater than the current maximum value,
then the function returns False
and the minimum will not change from
its current setting. On success, the function returns True.
If successful and the current value is lower than the new lower bound, if the control is limited, the value will be automatically adjusted to the new minimum value; if not limited, the value in the control will be colored as invalid.
If min > the max value allowed by the width of the control, the function will return False, and the min will not be set.
Resets the maximum value of the control. If a value of <I>None</I>
is provided, then the control will have no explicit maximum value.
If the value specified is less than the current minimum value, then
the function returns False
and the maximum will not change from its
current setting. On success, the function returns True.
If successful and the current value is greater than the new upper bound, if the control is limited the value will be automatically adjusted to this maximum value; if not limited, the value in the control will be colored as invalid.
If max > the max value allowed by the width of the control, the function will return False, and the max will not be set.
True
only if both operations succeed. <B><I>Note:</I> leaving out an argument
will remove the corresponding bound.GetLimited()
GetLimitOnFieldChange()
GetAllowNone()
GetAllowNegative()
GetGroupDigits()
NumberUpdatedEvent |
Used to fire an EVT_NUM event whenever the value in a NumCtrl changes. |
NumCtrl |
Masked edit control supporting “native” numeric values, ie. .SetValue(3), for |
NumCtrlAccessorsMixin |
Defines masked.NumCtrl’s list of attributes having their own |