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

Side by Side Diff: xfa/fxfa/app/xfa_ffpushbutton.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_ffimageedit.cpp ('k') | xfa/fxfa/app/xfa_fftextedit.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_ffpushbutton.h" 7 #include "xfa/fxfa/app/xfa_ffpushbutton.h"
8 8
9 #include "xfa/fwl/core/cfwl_widgetmgr.h" 9 #include "xfa/fwl/core/cfwl_widgetmgr.h"
10 #include "xfa/fwl/core/fwl_noteimp.h" 10 #include "xfa/fwl/core/fwl_noteimp.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 pGS, &mt); 52 pGS, &mt);
53 } 53 }
54 FX_BOOL CXFA_FFPushButton::LoadWidget() { 54 FX_BOOL CXFA_FFPushButton::LoadWidget() {
55 ASSERT(!m_pNormalWidget); 55 ASSERT(!m_pNormalWidget);
56 CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); 56 CFWL_PushButton* pPushButton = CFWL_PushButton::Create();
57 if (pPushButton) { 57 if (pPushButton) {
58 pPushButton->Initialize(); 58 pPushButton->Initialize();
59 } 59 }
60 m_pOldDelegate = pPushButton->SetDelegate(this); 60 m_pOldDelegate = pPushButton->SetDelegate(this);
61 m_pNormalWidget = (CFWL_Widget*)pPushButton; 61 m_pNormalWidget = (CFWL_Widget*)pPushButton;
62 m_pNormalWidget->SetLayoutItem(this);
62 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); 63 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
63 m_pNormalWidget->SetPrivateData(pWidget, this, NULL);
64 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); 64 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
65 pNoteDriver->RegisterEventTarget(pWidget, pWidget); 65 pNoteDriver->RegisterEventTarget(pWidget, pWidget);
66 m_pNormalWidget->LockUpdate(); 66 m_pNormalWidget->LockUpdate();
67 UpdateWidgetProperty(); 67 UpdateWidgetProperty();
68 LoadHighlightCaption(); 68 LoadHighlightCaption();
69 m_pNormalWidget->UnlockUpdate(); 69 m_pNormalWidget->UnlockUpdate();
70 return CXFA_FFField::LoadWidget(); 70 return CXFA_FFField::LoadWidget();
71 } 71 }
72 void CXFA_FFPushButton::UpdateWidgetProperty() { 72 void CXFA_FFPushButton::UpdateWidgetProperty() {
73 uint32_t dwStyleEx = 0; 73 uint32_t dwStyleEx = 0;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 pGraphics->SetLineWidth(fLineWidth); 238 pGraphics->SetLineWidth(fLineWidth);
239 CFX_Path path; 239 CFX_Path path;
240 path.Create(); 240 path.Create();
241 CFX_RectF rect; 241 CFX_RectF rect;
242 m_pNormalWidget->GetWidgetRect(rect); 242 m_pNormalWidget->GetWidgetRect(rect);
243 path.AddRectangle(0, 0, rect.width, rect.height); 243 path.AddRectangle(0, 0, rect.width, rect.height);
244 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); 244 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix);
245 } 245 }
246 } 246 }
247 } 247 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffimageedit.cpp ('k') | xfa/fxfa/app/xfa_fftextedit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698