| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/cfwl_monthcalendar.h" | 7 #include "xfa/fwl/cfwl_monthcalendar.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 DrawLButton(pGraphics, pTheme, pMatrix); | 203 DrawLButton(pGraphics, pTheme, pMatrix); |
| 204 DrawRButton(pGraphics, pTheme, pMatrix); | 204 DrawRButton(pGraphics, pTheme, pMatrix); |
| 205 DrawSeperator(pGraphics, pTheme, pMatrix); | 205 DrawSeperator(pGraphics, pTheme, pMatrix); |
| 206 DrawDatesInBK(pGraphics, pTheme, pMatrix); | 206 DrawDatesInBK(pGraphics, pTheme, pMatrix); |
| 207 DrawDatesInCircle(pGraphics, pTheme, pMatrix); | 207 DrawDatesInCircle(pGraphics, pTheme, pMatrix); |
| 208 DrawCaption(pGraphics, pTheme, pMatrix); | 208 DrawCaption(pGraphics, pTheme, pMatrix); |
| 209 DrawWeek(pGraphics, pTheme, pMatrix); | 209 DrawWeek(pGraphics, pTheme, pMatrix); |
| 210 DrawDatesIn(pGraphics, pTheme, pMatrix); | 210 DrawDatesIn(pGraphics, pTheme, pMatrix); |
| 211 DrawDatesOut(pGraphics, pTheme, pMatrix); | 211 DrawDatesOut(pGraphics, pTheme, pMatrix); |
| 212 DrawToday(pGraphics, pTheme, pMatrix); | 212 DrawToday(pGraphics, pTheme, pMatrix); |
| 213 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_WeekNumbers) { | |
| 214 DrawWeekNumberSep(pGraphics, pTheme, pMatrix); | |
| 215 DrawWeekNumber(pGraphics, pTheme, pMatrix); | |
| 216 } | |
| 217 } | 213 } |
| 218 | 214 |
| 219 void CFWL_MonthCalendar::SetSelect(int32_t iYear, | 215 void CFWL_MonthCalendar::SetSelect(int32_t iYear, |
| 220 int32_t iMonth, | 216 int32_t iMonth, |
| 221 int32_t iDay) { | 217 int32_t iDay) { |
| 222 ChangeToMonth(iYear, iMonth); | 218 ChangeToMonth(iYear, iMonth); |
| 223 AddSelDay(iDay); | 219 AddSelDay(iDay); |
| 224 } | 220 } |
| 225 | 221 |
| 226 void CFWL_MonthCalendar::DrawBackground(CFX_Graphics* pGraphics, | 222 void CFWL_MonthCalendar::DrawBackground(CFX_Graphics* pGraphics, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 params.m_iPart = CFWL_Part::DateInBK; | 323 params.m_iPart = CFWL_Part::DateInBK; |
| 328 params.m_pGraphics = pGraphics; | 324 params.m_pGraphics = pGraphics; |
| 329 if (pMatrix) | 325 if (pMatrix) |
| 330 params.m_matrix.Concat(*pMatrix); | 326 params.m_matrix.Concat(*pMatrix); |
| 331 | 327 |
| 332 int32_t iCount = m_arrDates.GetSize(); | 328 int32_t iCount = m_arrDates.GetSize(); |
| 333 for (int32_t j = 0; j < iCount; j++) { | 329 for (int32_t j = 0; j < iCount; j++) { |
| 334 DATEINFO* pDataInfo = m_arrDates.GetAt(j); | 330 DATEINFO* pDataInfo = m_arrDates.GetAt(j); |
| 335 if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Selected) { | 331 if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Selected) { |
| 336 params.m_dwStates |= CFWL_PartState_Selected; | 332 params.m_dwStates |= CFWL_PartState_Selected; |
| 337 if (((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_NoTodayCircle) == | 333 if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Flag) { |
| 338 0) && | |
| 339 pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Flag) { | |
| 340 params.m_dwStates |= CFWL_PartState_Flagged; | 334 params.m_dwStates |= CFWL_PartState_Flagged; |
| 341 } | 335 } |
| 342 if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Focused) | |
| 343 params.m_dwStates |= CFWL_PartState_Focused; | |
| 344 } else if (j == m_iHovered - 1) { | 336 } else if (j == m_iHovered - 1) { |
| 345 params.m_dwStates |= CFWL_PartState_Hovered; | 337 params.m_dwStates |= CFWL_PartState_Hovered; |
| 346 } else if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Flag) { | 338 } else if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Flag) { |
| 347 params.m_dwStates = CFWL_PartState_Flagged; | 339 params.m_dwStates = CFWL_PartState_Flagged; |
| 348 pTheme->DrawBackground(¶ms); | 340 pTheme->DrawBackground(¶ms); |
| 349 } | 341 } |
| 350 params.m_rtPart = pDataInfo->rect; | 342 params.m_rtPart = pDataInfo->rect; |
| 351 pTheme->DrawBackground(¶ms); | 343 pTheme->DrawBackground(¶ms); |
| 352 params.m_dwStates = 0; | 344 params.m_dwStates = 0; |
| 353 } | 345 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 369 for (int32_t i = 0; i < 7; i++) { | 361 for (int32_t i = 0; i < 7; i++) { |
| 370 rtDayOfWeek.Set(m_rtWeek.left + i * (m_szCell.x + MONTHCAL_HMARGIN * 2), | 362 rtDayOfWeek.Set(m_rtWeek.left + i * (m_szCell.x + MONTHCAL_HMARGIN * 2), |
| 371 m_rtWeek.top, m_szCell.x, m_szCell.y); | 363 m_rtWeek.top, m_szCell.x, m_szCell.y); |
| 372 params.m_rtPart = rtDayOfWeek; | 364 params.m_rtPart = rtDayOfWeek; |
| 373 params.m_wsText = *GetCapacityForDay(pTheme, params, i); | 365 params.m_wsText = *GetCapacityForDay(pTheme, params, i); |
| 374 params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; | 366 params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; |
| 375 pTheme->DrawText(¶ms); | 367 pTheme->DrawText(¶ms); |
| 376 } | 368 } |
| 377 } | 369 } |
| 378 | 370 |
| 379 void CFWL_MonthCalendar::DrawWeekNumber(CFX_Graphics* pGraphics, | |
| 380 IFWL_ThemeProvider* pTheme, | |
| 381 const CFX_Matrix* pMatrix) { | |
| 382 CFWL_ThemeText params; | |
| 383 params.m_pWidget = this; | |
| 384 params.m_iPart = CFWL_Part::WeekNum; | |
| 385 params.m_pGraphics = pGraphics; | |
| 386 params.m_dwStates = CFWL_PartState_Normal; | |
| 387 params.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft; | |
| 388 CFX_WideString wsWeekNum; | |
| 389 params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; | |
| 390 params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; | |
| 391 if (pMatrix) | |
| 392 params.m_matrix.Concat(*pMatrix); | |
| 393 | |
| 394 int32_t iMonthNum = m_pDateTime->GetMonth(); | |
| 395 int32_t iDayNum = FX_DaysInMonth(m_iCurYear, iMonthNum); | |
| 396 int32_t iTemp = 0; | |
| 397 FX_FLOAT fVStartPos = m_rtClient.top + m_fHeadHei + m_fHSepHei; | |
| 398 FX_FLOAT fHStartPos = m_rtClient.left; | |
| 399 for (int32_t i = 1; i <= iDayNum; i += 7) { | |
| 400 iTemp++; | |
| 401 m_rtWeekNum.Set(fHStartPos, fVStartPos + m_fDateCellHei * iTemp, | |
| 402 m_fWeekNumWid, m_fDateCellHei); | |
| 403 wsWeekNum.Format(L"0"); | |
| 404 params.m_wsText = wsWeekNum; | |
| 405 params.m_rtPart = m_rtWeekNum; | |
| 406 pTheme->DrawText(¶ms); | |
| 407 } | |
| 408 } | |
| 409 | |
| 410 void CFWL_MonthCalendar::DrawWeekNumberSep(CFX_Graphics* pGraphics, | |
| 411 IFWL_ThemeProvider* pTheme, | |
| 412 const CFX_Matrix* pMatrix) { | |
| 413 CFWL_ThemeBackground params; | |
| 414 params.m_pWidget = this; | |
| 415 params.m_iPart = CFWL_Part::WeekNumSep; | |
| 416 params.m_pGraphics = pGraphics; | |
| 417 params.m_dwStates = CFWL_PartState_Normal; | |
| 418 params.m_rtPart = m_rtWeekNumSep; | |
| 419 if (pMatrix) | |
| 420 params.m_matrix.Concat(*pMatrix); | |
| 421 pTheme->DrawBackground(¶ms); | |
| 422 } | |
| 423 | |
| 424 void CFWL_MonthCalendar::DrawToday(CFX_Graphics* pGraphics, | 371 void CFWL_MonthCalendar::DrawToday(CFX_Graphics* pGraphics, |
| 425 IFWL_ThemeProvider* pTheme, | 372 IFWL_ThemeProvider* pTheme, |
| 426 const CFX_Matrix* pMatrix) { | 373 const CFX_Matrix* pMatrix) { |
| 427 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_NoToday) | |
| 428 return; | |
| 429 | |
| 430 CFWL_ThemeText params; | 374 CFWL_ThemeText params; |
| 431 params.m_pWidget = this; | 375 params.m_pWidget = this; |
| 432 params.m_iPart = CFWL_Part::Today; | 376 params.m_iPart = CFWL_Part::Today; |
| 433 params.m_pGraphics = pGraphics; | 377 params.m_pGraphics = pGraphics; |
| 434 params.m_dwStates = CFWL_PartState_Normal; | 378 params.m_dwStates = CFWL_PartState_Normal; |
| 435 params.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft; | 379 params.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft; |
| 436 | 380 |
| 437 CFX_WideString* wsDay = static_cast<CFX_WideString*>( | 381 CFX_WideString* wsDay = static_cast<CFX_WideString*>( |
| 438 pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Today)); | 382 pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Today)); |
| 439 CFX_WideString wsText; | 383 CFX_WideString wsText; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 params.m_dwStates = CFWL_PartState_Normal; | 429 params.m_dwStates = CFWL_PartState_Normal; |
| 486 params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; | 430 params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; |
| 487 if (pMatrix) | 431 if (pMatrix) |
| 488 params.m_matrix.Concat(*pMatrix); | 432 params.m_matrix.Concat(*pMatrix); |
| 489 pTheme->DrawText(¶ms); | 433 pTheme->DrawText(¶ms); |
| 490 } | 434 } |
| 491 | 435 |
| 492 void CFWL_MonthCalendar::DrawDatesInCircle(CFX_Graphics* pGraphics, | 436 void CFWL_MonthCalendar::DrawDatesInCircle(CFX_Graphics* pGraphics, |
| 493 IFWL_ThemeProvider* pTheme, | 437 IFWL_ThemeProvider* pTheme, |
| 494 const CFX_Matrix* pMatrix) { | 438 const CFX_Matrix* pMatrix) { |
| 495 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_NoTodayCircle) | |
| 496 return; | |
| 497 if (m_iMonth != m_iCurMonth || m_iYear != m_iCurYear) | 439 if (m_iMonth != m_iCurMonth || m_iYear != m_iCurYear) |
| 498 return; | 440 return; |
| 499 if (m_iDay < 1 || m_iDay > m_arrDates.GetSize()) | 441 if (m_iDay < 1 || m_iDay > m_arrDates.GetSize()) |
| 500 return; | 442 return; |
| 501 | 443 |
| 502 DATEINFO* pDate = m_arrDates[m_iDay - 1]; | 444 DATEINFO* pDate = m_arrDates[m_iDay - 1]; |
| 503 if (!pDate) | 445 if (!pDate) |
| 504 return; | 446 return; |
| 505 | 447 |
| 506 CFWL_ThemeBackground params; | 448 CFWL_ThemeBackground params; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 DATEINFO* pDateInfo = m_arrDates.GetAt(i); | 583 DATEINFO* pDateInfo = m_arrDates.GetAt(i); |
| 642 if (bNewWeek) { | 584 if (bNewWeek) { |
| 643 iWeekOfMonth++; | 585 iWeekOfMonth++; |
| 644 bNewWeek = false; | 586 bNewWeek = false; |
| 645 } | 587 } |
| 646 pDateInfo->rect.Set( | 588 pDateInfo->rect.Set( |
| 647 fLeft + pDateInfo->iDayOfWeek * (m_szCell.x + (MONTHCAL_HMARGIN * 2)), | 589 fLeft + pDateInfo->iDayOfWeek * (m_szCell.x + (MONTHCAL_HMARGIN * 2)), |
| 648 fTop + iWeekOfMonth * (m_szCell.y + (MONTHCAL_VMARGIN * 2)), | 590 fTop + iWeekOfMonth * (m_szCell.y + (MONTHCAL_VMARGIN * 2)), |
| 649 m_szCell.x + (MONTHCAL_HMARGIN * 2), | 591 m_szCell.x + (MONTHCAL_HMARGIN * 2), |
| 650 m_szCell.y + (MONTHCAL_VMARGIN * 2)); | 592 m_szCell.y + (MONTHCAL_VMARGIN * 2)); |
| 651 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_WeekNumbers) | |
| 652 pDateInfo->rect.Offset(m_fWeekNumWid, 0); | |
| 653 if (pDateInfo->iDayOfWeek >= 6) | 593 if (pDateInfo->iDayOfWeek >= 6) |
| 654 bNewWeek = true; | 594 bNewWeek = true; |
| 655 } | 595 } |
| 656 } | 596 } |
| 657 | 597 |
| 658 void CFWL_MonthCalendar::GetCapValue() { | 598 void CFWL_MonthCalendar::GetCapValue() { |
| 659 if (!m_pProperties->m_pThemeProvider) | 599 if (!m_pProperties->m_pThemeProvider) |
| 660 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 600 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 661 | 601 |
| 662 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; | 602 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 m_fDateCellHei = *static_cast<FX_FLOAT*>( | 645 m_fDateCellHei = *static_cast<FX_FLOAT*>( |
| 706 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::DatesCellHeight)); | 646 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::DatesCellHeight)); |
| 707 m_fTodayWid = *static_cast<FX_FLOAT*>( | 647 m_fTodayWid = *static_cast<FX_FLOAT*>( |
| 708 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayWidth)); | 648 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayWidth)); |
| 709 m_fTodayHei = *static_cast<FX_FLOAT*>( | 649 m_fTodayHei = *static_cast<FX_FLOAT*>( |
| 710 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayHeight)); | 650 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayHeight)); |
| 711 m_fTodayFlagWid = *static_cast<FX_FLOAT*>( | 651 m_fTodayFlagWid = *static_cast<FX_FLOAT*>( |
| 712 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayFlagWidth)); | 652 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayFlagWidth)); |
| 713 m_fMCWid = *static_cast<FX_FLOAT*>( | 653 m_fMCWid = *static_cast<FX_FLOAT*>( |
| 714 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Width)); | 654 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Width)); |
| 715 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_WeekNumbers) | |
| 716 m_fMCWid += m_fWeekNumWid; | |
| 717 | 655 |
| 718 m_fMCHei = *static_cast<FX_FLOAT*>( | 656 m_fMCHei = *static_cast<FX_FLOAT*>( |
| 719 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Height)); | 657 pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Height)); |
| 720 } | 658 } |
| 721 | 659 |
| 722 void CFWL_MonthCalendar::InitDate() { | 660 void CFWL_MonthCalendar::InitDate() { |
| 723 // TODO(dsinclair): These should pull the real today values instead of | 661 // TODO(dsinclair): These should pull the real today values instead of |
| 724 // pretending it's 2011-01-01. | 662 // pretending it's 2011-01-01. |
| 725 m_iYear = 2011; | 663 m_iYear = 2011; |
| 726 m_iMonth = 1; | 664 m_iMonth = 1; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 DATEINFO* pDateInfo = m_arrDates.GetAt(iSelDay - 1); | 754 DATEINFO* pDateInfo = m_arrDates.GetAt(iSelDay - 1); |
| 817 pDateInfo->dwStates &= ~FWL_ITEMSTATE_MCD_Selected; | 755 pDateInfo->dwStates &= ~FWL_ITEMSTATE_MCD_Selected; |
| 818 } | 756 } |
| 819 } | 757 } |
| 820 m_arrSelDays.RemoveAll(); | 758 m_arrSelDays.RemoveAll(); |
| 821 return; | 759 return; |
| 822 } | 760 } |
| 823 | 761 |
| 824 void CFWL_MonthCalendar::AddSelDay(int32_t iDay) { | 762 void CFWL_MonthCalendar::AddSelDay(int32_t iDay) { |
| 825 ASSERT(iDay > 0); | 763 ASSERT(iDay > 0); |
| 826 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) | |
| 827 return; | |
| 828 | |
| 829 if (m_arrSelDays.Find(iDay) != -1) | 764 if (m_arrSelDays.Find(iDay) != -1) |
| 830 return; | 765 return; |
| 831 | 766 |
| 832 RemoveSelDay(); | 767 RemoveSelDay(); |
| 833 if (iDay <= m_arrDates.GetSize()) { | 768 if (iDay <= m_arrDates.GetSize()) { |
| 834 DATEINFO* pDateInfo = m_arrDates.GetAt(iDay - 1); | 769 DATEINFO* pDateInfo = m_arrDates.GetAt(iDay - 1); |
| 835 pDateInfo->dwStates |= FWL_ITEMSTATE_MCD_Selected; | 770 pDateInfo->dwStates |= FWL_ITEMSTATE_MCD_Selected; |
| 836 } | 771 } |
| 837 m_arrSelDays.Add(iDay); | 772 m_arrSelDays.Add(iDay); |
| 838 } | 773 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 void CFWL_MonthCalendar::OnLButtonDown(CFWL_MessageMouse* pMsg) { | 868 void CFWL_MonthCalendar::OnLButtonDown(CFWL_MessageMouse* pMsg) { |
| 934 if (m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { | 869 if (m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { |
| 935 m_iLBtnPartStates = CFWL_PartState_Pressed; | 870 m_iLBtnPartStates = CFWL_PartState_Pressed; |
| 936 PrevMonth(); | 871 PrevMonth(); |
| 937 RepaintRect(m_rtClient); | 872 RepaintRect(m_rtClient); |
| 938 } else if (m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { | 873 } else if (m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { |
| 939 m_iRBtnPartStates |= CFWL_PartState_Pressed; | 874 m_iRBtnPartStates |= CFWL_PartState_Pressed; |
| 940 NextMonth(); | 875 NextMonth(); |
| 941 RepaintRect(m_rtClient); | 876 RepaintRect(m_rtClient); |
| 942 } else if (m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { | 877 } else if (m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { |
| 943 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_NoToday) == 0) { | 878 JumpToToday(); |
| 944 JumpToToday(); | 879 RepaintRect(m_rtClient); |
| 945 RepaintRect(m_rtClient); | |
| 946 } | |
| 947 } else { | 880 } else { |
| 948 CFWL_DateTimePicker* pIPicker = static_cast<CFWL_DateTimePicker*>(m_pOuter); | 881 CFWL_DateTimePicker* pIPicker = static_cast<CFWL_DateTimePicker*>(m_pOuter); |
| 949 if (pIPicker->IsMonthCalendarVisible()) | 882 if (pIPicker->IsMonthCalendarVisible()) |
| 950 m_bFlag = 1; | 883 m_bFlag = 1; |
| 951 } | 884 } |
| 952 } | 885 } |
| 953 | 886 |
| 954 void CFWL_MonthCalendar::OnLButtonUp(CFWL_MessageMouse* pMsg) { | 887 void CFWL_MonthCalendar::OnLButtonUp(CFWL_MessageMouse* pMsg) { |
| 955 if (m_pWidgetMgr->IsFormDisabled()) | 888 if (m_pWidgetMgr->IsFormDisabled()) |
| 956 return DisForm_OnLButtonUp(pMsg); | 889 return DisForm_OnLButtonUp(pMsg); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 } | 956 } |
| 1024 AddSelDay(iCurSel); | 957 AddSelDay(iCurSel); |
| 1025 CFWL_DateTimePicker* pDateTime = | 958 CFWL_DateTimePicker* pDateTime = |
| 1026 static_cast<CFWL_DateTimePicker*>(m_pOuter); | 959 static_cast<CFWL_DateTimePicker*>(m_pOuter); |
| 1027 pDateTime->ProcessSelChanged(m_iCurYear, m_iCurMonth, iCurSel); | 960 pDateTime->ProcessSelChanged(m_iCurYear, m_iCurMonth, iCurSel); |
| 1028 pDateTime->ShowMonthCalendar(false); | 961 pDateTime->ShowMonthCalendar(false); |
| 1029 } | 962 } |
| 1030 } | 963 } |
| 1031 | 964 |
| 1032 void CFWL_MonthCalendar::OnMouseMove(CFWL_MessageMouse* pMsg) { | 965 void CFWL_MonthCalendar::OnMouseMove(CFWL_MessageMouse* pMsg) { |
| 1033 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) | |
| 1034 return; | |
| 1035 | |
| 1036 bool bRepaint = false; | 966 bool bRepaint = false; |
| 1037 CFX_RectF rtInvalidate; | 967 CFX_RectF rtInvalidate; |
| 1038 rtInvalidate.Set(0, 0, 0, 0); | 968 rtInvalidate.Set(0, 0, 0, 0); |
| 1039 if (m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) { | 969 if (m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) { |
| 1040 int32_t iHover = GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); | 970 int32_t iHover = GetDayAtPoint(pMsg->m_fx, pMsg->m_fy); |
| 1041 bRepaint = m_iHovered != iHover; | 971 bRepaint = m_iHovered != iHover; |
| 1042 if (bRepaint) { | 972 if (bRepaint) { |
| 1043 if (m_iHovered > 0) | 973 if (m_iHovered > 0) |
| 1044 GetDayRect(m_iHovered, rtInvalidate); | 974 GetDayRect(m_iHovered, rtInvalidate); |
| 1045 if (iHover > 0) { | 975 if (iHover > 0) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 uint32_t dwSt, | 1010 uint32_t dwSt, |
| 1081 CFX_RectF rc, | 1011 CFX_RectF rc, |
| 1082 CFX_WideString& wsday) | 1012 CFX_WideString& wsday) |
| 1083 : iDay(day), | 1013 : iDay(day), |
| 1084 iDayOfWeek(dayofweek), | 1014 iDayOfWeek(dayofweek), |
| 1085 dwStates(dwSt), | 1015 dwStates(dwSt), |
| 1086 rect(rc), | 1016 rect(rc), |
| 1087 wsDay(wsday) {} | 1017 wsDay(wsday) {} |
| 1088 | 1018 |
| 1089 CFWL_MonthCalendar::DATEINFO::~DATEINFO() {} | 1019 CFWL_MonthCalendar::DATEINFO::~DATEINFO() {} |
| OLD | NEW |