From 18547275bb96dd0f4dc8273771faf818e65a43b3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 3 Aug 2009 20:36:56 +0000 Subject: [PATCH] Added symbolic names for native control week days. No real changes, but MonthCal_Monday/Sunday is more clear than 0 or 6. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/calctrl.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index 239abf65ca..5618ebf933 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -36,6 +36,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl) +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +namespace +{ + +// values of week days used by the native control +enum +{ + MonthCal_Monday, + MonthCal_Tuesday, + MonthCal_Wednesday, + MonthCal_Thursday, + MonthCal_Friday, + MonthCal_Saturday, + MonthCal_Sunday +}; + +} // anonymous namespace + // ============================================================================ // implementation // ============================================================================ @@ -376,7 +397,9 @@ void wxCalendarCtrl::UpdateMarks() void wxCalendarCtrl::UpdateFirstDayOfWeek() { - MonthCal_SetFirstDayOfWeek(GetHwnd(), HasFlag(wxCAL_MONDAY_FIRST) ? 0 : 6); + MonthCal_SetFirstDayOfWeek(GetHwnd(), + HasFlag(wxCAL_MONDAY_FIRST) ? MonthCal_Monday + : MonthCal_Sunday); } // ----------------------------------------------------------------------------