| 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/cfwl_spinbutton.h" | 7 #include "xfa/fwl/core/cfwl_spinbutton.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 m_rtDnButton.Reset(); | 42 m_rtDnButton.Reset(); |
| 43 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; | 43 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert; |
| 44 } | 44 } |
| 45 | 45 |
| 46 CFWL_SpinButton::~CFWL_SpinButton() {} | 46 CFWL_SpinButton::~CFWL_SpinButton() {} |
| 47 | 47 |
| 48 FWL_Type CFWL_SpinButton::GetClassID() const { | 48 FWL_Type CFWL_SpinButton::GetClassID() const { |
| 49 return FWL_Type::SpinButton; | 49 return FWL_Type::SpinButton; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void CFWL_SpinButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { | 52 CFX_RectF CFWL_SpinButton::GetWidgetRect(bool bAutoSize) { |
| 53 if (!bAutoSize) { | 53 if (!bAutoSize) |
| 54 rect = m_pProperties->m_rtWidget; | 54 return m_pProperties->m_rtWidget; |
| 55 return; | |
| 56 } | |
| 57 | 55 |
| 56 CFX_RectF rect; |
| 58 rect.Set(0, 0, kMinWidth, kMinHeight); | 57 rect.Set(0, 0, kMinWidth, kMinHeight); |
| 59 InflateWidgetRect(rect); | 58 InflateWidgetRect(rect); |
| 59 return rect; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CFWL_SpinButton::Update() { | 62 void CFWL_SpinButton::Update() { |
| 63 if (IsLocked()) | 63 if (IsLocked()) |
| 64 return; | 64 return; |
| 65 | 65 |
| 66 GetClientRect(m_rtClient); | 66 GetClientRect(m_rtClient); |
| 67 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXE_SPB_Vert) { | 67 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXE_SPB_Vert) { |
| 68 m_rtUpButton.Set(m_rtClient.top, m_rtClient.left, m_rtClient.width, | 68 m_rtUpButton.Set(m_rtClient.top, m_rtClient.left, m_rtClient.width, |
| 69 m_rtClient.height / 2); | 69 m_rtClient.height / 2); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 void CFWL_SpinButton::Timer::Run(CFWL_TimerInfo* pTimerInfo) { | 368 void CFWL_SpinButton::Timer::Run(CFWL_TimerInfo* pTimerInfo) { |
| 369 CFWL_SpinButton* pButton = static_cast<CFWL_SpinButton*>(m_pWidget); | 369 CFWL_SpinButton* pButton = static_cast<CFWL_SpinButton*>(m_pWidget); |
| 370 | 370 |
| 371 if (!pButton->m_pTimerInfo) | 371 if (!pButton->m_pTimerInfo) |
| 372 return; | 372 return; |
| 373 | 373 |
| 374 CFWL_Event wmPosChanged(CFWL_Event::Type::Click, pButton); | 374 CFWL_Event wmPosChanged(CFWL_Event::Type::Click, pButton); |
| 375 pButton->DispatchEvent(&wmPosChanged); | 375 pButton->DispatchEvent(&wmPosChanged); |
| 376 } | 376 } |
| OLD | NEW |