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/core/ifwl_datetimepicker.h" | 7 #include "xfa/fwl/core/ifwl_datetimepicker.h" |
8 | 8 |
9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
10 #include "xfa/fwl/core/cfwl_msgmouse.h" | 10 #include "xfa/fwl/core/cfwl_msgmouse.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 void IFWL_DateTimePicker::OnLButtonDown(CFWL_MsgMouse* pMsg) { | 601 void IFWL_DateTimePicker::OnLButtonDown(CFWL_MsgMouse* pMsg) { |
602 if (!pMsg) | 602 if (!pMsg) |
603 return; | 603 return; |
604 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) | 604 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) |
605 SetFocus(true); | 605 SetFocus(true); |
606 if (!m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) | 606 if (!m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) |
607 return; | 607 return; |
608 | 608 |
609 if (IsMonthCalendarVisible()) { | 609 if (IsMonthCalendarVisible()) { |
610 ShowMonthCalendar(false); | 610 ShowMonthCalendar(false); |
611 CFWL_Event_DtpCloseUp ev; | |
612 DispatchEvent(&ev); | |
613 return; | 611 return; |
614 } | 612 } |
| 613 if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_TimeFormat)) |
| 614 ShowMonthCalendar(true); |
615 | 615 |
616 if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_TimeFormat)) { | |
617 ShowMonthCalendar(true); | |
618 CFWL_Event_DtpDropDown ev; | |
619 DispatchEvent(&ev); | |
620 } | |
621 m_bLBtnDown = true; | 616 m_bLBtnDown = true; |
622 Repaint(&m_rtClient); | 617 Repaint(&m_rtClient); |
623 } | 618 } |
624 | 619 |
625 void IFWL_DateTimePicker::OnLButtonUp(CFWL_MsgMouse* pMsg) { | 620 void IFWL_DateTimePicker::OnLButtonUp(CFWL_MsgMouse* pMsg) { |
626 if (!pMsg) | 621 if (!pMsg) |
627 return; | 622 return; |
628 | 623 |
629 m_bLBtnDown = false; | 624 m_bLBtnDown = false; |
630 if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) | 625 if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 return m_iCurDay; | 675 return m_iCurDay; |
681 } | 676 } |
682 | 677 |
683 int32_t IFWL_DateTimePicker::GetCurMonth(IFWL_Widget* pWidget) { | 678 int32_t IFWL_DateTimePicker::GetCurMonth(IFWL_Widget* pWidget) { |
684 return m_iCurMonth; | 679 return m_iCurMonth; |
685 } | 680 } |
686 | 681 |
687 int32_t IFWL_DateTimePicker::GetCurYear(IFWL_Widget* pWidget) { | 682 int32_t IFWL_DateTimePicker::GetCurYear(IFWL_Widget* pWidget) { |
688 return m_iCurYear; | 683 return m_iCurYear; |
689 } | 684 } |
OLD | NEW |