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_scrollbar.h" | 7 #include "xfa/fwl/core/ifwl_scrollbar.h" |
8 | 8 |
9 #include "xfa/fwl/core/cfwl_message.h" | 9 #include "xfa/fwl/core/cfwl_message.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
11 #include "xfa/fwl/core/cfwl_themepart.h" | 11 #include "xfa/fwl/core/cfwl_themepart.h" |
12 #include "xfa/fwl/core/fwl_noteimp.h" | 12 #include "xfa/fwl/core/fwl_noteimp.h" |
13 #include "xfa/fwl/core/ifwl_scrollbar.h" | 13 #include "xfa/fwl/core/ifwl_scrollbar.h" |
14 #include "xfa/fwl/core/ifwl_themeprovider.h" | 14 #include "xfa/fwl/core/ifwl_themeprovider.h" |
15 | 15 |
16 #define FWL_SCROLLBAR_Elapse 500 | 16 #define FWL_SCROLLBAR_Elapse 500 |
17 #define FWL_SCROLLBAR_MinThumb 5 | 17 #define FWL_SCROLLBAR_MinThumb 5 |
18 | 18 |
19 // static | |
20 IFWL_ScrollBar* IFWL_ScrollBar::Create( | |
21 const CFWL_WidgetImpProperties& properties, | |
22 IFWL_Widget* pOuter) { | |
23 return new IFWL_ScrollBar(properties, pOuter); | |
24 } | |
25 | |
26 IFWL_ScrollBar::IFWL_ScrollBar(const CFWL_WidgetImpProperties& properties, | 19 IFWL_ScrollBar::IFWL_ScrollBar(const CFWL_WidgetImpProperties& properties, |
27 IFWL_Widget* pOuter) | 20 IFWL_Widget* pOuter) |
28 : IFWL_Widget(properties, pOuter), | 21 : IFWL_Widget(properties, pOuter), |
29 m_pTimerInfo(nullptr), | 22 m_pTimerInfo(nullptr), |
30 m_fRangeMin(0), | 23 m_fRangeMin(0), |
31 m_fRangeMax(-1), | 24 m_fRangeMax(-1), |
32 m_fPageSize(0), | 25 m_fPageSize(0), |
33 m_fStepSize(0), | 26 m_fStepSize(0), |
34 m_fPos(0), | 27 m_fPos(0), |
35 m_fTrackPos(0), | 28 m_fTrackPos(0), |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 | 772 |
780 void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, | 773 void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, |
781 const CFX_RectF& rtItem, | 774 const CFX_RectF& rtItem, |
782 int32_t& iState) { | 775 int32_t& iState) { |
783 if (iState == CFWL_PartState_Hovered) { | 776 if (iState == CFWL_PartState_Hovered) { |
784 return; | 777 return; |
785 } | 778 } |
786 iState = CFWL_PartState_Hovered; | 779 iState = CFWL_PartState_Hovered; |
787 m_pOwner->Repaint(&rtItem); | 780 m_pOwner->Repaint(&rtItem); |
788 } | 781 } |
OLD | NEW |