| 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/core/ifwl_spinbutton.h" | 7 #include "xfa/fwl/core/ifwl_spinbutton.h" |
| 8 | 8 |
| 9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
| 10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
| 11 #include "xfa/fwl/core/cfwl_themebackground.h" | 11 #include "xfa/fwl/core/cfwl_themebackground.h" |
| 12 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" | 12 #include "xfa/fwl/core/cfwl_widgetproperties.h" |
| 13 #include "xfa/fwl/core/fwl_noteimp.h" | 13 #include "xfa/fwl/core/fwl_noteimp.h" |
| 14 #include "xfa/fwl/core/ifwl_spinbutton.h" | 14 #include "xfa/fwl/core/ifwl_spinbutton.h" |
| 15 #include "xfa/fwl/core/ifwl_themeprovider.h" | 15 #include "xfa/fwl/core/ifwl_themeprovider.h" |
| 16 #include "xfa/fwl/core/ifwl_themeprovider.h" | 16 #include "xfa/fwl/core/ifwl_themeprovider.h" |
| 17 #include "xfa/fwl/core/ifwl_timer.h" | 17 #include "xfa/fwl/core/ifwl_timer.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const int kMinWidth = 18; | 21 const int kMinWidth = 18; |
| 22 const int kMinHeight = 32; | 22 const int kMinHeight = 32; |
| 23 const int kElapseTime = 200; | 23 const int kElapseTime = 200; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 IFWL_SpinButton::IFWL_SpinButton(const IFWL_App* app, | 27 IFWL_SpinButton::IFWL_SpinButton( |
| 28 const CFWL_WidgetImpProperties& properties) | 28 const IFWL_App* app, |
| 29 : IFWL_Widget(app, properties, nullptr), | 29 std::unique_ptr<CFWL_WidgetProperties> properties) |
| 30 : IFWL_Widget(app, std::move(properties), nullptr), |
| 30 m_dwUpState(CFWL_PartState_Normal), | 31 m_dwUpState(CFWL_PartState_Normal), |
| 31 m_dwDnState(CFWL_PartState_Normal), | 32 m_dwDnState(CFWL_PartState_Normal), |
| 32 m_iButtonIndex(0), | 33 m_iButtonIndex(0), |
| 33 m_bLButtonDwn(false), | 34 m_bLButtonDwn(false), |
| 34 m_pTimerInfo(nullptr), | 35 m_pTimerInfo(nullptr), |
| 35 m_Timer(this) { | 36 m_Timer(this) { |
| 36 m_rtClient.Reset(); | 37 m_rtClient.Reset(); |
| 37 m_rtUpButton.Reset(); | 38 m_rtUpButton.Reset(); |
| 38 m_rtDnButton.Reset(); | 39 m_rtDnButton.Reset(); |
| 39 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; | 40 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 IFWL_SpinButton* pButton = static_cast<IFWL_SpinButton*>(m_pWidget); | 380 IFWL_SpinButton* pButton = static_cast<IFWL_SpinButton*>(m_pWidget); |
| 380 | 381 |
| 381 if (!pButton->m_pTimerInfo) | 382 if (!pButton->m_pTimerInfo) |
| 382 return; | 383 return; |
| 383 | 384 |
| 384 CFWL_EvtSpbClick wmPosChanged; | 385 CFWL_EvtSpbClick wmPosChanged; |
| 385 wmPosChanged.m_pSrcTarget = pButton; | 386 wmPosChanged.m_pSrcTarget = pButton; |
| 386 wmPosChanged.m_bUp = pButton->m_iButtonIndex == 0; | 387 wmPosChanged.m_bUp = pButton->m_iButtonIndex == 0; |
| 387 pButton->DispatchEvent(&wmPosChanged); | 388 pButton->DispatchEvent(&wmPosChanged); |
| 388 } | 389 } |
| OLD | NEW |