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_spinbuttonimp.h" | 7 #include "xfa/fwl/basewidget/fwl_spinbuttonimp.h" |
8 | 8 |
9 #include "xfa/fwl/basewidget/ifwl_spinbutton.h" | 9 #include "xfa/fwl/basewidget/ifwl_spinbutton.h" |
10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 m_dwUpState(CFWL_PartState_Normal), | 51 m_dwUpState(CFWL_PartState_Normal), |
52 m_dwDnState(CFWL_PartState_Normal), | 52 m_dwDnState(CFWL_PartState_Normal), |
53 m_iButtonIndex(0), | 53 m_iButtonIndex(0), |
54 m_bLButtonDwn(FALSE), | 54 m_bLButtonDwn(FALSE), |
55 m_hTimer(NULL) { | 55 m_hTimer(NULL) { |
56 m_rtClient.Reset(); | 56 m_rtClient.Reset(); |
57 m_rtUpButton.Reset(); | 57 m_rtUpButton.Reset(); |
58 m_rtDnButton.Reset(); | 58 m_rtDnButton.Reset(); |
59 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; | 59 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; |
60 } | 60 } |
| 61 |
61 CFWL_SpinButtonImp::~CFWL_SpinButtonImp() {} | 62 CFWL_SpinButtonImp::~CFWL_SpinButtonImp() {} |
| 63 |
62 FWL_Error CFWL_SpinButtonImp::GetClassName(CFX_WideString& wsClass) const { | 64 FWL_Error CFWL_SpinButtonImp::GetClassName(CFX_WideString& wsClass) const { |
63 wsClass = FWL_CLASS_SpinButton; | 65 wsClass = FWL_CLASS_SpinButton; |
64 return FWL_Error::Succeeded; | 66 return FWL_Error::Succeeded; |
65 } | 67 } |
66 uint32_t CFWL_SpinButtonImp::GetClassID() const { | 68 |
67 return FWL_CLASSHASH_SpinButton; | 69 FWL_Type CFWL_SpinButtonImp::GetClassID() const { |
| 70 return FWL_Type::SpinButton; |
68 } | 71 } |
| 72 |
69 FWL_Error CFWL_SpinButtonImp::Initialize() { | 73 FWL_Error CFWL_SpinButtonImp::Initialize() { |
70 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 74 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
71 return FWL_Error::Indefinite; | 75 return FWL_Error::Indefinite; |
| 76 |
72 m_pDelegate = new CFWL_SpinButtonImpDelegate(this); | 77 m_pDelegate = new CFWL_SpinButtonImpDelegate(this); |
73 return FWL_Error::Succeeded; | 78 return FWL_Error::Succeeded; |
74 } | 79 } |
| 80 |
75 FWL_Error CFWL_SpinButtonImp::Finalize() { | 81 FWL_Error CFWL_SpinButtonImp::Finalize() { |
76 delete m_pDelegate; | 82 delete m_pDelegate; |
77 m_pDelegate = nullptr; | 83 m_pDelegate = nullptr; |
78 return CFWL_WidgetImp::Finalize(); | 84 return CFWL_WidgetImp::Finalize(); |
79 } | 85 } |
80 FWL_Error CFWL_SpinButtonImp::GetWidgetRect(CFX_RectF& rect, | 86 FWL_Error CFWL_SpinButtonImp::GetWidgetRect(CFX_RectF& rect, |
81 FX_BOOL bAutoSize) { | 87 FX_BOOL bAutoSize) { |
82 if (bAutoSize) { | 88 if (bAutoSize) { |
83 rect.Set(0, 0, kMinWidth, kMinHeight); | 89 rect.Set(0, 0, kMinWidth, kMinHeight); |
84 CFWL_WidgetImp::GetWidgetRect(rect, TRUE); | 90 CFWL_WidgetImp::GetWidgetRect(rect, TRUE); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 if (!bUpEnable && !bDownEnable) { | 432 if (!bUpEnable && !bDownEnable) { |
427 return; | 433 return; |
428 } | 434 } |
429 CFWL_EvtSpbClick wmPosChanged; | 435 CFWL_EvtSpbClick wmPosChanged; |
430 wmPosChanged.m_pSrcTarget = m_pOwner->m_pInterface; | 436 wmPosChanged.m_pSrcTarget = m_pOwner->m_pInterface; |
431 wmPosChanged.m_bUp = bUpEnable; | 437 wmPosChanged.m_bUp = bUpEnable; |
432 m_pOwner->DispatchEvent(&wmPosChanged); | 438 m_pOwner->DispatchEvent(&wmPosChanged); |
433 m_pOwner->Repaint(bUpEnable ? &m_pOwner->m_rtUpButton | 439 m_pOwner->Repaint(bUpEnable ? &m_pOwner->m_rtUpButton |
434 : &m_pOwner->m_rtDnButton); | 440 : &m_pOwner->m_rtDnButton); |
435 } | 441 } |
OLD | NEW |