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/basewidget/ifwl_scrollbar.h" | 9 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" |
10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 m_bMinSize(FALSE), | 91 m_bMinSize(FALSE), |
92 m_bCustomLayout(FALSE), | 92 m_bCustomLayout(FALSE), |
93 m_fMinThumb(FWL_SCROLLBAR_MinThumb) { | 93 m_fMinThumb(FWL_SCROLLBAR_MinThumb) { |
94 m_rtClient.Reset(); | 94 m_rtClient.Reset(); |
95 m_rtThumb.Reset(); | 95 m_rtThumb.Reset(); |
96 m_rtMinBtn.Reset(); | 96 m_rtMinBtn.Reset(); |
97 m_rtMaxBtn.Reset(); | 97 m_rtMaxBtn.Reset(); |
98 m_rtMinTrack.Reset(); | 98 m_rtMinTrack.Reset(); |
99 m_rtMaxTrack.Reset(); | 99 m_rtMaxTrack.Reset(); |
100 } | 100 } |
| 101 |
101 CFWL_ScrollBarImp::~CFWL_ScrollBarImp() {} | 102 CFWL_ScrollBarImp::~CFWL_ScrollBarImp() {} |
| 103 |
102 FWL_Error CFWL_ScrollBarImp::GetClassName(CFX_WideString& wsClass) const { | 104 FWL_Error CFWL_ScrollBarImp::GetClassName(CFX_WideString& wsClass) const { |
103 wsClass = FWL_CLASS_ScrollBar; | 105 wsClass = FWL_CLASS_ScrollBar; |
104 return FWL_Error::Succeeded; | 106 return FWL_Error::Succeeded; |
105 } | 107 } |
106 uint32_t CFWL_ScrollBarImp::GetClassID() const { | 108 |
107 return FWL_CLASSHASH_ScrollBar; | 109 FWL_Type CFWL_ScrollBarImp::GetClassID() const { |
| 110 return FWL_Type::ScrollBar; |
108 } | 111 } |
| 112 |
109 FWL_Error CFWL_ScrollBarImp::Initialize() { | 113 FWL_Error CFWL_ScrollBarImp::Initialize() { |
110 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 114 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
111 return FWL_Error::Indefinite; | 115 return FWL_Error::Indefinite; |
| 116 |
112 m_pDelegate = new CFWL_ScrollBarImpDelegate(this); | 117 m_pDelegate = new CFWL_ScrollBarImpDelegate(this); |
113 return FWL_Error::Succeeded; | 118 return FWL_Error::Succeeded; |
114 } | 119 } |
| 120 |
115 FWL_Error CFWL_ScrollBarImp::Finalize() { | 121 FWL_Error CFWL_ScrollBarImp::Finalize() { |
116 delete m_pDelegate; | 122 delete m_pDelegate; |
117 m_pDelegate = nullptr; | 123 m_pDelegate = nullptr; |
118 return CFWL_WidgetImp::Finalize(); | 124 return CFWL_WidgetImp::Finalize(); |
119 } | 125 } |
120 FWL_Error CFWL_ScrollBarImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 126 FWL_Error CFWL_ScrollBarImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
121 if (bAutoSize) { | 127 if (bAutoSize) { |
122 rect.Set(0, 0, 0, 0); | 128 rect.Set(0, 0, 0, 0); |
123 FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>( | 129 FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>( |
124 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); | 130 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 } | 806 } |
801 void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, | 807 void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, |
802 const CFX_RectF& rtItem, | 808 const CFX_RectF& rtItem, |
803 int32_t& iState) { | 809 int32_t& iState) { |
804 if (iState == CFWL_PartState_Hovered) { | 810 if (iState == CFWL_PartState_Hovered) { |
805 return; | 811 return; |
806 } | 812 } |
807 iState = CFWL_PartState_Hovered; | 813 iState = CFWL_PartState_Hovered; |
808 m_pOwner->Repaint(&rtItem); | 814 m_pOwner->Repaint(&rtItem); |
809 } | 815 } |
OLD | NEW |