johnf wrote:
>> Thanks. I think instead we want to catch decimal.InvalidOperation as well
>> as ValueError, which also catches changing the value to "dd", for example.
>>
>> Paul
> 
> When I test dTextBox and type in the last box I get no change - of course 
> after adding a space or two.  Is that what you want to occur??? 

When I run dTextBox.py and type in the last box, " 45.53", the Value changes to 
Decimal("45.53"). Isn't that what should occur?

When I type something truly invalid, like "ff", the Value reverts back to the 
original value. Isn't that what should occur?

Is this not what you are seeing?


> You are only 
> catching the error and doing nothing.  

No, I'm catching the error and raising ValueError, which has the effect in 
upstream 
code of restoring the value back to the original.


> So the user does not realize what has 
> happened.  

I think the instant feedback of the value reverting is good.


> If I paste something into the box that contains a leadng space it  
> does nothing.   

What do you mean by "does nothing"?


> Why not just strip it and there would be no reason to worry 
> about errors (at least for spaces at the start or end of the value) or any 
> lack of any acknowledgement for the user.   We need something don't you 
> think?

Didn't you see my second commit, which does just this?


> I realize that we can't catch all the invalid inputs into a decimal ctrl but 
> I 
> think putting in a leading space should not raise an error.

I agree!

Paul



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to