MaskedNumCtrl - problem with using ChangeValue

Any change that this can make it into wxPython 2.8.9.2?

Having a problem when using numCtrl.ChangeValue(floatValue).

Problem can be demonstrated in the wxPython demo, change line 335, i.e.
From:
        try:
            self.target_ctl.SetValue(numvalue)
        except:
            type, value, tb = sys.exc_info()

To:
        try:
            self.target_ctl.ChangeValue(numvalue)
        except:
            type, value, tb = sys.exc_info()

I get a exception "TypeError: object of type 'float' has no len()" when
trying to use the combobox "Programmatically set the above value entry
ctrl" and having set the "Fraction width" to e.g. "2" and using one of
the float values.

Proposed correction is to add the following to wx.lib.masked.numctrl.py:

    def ChangeValue(self, value):
        """
        Sets the value of the control to the value specified.
        The resulting actual value of the control may be altered to
        conform with the bounds set on the control if limited,
        or colored if not limited but the value is out-of-bounds.
        A ValueError exception will be raised if an invalid value
        is specified.
        """
## dbg('NumCtrl::ChangeValue(%s)' % value, indent=1)
        BaseMaskedTextCtrl.ChangeValue( self, self._toGUI(value) )
## dbg(indent=0)

If above is o.k. could it be included with the next version? If yes,
should I submit a patch or is above fine?

Werner

···

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Werner F. Bruhin wrote:

If above is o.k. could it be included with the next version? If yes,
should I submit a patch or is above fine?

It has already been done, 3 weeks ago.

http://trac.wxwidgets.org/changeset/57753

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

If above is o.k. could it be included with the next version? If yes,
should I submit a patch or is above fine?

It has already been done, 3 weeks ago.

wxTrac has been migrated to GitHub Issues - wxWidgets

Great, thanks
Werner