| 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/basewidget/fwl_datetimepickerimp.h" | 7 #include "xfa/fwl/basewidget/fwl_datetimepickerimp.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/basewidget/fwl_editimp.h" | 9 #include "xfa/fwl/basewidget/fwl_editimp.h" |
| 10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h" | 10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 FX_BOOL IFWL_DateTimePicker::DeSelect() { | 141 FX_BOOL IFWL_DateTimePicker::DeSelect() { |
| 142 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->DeSelect(); | 142 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->DeSelect(); |
| 143 } | 143 } |
| 144 FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) { | 144 FWL_ERR IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) { |
| 145 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->GetBBox(rect); | 145 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->GetBBox(rect); |
| 146 } | 146 } |
| 147 FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { | 147 FWL_ERR IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { |
| 148 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SetEditLimit(nLimit); | 148 return static_cast<CFWL_DateTimePickerImp*>(GetImpl())->SetEditLimit(nLimit); |
| 149 } | 149 } |
| 150 FWL_ERR IFWL_DateTimePicker::ModifyEditStylesEx(FX_DWORD dwStylesExAdded, | 150 FWL_ERR IFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded, |
| 151 FX_DWORD dwStylesExRemoved) { | 151 uint32_t dwStylesExRemoved) { |
| 152 return static_cast<CFWL_DateTimePickerImp*>(GetImpl()) | 152 return static_cast<CFWL_DateTimePickerImp*>(GetImpl()) |
| 153 ->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved); | 153 ->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved); |
| 154 } | 154 } |
| 155 CFWL_DateTimeEdit::CFWL_DateTimeEdit(const CFWL_WidgetImpProperties& properties, | 155 CFWL_DateTimeEdit::CFWL_DateTimeEdit(const CFWL_WidgetImpProperties& properties, |
| 156 IFWL_Widget* pOuter) | 156 IFWL_Widget* pOuter) |
| 157 : CFWL_EditImp(properties, pOuter) {} | 157 : CFWL_EditImp(properties, pOuter) {} |
| 158 FWL_ERR CFWL_DateTimeEdit::Initialize() { | 158 FWL_ERR CFWL_DateTimeEdit::Initialize() { |
| 159 m_pDelegate = new CFWL_DateTimeEditImpDelegate(this); | 159 m_pDelegate = new CFWL_DateTimeEditImpDelegate(this); |
| 160 if (CFWL_EditImp::Initialize() != FWL_ERR_Succeeded) | 160 if (CFWL_EditImp::Initialize() != FWL_ERR_Succeeded) |
| 161 return FWL_ERR_Indefinite; | 161 return FWL_ERR_Indefinite; |
| 162 return FWL_ERR_Succeeded; | 162 return FWL_ERR_Succeeded; |
| 163 } | 163 } |
| 164 FWL_ERR CFWL_DateTimeEdit::Finalize() { | 164 FWL_ERR CFWL_DateTimeEdit::Finalize() { |
| 165 delete m_pDelegate; | 165 delete m_pDelegate; |
| 166 m_pDelegate = nullptr; | 166 m_pDelegate = nullptr; |
| 167 return CFWL_EditImp::Finalize(); | 167 return CFWL_EditImp::Finalize(); |
| 168 } | 168 } |
| 169 CFWL_DateTimeEditImpDelegate::CFWL_DateTimeEditImpDelegate( | 169 CFWL_DateTimeEditImpDelegate::CFWL_DateTimeEditImpDelegate( |
| 170 CFWL_DateTimeEdit* pOwner) | 170 CFWL_DateTimeEdit* pOwner) |
| 171 : CFWL_EditImpDelegate(pOwner), m_pOwner(pOwner) {} | 171 : CFWL_EditImpDelegate(pOwner), m_pOwner(pOwner) {} |
| 172 int32_t CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 172 int32_t CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 173 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { | 173 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { |
| 174 return DisForm_OnProcessMessage(pMessage); | 174 return DisForm_OnProcessMessage(pMessage); |
| 175 } | 175 } |
| 176 FX_DWORD dwHashCode = pMessage->GetClassID(); | 176 uint32_t dwHashCode = pMessage->GetClassID(); |
| 177 if (dwHashCode == FWL_MSGHASH_SetFocus || | 177 if (dwHashCode == FWL_MSGHASH_SetFocus || |
| 178 dwHashCode == FWL_MSGHASH_KillFocus) { | 178 dwHashCode == FWL_MSGHASH_KillFocus) { |
| 179 IFWL_Widget* pOuter = m_pOwner->GetOuter(); | 179 IFWL_Widget* pOuter = m_pOwner->GetOuter(); |
| 180 IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL); | 180 IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL); |
| 181 pDelegate->OnProcessMessage(pMessage); | 181 pDelegate->OnProcessMessage(pMessage); |
| 182 } | 182 } |
| 183 return 1; | 183 return 1; |
| 184 } | 184 } |
| 185 int32_t CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage( | 185 int32_t CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage( |
| 186 CFWL_Message* pMessage) { | 186 CFWL_Message* pMessage) { |
| 187 FX_DWORD dwHashCode = pMessage->GetClassID(); | 187 uint32_t dwHashCode = pMessage->GetClassID(); |
| 188 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { | 188 if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) { |
| 189 if (dwHashCode == FWL_MSGHASH_Mouse) { | 189 if (dwHashCode == FWL_MSGHASH_Mouse) { |
| 190 CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage); | 190 CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage); |
| 191 if (pMouse->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown || | 191 if (pMouse->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown || |
| 192 pMouse->m_dwCmd == FWL_MSGMOUSECMD_RButtonDown) { | 192 pMouse->m_dwCmd == FWL_MSGMOUSECMD_RButtonDown) { |
| 193 if ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) { | 193 if ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) { |
| 194 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; | 194 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; |
| 195 } | 195 } |
| 196 CFWL_DateTimePickerImp* pDateTime = | 196 CFWL_DateTimePickerImp* pDateTime = |
| 197 static_cast<CFWL_DateTimePickerImp*>(m_pOwner->m_pOuter->GetImpl()); | 197 static_cast<CFWL_DateTimePickerImp*>(m_pOwner->m_pOuter->GetImpl()); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 225 m_pDelegate = nullptr; | 225 m_pDelegate = nullptr; |
| 226 return CFWL_MonthCalendarImp::Finalize(); | 226 return CFWL_MonthCalendarImp::Finalize(); |
| 227 } | 227 } |
| 228 CFWL_DateTimeCalendarImpDelegate::CFWL_DateTimeCalendarImpDelegate( | 228 CFWL_DateTimeCalendarImpDelegate::CFWL_DateTimeCalendarImpDelegate( |
| 229 CFWL_DateTimeCalendar* pOwner) | 229 CFWL_DateTimeCalendar* pOwner) |
| 230 : CFWL_MonthCalendarImpDelegate(pOwner), m_pOwner(pOwner) { | 230 : CFWL_MonthCalendarImpDelegate(pOwner), m_pOwner(pOwner) { |
| 231 m_bFlag = FALSE; | 231 m_bFlag = FALSE; |
| 232 } | 232 } |
| 233 int32_t CFWL_DateTimeCalendarImpDelegate::OnProcessMessage( | 233 int32_t CFWL_DateTimeCalendarImpDelegate::OnProcessMessage( |
| 234 CFWL_Message* pMessage) { | 234 CFWL_Message* pMessage) { |
| 235 FX_DWORD dwCode = pMessage->GetClassID(); | 235 uint32_t dwCode = pMessage->GetClassID(); |
| 236 if (dwCode == FWL_MSGHASH_SetFocus || dwCode == FWL_MSGHASH_KillFocus) { | 236 if (dwCode == FWL_MSGHASH_SetFocus || dwCode == FWL_MSGHASH_KillFocus) { |
| 237 IFWL_Widget* pOuter = m_pOwner->GetOuter(); | 237 IFWL_Widget* pOuter = m_pOwner->GetOuter(); |
| 238 IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL); | 238 IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL); |
| 239 return pDelegate->OnProcessMessage(pMessage); | 239 return pDelegate->OnProcessMessage(pMessage); |
| 240 } else if (dwCode == FWL_MSGHASH_Mouse) { | 240 } else if (dwCode == FWL_MSGHASH_Mouse) { |
| 241 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 241 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
| 242 if (pMsg->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown) { | 242 if (pMsg->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown) { |
| 243 OnLButtonDownEx(pMsg); | 243 OnLButtonDownEx(pMsg); |
| 244 return 1; | 244 return 1; |
| 245 } else if (pMsg->m_dwCmd == FWL_MSGMOUSECMD_LButtonUp) { | 245 } else if (pMsg->m_dwCmd == FWL_MSGMOUSECMD_LButtonUp) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 m_pEdit(nullptr), | 424 m_pEdit(nullptr), |
| 425 m_pMonthCal(nullptr), | 425 m_pMonthCal(nullptr), |
| 426 m_pForm(nullptr) { | 426 m_pForm(nullptr) { |
| 427 m_rtBtn.Set(0, 0, 0, 0); | 427 m_rtBtn.Set(0, 0, 0, 0); |
| 428 } | 428 } |
| 429 CFWL_DateTimePickerImp::~CFWL_DateTimePickerImp() {} | 429 CFWL_DateTimePickerImp::~CFWL_DateTimePickerImp() {} |
| 430 FWL_ERR CFWL_DateTimePickerImp::GetClassName(CFX_WideString& wsClass) const { | 430 FWL_ERR CFWL_DateTimePickerImp::GetClassName(CFX_WideString& wsClass) const { |
| 431 wsClass = FWL_CLASS_DateTimePicker; | 431 wsClass = FWL_CLASS_DateTimePicker; |
| 432 return FWL_ERR_Succeeded; | 432 return FWL_ERR_Succeeded; |
| 433 } | 433 } |
| 434 FX_DWORD CFWL_DateTimePickerImp::GetClassID() const { | 434 uint32_t CFWL_DateTimePickerImp::GetClassID() const { |
| 435 return FWL_CLASSHASH_DateTimePicker; | 435 return FWL_CLASSHASH_DateTimePicker; |
| 436 } | 436 } |
| 437 FWL_ERR CFWL_DateTimePickerImp::Initialize() { | 437 FWL_ERR CFWL_DateTimePickerImp::Initialize() { |
| 438 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) | 438 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) |
| 439 return FWL_ERR_Indefinite; | 439 return FWL_ERR_Indefinite; |
| 440 m_pDelegate = new CFWL_DateTimePickerImpDelegate(this); | 440 m_pDelegate = new CFWL_DateTimePickerImpDelegate(this); |
| 441 m_pProperties->m_dwStyleExes = FWL_STYLEEXT_DTP_ShortDateFormat; | 441 m_pProperties->m_dwStyleExes = FWL_STYLEEXT_DTP_ShortDateFormat; |
| 442 CFWL_WidgetImpProperties propMonth; | 442 CFWL_WidgetImpProperties propMonth; |
| 443 propMonth.m_dwStyles = FWL_WGTSTYLE_Popup | FWL_WGTSTYLE_Border; | 443 propMonth.m_dwStyles = FWL_WGTSTYLE_Popup | FWL_WGTSTYLE_Border; |
| 444 propMonth.m_dwStates = FWL_WGTSTATE_Invisible; | 444 propMonth.m_dwStates = FWL_WGTSTATE_Invisible; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 } | 524 } |
| 525 CFX_RectF rtMonthCal; | 525 CFX_RectF rtMonthCal; |
| 526 m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE); | 526 m_pMonthCal->GetWidgetRect(rtMonthCal, TRUE); |
| 527 CFX_RectF rtPopUp; | 527 CFX_RectF rtPopUp; |
| 528 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + FWL_DTP_HEIGHT, | 528 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + FWL_DTP_HEIGHT, |
| 529 rtMonthCal.width, rtMonthCal.height); | 529 rtMonthCal.width, rtMonthCal.height); |
| 530 m_pMonthCal->SetWidgetRect(rtPopUp); | 530 m_pMonthCal->SetWidgetRect(rtPopUp); |
| 531 m_pMonthCal->Update(); | 531 m_pMonthCal->Update(); |
| 532 return FWL_ERR_Succeeded; | 532 return FWL_ERR_Succeeded; |
| 533 } | 533 } |
| 534 FX_DWORD CFWL_DateTimePickerImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 534 uint32_t CFWL_DateTimePickerImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 535 if (m_pWidgetMgr->IsFormDisabled()) { | 535 if (m_pWidgetMgr->IsFormDisabled()) { |
| 536 return DisForm_HitTest(fx, fy); | 536 return DisForm_HitTest(fx, fy); |
| 537 } | 537 } |
| 538 if (m_rtClient.Contains(fx, fy)) { | 538 if (m_rtClient.Contains(fx, fy)) { |
| 539 return FWL_WGTHITTEST_Client; | 539 return FWL_WGTHITTEST_Client; |
| 540 } | 540 } |
| 541 if (IsMonthCalendarShowed()) { | 541 if (IsMonthCalendarShowed()) { |
| 542 CFX_RectF rect; | 542 CFX_RectF rect; |
| 543 m_pMonthCal->GetWidgetRect(rect); | 543 m_pMonthCal->GetWidgetRect(rect); |
| 544 if (rect.Contains(fx, fy)) { | 544 if (rect.Contains(fx, fy)) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 m_pMonthCal->GetWidgetRect(rtMonth); | 668 m_pMonthCal->GetWidgetRect(rtMonth); |
| 669 rtMonth.Offset(m_pProperties->m_rtWidget.left, | 669 rtMonth.Offset(m_pProperties->m_rtWidget.left, |
| 670 m_pProperties->m_rtWidget.top); | 670 m_pProperties->m_rtWidget.top); |
| 671 rect.Union(rtMonth); | 671 rect.Union(rtMonth); |
| 672 } | 672 } |
| 673 return FWL_ERR_Succeeded; | 673 return FWL_ERR_Succeeded; |
| 674 } | 674 } |
| 675 FWL_ERR CFWL_DateTimePickerImp::SetEditLimit(int32_t nLimit) { | 675 FWL_ERR CFWL_DateTimePickerImp::SetEditLimit(int32_t nLimit) { |
| 676 return m_pEdit->SetLimit(nLimit); | 676 return m_pEdit->SetLimit(nLimit); |
| 677 } | 677 } |
| 678 FWL_ERR CFWL_DateTimePickerImp::ModifyEditStylesEx(FX_DWORD dwStylesExAdded, | 678 FWL_ERR CFWL_DateTimePickerImp::ModifyEditStylesEx(uint32_t dwStylesExAdded, |
| 679 FX_DWORD dwStylesExRemoved) { | 679 uint32_t dwStylesExRemoved) { |
| 680 return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | 680 return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
| 681 } | 681 } |
| 682 void CFWL_DateTimePickerImp::DrawDropDownButton(CFX_Graphics* pGraphics, | 682 void CFWL_DateTimePickerImp::DrawDropDownButton(CFX_Graphics* pGraphics, |
| 683 IFWL_ThemeProvider* pTheme, | 683 IFWL_ThemeProvider* pTheme, |
| 684 const CFX_Matrix* pMatrix) { | 684 const CFX_Matrix* pMatrix) { |
| 685 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_Spin) == | 685 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_Spin) == |
| 686 FWL_STYLEEXT_DTP_Spin) { | 686 FWL_STYLEEXT_DTP_Spin) { |
| 687 CFWL_WidgetImpProperties prop; | 687 CFWL_WidgetImpProperties prop; |
| 688 prop.m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; | 688 prop.m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; |
| 689 prop.m_pParent = m_pInterface; | 689 prop.m_pParent = m_pInterface; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 if (m_pWidgetMgr->IsFormDisabled()) { | 748 if (m_pWidgetMgr->IsFormDisabled()) { |
| 749 return DisForm_IsMonthCalendarShowed(); | 749 return DisForm_IsMonthCalendarShowed(); |
| 750 } | 750 } |
| 751 if (!m_pForm) | 751 if (!m_pForm) |
| 752 return FALSE; | 752 return FALSE; |
| 753 return !(m_pForm->GetStates() & FWL_WGTSTATE_Invisible); | 753 return !(m_pForm->GetStates() & FWL_WGTSTATE_Invisible); |
| 754 } | 754 } |
| 755 void CFWL_DateTimePickerImp::ReSetEditAlignment() { | 755 void CFWL_DateTimePickerImp::ReSetEditAlignment() { |
| 756 if (!m_pEdit) | 756 if (!m_pEdit) |
| 757 return; | 757 return; |
| 758 FX_DWORD dwStylExes = m_pProperties->m_dwStyleExes; | 758 uint32_t dwStylExes = m_pProperties->m_dwStyleExes; |
| 759 FX_DWORD dwAdd = 0; | 759 uint32_t dwAdd = 0; |
| 760 switch (dwStylExes & FWL_STYLEEXT_DTP_EditHAlignMask) { | 760 switch (dwStylExes & FWL_STYLEEXT_DTP_EditHAlignMask) { |
| 761 case FWL_STYLEEXT_DTP_EditHCenter: { | 761 case FWL_STYLEEXT_DTP_EditHCenter: { |
| 762 dwAdd |= FWL_STYLEEXT_EDT_HCenter; | 762 dwAdd |= FWL_STYLEEXT_EDT_HCenter; |
| 763 break; | 763 break; |
| 764 } | 764 } |
| 765 case FWL_STYLEEXT_DTP_EditHFar: { | 765 case FWL_STYLEEXT_DTP_EditHFar: { |
| 766 dwAdd |= FWL_STYLEEXT_EDT_HFar; | 766 dwAdd |= FWL_STYLEEXT_EDT_HFar; |
| 767 break; | 767 break; |
| 768 } | 768 } |
| 769 default: { dwAdd |= FWL_STYLEEXT_EDT_HNear; } | 769 default: { dwAdd |= FWL_STYLEEXT_EDT_HNear; } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 pDelegate->OnProcessMessage(&msg); | 894 pDelegate->OnProcessMessage(&msg); |
| 895 } | 895 } |
| 896 CFX_RectF rtInvalidate, rtCal; | 896 CFX_RectF rtInvalidate, rtCal; |
| 897 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, | 897 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, |
| 898 m_pProperties->m_rtWidget.height); | 898 m_pProperties->m_rtWidget.height); |
| 899 m_pMonthCal->GetWidgetRect(rtCal); | 899 m_pMonthCal->GetWidgetRect(rtCal); |
| 900 rtInvalidate.Union(rtCal); | 900 rtInvalidate.Union(rtCal); |
| 901 rtInvalidate.Inflate(2, 2); | 901 rtInvalidate.Inflate(2, 2); |
| 902 Repaint(&rtInvalidate); | 902 Repaint(&rtInvalidate); |
| 903 } | 903 } |
| 904 FX_DWORD CFWL_DateTimePickerImp::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 904 uint32_t CFWL_DateTimePickerImp::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 905 CFX_RectF rect; | 905 CFX_RectF rect; |
| 906 rect.Set(0, 0, m_pProperties->m_rtWidget.width, | 906 rect.Set(0, 0, m_pProperties->m_rtWidget.width, |
| 907 m_pProperties->m_rtWidget.height); | 907 m_pProperties->m_rtWidget.height); |
| 908 if (rect.Contains(fx, fy)) { | 908 if (rect.Contains(fx, fy)) { |
| 909 return FWL_WGTHITTEST_Edit; | 909 return FWL_WGTHITTEST_Edit; |
| 910 } | 910 } |
| 911 if (DisForm_IsNeedShowButton()) { | 911 if (DisForm_IsNeedShowButton()) { |
| 912 rect.width += m_fBtn; | 912 rect.width += m_fBtn; |
| 913 } | 913 } |
| 914 if (rect.Contains(fx, fy)) { | 914 if (rect.Contains(fx, fy)) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 } | 1011 } |
| 1012 return FWL_ERR_Succeeded; | 1012 return FWL_ERR_Succeeded; |
| 1013 } | 1013 } |
| 1014 CFWL_DateTimePickerImpDelegate::CFWL_DateTimePickerImpDelegate( | 1014 CFWL_DateTimePickerImpDelegate::CFWL_DateTimePickerImpDelegate( |
| 1015 CFWL_DateTimePickerImp* pOwner) | 1015 CFWL_DateTimePickerImp* pOwner) |
| 1016 : m_pOwner(pOwner) {} | 1016 : m_pOwner(pOwner) {} |
| 1017 int32_t CFWL_DateTimePickerImpDelegate::OnProcessMessage( | 1017 int32_t CFWL_DateTimePickerImpDelegate::OnProcessMessage( |
| 1018 CFWL_Message* pMessage) { | 1018 CFWL_Message* pMessage) { |
| 1019 if (!pMessage) | 1019 if (!pMessage) |
| 1020 return 0; | 1020 return 0; |
| 1021 FX_DWORD dwMsgCode = pMessage->GetClassID(); | 1021 uint32_t dwMsgCode = pMessage->GetClassID(); |
| 1022 switch (dwMsgCode) { | 1022 switch (dwMsgCode) { |
| 1023 case FWL_MSGHASH_SetFocus: | 1023 case FWL_MSGHASH_SetFocus: |
| 1024 case FWL_MSGHASH_KillFocus: { | 1024 case FWL_MSGHASH_KillFocus: { |
| 1025 OnFocusChanged(pMessage, dwMsgCode == FWL_MSGHASH_SetFocus); | 1025 OnFocusChanged(pMessage, dwMsgCode == FWL_MSGHASH_SetFocus); |
| 1026 break; | 1026 break; |
| 1027 } | 1027 } |
| 1028 case FWL_MSGHASH_Mouse: { | 1028 case FWL_MSGHASH_Mouse: { |
| 1029 CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage); | 1029 CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage); |
| 1030 FX_DWORD dwCmd = pMouse->m_dwCmd; | 1030 uint32_t dwCmd = pMouse->m_dwCmd; |
| 1031 switch (dwCmd) { | 1031 switch (dwCmd) { |
| 1032 case FWL_MSGMOUSECMD_LButtonDown: { | 1032 case FWL_MSGMOUSECMD_LButtonDown: { |
| 1033 OnLButtonDown(pMouse); | 1033 OnLButtonDown(pMouse); |
| 1034 break; | 1034 break; |
| 1035 } | 1035 } |
| 1036 case FWL_MSGMOUSECMD_LButtonUp: { | 1036 case FWL_MSGMOUSECMD_LButtonUp: { |
| 1037 OnLButtonUp(pMouse); | 1037 OnLButtonUp(pMouse); |
| 1038 break; | 1038 break; |
| 1039 } | 1039 } |
| 1040 case FWL_MSGMOUSECMD_MouseMove: { | 1040 case FWL_MSGMOUSECMD_MouseMove: { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 } | 1155 } |
| 1156 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { | 1156 if (m_pOwner->m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { |
| 1157 pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get(); | 1157 pMsg->m_pSrcTarget = m_pOwner->m_pEdit.get(); |
| 1158 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); | 1158 IFWL_WidgetDelegate* pDelegate = m_pOwner->m_pEdit->SetDelegate(NULL); |
| 1159 pDelegate->OnProcessMessage(pMsg); | 1159 pDelegate->OnProcessMessage(pMsg); |
| 1160 } | 1160 } |
| 1161 } | 1161 } |
| 1162 rtInvalidate.Inflate(2, 2); | 1162 rtInvalidate.Inflate(2, 2); |
| 1163 m_pOwner->Repaint(&rtInvalidate); | 1163 m_pOwner->Repaint(&rtInvalidate); |
| 1164 } | 1164 } |
| OLD | NEW |