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 #ifndef XFA_FWL_CORE_CFWL_SCROLLBAR_H_ | 7 #ifndef XFA_FWL_CFWL_SCROLLBAR_H_ |
8 #define XFA_FWL_CORE_CFWL_SCROLLBAR_H_ | 8 #define XFA_FWL_CFWL_SCROLLBAR_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxcrt/fx_system.h" | 12 #include "core/fxcrt/fx_system.h" |
13 #include "xfa/fwl/core/cfwl_evtscroll.h" | 13 #include "xfa/fwl/cfwl_eventscroll.h" |
14 #include "xfa/fwl/core/cfwl_timer.h" | 14 #include "xfa/fwl/cfwl_timer.h" |
15 #include "xfa/fwl/core/cfwl_widget.h" | 15 #include "xfa/fwl/cfwl_widget.h" |
16 #include "xfa/fwl/core/cfwl_widgetproperties.h" | 16 #include "xfa/fwl/cfwl_widgetproperties.h" |
17 | 17 |
18 class CFWL_Widget; | 18 class CFWL_Widget; |
19 | 19 |
20 #define FWL_STYLEEXT_SCB_Horz (0L << 0) | 20 #define FWL_STYLEEXT_SCB_Horz (0L << 0) |
21 #define FWL_STYLEEXT_SCB_Vert (1L << 0) | 21 #define FWL_STYLEEXT_SCB_Vert (1L << 0) |
22 | 22 |
23 class CFWL_ScrollBar : public CFWL_Widget { | 23 class CFWL_ScrollBar : public CFWL_Widget { |
24 public: | 24 public: |
25 CFWL_ScrollBar(const CFWL_App* app, | 25 CFWL_ScrollBar(const CFWL_App* app, |
26 std::unique_ptr<CFWL_WidgetProperties> properties, | 26 std::unique_ptr<CFWL_WidgetProperties> properties, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void Layout(); | 80 void Layout(); |
81 void CalcButtonLen(); | 81 void CalcButtonLen(); |
82 void CalcMinButtonRect(CFX_RectF& rect); | 82 void CalcMinButtonRect(CFX_RectF& rect); |
83 void CalcMaxButtonRect(CFX_RectF& rect); | 83 void CalcMaxButtonRect(CFX_RectF& rect); |
84 void CalcThumbButtonRect(CFX_RectF& rect); | 84 void CalcThumbButtonRect(CFX_RectF& rect); |
85 void CalcMinTrackRect(CFX_RectF& rect); | 85 void CalcMinTrackRect(CFX_RectF& rect); |
86 void CalcMaxTrackRect(CFX_RectF& rect); | 86 void CalcMaxTrackRect(CFX_RectF& rect); |
87 FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy); | 87 FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy); |
88 | 88 |
89 bool SendEvent(); | 89 bool SendEvent(); |
90 bool OnScroll(CFWL_EvtScroll::Code dwCode, FX_FLOAT fPos); | 90 bool OnScroll(CFWL_EventScroll::Code dwCode, FX_FLOAT fPos); |
91 void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 91 void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
92 void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 92 void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
93 void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 93 void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
94 void OnMouseLeave(); | 94 void OnMouseLeave(); |
95 void OnMouseWheel(FX_FLOAT fx, | 95 void OnMouseWheel(FX_FLOAT fx, |
96 FX_FLOAT fy, | 96 FX_FLOAT fy, |
97 uint32_t dwFlags, | 97 uint32_t dwFlags, |
98 FX_FLOAT fDeltaX, | 98 FX_FLOAT fDeltaX, |
99 FX_FLOAT fDeltaY); | 99 FX_FLOAT fDeltaY); |
100 bool DoScroll(CFWL_EvtScroll::Code dwCode, FX_FLOAT fPos); | 100 bool DoScroll(CFWL_EventScroll::Code dwCode, FX_FLOAT fPos); |
101 void DoMouseDown(int32_t iItem, | 101 void DoMouseDown(int32_t iItem, |
102 const CFX_RectF& rtItem, | 102 const CFX_RectF& rtItem, |
103 int32_t& iState, | 103 int32_t& iState, |
104 FX_FLOAT fx, | 104 FX_FLOAT fx, |
105 FX_FLOAT fy); | 105 FX_FLOAT fy); |
106 void DoMouseUp(int32_t iItem, | 106 void DoMouseUp(int32_t iItem, |
107 const CFX_RectF& rtItem, | 107 const CFX_RectF& rtItem, |
108 int32_t& iState, | 108 int32_t& iState, |
109 FX_FLOAT fx, | 109 FX_FLOAT fx, |
110 FX_FLOAT fy); | 110 FX_FLOAT fy); |
(...skipping 27 matching lines...) Expand all Loading... |
138 CFX_RectF m_rtClient; | 138 CFX_RectF m_rtClient; |
139 CFX_RectF m_rtThumb; | 139 CFX_RectF m_rtThumb; |
140 CFX_RectF m_rtMinBtn; | 140 CFX_RectF m_rtMinBtn; |
141 CFX_RectF m_rtMaxBtn; | 141 CFX_RectF m_rtMaxBtn; |
142 CFX_RectF m_rtMinTrack; | 142 CFX_RectF m_rtMinTrack; |
143 CFX_RectF m_rtMaxTrack; | 143 CFX_RectF m_rtMaxTrack; |
144 FX_FLOAT m_fMinThumb; | 144 FX_FLOAT m_fMinThumb; |
145 CFWL_ScrollBar::Timer m_Timer; | 145 CFWL_ScrollBar::Timer m_Timer; |
146 }; | 146 }; |
147 | 147 |
148 #endif // XFA_FWL_CORE_CFWL_SCROLLBAR_H_ | 148 #endif // XFA_FWL_CFWL_SCROLLBAR_H_ |
OLD | NEW |