| 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 "fpdfsdk/include/pdfwindow/PDFWindow.h" | |
| 8 #include "fpdfsdk/include/pdfwindow/PWL_Button.h" | 7 #include "fpdfsdk/include/pdfwindow/PWL_Button.h" |
| 9 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" | 8 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" |
| 10 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" | 9 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" |
| 11 | 10 |
| 12 /* ------------------------------- CPWL_Button | |
| 13 * ---------------------------------- */ | |
| 14 | |
| 15 CPWL_Button::CPWL_Button() : m_bMouseDown(FALSE) {} | 11 CPWL_Button::CPWL_Button() : m_bMouseDown(FALSE) {} |
| 16 | 12 |
| 17 CPWL_Button::~CPWL_Button() { | 13 CPWL_Button::~CPWL_Button() { |
| 18 // PWL_TRACE("~CPWL_Button\n"); | |
| 19 } | 14 } |
| 20 | 15 |
| 21 CFX_ByteString CPWL_Button::GetClassName() const { | 16 CFX_ByteString CPWL_Button::GetClassName() const { |
| 22 return "CPWL_Button"; | 17 return "CPWL_Button"; |
| 23 } | 18 } |
| 24 | 19 |
| 25 void CPWL_Button::OnCreate(PWL_CREATEPARAM& cp) { | 20 void CPWL_Button::OnCreate(PWL_CREATEPARAM& cp) { |
| 26 cp.eCursorType = FXCT_HAND; | 21 cp.eCursorType = FXCT_HAND; |
| 27 } | 22 } |
| 28 | 23 |
| 29 FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { | 24 FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { |
| 30 CPWL_Wnd::OnLButtonDown(point, nFlag); | 25 CPWL_Wnd::OnLButtonDown(point, nFlag); |
| 31 | 26 |
| 32 m_bMouseDown = TRUE; | 27 m_bMouseDown = TRUE; |
| 33 SetCapture(); | 28 SetCapture(); |
| 34 | 29 |
| 35 return TRUE; | 30 return TRUE; |
| 36 } | 31 } |
| 37 | 32 |
| 38 FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { | 33 FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { |
| 39 CPWL_Wnd::OnLButtonUp(point, nFlag); | 34 CPWL_Wnd::OnLButtonUp(point, nFlag); |
| 40 | 35 |
| 41 ReleaseCapture(); | 36 ReleaseCapture(); |
| 42 m_bMouseDown = FALSE; | 37 m_bMouseDown = FALSE; |
| 43 | 38 |
| 44 return TRUE; | 39 return TRUE; |
| 45 } | 40 } |
| OLD | NEW |