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/fxfa/app/xfa_ffpushbutton.h" | 7 #include "xfa/fxfa/app/xfa_ffpushbutton.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_widgetmgrimp.h" | 10 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 } | 198 } |
199 if (pCapTextLayout) { | 199 if (pCapTextLayout) { |
200 pCapTextLayout->DrawString(pRenderDevice, mt, rtClip); | 200 pCapTextLayout->DrawString(pRenderDevice, mt, rtClip); |
201 } | 201 } |
202 } | 202 } |
203 } | 203 } |
204 int32_t CXFA_FFPushButton::OnProcessMessage(CFWL_Message* pMessage) { | 204 int32_t CXFA_FFPushButton::OnProcessMessage(CFWL_Message* pMessage) { |
205 return m_pOldDelegate->OnProcessMessage(pMessage); | 205 return m_pOldDelegate->OnProcessMessage(pMessage); |
206 } | 206 } |
207 FWL_ERR CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) { | 207 FWL_Error CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) { |
208 m_pOldDelegate->OnProcessEvent(pEvent); | 208 m_pOldDelegate->OnProcessEvent(pEvent); |
209 return CXFA_FFField::OnProcessEvent(pEvent); | 209 return CXFA_FFField::OnProcessEvent(pEvent); |
210 } | 210 } |
211 FWL_ERR CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, | 211 FWL_Error CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, |
212 const CFX_Matrix* pMatrix) { | 212 const CFX_Matrix* pMatrix) { |
213 if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) { | 213 if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) { |
214 if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && | 214 if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && |
215 (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { | 215 (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { |
216 CFX_RectF rtFill; | 216 CFX_RectF rtFill; |
217 m_pNormalWidget->GetWidgetRect(rtFill); | 217 m_pNormalWidget->GetWidgetRect(rtFill); |
218 rtFill.left = rtFill.top = 0; | 218 rtFill.left = rtFill.top = 0; |
219 FX_FLOAT fLineWith = GetLineWidth(); | 219 FX_FLOAT fLineWith = GetLineWidth(); |
220 rtFill.Deflate(fLineWith, fLineWith); | 220 rtFill.Deflate(fLineWith, fLineWith); |
221 CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255)); | 221 CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255)); |
222 pGraphics->SetFillColor(&cr); | 222 pGraphics->SetFillColor(&cr); |
(...skipping 12 matching lines...) Expand all Loading... |
235 pGraphics->SetLineWidth(fLineWidth); | 235 pGraphics->SetLineWidth(fLineWidth); |
236 CFX_Path path; | 236 CFX_Path path; |
237 path.Create(); | 237 path.Create(); |
238 CFX_RectF rect; | 238 CFX_RectF rect; |
239 m_pNormalWidget->GetWidgetRect(rect); | 239 m_pNormalWidget->GetWidgetRect(rect); |
240 path.AddRectangle(0, 0, rect.width, rect.height); | 240 path.AddRectangle(0, 0, rect.width, rect.height); |
241 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); | 241 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); |
242 } | 242 } |
243 } else if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HilitePush) { | 243 } else if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HilitePush) { |
244 } | 244 } |
245 return FWL_ERR_Succeeded; | 245 return FWL_Error::Succeeded; |
246 } | 246 } |
OLD | NEW |