Discussion:
wxIntCtrl and decimal point values
Giuseppe Costanzi
2007-05-27 05:58:53 UTC
Permalink
Hi,
can I use wxIntCtrl with decimal point values, such as 0,23 or 2,45?

Thanks.

Beppe
Josiah Carlson
2007-05-27 06:25:15 UTC
Permalink
Post by Giuseppe Costanzi
Hi,
can I use wxIntCtrl with decimal point values, such as 0,23 or 2,45?
That would not be an IntCtrl then, that would be a FloatCtrl. There are
examples of how you can get such a thing in the wxPython demo (which is
available for download from wxpython.org)

- Josiah
Giuseppe Costanzi
2007-05-27 16:12:48 UTC
Permalink
----- Original Message -----
From: Josiah Carlson
To: Giuseppe Costanzi
Sent: Sunday, May 27, 2007 6:10 PM
Subject: Re: [wxPython-users] wxIntCtrl and decimal point values



A more flexible example of what is possible with text controls in
wxPython is the MaskedNumCtrl . It offers just about any and every
option about number entry that is necessary.

- Josiah

I've see this control in the Python demo and I've just become to studied it.

Thanks.
----- Original Message -----
From: Josiah Carlson
Sent: Sunday, May 27, 2007 8:25 AM
Subject: Re: [wxPython-users] wxIntCtrl and decimal point values
Post by Giuseppe Costanzi
Hi,
can I use wxIntCtrl with decimal point values, such as 0,23 or 2,45?
That would not be an IntCtrl then,
Yes...it's right!I'm goofy ;)
that would be a FloatCtrl. There are
examples of how you can get such a thing in the wxPython demo (which is
available for download from wxpython.org)
I've not found this control on wxPython demo, searching with 'Float '
,I've
found FloatCanavas and FloatBar.
Anyway my problem was to convert a string in a wx.TextCtrl in a number to
use it in a function, and I've trought that there was
a specific control instead to make the conversion.
Now I do it
x = float(self.txPoolAPTT.GetValue())
and control the input with a validator class.
and it seems work right but i will studied your option that i've found at
http://nebuladevice.cubik.org/documentation/nebula2/wxfloatctrl_8h-source.shtml
tanks for your interest
Best regards.
Beppe
- Josiah
Loading...