| 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_checkboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_checkboximp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 void CFWL_CheckBoxImp::NextStates() { | 356 void CFWL_CheckBoxImp::NextStates() { |
| 357 uint32_t dwFirststate = m_pProperties->m_dwStates; | 357 uint32_t dwFirststate = m_pProperties->m_dwStates; |
| 358 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { | 358 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { |
| 359 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == | 359 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == |
| 360 FWL_STATE_CKB_Unchecked) { | 360 FWL_STATE_CKB_Unchecked) { |
| 361 CFWL_WidgetMgr* pWidgetMgr = | 361 CFWL_WidgetMgr* pWidgetMgr = |
| 362 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); | 362 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| 363 if (!pWidgetMgr->IsFormDisabled()) { | 363 if (!pWidgetMgr->IsFormDisabled()) { |
| 364 CFX_PtrArray radioarr; | 364 CFX_ArrayTemplate<IFWL_Widget*> radioarr; |
| 365 pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); | 365 pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); |
| 366 IFWL_CheckBox* pCheckBox = NULL; | 366 IFWL_CheckBox* pCheckBox = NULL; |
| 367 int32_t iCount = radioarr.GetSize(); | 367 int32_t iCount = radioarr.GetSize(); |
| 368 for (int32_t i = 0; i < iCount; i++) { | 368 for (int32_t i = 0; i < iCount; i++) { |
| 369 pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); | 369 pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); |
| 370 if (pCheckBox != m_pInterface && | 370 if (pCheckBox != m_pInterface && |
| 371 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { | 371 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { |
| 372 pCheckBox->SetCheckState(0); | 372 pCheckBox->SetCheckState(0); |
| 373 CFX_RectF rt; | 373 CFX_RectF rt; |
| 374 pCheckBox->GetWidgetRect(rt); | 374 pCheckBox->GetWidgetRect(rt); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { | 556 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { |
| 557 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { | 557 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { |
| 558 m_pOwner->DispatchKeyEvent(pMsg); | 558 m_pOwner->DispatchKeyEvent(pMsg); |
| 559 return; | 559 return; |
| 560 } | 560 } |
| 561 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 561 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
| 562 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 562 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
| 563 m_pOwner->NextStates(); | 563 m_pOwner->NextStates(); |
| 564 } | 564 } |
| 565 } | 565 } |
| OLD | NEW |