| 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/core/cfwl_checkbox.h" | 7 #include "xfa/fwl/core/cfwl_checkbox.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 CFX_ArrayTemplate<CFWL_Widget*> radioarr; | 302 CFX_ArrayTemplate<CFWL_Widget*> radioarr; |
| 303 pWidgetMgr->GetSameGroupRadioButton(this, radioarr); | 303 pWidgetMgr->GetSameGroupRadioButton(this, radioarr); |
| 304 CFWL_CheckBox* pCheckBox = nullptr; | 304 CFWL_CheckBox* pCheckBox = nullptr; |
| 305 int32_t iCount = radioarr.GetSize(); | 305 int32_t iCount = radioarr.GetSize(); |
| 306 for (int32_t i = 0; i < iCount; i++) { | 306 for (int32_t i = 0; i < iCount; i++) { |
| 307 pCheckBox = static_cast<CFWL_CheckBox*>(radioarr[i]); | 307 pCheckBox = static_cast<CFWL_CheckBox*>(radioarr[i]); |
| 308 if (pCheckBox != this && | 308 if (pCheckBox != this && |
| 309 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { | 309 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { |
| 310 pCheckBox->SetCheckState(0); | 310 pCheckBox->SetCheckState(0); |
| 311 CFX_RectF rt; | 311 CFX_RectF rt; |
| 312 pCheckBox->GetWidgetRect(rt); | 312 pCheckBox->GetWidgetRect(rt, false); |
| 313 rt.left = rt.top = 0; | 313 rt.left = rt.top = 0; |
| 314 m_pWidgetMgr->RepaintWidget(pCheckBox, &rt); | 314 m_pWidgetMgr->RepaintWidget(pCheckBox, &rt); |
| 315 break; | 315 break; |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 m_pProperties->m_dwStates |= FWL_STATE_CKB_Checked; | 319 m_pProperties->m_dwStates |= FWL_STATE_CKB_Checked; |
| 320 } | 320 } |
| 321 } else { | 321 } else { |
| 322 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == | 322 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } | 474 } |
| 475 | 475 |
| 476 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { | 476 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { |
| 477 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) | 477 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) |
| 478 return; | 478 return; |
| 479 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 479 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
| 480 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 480 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
| 481 NextStates(); | 481 NextStates(); |
| 482 } | 482 } |
| 483 } | 483 } |
| OLD | NEW |