| 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_pushbuttonimp.h" | 7 #include "xfa/fwl/basewidget/fwl_pushbuttonimp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" | 10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 FX_FLOAT* fcaption = | 77 FX_FLOAT* fcaption = |
| 78 static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin)); | 78 static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin)); |
| 79 rect.Inflate(*fcaption, *fcaption); | 79 rect.Inflate(*fcaption, *fcaption); |
| 80 CFWL_WidgetImp::GetWidgetRect(rect, TRUE); | 80 CFWL_WidgetImp::GetWidgetRect(rect, TRUE); |
| 81 } else { | 81 } else { |
| 82 rect = m_pProperties->m_rtWidget; | 82 rect = m_pProperties->m_rtWidget; |
| 83 } | 83 } |
| 84 return FWL_ERR_Succeeded; | 84 return FWL_ERR_Succeeded; |
| 85 } | 85 } |
| 86 FWL_ERR CFWL_PushButtonImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { | 86 |
| 87 void CFWL_PushButtonImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
| 87 if ((dwStates & FWL_WGTSTATE_Disabled) && bSet) { | 88 if ((dwStates & FWL_WGTSTATE_Disabled) && bSet) { |
| 88 m_pProperties->m_dwStates = FWL_WGTSTATE_Disabled; | 89 m_pProperties->m_dwStates = FWL_WGTSTATE_Disabled; |
| 89 return FWL_ERR_Succeeded; | 90 return; |
| 90 } | 91 } |
| 91 return CFWL_WidgetImp::SetStates(dwStates, bSet); | 92 CFWL_WidgetImp::SetStates(dwStates, bSet); |
| 92 } | 93 } |
| 94 |
| 93 FWL_ERR CFWL_PushButtonImp::Update() { | 95 FWL_ERR CFWL_PushButtonImp::Update() { |
| 94 if (IsLocked()) { | 96 if (IsLocked()) { |
| 95 return FWL_ERR_Indefinite; | 97 return FWL_ERR_Indefinite; |
| 96 } | 98 } |
| 97 if (!m_pProperties->m_pThemeProvider) { | 99 if (!m_pProperties->m_pThemeProvider) { |
| 98 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 100 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 99 } | 101 } |
| 100 UpdateTextOutStyles(); | 102 UpdateTextOutStyles(); |
| 101 GetClientRect(m_rtClient); | 103 GetClientRect(m_rtClient); |
| 102 m_rtCaption = m_rtClient; | 104 m_rtCaption = m_rtClient; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 CFWL_EvtClick wmClick; | 551 CFWL_EvtClick wmClick; |
| 550 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; | 552 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; |
| 551 m_pOwner->DispatchEvent(&wmClick); | 553 m_pOwner->DispatchEvent(&wmClick); |
| 552 return; | 554 return; |
| 553 } | 555 } |
| 554 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { | 556 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { |
| 555 return; | 557 return; |
| 556 } | 558 } |
| 557 m_pOwner->DispatchKeyEvent(pMsg); | 559 m_pOwner->DispatchKeyEvent(pMsg); |
| 558 } | 560 } |
| OLD | NEW |