Re: [dabo-users] dNumeric issue

Author: Adrian Klaver

Posted: 2012-03-19 at 21:12:07

On 03/19/2012 05:40 PM, John Fabiani wrote:

> OpenSuse 12.1, python 2.7, wxpython 2.8.11, latest Dabo.

>

> I get an traceback when I enter a number in the control. I'm trying to use

> the dNumeric to enter in integers using the below code.

>

> gs.append(dabo.ui.dNumericBox(self, RegID = 'outQtyID',AutoWidth = True,

> DecimalWidth = 0, Alignment = 'left'))

>

> I think I needed the Alignment because the control was being cut off on the

> screen!

>

> Traceback (most recent call last):

> File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-

> unicode/wx/lib/masked/maskededit.py", line 3118, in _OnChar

> newfield = self._FindField(newpos)

> File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-

> unicode/wx/lib/masked/maskededit.py", line 3202, in _FindField

> raise IndexError('position %s out of range of control' % str(pos))

> IndexError: position 15 out of range of control

Seems related to the DecimalWidth = 0 setting. I put a DecimalWidth > 0

and the problem goes away. Looking at what happens when there is a

decimal separator and decimal places, the code puts the cursor just to

the right of integer value. In the all integer case it seems to throw

the error because it cannot insert to the right of the integer.

>

> Johnf

--

Adrian Klaver

adrian.klaver@gmail.com

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/4F67E777.7030905@gmail.com

©2012 Adrian Klaver