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

@@ -27,7 +27,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,
@@ -332,6 +332,9 @@ protected:
// called by EnableHolidayDisplay()
virtual void RefreshHolidays() { }
// does the week start on monday based on flags and OS settings?
bool WeekStartsOnMonday() const;
};
// ----------------------------------------------------------------------------