1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "fpdfsdk/pwl/cpwl_button.h" 8 9 #include <utility> 10 CPWL_Button(const CreateParams & cp,std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData)11CPWL_Button::CPWL_Button( 12 const CreateParams& cp, 13 std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) 14 : CPWL_Wnd(cp, std::move(pAttachedData)) { 15 GetCreationParams()->eCursorType = FXCT_HAND; 16 } 17 18 CPWL_Button::~CPWL_Button() = default; 19 OnLButtonDown(const CFX_PointF & point,uint32_t nFlag)20bool CPWL_Button::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) { 21 CPWL_Wnd::OnLButtonDown(point, nFlag); 22 m_bMouseDown = true; 23 SetCapture(); 24 return true; 25 } 26 OnLButtonUp(const CFX_PointF & point,uint32_t nFlag)27bool CPWL_Button::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) { 28 CPWL_Wnd::OnLButtonUp(point, nFlag); 29 ReleaseCapture(); 30 m_bMouseDown = false; 31 return true; 32 } 33