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 "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
8 #include "../core/include/fwl_targetimp.h" | 8 #include "../core/include/fwl_targetimp.h" |
9 #include "../core/include/fwl_noteimp.h" | 9 #include "../core/include/fwl_noteimp.h" |
10 #include "../core/include/fwl_widgetimp.h" | 10 #include "../core/include/fwl_widgetimp.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 FWL_ERR CFWL_PushButtonImp::GetClassName(CFX_WideString& wsClass) const { | 44 FWL_ERR CFWL_PushButtonImp::GetClassName(CFX_WideString& wsClass) const { |
45 wsClass = FWL_CLASS_PushButton; | 45 wsClass = FWL_CLASS_PushButton; |
46 return FWL_ERR_Succeeded; | 46 return FWL_ERR_Succeeded; |
47 } | 47 } |
48 FX_DWORD CFWL_PushButtonImp::GetClassID() const { | 48 FX_DWORD CFWL_PushButtonImp::GetClassID() const { |
49 return FWL_CLASSHASH_PushButton; | 49 return FWL_CLASSHASH_PushButton; |
50 } | 50 } |
51 FWL_ERR CFWL_PushButtonImp::Initialize() { | 51 FWL_ERR CFWL_PushButtonImp::Initialize() { |
52 _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_WidgetImp::Initialize(), | 52 _FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_WidgetImp::Initialize(), |
53 FWL_ERR_Indefinite); | 53 FWL_ERR_Indefinite); |
54 m_pDelegate = (IFWL_WidgetDelegate*)new CFWL_PushButtonImpDelegate(this); | 54 m_pDelegate = new CFWL_PushButtonImpDelegate(this); |
55 return FWL_ERR_Succeeded; | 55 return FWL_ERR_Succeeded; |
56 } | 56 } |
57 FWL_ERR CFWL_PushButtonImp::Finalize() { | 57 FWL_ERR CFWL_PushButtonImp::Finalize() { |
58 if (m_pDelegate) { | 58 delete m_pDelegate; |
59 delete (CFWL_PushButtonImpDelegate*)m_pDelegate; | 59 m_pDelegate = nullptr; |
60 m_pDelegate = NULL; | |
61 } | |
62 return CFWL_WidgetImp::Finalize(); | 60 return CFWL_WidgetImp::Finalize(); |
63 } | 61 } |
64 FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 62 FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
65 if (bAutoSize) { | 63 if (bAutoSize) { |
66 rect.Set(0, 0, 0, 0); | 64 rect.Set(0, 0, 0, 0); |
67 if (m_pProperties->m_pThemeProvider == NULL) { | 65 if (m_pProperties->m_pThemeProvider == NULL) { |
68 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 66 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
69 } | 67 } |
70 CFX_WideString wsCaption; | 68 CFX_WideString wsCaption; |
71 IFWL_PushButtonDP* pData = | 69 IFWL_PushButtonDP* pData = |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 CFWL_EvtClick wmClick; | 541 CFWL_EvtClick wmClick; |
544 wmClick.m_pSrcTarget = (IFWL_PushButton*)m_pOwner->m_pInterface; | 542 wmClick.m_pSrcTarget = (IFWL_PushButton*)m_pOwner->m_pInterface; |
545 m_pOwner->DispatchEvent(&wmClick); | 543 m_pOwner->DispatchEvent(&wmClick); |
546 return; | 544 return; |
547 } | 545 } |
548 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { | 546 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { |
549 return; | 547 return; |
550 } | 548 } |
551 m_pOwner->DispatchKeyEvent(pMsg); | 549 m_pOwner->DispatchKeyEvent(pMsg); |
552 } | 550 } |
OLD | NEW |