| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 m_dwTTOStyles |= FDE_TTOSTYLE_LineWrap; | 361 m_dwTTOStyles |= FDE_TTOSTYLE_LineWrap; |
| 362 } else { | 362 } else { |
| 363 m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; | 363 m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; |
| 364 } | 364 } |
| 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 = | 371 CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); |
| 372 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); | |
| 373 if (!pWidgetMgr->IsFormDisabled()) { | 372 if (!pWidgetMgr->IsFormDisabled()) { |
| 374 CFX_ArrayTemplate<IFWL_Widget*> radioarr; | 373 CFX_ArrayTemplate<IFWL_Widget*> radioarr; |
| 375 pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); | 374 pWidgetMgr->GetSameGroupRadioButton(m_pInterface, radioarr); |
| 376 IFWL_CheckBox* pCheckBox = NULL; | 375 IFWL_CheckBox* pCheckBox = NULL; |
| 377 int32_t iCount = radioarr.GetSize(); | 376 int32_t iCount = radioarr.GetSize(); |
| 378 for (int32_t i = 0; i < iCount; i++) { | 377 for (int32_t i = 0; i < iCount; i++) { |
| 379 pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); | 378 pCheckBox = static_cast<IFWL_CheckBox*>(radioarr[i]); |
| 380 if (pCheckBox != m_pInterface && | 379 if (pCheckBox != m_pInterface && |
| 381 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { | 380 pCheckBox->GetStates() & FWL_STATE_CKB_Checked) { |
| 382 pCheckBox->SetCheckState(0); | 381 pCheckBox->SetCheckState(0); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { | 563 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { |
| 565 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { | 564 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { |
| 566 m_pOwner->DispatchKeyEvent(pMsg); | 565 m_pOwner->DispatchKeyEvent(pMsg); |
| 567 return; | 566 return; |
| 568 } | 567 } |
| 569 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 568 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
| 570 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 569 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
| 571 m_pOwner->NextStates(); | 570 m_pOwner->NextStates(); |
| 572 } | 571 } |
| 573 } | 572 } |
| OLD | NEW |