implemented toggling of wxCAL_MONDAY_FIRST in the native MSW version of wxCalendarCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -87,6 +87,9 @@ wxCalendarCtrl::Create(wxWindow *parent,
|
||||
if ( !MSWCreateControl(clsname, wxEmptyString, pos, size) )
|
||||
return false;
|
||||
|
||||
// initialize the control
|
||||
UpdateFirstDayOfWeek();
|
||||
|
||||
SetDate(dt.IsValid() ? dt : wxDateTime::Today());
|
||||
|
||||
UpdateMarks();
|
||||
@@ -115,12 +118,21 @@ WXDWORD wxCalendarCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
return styleMSW;
|
||||
}
|
||||
|
||||
// TODO: handle WM_WININICHANGE
|
||||
void wxCalendarCtrl::SetWindowStyleFlag(long style)
|
||||
{
|
||||
const bool hadMondayFirst = HasFlag(wxCAL_MONDAY_FIRST);
|
||||
|
||||
wxCalendarCtrlBase::SetWindowStyleFlag(style);
|
||||
|
||||
if ( HasFlag(wxCAL_MONDAY_FIRST) != hadMondayFirst )
|
||||
UpdateFirstDayOfWeek();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCalendarCtrl geometry
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// TODO: handle WM_WININICHANGE
|
||||
wxSize wxCalendarCtrl::DoGetBestSize() const
|
||||
{
|
||||
RECT rc;
|
||||
@@ -324,6 +336,11 @@ void wxCalendarCtrl::UpdateMarks()
|
||||
}
|
||||
}
|
||||
|
||||
void wxCalendarCtrl::UpdateFirstDayOfWeek()
|
||||
{
|
||||
MonthCal_SetFirstDayOfWeek(GetHwnd(), HasFlag(wxCAL_MONDAY_FIRST) ? 0 : 6);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCalendarCtrl events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user