> ie: 2,145,145,789.19 vs 2145145789.19
> 2011-12-07 vs 07/12/2011
> XX 11-234567 vs XX11234567
>
Have a look at wx.lib.masked, first would be a MaskedNumCtrl and the
third a MaskedTextCtrl.
Thanks Werner, that's exactly what I wanted:)
For the date I would probably use
wx.DatePickerCtrl.
I use it but didn't found out how to change the displayed date to
my format instead of the default one.
JY
···
On Wed, 07 Dec 2011 08:53:34 +0100 werner <wbruhin@free.fr> wrote:
--
"It's today!" said Piglet.
"My favorite day," said Pooh.
Of course masked text control supports dates as well, EUDATEYYYYMMDD. or
EUDATEYYYYMMDD/ nearly do what you need or you could use a mask of
####-##-## and if necessary supply a validator.
Gadget/Steve
···
On 07/12/2011 2:03 PM, werner wrote:
On 12/07/2011 01:59 PM, Jean-Yves F. Barbier wrote:
On Wed, 07 Dec 2011 08:53:34 +0100 >> werner<wbruhin@free.fr> wrote:
ie: 2,145,145,789.19 vs 2145145789.19
2011-12-07 vs 07/12/2011
XX 11-234567 vs XX11234567
Have a look at wx.lib.masked, first would be a MaskedNumCtrl and the
third a MaskedTextCtrl.
Thanks Werner, that's exactly what I wanted:)
For the date I would probably use
wx.DatePickerCtrl.
I use it but didn't found out how to change the displayed date to
my format instead of the default one.
Oops, didn't catch on that it is another 370 style thingy;-)
But only with the generic version of the control as per the doc,
otherwise it default to the format set in the users locale.
Werner
Of course masked text control supports dates as well, EUDATEYYYYMMDD. or
EUDATEYYYYMMDD/ nearly do what you need or you could use a mask of
####-##-## and if necessary supply a validator.
Ok, thanks; I browse the web using your info and find some examples,
although there's a big PB: SetFormat isn't part of wxPython
2.8.12.1-4, it doesn't appear in pydoc and a test:
self.myDP.SetFormat("%y-%m-%d")
errors as:
AttributeError: 'GenericDatePickerCtrl' object has no
attribute 'SetFormat'
So, either I missed the whole picture (which is totally possible),
or I'm a sitting duck.
JY
···
On Wed, 07 Dec 2011 15:03:58 +0100 werner <wbruhin@free.fr> wrote:
But only with the generic version of the control as per the doc,
otherwise it default to the format set in the users locale.
Ok, thanks; I browse the web using your info and find some examples,
although there's a big PB: SetFormat isn't part of wxPython
2.8.12.1-4, it doesn't appear in pydoc and a test:
self.myDP.SetFormat("%y-%m-%d")
errors as:
AttributeError: 'GenericDatePickerCtrl' object has no
attribute 'SetFormat'
I see the same on 2.9.2.4.
Will have to wait for Robin or someone else to chip in who actually used this.
But only with the generic version of the control as per the doc,
otherwise it default to the format set in the users locale.
Ok, thanks; I browse the web using your info and find some examples,
although there's a big PB: SetFormat isn't part of wxPython
2.8.12.1-4, it doesn't appear in pydoc and a test:
self.myDP.SetFormat("%y-%m-%d")
errors as:
AttributeError: 'GenericDatePickerCtrl' object has no
attribute 'SetFormat'
I see the same on 2.9.2.4.
Will have to wait for Robin or someone else to chip in who actually used
this.