Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: xfa/fxfa/app/xfa_ffchoicelist.cpp

Issue 2010923002: Add opaque "layout item" to widgets for caller's use. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Cast to FFWidget. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffcheckbutton.cpp ('k') | xfa/fxfa/app/xfa_ffimageedit.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ffchoicelist.h" 7 #include "xfa/fxfa/app/xfa_ffchoicelist.h"
8 8
9 #include "xfa/fwl/basewidget/ifwl_edit.h" 9 #include "xfa/fwl/basewidget/ifwl_edit.h"
10 #include "xfa/fwl/core/fwl_noteimp.h" 10 #include "xfa/fwl/core/fwl_noteimp.h"
(...skipping 16 matching lines...) Expand all
27 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); 27 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
28 pNoteDriver->UnregisterEventTarget(pWidget); 28 pNoteDriver->UnregisterEventTarget(pWidget);
29 } 29 }
30 } 30 }
31 FX_BOOL CXFA_FFListBox::LoadWidget() { 31 FX_BOOL CXFA_FFListBox::LoadWidget() {
32 CFWL_ListBox* pListBox = CFWL_ListBox::Create(); 32 CFWL_ListBox* pListBox = CFWL_ListBox::Create();
33 pListBox->Initialize(); 33 pListBox->Initialize();
34 pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground, 34 pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll | FWL_WGTSTYLE_NoBackground,
35 0xFFFFFFFF); 35 0xFFFFFFFF);
36 m_pNormalWidget = (CFWL_Widget*)pListBox; 36 m_pNormalWidget = (CFWL_Widget*)pListBox;
37 m_pNormalWidget->SetLayoutItem(this);
37 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); 38 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
38 m_pNormalWidget->SetPrivateData(pWidget, this, NULL);
39 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); 39 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
40 pNoteDriver->RegisterEventTarget(pWidget, pWidget); 40 pNoteDriver->RegisterEventTarget(pWidget, pWidget);
41 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); 41 m_pOldDelegate = m_pNormalWidget->SetDelegate(this);
42 m_pNormalWidget->LockUpdate(); 42 m_pNormalWidget->LockUpdate();
43 CFX_WideStringArray wsLabelArray; 43 CFX_WideStringArray wsLabelArray;
44 m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); 44 m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
45 int32_t iItems = wsLabelArray.GetSize(); 45 int32_t iItems = wsLabelArray.GetSize();
46 for (int32_t i = 0; i < iItems; i++) { 46 for (int32_t i = 0; i < iItems; i++) {
47 pListBox->AddString(wsLabelArray[i].AsStringC()); 47 pListBox->AddString(wsLabelArray[i].AsStringC());
48 } 48 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 ((CFWL_ComboBox*)m_pNormalWidget)->GetBBox(rtWidget); 225 ((CFWL_ComboBox*)m_pNormalWidget)->GetBBox(rtWidget);
226 if (rtWidget.Contains(fx, fy)) { 226 if (rtWidget.Contains(fx, fy)) {
227 return TRUE; 227 return TRUE;
228 } 228 }
229 return FALSE; 229 return FALSE;
230 } 230 }
231 FX_BOOL CXFA_FFComboBox::LoadWidget() { 231 FX_BOOL CXFA_FFComboBox::LoadWidget() {
232 CFWL_ComboBox* pComboBox = CFWL_ComboBox::Create(); 232 CFWL_ComboBox* pComboBox = CFWL_ComboBox::Create();
233 pComboBox->Initialize(); 233 pComboBox->Initialize();
234 m_pNormalWidget = (CFWL_Widget*)pComboBox; 234 m_pNormalWidget = (CFWL_Widget*)pComboBox;
235 m_pNormalWidget->SetLayoutItem(this);
235 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); 236 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
236 m_pNormalWidget->SetPrivateData(pWidget, this, NULL);
237 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); 237 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
238 pNoteDriver->RegisterEventTarget(pWidget, pWidget); 238 pNoteDriver->RegisterEventTarget(pWidget, pWidget);
239 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); 239 m_pOldDelegate = m_pNormalWidget->SetDelegate(this);
240 m_pNormalWidget->LockUpdate(); 240 m_pNormalWidget->LockUpdate();
241 CFX_WideStringArray wsLabelArray; 241 CFX_WideStringArray wsLabelArray;
242 m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE); 242 m_pDataAcc->GetChoiceListItems(wsLabelArray, FALSE);
243 int32_t iItems = wsLabelArray.GetSize(); 243 int32_t iItems = wsLabelArray.GetSize();
244 for (int32_t i = 0; i < iItems; i++) { 244 for (int32_t i = 0; i < iItems; i++) {
245 pComboBox->AddString(wsLabelArray[i].AsStringC()); 245 pComboBox->AddString(wsLabelArray[i].AsStringC());
246 } 246 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 default: 526 default:
527 break; 527 break;
528 } 528 }
529 m_pOldDelegate->OnProcessEvent(pEvent); 529 m_pOldDelegate->OnProcessEvent(pEvent);
530 } 530 }
531 531
532 void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics, 532 void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics,
533 const CFX_Matrix* pMatrix) { 533 const CFX_Matrix* pMatrix) {
534 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); 534 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
535 } 535 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffcheckbutton.cpp ('k') | xfa/fxfa/app/xfa_ffimageedit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698