Monday_First at DatePickerCtrl?

29 views
Skip to first unread message

Claus Gaisser

unread,
Jan 18, 2010, 6:35:15 AM1/18/10
to wxPython-users
Hallo,

my name is Claus, I'm from bavaria in germany and I try to learn
Python and wxPython. Today I don't know much of it, but it will become
more and more... :-)

Please excuse my bad english!

The problem I had today is this: I want to use the DatePickerCtrl-
Class with Monday at the first day of the week. In CalendarCtrl there
is a style flag called wx.CAL_MONDAY_FIRST. Is there some way to have
Monday at first in the DatePickerCtrl?

Thanks a lot for your help!

Claus

Robin Dunn

unread,
Jan 18, 2010, 9:19:15 PM1/18/10
to wxpytho...@googlegroups.com

No, there isn't a way to pass on the style to the CalendarCtrl, and in
some cases it's a native calendar that will be used, so there isn't any
CalendarCtrl widget to pass the style on to anyway.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Dominique

unread,
Jan 19, 2010, 1:56:28 AM1/19/10
to wxPython-users
Hello Claus,


On Jan 18, 12:35 pm, Claus Gaisser <mutete...@yahoo.de> wrote:

> The problem I had today is this: I want to use the DatePickerCtrl-
> Class with Monday at the first day of the week. In CalendarCtrl there
> is a style flag called wx.CAL_MONDAY_FIRST. Is there some way to have
> Monday at first in the DatePickerCtrl?

In addition to what Robin told you, note that on my computer (with
Windows XP), when I run the demo,
the first picker (wx.DatePickerCtrl) is set with the first day of the
week as Monday and is in French
whereas the second picker (wx.GenericDatePickerCtrl) is set to Sunday
and is in English.

Python and wxPython experts (not me !!!) will certainly know why.
I wonder if it is something linked to a locale but this is just a
guess.

Hope this can help you
Dominique

Claus Gaisser

unread,
Jan 19, 2010, 4:42:59 PM1/19/10
to wxPython-users
Hello Dominique,

thanks for your annotation.

> In addition to what Robin told you, note that on my computer (with
> Windows XP), when I run the demo,
> the first picker (wx.DatePickerCtrl) is set with the first day of the
> week as Monday and is in French
> whereas the second picker (wx.GenericDatePickerCtrl) is set to Sunday
> and is in English.

Here is, what the wxPython Docs says:

wxDatePickerCtrl::SetFormat
void SetFormat(const wxChar* format)
Please note that this function is only available in the generic
version of this control. The native version always uses the current
system locale.

My system language, timezone, date- and timeformat and so on is set to
german, but the DatePickerCtrl don't realize it. When the
DatePickerCtrl uses the current system locale, why it shows sunday as
the first day of the week?

Hmm... it's tricky...

Robin Dunn

unread,
Jan 19, 2010, 6:00:20 PM1/19/10
to wxpytho...@googlegroups.com

That is correct. The native control is picking up the locale info from
the system and is applying the locale based preferences to the widget.
The generic widget will do some locale-specific customization as well,
but I'm not sure how far it goes. It may also require that a wx.Locale
object have been created and initialized before it will do anything.

Reply all
Reply to author
Forward
0 new messages