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/fxfa/app/xfa_ffcheckbutton.h" | 7 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" |
8 | 8 |
9 #include "xfa/fwl/core/cfwl_checkbox.h" | 9 #include "xfa/fwl/core/cfwl_checkbox.h" |
10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 FX_BOOL CXFA_FFCheckButton::LoadWidget() { | 29 FX_BOOL CXFA_FFCheckButton::LoadWidget() { |
30 CFWL_CheckBox* pCheckBox = new CFWL_CheckBox(GetFWLApp()); | 30 CFWL_CheckBox* pCheckBox = new CFWL_CheckBox(GetFWLApp()); |
31 pCheckBox->Initialize(); | 31 pCheckBox->Initialize(); |
32 m_pNormalWidget = pCheckBox; | 32 m_pNormalWidget = pCheckBox; |
33 m_pNormalWidget->SetLayoutItem(this); | 33 m_pNormalWidget->SetLayoutItem(this); |
34 | 34 |
35 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 35 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); |
36 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); | 36 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); |
37 pNoteDriver->RegisterEventTarget(pWidget, pWidget); | 37 pNoteDriver->RegisterEventTarget(pWidget, pWidget); |
38 | 38 |
39 m_pOldDelegate = m_pNormalWidget->GetCurrentDelegate(); | 39 m_pOldDelegate = m_pNormalWidget->GetDelegate(); |
40 m_pNormalWidget->SetCurrentDelegate(this); | 40 m_pNormalWidget->SetDelegate(this); |
41 | 41 |
42 if (m_pDataAcc->IsRadioButton()) | 42 if (m_pDataAcc->IsRadioButton()) |
43 pCheckBox->ModifyStylesEx(FWL_STYLEEXT_CKB_RadioButton, 0xFFFFFFFF); | 43 pCheckBox->ModifyStylesEx(FWL_STYLEEXT_CKB_RadioButton, 0xFFFFFFFF); |
44 | 44 |
45 m_pNormalWidget->LockUpdate(); | 45 m_pNormalWidget->LockUpdate(); |
46 UpdateWidgetProperty(); | 46 UpdateWidgetProperty(); |
47 SetFWLCheckState(m_pDataAcc->GetCheckState()); | 47 SetFWLCheckState(m_pDataAcc->GetCheckState()); |
48 m_pNormalWidget->UnlockUpdate(); | 48 m_pNormalWidget->UnlockUpdate(); |
49 return CXFA_FFField::LoadWidget(); | 49 return CXFA_FFField::LoadWidget(); |
50 } | 50 } |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 default: | 331 default: |
332 break; | 332 break; |
333 } | 333 } |
334 m_pOldDelegate->OnProcessEvent(pEvent); | 334 m_pOldDelegate->OnProcessEvent(pEvent); |
335 } | 335 } |
336 | 336 |
337 void CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics, | 337 void CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics, |
338 const CFX_Matrix* pMatrix) { | 338 const CFX_Matrix* pMatrix) { |
339 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); | 339 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); |
340 } | 340 } |
OLD | NEW |