XTPCalendarRemindersDialog.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:15k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // XTPCalendarRemindersDialog.cpp :
  2. #include "stdafx.h"
  3. #include "Common/XTPResourceManager.h"
  4. #include "Common/XTPVC50Helpers.h"
  5. #include "XTPCalendarRemindersDialog.h"
  6. #include "XTPCalendarEventPropertiesDlg.h"
  7. #include "XTPCalendarEvent.h"
  8. #include "XTPCalendarNotifications.h"
  9. #include "XTPCalendarControl.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. #define XTP_CALENDAR_RMD_REFRESH_TIMERID 1
  16. #define XTP_CALENDAR_RMD_REFRESH_TIMEOUT 60*1000 // 1 minute
  17. #define XTP_CALENDAR_RMD_REFRESH_ITEM_TIMERID 2
  18. #define XTP_CALENDAR_RMD_REFRESH_ITEM_TIMEOUT 70 // 70 ms
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CXTPCalendarRemindersDialog dialog
  21. CXTPCalendarRemindersDialog::CXTPCalendarRemindersDialog(CWnd* pParent, UINT nIDTemplate)
  22. {
  23. InitModalIndirect(XTPResourceManager()->LoadDialogTemplate(nIDTemplate), pParent);
  24. m_pRemindersMan = NULL;
  25. m_pCalendar = NULL;
  26. m_nNextRefreshIndex = -1;
  27. m_bAutoPopup = TRUE;
  28. m_bShowInTaskBar = TRUE;
  29. }
  30. CXTPCalendarRemindersDialog::~CXTPCalendarRemindersDialog()
  31. {
  32. DestroyWindow();
  33. m_Sink.UnadviseAll();
  34. CMDTARGET_RELEASE(m_pRemindersMan);
  35. CMDTARGET_RELEASE(m_pCalendar);
  36. }
  37. BOOL CXTPCalendarRemindersDialog::Create(CWnd* pParent)
  38. {
  39. BOOL bCreated = CDialog::CreateIndirect(XTPResourceManager()->LoadDialogTemplate(IDD), pParent);
  40. if (bCreated)
  41. {
  42. if (m_bShowInTaskBar)
  43. {
  44. ModifyStyleEx(0, WS_EX_APPWINDOW);
  45. }
  46. }
  47. return bCreated;
  48. }
  49. BOOL CXTPCalendarRemindersDialog::IsShowInTaskBar()
  50. {
  51. return m_bShowInTaskBar;
  52. }
  53. void CXTPCalendarRemindersDialog::SetShowInTaskBar(BOOL bShow)
  54. {
  55. BOOL bChanged = m_bShowInTaskBar != bShow;
  56. m_bShowInTaskBar = bShow;
  57. if (m_hWnd)
  58. {
  59. BOOL bVisible = IsWindowVisible();
  60. if (bChanged)
  61. ShowWindow(SW_HIDE);
  62. ModifyStyleEx(m_bShowInTaskBar ? 0 : WS_EX_APPWINDOW, m_bShowInTaskBar ? WS_EX_APPWINDOW : 0);
  63. if (bChanged && bVisible)
  64. ShowWindow(SW_SHOWNORMAL);
  65. }
  66. }
  67. void CXTPCalendarRemindersDialog::DoDataExchange(CDataExchange* pDX)
  68. {
  69. CDialog::DoDataExchange(pDX);
  70. DDX_Control(pDX, XTP_IDC_RMD_SNOZE_TIME_CB, m_ctrlSnoozeTimeCB);
  71. DDX_Control(pDX, XTP_IDC_RMD_SNOOZE, m_ctrlSnoozeBtn);
  72. DDX_Control(pDX, XTP_IDC_RMD_REMINDERS_LIST, m_ctrlRemindersList);
  73. DDX_Control(pDX, XTP_IDC_RMD_DIMISS_ALL, m_ctrlDismissAllBtn);
  74. DDX_Control(pDX, XTP_IDC_RMD_DIMISS, m_ctrlDismissBtn);
  75. DDX_Control(pDX, XTP_IDC_RMD_OPEN_ITEM, m_ctrlOpenItemBtn);
  76. DDX_Control(pDX, XTP_IDC_RMD_DESCRIPTION, m_ctrlDescription);
  77. }
  78. BEGIN_MESSAGE_MAP(CXTPCalendarRemindersDialog, CDialog)
  79. ON_BN_CLICKED(XTP_IDC_RMD_DIMISS, OnDismiss)
  80. ON_BN_CLICKED(XTP_IDC_RMD_DIMISS_ALL, OnDismissAll)
  81. ON_BN_CLICKED(XTP_IDC_RMD_OPEN_ITEM, OnOpenItem)
  82. ON_BN_CLICKED(XTP_IDC_RMD_SNOOZE, OnSnooze)
  83. ON_NOTIFY(LVN_ITEMCHANGED, XTP_IDC_RMD_REMINDERS_LIST, OnRemindersList_ItemChanged)
  84. ON_NOTIFY(NM_DBLCLK, XTP_IDC_RMD_REMINDERS_LIST, OnRemindersList_DblClick)
  85. ON_WM_TIMER()
  86. END_MESSAGE_MAP()
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CXTPCalendarRemindersDialog message handlers
  89. BOOL CXTPCalendarRemindersDialog::OnInitDialog()
  90. {
  91. CDialog::OnInitDialog();
  92. CRect rcList(0,0,0,0);
  93. m_ctrlRemindersList.GetClientRect(&rcList);
  94. int nColWith0 = rcList.Width()*60/100;
  95. int nColWith1 = rcList.Width()*30/100;
  96. m_ctrlRemindersList.InsertColumn(0, CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_SUBJECT),
  97.  LVCFMT_LEFT, nColWith0, 0);
  98. m_ctrlRemindersList.InsertColumn(1, CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_DUEIN),
  99.  LVCFMT_LEFT, nColWith1, 1);
  100. ListView_SetExtendedListViewStyleEx(m_ctrlRemindersList.m_hWnd, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
  101. InitSnoozeComboBox();
  102. UpdateFromManager();
  103. UpdateControlsBySelection();
  104. return TRUE;  // return TRUE unless you set the focus to a control
  105.               // EXCEPTION: OCX Property Pages should return FALSE
  106. }
  107. void CXTPCalendarRemindersDialog::InitSnoozeComboBox()
  108. {
  109. m_ctrlSnoozeTimeCB.ResetContent();
  110. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_MINUTES_1));
  111. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_MINUTES_5));
  112. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_MINUTES_10));
  113. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_MINUTES_15));
  114. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_HOURS_1));
  115. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_HOURS_2));
  116. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_HOURS_4));
  117. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_HOURS_8));
  118. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_DAYS_0_5));
  119. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_DAYS_1));
  120. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_DAYS_2));
  121. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_DAYS_3));
  122. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_WEEKS_1));
  123. m_ctrlSnoozeTimeCB.AddString(CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_WEEKS_2));
  124. }
  125. void CXTPCalendarRemindersDialog::OnDismissAll()
  126. {
  127. CWaitCursor _WC;
  128. ASSERT(m_pRemindersMan);
  129. if (m_pRemindersMan)
  130. {
  131. VERIFY(m_pRemindersMan->DismissAll());
  132. }
  133. }
  134. BOOL CXTPCalendarRemindersDialog::_RemoveReminderInfo(CXTPCalendarReminder* pReminder)
  135. {
  136. int nRmdIdx = m_arActiveReminders.Find(pReminder);
  137. if (nRmdIdx >= 0 && nRmdIdx < m_ctrlRemindersList.GetItemCount())
  138. {
  139. m_ctrlRemindersList.DeleteItem(nRmdIdx);
  140. m_arActiveReminders.RemoveAt(nRmdIdx);
  141. UpdateControlsBySelection();
  142. SelectItem(nRmdIdx);
  143. UpdateTitle();
  144. return TRUE;
  145. }
  146. return FALSE;
  147. }
  148. void CXTPCalendarRemindersDialog::OnDismiss()
  149. {
  150. int nSelIdx = m_ctrlRemindersList.GetNextItem(-1, LVNI_FOCUSED|LVNI_SELECTED);
  151. if (nSelIdx >= 0)
  152. {
  153. CXTPCalendarReminder* pReminder = m_arActiveReminders.GetAt(nSelIdx, FALSE);
  154. ASSERT(pReminder);
  155. if (pReminder)
  156. {
  157. VERIFY(pReminder->Dismiss());
  158. }
  159. }
  160. }
  161. void CXTPCalendarRemindersDialog::OnSnooze()
  162. {
  163. int nSelIdx = m_ctrlRemindersList.GetNextItem(-1, LVNI_FOCUSED|LVNI_SELECTED);
  164. if (nSelIdx >= 0)
  165. {
  166. CXTPCalendarReminder* pReminder = m_arActiveReminders.GetAt(nSelIdx, FALSE);
  167. ASSERT(pReminder);
  168. if (pReminder)
  169. {
  170. CString strSnooze;
  171. m_ctrlSnoozeTimeCB.GetWindowText(strSnooze);
  172. int nSnoozeTime = CXTPCalendarUtils::ParceTimeDuration_min(strSnooze);
  173. if (nSnoozeTime == INT_MIN || nSnoozeTime < 1)
  174. {
  175. m_ctrlSnoozeTimeCB.SetFocus();
  176. XTPResourceManager()->ShowMessageBox(XTP_IDS_CALENDAR_WRONG_VALUE);
  177. return;
  178. }
  179. VERIFY(pReminder->Snooze(nSnoozeTime));
  180. }
  181. }
  182. }
  183. void CXTPCalendarRemindersDialog::OnOpenItem()
  184. {
  185. ASSERT(m_pCalendar);
  186. if (!m_pCalendar) {
  187. return;
  188. }
  189. int nSelIdx = m_ctrlRemindersList.GetNextItem(-1, LVNI_FOCUSED|LVNI_SELECTED);
  190. if (nSelIdx >= 0)
  191. {
  192. CXTPCalendarReminder* pReminder = m_arActiveReminders.GetAt(nSelIdx, FALSE);
  193. ASSERT(pReminder);
  194. if (pReminder)
  195. {
  196. CXTPCalendarEventPtr ptrEvent = pReminder->GetEvent();
  197. CXTPCalendarEventPropertiesDlg dlg(m_pCalendar, FALSE, this, ptrEvent);
  198. dlg.DoModal();
  199. }
  200. }
  201. }
  202. void CXTPCalendarRemindersDialog::OnRemindersList_ItemChanged(NMHDR* pNMHDR, LRESULT* pResult)
  203. {
  204. UNREFERENCED_PARAMETER(pNMHDR);
  205. //NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  206. *pResult = 0;
  207. UpdateControlsBySelection();
  208. }
  209. void CXTPCalendarRemindersDialog::OnRemindersList_DblClick(NMHDR* , LRESULT* )
  210. {
  211. if (m_pCalendar) {
  212. OnOpenItem();
  213. }
  214. }
  215. void CXTPCalendarRemindersDialog::UpdateControlsBySelection()
  216. {
  217. CString strDescription;
  218. BOOL bEnableControls = FALSE;
  219. int nSelIdx = m_ctrlRemindersList.GetNextItem(-1, LVNI_FOCUSED|LVNI_SELECTED);
  220. if (nSelIdx < 0)
  221. {
  222. if (m_ctrlRemindersList.GetItemCount())
  223. {
  224. strDescription = CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_SEL_0_RMD);
  225. }
  226. else
  227. {
  228. strDescription = CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_NO_REMINDERS);
  229. }
  230. }
  231. else
  232. {
  233. CXTPCalendarReminder* pReminder = m_arActiveReminders.GetAt(nSelIdx, FALSE);
  234. CXTPCalendarEventPtr ptrEvent = pReminder ? pReminder->GetEvent() : NULL;
  235. ASSERT(ptrEvent);
  236. if (ptrEvent)
  237. {
  238. bEnableControls = TRUE;
  239. CString strSubject = ptrEvent->GetSubject();
  240. SYSTEMTIME stStart;
  241. GETASSYSTEMTIME_DT(ptrEvent->GetStartTime(), stStart);
  242. CString strFormatDate = CXTPCalendarUtils::GetLocaleString(LOCALE_SLONGDATE, 81);
  243. CString strFormatTime = CXTPCalendarUtils::GetTimeFormatString_HrMin();
  244. CString strDate = CXTPCalendarUtils::GetDateFormat(&stStart, strFormatDate);
  245. CString strTime = CXTPCalendarUtils::GetTimeFormat(&stStart, strFormatTime);
  246. strDescription.Format(_T("%s nn%s: %s %s"), (LPCTSTR)strSubject,
  247. (LPCTSTR)CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_START_TIME),
  248. (LPCTSTR)strDate, (LPCTSTR)strTime);
  249. }
  250. }
  251. //===================================================================
  252. m_ctrlDescription.SetWindowText(strDescription);
  253. CString strSnooze = CXTPCalendarUtils::FormatTimeDuration(15, FALSE);
  254. m_ctrlSnoozeTimeCB.SetWindowText(strSnooze);
  255. m_ctrlSnoozeTimeCB.EnableWindow(bEnableControls);
  256. m_ctrlSnoozeBtn.EnableWindow(bEnableControls);
  257. m_ctrlDismissBtn.EnableWindow(bEnableControls);
  258. int nItemsCount = m_ctrlRemindersList.GetItemCount();
  259. m_ctrlDismissAllBtn.EnableWindow(nItemsCount > 0);
  260. m_ctrlOpenItemBtn.EnableWindow(bEnableControls && m_pCalendar != NULL);
  261. }
  262. void CXTPCalendarRemindersDialog::SetRemindersManager(CXTPCalendarControl* pCalendar)
  263. {
  264. m_Sink.UnadviseAll();
  265. m_ctrlRemindersList.DeleteAllItems();
  266. CMDTARGET_ADDREF(pCalendar);
  267. CMDTARGET_RELEASE(m_pCalendar);
  268. m_pCalendar = pCalendar;
  269. CMDTARGET_RELEASE(m_pRemindersMan);
  270. if (!m_pCalendar)
  271. {
  272. return;
  273. }
  274. CXTPNotifyConnection* pConn = m_pCalendar->GetConnection();
  275. ASSERT(pConn);
  276. if (pConn)
  277. {
  278. m_Sink.Advise(pConn, XTP_NC_CALENDAR_ON_REMINDERS, &CXTPCalendarRemindersDialog::OnReminders);
  279. }
  280. m_pRemindersMan = m_pCalendar->GetRemindersManager();
  281. CMDTARGET_ADDREF(m_pRemindersMan);
  282. UpdateFromManager();
  283. }
  284. void CXTPCalendarRemindersDialog::UpdateFromManager()
  285. {
  286. CWaitCursor _WC;
  287. if (!m_pRemindersMan || !m_ctrlRemindersList.m_hWnd) {
  288. return;
  289. }
  290. m_pRemindersMan->GetActiveReminders(m_arActiveReminders);
  291. COleDateTime dtNow = CXTPCalendarUtils::GetCurrentTime();
  292. int nSelIdx = m_ctrlRemindersList.GetNextItem(-1, LVNI_FOCUSED|LVNI_SELECTED);
  293. m_ctrlRemindersList.DeleteAllItems();
  294. int nCount = m_arActiveReminders.GetCount();
  295. for (int i = 0; i < nCount; i++)
  296. {
  297. CXTPCalendarReminder* pReminder = m_arActiveReminders.GetAt(i, FALSE);
  298. CXTPCalendarEventPtr ptrEvent = pReminder ? pReminder->GetEvent() : NULL;
  299. if (!ptrEvent) {
  300. ASSERT(FALSE);
  301. continue;
  302. }
  303. CString strText = ptrEvent->GetSubject();
  304. m_ctrlRemindersList.InsertItem(i, strText);
  305. //-----------------------------------------
  306. COleDateTimeSpan spDueIn = ptrEvent->GetStartTime() - dtNow;
  307. int nMunutes = GETTOTAL_MINUTES_DTS(spDueIn);
  308. strText = CXTPCalendarUtils::FormatTimeDuration(labs(nMunutes), TRUE);
  309. if (nMunutes < 0) {
  310. strText += _T(" ") + CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_OVERDUE);
  311. }
  312. m_ctrlRemindersList.SetItem(i, 1, LVIF_TEXT, strText, 0, 0, 0, 0);
  313. }
  314. SelectItem(nSelIdx);
  315. UpdateControlsBySelection();
  316. UpdateTitle();
  317. KillTimer(XTP_CALENDAR_RMD_REFRESH_ITEM_TIMERID);
  318. m_nNextRefreshIndex = -1;
  319. SetTimer(XTP_CALENDAR_RMD_REFRESH_TIMERID, XTP_CALENDAR_RMD_REFRESH_TIMEOUT, NULL);
  320. }
  321. void CXTPCalendarRemindersDialog::UpdateTitle()
  322. {
  323. int nItemsCount = m_ctrlRemindersList.GetItemCount();
  324. CString strTitle;
  325. strTitle.Format((LPCTSTR)CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_REMINDERS), nItemsCount);
  326. SetWindowText(strTitle);
  327. }
  328. void CXTPCalendarRemindersDialog::SelectItem(int nSelItemIndex)
  329. {
  330. int nItemsCount = m_ctrlRemindersList.GetItemCount();
  331. if (nSelItemIndex >= 0 && nItemsCount)
  332. {
  333. if (nSelItemIndex >= nItemsCount) {
  334. nSelItemIndex = nItemsCount - 1;
  335. }
  336. UINT uState = LVNI_FOCUSED|LVNI_SELECTED;
  337. m_ctrlRemindersList.SetItemState(nSelItemIndex, uState, uState);
  338. m_ctrlRemindersList.EnsureVisible(nSelItemIndex, FALSE);
  339. }
  340. }
  341. void CXTPCalendarRemindersDialog::OnReminders(XTP_NOTIFY_CODE Event, WPARAM wParam , LPARAM lParam)
  342. {
  343. if (Event != XTP_NC_CALENDAR_ON_REMINDERS)
  344. {
  345. ASSERT(FALSE);
  346. return;
  347. }
  348. int eAction = (int)wParam;
  349. if (eAction == xtpCalendarRemindersFire ||
  350. eAction == xtpCalendarReminderDismissedAll)
  351. {
  352. UpdateFromManager();
  353. if (m_bAutoPopup && m_pRemindersMan && m_pRemindersMan->GetActiveRemindersCount())
  354. {
  355. ShowWindow(SW_SHOWNORMAL);
  356. }
  357. }
  358. else if (eAction == xtpCalendarReminderSnoozed ||
  359.  eAction == xtpCalendarReminderDismissed)
  360. {
  361. CXTPCalendarReminder* pReminder = (CXTPCalendarReminder*)lParam;
  362. ASSERT(pReminder);
  363. if (!_RemoveReminderInfo(pReminder))
  364. {
  365. ASSERT(FALSE);
  366. UpdateFromManager();
  367. }
  368. }
  369. else if (eAction == xtpCalendarRemindersMonitoringStarted)
  370. {
  371. ASSERT(!m_pRemindersMan);
  372. ASSERT(m_pCalendar);
  373. CMDTARGET_RELEASE(m_pRemindersMan);
  374. m_pRemindersMan = m_pCalendar ? m_pCalendar->GetRemindersManager() : NULL;
  375. CMDTARGET_ADDREF(m_pRemindersMan);
  376. UpdateFromManager();
  377. }
  378. else if (eAction == xtpCalendarRemindersMonitoringStopped)
  379. {
  380. m_ctrlRemindersList.DeleteAllItems();
  381. m_arActiveReminders.RemoveAll();
  382. UpdateControlsBySelection();
  383. KillTimer(XTP_CALENDAR_RMD_REFRESH_TIMERID);
  384. KillTimer(XTP_CALENDAR_RMD_REFRESH_ITEM_TIMERID);
  385. CMDTARGET_RELEASE(m_pRemindersMan);
  386. }
  387. if (!m_arActiveReminders.GetCount())
  388. {
  389. ShowWindow(SW_HIDE);
  390. }
  391. }
  392. void CXTPCalendarRemindersDialog::OnOK()
  393. {
  394. OnSnooze();
  395. }
  396. void CXTPCalendarRemindersDialog::OnTimer(UINT_PTR nIDEvent)
  397. {
  398. CDialog::OnTimer(nIDEvent);
  399. if (nIDEvent == XTP_CALENDAR_RMD_REFRESH_TIMERID)
  400. {
  401. if (m_nNextRefreshIndex < 0)
  402. {
  403. m_nNextRefreshIndex = 0;
  404. SetTimer(XTP_CALENDAR_RMD_REFRESH_ITEM_TIMERID, XTP_CALENDAR_RMD_REFRESH_ITEM_TIMEOUT, NULL);
  405. }
  406. return;
  407. }
  408. //=======================================================================
  409. if (nIDEvent != XTP_CALENDAR_RMD_REFRESH_ITEM_TIMERID)
  410. {
  411. return;
  412. }
  413. if (!m_pRemindersMan || !m_ctrlRemindersList.m_hWnd)
  414. {
  415. ASSERT(FALSE);
  416. return;
  417. }
  418. m_pRemindersMan->GetActiveReminders(m_arActiveReminders);
  419. COleDateTime dtNow = CXTPCalendarUtils::GetCurrentTime();
  420. int nCount = m_arActiveReminders.GetCount();
  421. if (m_nNextRefreshIndex < nCount)
  422. {
  423. int nIndex = m_nNextRefreshIndex;
  424. m_nNextRefreshIndex++;
  425. CXTPCalendarReminder* pReminder = m_arActiveReminders.GetAt(nIndex, FALSE);
  426. CXTPCalendarEventPtr ptrEvent = pReminder ? pReminder->GetEvent() : NULL;
  427. if (!ptrEvent) {
  428. ASSERT(FALSE);
  429. return;
  430. }
  431. //-----------------------------------------
  432. COleDateTimeSpan spDueIn = ptrEvent->GetStartTime() - dtNow;
  433. int nMunutes = GETTOTAL_MINUTES_DTS(spDueIn);
  434. CString strText = CXTPCalendarUtils::FormatTimeDuration(labs(nMunutes), TRUE);
  435. if (nMunutes < 0)
  436. {
  437. strText += _T(" ") + CXTPCalendarUtils::LoadString(XTP_IDS_CALENDAR_OVERDUE);
  438. }
  439. m_ctrlRemindersList.SetItem(nIndex, 1, LVIF_TEXT, strText, 0, 0, 0, 0);
  440. }
  441. else
  442. {
  443. m_nNextRefreshIndex = -1;
  444. KillTimer(XTP_CALENDAR_RMD_REFRESH_ITEM_TIMERID);
  445. }
  446. }