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_listboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_listboximp.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" | 10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 if (m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_RTLReading) { | 136 if (m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_RTLReading) { |
137 m_dwTTOStyles |= FDE_TTOSTYLE_RTL; | 137 m_dwTTOStyles |= FDE_TTOSTYLE_RTL; |
138 } | 138 } |
139 m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; | 139 m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; |
140 m_fScorllBarWidth = GetScrollWidth(); | 140 m_fScorllBarWidth = GetScrollWidth(); |
141 SortItem(); | 141 SortItem(); |
142 CalcSize(); | 142 CalcSize(); |
143 return FWL_ERR_Succeeded; | 143 return FWL_ERR_Succeeded; |
144 } | 144 } |
145 uint32_t CFWL_ListBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 145 FWL_WidgetHit CFWL_ListBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
146 if (IsShowScrollBar(FALSE)) { | 146 if (IsShowScrollBar(FALSE)) { |
147 CFX_RectF rect; | 147 CFX_RectF rect; |
148 m_pHorzScrollBar->GetWidgetRect(rect); | 148 m_pHorzScrollBar->GetWidgetRect(rect); |
149 if (rect.Contains(fx, fy)) { | 149 if (rect.Contains(fx, fy)) |
150 return FWL_WGTHITTEST_HScrollBar; | 150 return FWL_WidgetHit::HScrollBar; |
151 } | |
152 } | 151 } |
153 if (IsShowScrollBar(TRUE)) { | 152 if (IsShowScrollBar(TRUE)) { |
154 CFX_RectF rect; | 153 CFX_RectF rect; |
155 m_pVertScrollBar->GetWidgetRect(rect); | 154 m_pVertScrollBar->GetWidgetRect(rect); |
156 if (rect.Contains(fx, fy)) { | 155 if (rect.Contains(fx, fy)) |
157 return FWL_WGTHITTEST_VScrollBar; | 156 return FWL_WidgetHit::VScrollBar; |
158 } | |
159 } | 157 } |
160 if (m_rtClient.Contains(fx, fy)) { | 158 if (m_rtClient.Contains(fx, fy)) |
161 return FWL_WGTHITTEST_Client; | 159 return FWL_WidgetHit::Client; |
162 } | 160 return FWL_WidgetHit::Unknown; |
163 return FWL_WGTHITTEST_Unknown; | |
164 } | 161 } |
165 FWL_ERR CFWL_ListBoxImp::DrawWidget(CFX_Graphics* pGraphics, | 162 FWL_ERR CFWL_ListBoxImp::DrawWidget(CFX_Graphics* pGraphics, |
166 const CFX_Matrix* pMatrix) { | 163 const CFX_Matrix* pMatrix) { |
167 if (!pGraphics) | 164 if (!pGraphics) |
168 return FWL_ERR_Indefinite; | 165 return FWL_ERR_Indefinite; |
169 if (!m_pProperties->m_pThemeProvider) | 166 if (!m_pProperties->m_pThemeProvider) |
170 return FWL_ERR_Indefinite; | 167 return FWL_ERR_Indefinite; |
171 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; | 168 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; |
172 pGraphics->SaveGraphState(); | 169 pGraphics->SaveGraphState(); |
173 if (HasBorder()) { | 170 if (HasBorder()) { |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 pScrollBar->SetTrackPos(fPos); | 1242 pScrollBar->SetTrackPos(fPos); |
1246 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1243 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
1247 } | 1244 } |
1248 return TRUE; | 1245 return TRUE; |
1249 } | 1246 } |
1250 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { | 1247 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { |
1251 CFWL_EvtLtbSelChanged ev; | 1248 CFWL_EvtLtbSelChanged ev; |
1252 ev.m_pSrcTarget = m_pOwner->m_pInterface; | 1249 ev.m_pSrcTarget = m_pOwner->m_pInterface; |
1253 m_pOwner->DispatchEvent(&ev); | 1250 m_pOwner->DispatchEvent(&ev); |
1254 } | 1251 } |
OLD | NEW |