Automatically determine the first weekday for a calendar control

If neither wxCAL_SUNDAY_FIRST or wxCAL_MONDAY_FIRST was given, use
wxDateTime::GetFirstWeekDay() to automatically determine the preferred
day.

This changes the earlier default behaviour, which was to use Sunday
if not otherwise specified. However, the wxGTK native calendar control
ignored this behaviour anyway.
This commit is contained in:
Lauri Nurmi
2017-07-09 17:56:16 +03:00
parent 378851a283
commit 2f2700b2dd
7 changed files with 46 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
enum
{
// show Sunday as the first day of the week (default)
wxCAL_SUNDAY_FIRST = 0x0000,
wxCAL_SUNDAY_FIRST = 0x0080,
// show Monday as the first day of the week
wxCAL_MONDAY_FIRST = 0x0001,
@@ -254,6 +254,11 @@ enum wxCalendarHitTestResult
month is changed, so you will often want to update them in
@c EVT_CALENDAR_PAGE_CHANGED event handler.
If neither the @c wxCAL_SUNDAY_FIRST or @c wxCAL_MONDAY_FIRST style is given,
the first day of the week is determined from operating system's settings,
if possible. The native wxGTK calendar chooses the first weekday based on
locale, and these styles have no effect on it.
@beginStyleTable
@style{wxCAL_SUNDAY_FIRST}
Show Sunday as the first day in the week (not in wxGTK)