| 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_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 CFX_RectF rtWidget; | 45 CFX_RectF rtWidget; |
| 46 GetRectWithoutRotate(rtWidget); | 46 GetRectWithoutRotate(rtWidget); |
| 47 CFX_Matrix mt; | 47 CFX_Matrix mt; |
| 48 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); | 48 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); |
| 49 mt.Concat(mtRotate); | 49 mt.Concat(mtRotate); |
| 50 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), | 50 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), |
| 51 pGS, &mt); | 51 pGS, &mt); |
| 52 } | 52 } |
| 53 FX_BOOL CXFA_FFPushButton::LoadWidget() { | 53 FX_BOOL CXFA_FFPushButton::LoadWidget() { |
| 54 ASSERT(!m_pNormalWidget); | 54 ASSERT(!m_pNormalWidget); |
| 55 CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); | 55 CFWL_PushButton* pPushButton = new CFWL_PushButton; |
| 56 if (pPushButton) { | 56 pPushButton->Initialize(); |
| 57 pPushButton->Initialize(); | 57 |
| 58 } | |
| 59 m_pOldDelegate = pPushButton->SetDelegate(this); | 58 m_pOldDelegate = pPushButton->SetDelegate(this); |
| 60 m_pNormalWidget = pPushButton; | 59 m_pNormalWidget = pPushButton; |
| 61 m_pNormalWidget->SetLayoutItem(this); | 60 m_pNormalWidget->SetLayoutItem(this); |
| 62 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 61 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); |
| 63 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 62 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
| 64 pNoteDriver->RegisterEventTarget(pWidget, pWidget); | 63 pNoteDriver->RegisterEventTarget(pWidget, pWidget); |
| 65 m_pNormalWidget->LockUpdate(); | 64 m_pNormalWidget->LockUpdate(); |
| 66 UpdateWidgetProperty(); | 65 UpdateWidgetProperty(); |
| 67 LoadHighlightCaption(); | 66 LoadHighlightCaption(); |
| 68 m_pNormalWidget->UnlockUpdate(); | 67 m_pNormalWidget->UnlockUpdate(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 pGraphics->SetLineWidth(fLineWidth); | 236 pGraphics->SetLineWidth(fLineWidth); |
| 238 CFX_Path path; | 237 CFX_Path path; |
| 239 path.Create(); | 238 path.Create(); |
| 240 CFX_RectF rect; | 239 CFX_RectF rect; |
| 241 m_pNormalWidget->GetWidgetRect(rect); | 240 m_pNormalWidget->GetWidgetRect(rect); |
| 242 path.AddRectangle(0, 0, rect.width, rect.height); | 241 path.AddRectangle(0, 0, rect.width, rect.height); |
| 243 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); | 242 pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); |
| 244 } | 243 } |
| 245 } | 244 } |
| 246 } | 245 } |
| OLD | NEW |