Calendar Selection Bug Fixes. |
Post Reply |
Author | |
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(0)
Posted: 27 August 2013 at 4:37pm |
These have been around for awhile and no official fix in sight so I thought I would share my fixes to correct some pretty egregious errors.
1. Using Prev/Next arrows changes the view to Day. To maintain the correct view revert the code in file XTPCalendarThemePrevNextEventButton.cpp function BOOL CTOPrevNextEventButton::OnLButtonDown(CCmdTarget* /*pObject*/, UINT /*nFlags*/, CPoint point, CTOPrevNextEventButtons *pButtons) From: CXTPCalendarView* pNewView = GetTheme()->GetCalendarControl()->GetActiveView(); pView = GetTheme()->GetCalendarControl()->GetActiveView(); if (pView != pNewView) { pView = pNewView; if (pView && pView->GetViewType() != nViewType) GetTheme()->GetCalendarControl()->SwitchActiveView(nViewType); } To: pView = GetTheme()->GetCalendarControl()->GetActiveView(); if (pView && pView->GetViewType() != nViewType) GetTheme()->GetCalendarControl()->SwitchActiveView(nViewType); 2. Toggle from timeline mode to standard sets calendar display to "Today". Change the following code in file XTPCalendarControl.cpp function void CXTPCalendarControl::OnCalendarTimeline() From: COleDateTime dtNow(COleDateTime::GetCurrentTime()); m_eViewType = viewtype; //prev view type if (viewtype == xtpCalendarDayView) { m_nTimelineScale = xtpTSPID_Day; dtNow -= COleDateTimeSpan(1,3,0,0); } else if (viewtype == xtpCalendarWorkWeekView) { m_nTimelineScale = xtpTSPID_WorkWeek; dtNow -= COleDateTimeSpan(5.0); } else if (viewtype == xtpCalendarWeekView) { m_nTimelineScale = xtpTSPID_Week; dtNow -= COleDateTimeSpan(7.0); } else if (viewtype == xtpCalendarMonthView) { m_nTimelineScale = xtpTSPID_Month; dtNow -= COleDateTimeSpan(11.0); } To: COleDateTime dtNow(COleDateTime::GetCurrentTime()); COleDateTime dtCurrent(dtNow); m_eViewType = viewtype; //prev view type if (viewtype == xtpCalendarDayView) { dtNow = ((CXTPCalendarDayView*)GetActiveView())->GetViewDayDate(0); m_nTimelineScale = xtpTSPID_Day; if (dtNow == dtCurrent) dtNow -= COleDateTimeSpan(1,3,0,0); } else if (viewtype == xtpCalendarWorkWeekView) { dtNow = ((CXTPCalendarWeekView*)GetActiveView())->GetViewDayDate(0); m_nTimelineScale = xtpTSPID_WorkWeek; if (dtNow == dtCurrent) dtNow -= COleDateTimeSpan(5.0); } else if (viewtype == xtpCalendarWeekView) { dtNow = ((CXTPCalendarWeekView*)GetActiveView())->GetViewDayDate(0); m_nTimelineScale = xtpTSPID_Week; if (dtNow == dtCurrent) dtNow -= COleDateTimeSpan(7.0); } else if (viewtype == xtpCalendarMonthView) { dtNow = ((CXTPCalendarMonthView*)GetActiveView())->GetViewDayDate(0); m_nTimelineScale = xtpTSPID_Month; if (dtNow == dtCurrent) dtNow -= COleDateTimeSpan(11.0); } I hope this helps folks out and hopefully CJ will see fit to incorporate or improve upon these fixes in upcoming releases. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |