wxIntCtrl and decimal point values

Hi,

can I use wxIntCtrl with decimal point values, such as 0,23 or 2,45?

Thanks.

Beppe

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" <g.costanzi@idi.it> wrote:

Hi,
can I use wxIntCtrl with decimal point values, such as 0,23 or 2,45?

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
To: Giuseppe Costanzi
Sent: Sunday, May 27, 2007 6:10 PM
Subject: Re: [wxPython-users] wxIntCtrl and decimal point values

"Giuseppe Costanzi" <g.costanzi@idi.it> wrote:

----- Original Message ----- From: Josiah Carlson
To: Giuseppe Costanzi ; wxPython-users@lists.wxwidgets.org
Sent: Sunday, May 27, 2007 8:25 AM
Subject: Re: [wxPython-users] wxIntCtrl and decimal point values

"Giuseppe Costanzi" <g.costanzi@idi.it> wrote:
> 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 :wink:

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

def OnCalculate(self,event):
        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