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_scrollbarimp.h" | 7 #include "xfa/fwl/basewidget/fwl_scrollbarimp.h" |
8 | 8 |
9 #include "xfa/fwl/core/fwl_noteimp.h" | 9 #include "xfa/fwl/core/fwl_noteimp.h" |
10 #include "xfa/fwl/core/fwl_targetimp.h" | 10 #include "xfa/fwl/core/fwl_targetimp.h" |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 } | 599 } |
600 if (m_iMinTrackState == FWL_PARTSTATE_SCB_Pressed) { | 600 if (m_iMinTrackState == FWL_PARTSTATE_SCB_Pressed) { |
601 DoScroll(FWL_SCBCODE_PageBackward, m_fTrackPos); | 601 DoScroll(FWL_SCBCODE_PageBackward, m_fTrackPos); |
602 return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); | 602 return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); |
603 } | 603 } |
604 if (m_iMaxTrackState == FWL_PARTSTATE_SCB_Pressed) { | 604 if (m_iMaxTrackState == FWL_PARTSTATE_SCB_Pressed) { |
605 DoScroll(FWL_SCBCODE_PageForward, m_fTrackPos); | 605 DoScroll(FWL_SCBCODE_PageForward, m_fTrackPos); |
606 return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); | 606 return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); |
607 } | 607 } |
608 if (m_iMouseWheel) { | 608 if (m_iMouseWheel) { |
609 FX_WORD dwCode = | 609 uint16_t dwCode = |
610 m_iMouseWheel < 0 ? FWL_SCBCODE_StepForward : FWL_SCBCODE_StepBackward; | 610 m_iMouseWheel < 0 ? FWL_SCBCODE_StepForward : FWL_SCBCODE_StepBackward; |
611 DoScroll(dwCode, m_fTrackPos); | 611 DoScroll(dwCode, m_fTrackPos); |
612 } | 612 } |
613 return TRUE; | 613 return TRUE; |
614 } | 614 } |
615 FX_BOOL CFWL_ScrollBarImp::OnScroll(FX_DWORD dwCode, FX_FLOAT fPos) { | 615 FX_BOOL CFWL_ScrollBarImp::OnScroll(FX_DWORD dwCode, FX_FLOAT fPos) { |
616 FX_BOOL bRet = TRUE; | 616 FX_BOOL bRet = TRUE; |
617 CFWL_EvtScroll ev; | 617 CFWL_EvtScroll ev; |
618 ev.m_iScrollCode = dwCode; | 618 ev.m_iScrollCode = dwCode; |
619 ev.m_pSrcTarget = m_pInterface; | 619 ev.m_pSrcTarget = m_pInterface; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 } | 796 } |
797 void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, | 797 void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, |
798 const CFX_RectF& rtItem, | 798 const CFX_RectF& rtItem, |
799 int32_t& iState) { | 799 int32_t& iState) { |
800 if (iState == FWL_PARTSTATE_SCB_Hovered) { | 800 if (iState == FWL_PARTSTATE_SCB_Hovered) { |
801 return; | 801 return; |
802 } | 802 } |
803 iState = FWL_PARTSTATE_SCB_Hovered; | 803 iState = FWL_PARTSTATE_SCB_Hovered; |
804 m_pOwner->Repaint(&rtItem); | 804 m_pOwner->Repaint(&rtItem); |
805 } | 805 } |
OLD | NEW |