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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 365 } |
366 void CFWL_CheckBoxImp::NextStates() { | 366 void CFWL_CheckBoxImp::NextStates() { |
367 uint32_t dwFirststate = m_pProperties->m_dwStates; | 367 uint32_t dwFirststate = m_pProperties->m_dwStates; |
368 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { | 368 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { |
369 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == | 369 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == |
370 FWL_STATE_CKB_Unchecked) { | 370 FWL_STATE_CKB_Unchecked) { |
371 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); | 371 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); |
372 if (!pWidgetMgr->IsFormDisabled()) { | 372 if (!pWidgetMgr->IsFormDisabled()) { |
373 CFX_ArrayTemplate<IFWL_Widget*> radioarr; | 373 CFX_ArrayTemplate<IFWL_Widget*> radioarr; |
374 pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); | 374 pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); |
375 IFWL_CheckBox* pCheckBox = NULL; | 375 IFWL_CheckBox* pCheckBox = nullptr; |
376 int32_t iCount = radioarr.GetSize(); | 376 int32_t iCount = radioarr.GetSize(); |
377 for (int32_t i = 0; i < iCount; i++) { | 377 for (int32_t i = 0; i < iCount; i++) { |
378 pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); | 378 pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); |
379 if (pCheckBox != m_pInterface && | 379 if (pCheckBox != m_pInterface && |
380 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { | 380 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { |
381 pCheckBox->SetCheckState(0); | 381 pCheckBox->SetCheckState(0); |
382 CFX_RectF rt; | 382 CFX_RectF rt; |
383 pCheckBox->GetWidgetRect(rt); | 383 pCheckBox->GetWidgetRect(rt); |
384 rt.left = rt.top = 0; | 384 rt.left = rt.top = 0; |
385 m_pWidgetMgr->RepaintWidget(pCheckBox, &rt); | 385 m_pWidgetMgr->RepaintWidget(pCheckBox, &rt); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { | 563 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { |
564 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { | 564 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { |
565 m_pOwner->DispatchKeyEvent(pMsg); | 565 m_pOwner->DispatchKeyEvent(pMsg); |
566 return; | 566 return; |
567 } | 567 } |
568 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 568 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
569 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 569 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
570 m_pOwner->NextStates(); | 570 m_pOwner->NextStates(); |
571 } | 571 } |
572 } | 572 } |
OLD | NEW |