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_ffimageedit.h" | 7 #include "xfa/fxfa/app/xfa_ffimageedit.h" |
8 | 8 |
9 #include "xfa/fwl/core/cfwl_message.h" | 9 #include "xfa/fwl/core/cfwl_message.h" |
10 #include "xfa/fwl/core/cfwl_picturebox.h" | 10 #include "xfa/fwl/core/cfwl_picturebox.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 FX_BOOL CXFA_FFImageEdit::LoadWidget() { | 25 FX_BOOL CXFA_FFImageEdit::LoadWidget() { |
26 CFWL_PictureBox* pPictureBox = new CFWL_PictureBox(GetFWLApp()); | 26 CFWL_PictureBox* pPictureBox = new CFWL_PictureBox(GetFWLApp()); |
27 pPictureBox->Initialize(); | 27 pPictureBox->Initialize(); |
28 m_pNormalWidget = pPictureBox; | 28 m_pNormalWidget = pPictureBox; |
29 m_pNormalWidget->SetLayoutItem(this); | 29 m_pNormalWidget->SetLayoutItem(this); |
30 | 30 |
31 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 31 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); |
32 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); | 32 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); |
33 pNoteDriver->RegisterEventTarget(pWidget, pWidget); | 33 pNoteDriver->RegisterEventTarget(pWidget, pWidget); |
34 m_pOldDelegate = pPictureBox->SetDelegate(this); | 34 |
| 35 m_pOldDelegate = pPictureBox->GetCurrentDelegate(); |
| 36 pPictureBox->SetCurrentDelegate(this); |
| 37 |
35 CXFA_FFField::LoadWidget(); | 38 CXFA_FFField::LoadWidget(); |
36 if (m_pDataAcc->GetImageEditImage()) { | 39 if (m_pDataAcc->GetImageEditImage()) { |
37 return TRUE; | 40 return TRUE; |
38 } | 41 } |
39 UpdateFWLData(); | 42 UpdateFWLData(); |
40 return TRUE; | 43 return TRUE; |
41 } | 44 } |
42 void CXFA_FFImageEdit::UnloadWidget() { | 45 void CXFA_FFImageEdit::UnloadWidget() { |
43 m_pDataAcc->SetImageEditImage(nullptr); | 46 m_pDataAcc->SetImageEditImage(nullptr); |
44 CXFA_FFField::UnloadWidget(); | 47 CXFA_FFField::UnloadWidget(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 131 |
129 void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) { | 132 void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) { |
130 CXFA_FFField::OnProcessEvent(pEvent); | 133 CXFA_FFField::OnProcessEvent(pEvent); |
131 m_pOldDelegate->OnProcessEvent(pEvent); | 134 m_pOldDelegate->OnProcessEvent(pEvent); |
132 } | 135 } |
133 | 136 |
134 void CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics, | 137 void CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics, |
135 const CFX_Matrix* pMatrix) { | 138 const CFX_Matrix* pMatrix) { |
136 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); | 139 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); |
137 } | 140 } |
OLD | NEW |