| 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/src/fwl/src/basewidget/fwl_monthcalendarimp.h" | 7 #include "xfa/src/fwl/basewidget/fwl_monthcalendarimp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "xfa/include/fwl/basewidget/fwl_monthcalendar.h" | 11 #include "xfa/include/fwl/basewidget/fwl_monthcalendar.h" |
| 12 #include "xfa/include/fwl/core/fwl_theme.h" | 12 #include "xfa/include/fwl/core/fwl_theme.h" |
| 13 #include "xfa/src/fdp/include/fde_tto.h" | 13 #include "xfa/src/fdp/include/fde_tto.h" |
| 14 #include "xfa/src/fwl/src/core/fwl_noteimp.h" | 14 #include "xfa/src/fwl/core/fwl_noteimp.h" |
| 15 #include "xfa/src/fwl/src/core/fwl_targetimp.h" | 15 #include "xfa/src/fwl/core/fwl_targetimp.h" |
| 16 #include "xfa/src/fwl/src/core/fwl_widgetimp.h" | 16 #include "xfa/src/fwl/core/fwl_widgetimp.h" |
| 17 | 17 |
| 18 #define MONTHCAL_HSEP_HEIGHT 1 | 18 #define MONTHCAL_HSEP_HEIGHT 1 |
| 19 #define MONTHCAL_VSEP_WIDTH 1 | 19 #define MONTHCAL_VSEP_WIDTH 1 |
| 20 #define MONTHCAL_HMARGIN 3 | 20 #define MONTHCAL_HMARGIN 3 |
| 21 #define MONTHCAL_VMARGIN 2 | 21 #define MONTHCAL_VMARGIN 2 |
| 22 #define MONTHCAL_ROWS 9 | 22 #define MONTHCAL_ROWS 9 |
| 23 #define MONTHCAL_COLUMNS 7 | 23 #define MONTHCAL_COLUMNS 7 |
| 24 #define MONTHCAL_HEADER_BTN_VMARGIN 7 | 24 #define MONTHCAL_HEADER_BTN_VMARGIN 7 |
| 25 #define MONTHCAL_HEADER_BTN_HMARGIN 5 | 25 #define MONTHCAL_HEADER_BTN_HMARGIN 5 |
| 26 | 26 |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 } | 967 } |
| 968 } | 968 } |
| 969 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 969 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
| 970 return iRet; | 970 return iRet; |
| 971 } | 971 } |
| 972 FWL_ERR CFWL_MonthCalendarImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 972 FWL_ERR CFWL_MonthCalendarImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 973 const CFX_Matrix* pMatrix) { | 973 const CFX_Matrix* pMatrix) { |
| 974 return m_pOwner->DrawWidget(pGraphics, pMatrix); | 974 return m_pOwner->DrawWidget(pGraphics, pMatrix); |
| 975 } | 975 } |
| 976 | 976 |
| 977 void CFWL_MonthCalendarImpDelegate::OnActivate(CFWL_Message* pMsg) { | 977 void CFWL_MonthCalendarImpDelegate::OnActivate(CFWL_Message* pMsg) {} |
| 978 } | |
| 979 | 978 |
| 980 void CFWL_MonthCalendarImpDelegate::OnFocusChanged(CFWL_Message* pMsg, | 979 void CFWL_MonthCalendarImpDelegate::OnFocusChanged(CFWL_Message* pMsg, |
| 981 FX_BOOL bSet) { | 980 FX_BOOL bSet) { |
| 982 if (bSet) { | 981 if (bSet) { |
| 983 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 982 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
| 984 } else { | 983 } else { |
| 985 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; | 984 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; |
| 986 } | 985 } |
| 987 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 986 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
| 988 } | 987 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 if (m_pOwner->m_iHovered > 0) { | 1089 if (m_pOwner->m_iHovered > 0) { |
| 1091 CFX_RectF rtInvalidate; | 1090 CFX_RectF rtInvalidate; |
| 1092 rtInvalidate.Set(0, 0, 0, 0); | 1091 rtInvalidate.Set(0, 0, 0, 0); |
| 1093 m_pOwner->GetDayRect(m_pOwner->m_iHovered, rtInvalidate); | 1092 m_pOwner->GetDayRect(m_pOwner->m_iHovered, rtInvalidate); |
| 1094 m_pOwner->m_iHovered = -1; | 1093 m_pOwner->m_iHovered = -1; |
| 1095 if (!rtInvalidate.IsEmpty()) { | 1094 if (!rtInvalidate.IsEmpty()) { |
| 1096 m_pOwner->Repaint(&rtInvalidate); | 1095 m_pOwner->Repaint(&rtInvalidate); |
| 1097 } | 1096 } |
| 1098 } | 1097 } |
| 1099 } | 1098 } |
| OLD | NEW |