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_ffbarcode.h" | 7 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
8 | 8 |
9 #include "core/fxcrt/fx_ext.h" | 9 #include "core/fxcrt/fx_ext.h" |
10 #include "xfa/fwl/core/cfwl_app.h" | 10 #include "xfa/fwl/core/cfwl_app.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } // namespace. | 117 } // namespace. |
118 | 118 |
119 CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, | 119 CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, |
120 CXFA_WidgetAcc* pDataAcc) | 120 CXFA_WidgetAcc* pDataAcc) |
121 : CXFA_FFTextEdit(pPageView, pDataAcc) {} | 121 : CXFA_FFTextEdit(pPageView, pDataAcc) {} |
122 | 122 |
123 CXFA_FFBarcode::~CXFA_FFBarcode() {} | 123 CXFA_FFBarcode::~CXFA_FFBarcode() {} |
124 | 124 |
125 bool CXFA_FFBarcode::LoadWidget() { | 125 bool CXFA_FFBarcode::LoadWidget() { |
126 CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp()); | 126 CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp()); |
127 pFWLBarcode->Initialize(); | |
128 | 127 |
129 m_pNormalWidget = pFWLBarcode; | 128 m_pNormalWidget = pFWLBarcode; |
130 m_pNormalWidget->SetLayoutItem(this); | 129 m_pNormalWidget->SetLayoutItem(this); |
131 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 130 CFWL_NoteDriver* pNoteDriver = |
132 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver(); | 131 m_pNormalWidget->GetOwnerApp()->GetNoteDriver(); |
133 pNoteDriver->RegisterEventTarget(pWidget, pWidget); | 132 pNoteDriver->RegisterEventTarget(m_pNormalWidget, m_pNormalWidget); |
134 | 133 |
135 m_pOldDelegate = m_pNormalWidget->GetDelegate(); | 134 m_pOldDelegate = m_pNormalWidget->GetDelegate(); |
136 m_pNormalWidget->SetDelegate(this); | 135 m_pNormalWidget->SetDelegate(this); |
137 m_pNormalWidget->LockUpdate(); | 136 m_pNormalWidget->LockUpdate(); |
138 | 137 |
139 CFX_WideString wsText; | 138 CFX_WideString wsText; |
140 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); | 139 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); |
141 pFWLBarcode->SetText(wsText); | 140 pFWLBarcode->SetText(wsText); |
142 UpdateWidgetProperty(); | 141 UpdateWidgetProperty(); |
143 m_pNormalWidget->UnlockUpdate(); | 142 m_pNormalWidget->UnlockUpdate(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 234 } |
236 return CXFA_FFTextEdit::OnLButtonDown(dwFlags, fx, fy); | 235 return CXFA_FFTextEdit::OnLButtonDown(dwFlags, fx, fy); |
237 } | 236 } |
238 bool CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 237 bool CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
239 CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget; | 238 CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget; |
240 if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) { | 239 if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) { |
241 return false; | 240 return false; |
242 } | 241 } |
243 return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy); | 242 return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy); |
244 } | 243 } |
OLD | NEW |