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/cfwl_notedriver.h" | 9 #include "xfa/fwl/core/cfwl_notedriver.h" |
10 #include "xfa/fwl/core/cfwl_pushbutton.h" | 10 #include "xfa/fwl/core/cfwl_pushbutton.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 m_pOldDelegate->OnProcessEvent(pEvent); | 208 m_pOldDelegate->OnProcessEvent(pEvent); |
209 CXFA_FFField::OnProcessEvent(pEvent); | 209 CXFA_FFField::OnProcessEvent(pEvent); |
210 } | 210 } |
211 | 211 |
212 void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, | 212 void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics, |
213 const CFX_Matrix* pMatrix) { | 213 const CFX_Matrix* pMatrix) { |
214 if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) { | 214 if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) { |
215 if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && | 215 if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && |
216 (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { | 216 (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { |
217 CFX_RectF rtFill; | 217 CFX_RectF rtFill; |
218 m_pNormalWidget->GetWidgetRect(rtFill); | 218 m_pNormalWidget->GetWidgetRect(rtFill, false); |
219 rtFill.left = rtFill.top = 0; | 219 rtFill.left = rtFill.top = 0; |
220 FX_FLOAT fLineWith = GetLineWidth(); | 220 FX_FLOAT fLineWith = GetLineWidth(); |
221 rtFill.Deflate(fLineWith, fLineWith); | 221 rtFill.Deflate(fLineWith, fLineWith); |
222 CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255)); | 222 CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255)); |
223 pGraphics->SetFillColor(&cr); | 223 pGraphics->SetFillColor(&cr); |
224 CFX_Path path; | 224 CFX_Path path; |
225 path.Create(); | 225 path.Create(); |
226 path.AddRectangle(rtFill.left, rtFill.top, rtFill.width, rtFill.height); | 226 path.AddRectangle(rtFill.left, rtFill.top, rtFill.width, rtFill.height); |
227 pGraphics->FillPath(&path, FXFILL_WINDING, (CFX_Matrix*)pMatrix); | 227 pGraphics->FillPath(&path, FXFILL_WINDING, (CFX_Matrix*)pMatrix); |
228 } | 228 } |
229 } else if (m_pNormalWidget->GetStylesEx() & | 229 } else if (m_pNormalWidget->GetStylesEx() & |
230 XFA_FWL_PSBSTYLEEXT_HiliteOutLine) { | 230 XFA_FWL_PSBSTYLEEXT_HiliteOutLine) { |
231 if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && | 231 if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && |
232 (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { | 232 (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { |
233 FX_FLOAT fLineWidth = GetLineWidth(); | 233 FX_FLOAT fLineWidth = GetLineWidth(); |
234 CFX_Color cr(FXARGB_MAKE(255, 128, 255, 255)); | 234 CFX_Color cr(FXARGB_MAKE(255, 128, 255, 255)); |
235 pGraphics->SetStrokeColor(&cr); | 235 pGraphics->SetStrokeColor(&cr); |
236 pGraphics->SetLineWidth(fLineWidth); | 236 pGraphics->SetLineWidth(fLineWidth); |
237 CFX_Path path; | 237 CFX_Path path; |
238 path.Create(); | 238 path.Create(); |
239 CFX_RectF rect; | 239 CFX_RectF rect; |
240 m_pNormalWidget->GetWidgetRect(rect); | 240 m_pNormalWidget->GetWidgetRect(rect, false); |
241 path.AddRectangle(0, 0, rect.width, rect.height); | 241 path.AddRectangle(0, 0, rect.width, rect.height); |
242 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); | 242 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); |
243 } | 243 } |
244 } | 244 } |
245 } | 245 } |
OLD | NEW |