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/fwl/basewidget/fwl_pushbuttonimp.h" | 7 #include "xfa/fwl/basewidget/fwl_pushbuttonimp.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" | 10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 CFWL_PushButtonImp::CFWL_PushButtonImp( | 31 CFWL_PushButtonImp::CFWL_PushButtonImp( |
32 const CFWL_WidgetImpProperties& properties, | 32 const CFWL_WidgetImpProperties& properties, |
33 IFWL_Widget* pOuter) | 33 IFWL_Widget* pOuter) |
34 : CFWL_WidgetImp(properties, pOuter), | 34 : CFWL_WidgetImp(properties, pOuter), |
35 m_bBtnDown(FALSE), | 35 m_bBtnDown(FALSE), |
36 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), | 36 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), |
37 m_iTTOAlign(FDE_TTOALIGNMENT_Center) { | 37 m_iTTOAlign(FDE_TTOALIGNMENT_Center) { |
38 m_rtClient.Set(0, 0, 0, 0); | 38 m_rtClient.Set(0, 0, 0, 0); |
39 m_rtCaption.Set(0, 0, 0, 0); | 39 m_rtCaption.Set(0, 0, 0, 0); |
40 } | 40 } |
| 41 |
41 CFWL_PushButtonImp::~CFWL_PushButtonImp() {} | 42 CFWL_PushButtonImp::~CFWL_PushButtonImp() {} |
| 43 |
42 FWL_Error CFWL_PushButtonImp::GetClassName(CFX_WideString& wsClass) const { | 44 FWL_Error CFWL_PushButtonImp::GetClassName(CFX_WideString& wsClass) const { |
43 wsClass = FWL_CLASS_PushButton; | 45 wsClass = FWL_CLASS_PushButton; |
44 return FWL_Error::Succeeded; | 46 return FWL_Error::Succeeded; |
45 } | 47 } |
46 uint32_t CFWL_PushButtonImp::GetClassID() const { | 48 |
47 return FWL_CLASSHASH_PushButton; | 49 FWL_Type CFWL_PushButtonImp::GetClassID() const { |
| 50 return FWL_Type::PushButton; |
48 } | 51 } |
| 52 |
49 FWL_Error CFWL_PushButtonImp::Initialize() { | 53 FWL_Error CFWL_PushButtonImp::Initialize() { |
50 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 54 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
51 return FWL_Error::Indefinite; | 55 return FWL_Error::Indefinite; |
| 56 |
52 m_pDelegate = new CFWL_PushButtonImpDelegate(this); | 57 m_pDelegate = new CFWL_PushButtonImpDelegate(this); |
53 return FWL_Error::Succeeded; | 58 return FWL_Error::Succeeded; |
54 } | 59 } |
| 60 |
55 FWL_Error CFWL_PushButtonImp::Finalize() { | 61 FWL_Error CFWL_PushButtonImp::Finalize() { |
56 delete m_pDelegate; | 62 delete m_pDelegate; |
57 m_pDelegate = nullptr; | 63 m_pDelegate = nullptr; |
58 return CFWL_WidgetImp::Finalize(); | 64 return CFWL_WidgetImp::Finalize(); |
59 } | 65 } |
60 FWL_Error CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, | 66 FWL_Error CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, |
61 FX_BOOL bAutoSize) { | 67 FX_BOOL bAutoSize) { |
62 if (bAutoSize) { | 68 if (bAutoSize) { |
63 rect.Set(0, 0, 0, 0); | 69 rect.Set(0, 0, 0, 0); |
64 if (m_pProperties->m_pThemeProvider == NULL) { | 70 if (m_pProperties->m_pThemeProvider == NULL) { |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 CFWL_EvtClick wmClick; | 555 CFWL_EvtClick wmClick; |
550 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; | 556 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; |
551 m_pOwner->DispatchEvent(&wmClick); | 557 m_pOwner->DispatchEvent(&wmClick); |
552 return; | 558 return; |
553 } | 559 } |
554 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { | 560 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { |
555 return; | 561 return; |
556 } | 562 } |
557 m_pOwner->DispatchKeyEvent(pMsg); | 563 m_pOwner->DispatchKeyEvent(pMsg); |
558 } | 564 } |
OLD | NEW |