[wxpython-users] Set dd/mm/yyyy format to wx.DatePickerCtrl?

Raffaello Barella barbarossa.platz at gmail.com
Mon Mar 31 22:20:50 PDT 2008


Hi, Trai Tan, happy that the code it was of some use for you.

 I discovered myself a bug. The line 79:
          tx =3D self.dictLocale[self.Locale][0][V.GetWeekDay() - 1] + sp
is to be replaced with this new text:
          tx =3D self.dictLocale[self.Locale][0][V.GetWeekDay() ] + sp
(lest you get a Monday instead of a Tuesday).

Bye bye



2008/4/1, Tai Tran Tan <tttai at tma.com.vn>:
>
>  Hi Raffaello,
>
>
>
> It's great on WinXP, I did not test on other platforms yet, but I think it
> will be OK too. From your idea, I'm trying to make the same thing using t=
he
> popup control of wxPython and it seems to be very promising. I'll send you
> my source code if I can make it that way.
>
>
>
> Sorry for my late reply. I've been busy myself recently.
>
>
>
> Thanks,
>
> Tai Tran
>
>
>  ------------------------------
>
> *From:* wxpython-users-bounces+tttai=3Dtma.com.vn at lists.wxwidgets.org[mai=
lto:
> wxpython-users-bounces+tttai=3Dtma.com.vn at lists.wxwidgets.org] *On Behalf=
 Of
> *Raffaello Barella
> *Sent:* Friday, March 28, 2008 11:46 PM
> *To:* wxpython-users at lists.wxwidgets.org
> *Subject:* Re: [wxpython-users] Set dd/mm/yyyy format to wx.DatePickerCtrl
> ?
>
>
>
> Hi, Tai Tran Tan.
>
> With a little spare time, I cooked up a =ABrbDatePickerCtrl=BB, that has a
> SetFormat() method properly running. If you like it, you can put it in yo=
ur
> library of custom controls.
>
> You'll see that I am far from having covered all  possible date formats: I
> shall gladly welcome additions, amendments and -obviously- bug reports,
> wherever they come from.
>
> 2008/3/27, Raffaello Barella <barbarossa.platz at gmail.com>:
>
> Don't mention it.
>
> 2008/3/27, Tai Tran Tan <tttai at tma.com.vn>:
>
>  Your solution could work, I'll try it. Thanks!
>
>
>
> Best regards,
>
> Tai Tran
>
>
>  ------------------------------
>
> *From:* wxpython-users-bounces+tttai=3Dtma.com.vn at lists.wxwidgets.org[mai=
lto:
> wxpython-users-bounces+tttai=3Dtma.com.vn at lists.wxwidgets.org] *On Behalf=
 Of
> *Raffaello Barella
> *Sent:* Tuesday, March 25, 2008 4:42 PM
> *To:* wxpython-users at lists.wxwidgets.org
> *Subject:* Re: [wxpython-users] Set dd/mm/yyyy format to wx.DatePickerCtrl
> ?
>
>
>
> I met with the same problem, and didn't find any solution working on
> wx.DatePickerCtrl or the locale. My workaround is to build a wx.TextCtrl(=
read-only) with the same size and position of the
> wx.DatePickerCtrl. The wx.TextCtrl shows only when the wx.DatePickerCtrll=
oses focus, and its internal code translates the value of the
> wx.DatePickerCtrl to the format you desire. Then a double click to the
> wx.TextCtrl hides it and renders the focus to the wx.DatePickerCtrl.  You
> might use also a wx.StaticText, but this one does not allow to copy its
> value with Ctrl-c.
>
> 2008/3/25, Tai Tran Tan <tttai at tma.com.vn>:
>
> Sorry, I don't really understand your idea, I played around with the
> wx.Locale class and did not find anything interesting that fits my need.
>
>
>
> Best regards,
>
> Tai Tran
>
>
>  ------------------------------
>
> *From:* wxpython-users-bounces+tttai=3Dtma.com.vn at lists.wxwidgets.org[mai=
lto:
> wxpython-users-bounces+tttai=3Dtma.com.vn at lists.wxwidgets.org] *On Behalf=
 Of
> *Marc Tompkins
> *Sent:* Tuesday, March 25, 2008 10:59 AM
> *To:* wxpython-users at lists.wxwidgets.org
> *Subject:* Re: [wxpython-users] Set dd/mm/yyyy format to wx.DatePickerCtrl
> ?
>
>
>
> On Mon, Mar 24, 2008 at 8:41 PM, Tai Tran Tan <tttai at tma.com.vn> wrote:
>
>  Thanks for your suggestion!
> SetFormat() function is not available to wxPython, I've tried this but it
> simply did not work at all
>
>  From my reading of that passage, you might be able to mess with the
> Python "locale" module to do what you want to do.  (In other words, play
> with the system's internationalization on a "sandbox" basis without
> affecting anybody else.)
> I'd try it out before shooting my mouth off, but I'm only checking my
> email while I wait for my $%^&* slow system to transcode a video...
>
>
>
>     Please note that this function is only available in the generic
> version of this control. The native version always uses the current system
> locale.
>
>
>
> --
> www.fsrtechnologies.com
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>
>
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200804=
01/b88c25bc/attachment.htm


More information about the wxpython-users mailing list