No real changes, just cleanup week days handling in wxGenericCalendarCtrl.

Use helper GetWeek{Start,End}() functions instead of repeating tests for
wxCAL_MONDAY_FIRST over and over again.

Also replace some occurrences of GetWindowStyle() with shorter and more clear
HasFlag().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-10-24 22:40:47 +00:00
parent 3c9863aca7
commit 0bb84570ce
2 changed files with 25 additions and 25 deletions

View File

@@ -199,6 +199,20 @@ private:
// get the date from which we start drawing days
wxDateTime GetStartDate() const;
// get the first/last days of the week corresponding to the current style
wxDateTime::WeekDay GetWeekStart() const
{
return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Mon
: wxDateTime::Sun;
}
wxDateTime::WeekDay GetWeekEnd() const
{
return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Sun
: wxDateTime::Sat;
}
// is this date shown?
bool IsDateShown(const wxDateTime& date) const;