<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Calendar Selection Bug Fixes.</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Calendar : Calendar Selection Bug Fixes.]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 30 May 2026 13:55:17 +0000</pubDate>
  <lastBuildDate>Tue, 27 Aug 2013 16:37:21 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=21864</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Calendar Selection Bug Fixes. : These have been around for awhile...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=21864&amp;PID=71551&amp;title=calendar-selection-bug-fixes#71551</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 21864<br /><strong>Posted:</strong> 27 August 2013 at 4:37pm<br /><br />These have been around for awhile and no official fix in sight so I thought I would share my fixes&nbsp; to correct some pretty egregious errors.<br><br><font size="2">1. Using Prev/Next arrows changes the view to Day. To maintain the correct view r</font>evert the code in file <b>XTPCalendarThemePrevNextEventButton.cpp </b>function <br>BOOL CTOPrevNextEventButton::<b>OnLButtonDown</b>(CCmdTarget* /*pObject*/, UINT /*nFlags*/, CPoint point, CTOPrevNextEventButtons *pButtons)<br><br>From:<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPCalendarView* pNewView = GetTheme()-&gt;GetCalendarControl()-&gt;GetActiveView();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pView = GetTheme()-&gt;GetCalendarControl()-&gt;GetActiveView();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pView != pNewView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pView = pNewView;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pView &amp;&amp; pView-&gt;GetViewType() != nViewType)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GetTheme()-&gt;GetCalendarControl()-&gt;SwitchActiveView(nViewType);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>To:<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pView = GetTheme()-&gt;GetCalendarControl()-&gt;GetActiveView();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pView &amp;&amp; pView-&gt;GetViewType() != nViewType)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GetTheme()-&gt;GetCalendarControl()-&gt;SwitchActiveView(nViewType);<br><br>2. Toggle from timeline mode to standard sets calendar display to "Today".<br><br>Change the following code in file <b>XTPCalendarControl.cpp</b> function<br>void CXTPCalendarControl::<b>OnCalendarTimeline()</b><br><br>From:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COleDateTime dtNow(COleDateTime::GetCurrentTime());<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_eViewType = viewtype; //prev view type<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (viewtype == xtpCalendarDayView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_Day;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(1,3,0,0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (viewtype == xtpCalendarWorkWeekView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_WorkWeek;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(5.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (viewtype == xtpCalendarWeekView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_Week;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(7.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (viewtype == xtpCalendarMonthView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_Month;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(11.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>To:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COleDateTime dtNow(COleDateTime::GetCurrentTime());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COleDateTime dtCurrent(dtNow);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_eViewType = viewtype; //prev view type<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (viewtype == xtpCalendarDayView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow = ((CXTPCalendarDayView*)GetActiveView())-&gt;GetViewDayDate(0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_Day;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (dtNow == dtCurrent)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(1,3,0,0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (viewtype == xtpCalendarWorkWeekView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow = ((CXTPCalendarWeekView*)GetActiveView())-&gt;GetViewDayDate(0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_WorkWeek;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (dtNow == dtCurrent)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(5.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (viewtype == xtpCalendarWeekView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow = ((CXTPCalendarWeekView*)GetActiveView())-&gt;GetViewDayDate(0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_Week;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (dtNow == dtCurrent)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(7.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (viewtype == xtpCalendarMonthView)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow = ((CXTPCalendarMonthView*)GetActiveView())-&gt;GetViewDayDate(0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_nTimelineScale = xtpTSPID_Month;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (dtNow == dtCurrent)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dtNow -= COleDateTimeSpan(11.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>I hope this helps folks out and hopefully CJ will see fit to incorporate or improve upon these fixes in upcoming releases.<br><br>]]>
   </description>
   <pubDate>Tue, 27 Aug 2013 16:37:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=21864&amp;PID=71551&amp;title=calendar-selection-bug-fixes#71551</guid>
  </item> 
 </channel>
</rss>