| 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 CFWL_ScrollBar* CFWL_ScrollBar::Create() { | 8 CFWL_ScrollBar* CFWL_ScrollBar::Create() { |
| 9 return new CFWL_ScrollBar; | 9 return new CFWL_ScrollBar; |
| 10 } | 10 } |
| 11 FWL_ERR CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) { | 11 FWL_ERR CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) { |
| 12 if (m_pIface) | 12 if (m_pIface) |
| 13 return FWL_ERR_Indefinite; | 13 return FWL_ERR_Indefinite; |
| 14 if (pProperties) { | 14 if (pProperties) { |
| 15 *m_pProperties = *pProperties; | 15 *m_pProperties = *pProperties; |
| 16 } | 16 } |
| 17 m_pIface = IFWL_ScrollBar::Create(); | 17 m_pIface = new IFWL_ScrollBar; |
| 18 FWL_ERR ret = | 18 FWL_ERR ret = |
| 19 ((IFWL_ScrollBar*)m_pIface) | 19 ((IFWL_ScrollBar*)m_pIface) |
| 20 ->Initialize(m_pProperties->MakeWidgetImpProperties(nullptr), | 20 ->Initialize(m_pProperties->MakeWidgetImpProperties(nullptr), |
| 21 nullptr); | 21 nullptr); |
| 22 if (ret == FWL_ERR_Succeeded) { | 22 if (ret == FWL_ERR_Succeeded) { |
| 23 CFWL_Widget::Initialize(); | 23 CFWL_Widget::Initialize(); |
| 24 } | 24 } |
| 25 return ret; | 25 return ret; |
| 26 } | 26 } |
| 27 FX_BOOL CFWL_ScrollBar::IsVertical() { | 27 FX_BOOL CFWL_ScrollBar::IsVertical() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 return FWL_ERR_Indefinite; | 79 return FWL_ERR_Indefinite; |
| 80 return ((IFWL_ScrollBar*)m_pIface)->SetTrackPos(fTrackPos); | 80 return ((IFWL_ScrollBar*)m_pIface)->SetTrackPos(fTrackPos); |
| 81 } | 81 } |
| 82 FX_BOOL CFWL_ScrollBar::DoScroll(FX_DWORD dwCode, FX_FLOAT fPos) { | 82 FX_BOOL CFWL_ScrollBar::DoScroll(FX_DWORD dwCode, FX_FLOAT fPos) { |
| 83 if (!m_pIface) | 83 if (!m_pIface) |
| 84 return FALSE; | 84 return FALSE; |
| 85 return ((IFWL_ScrollBar*)m_pIface)->DoScroll(dwCode, fPos); | 85 return ((IFWL_ScrollBar*)m_pIface)->DoScroll(dwCode, fPos); |
| 86 } | 86 } |
| 87 CFWL_ScrollBar::CFWL_ScrollBar() {} | 87 CFWL_ScrollBar::CFWL_ScrollBar() {} |
| 88 CFWL_ScrollBar::~CFWL_ScrollBar() {} | 88 CFWL_ScrollBar::~CFWL_ScrollBar() {} |
| OLD | NEW |