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 #include "fpdfsdk/pwl/cpwl_wnd.h" 9 CPWL_Button()10CPWL_Button::CPWL_Button() : m_bMouseDown(false) {} 11 ~CPWL_Button()12CPWL_Button::~CPWL_Button() {} 13 GetClassName() const14ByteString CPWL_Button::GetClassName() const { 15 return "CPWL_Button"; 16 } 17 OnCreate(CreateParams * pParamsToAdjust)18void CPWL_Button::OnCreate(CreateParams* pParamsToAdjust) { 19 pParamsToAdjust->eCursorType = FXCT_HAND; 20 } 21 OnLButtonDown(const CFX_PointF & point,uint32_t nFlag)22bool CPWL_Button::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) { 23 CPWL_Wnd::OnLButtonDown(point, nFlag); 24 m_bMouseDown = true; 25 SetCapture(); 26 return true; 27 } 28 OnLButtonUp(const CFX_PointF & point,uint32_t nFlag)29bool CPWL_Button::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) { 30 CPWL_Wnd::OnLButtonUp(point, nFlag); 31 ReleaseCapture(); 32 m_bMouseDown = false; 33 return true; 34 } 35