| 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/pdfwindow/PWL_Button.h" | 7 #include "fpdfsdk/pdfwindow/PWL_Button.h" |
| 8 #include "fpdfsdk/pdfwindow/PWL_SpecialButton.h" | 8 #include "fpdfsdk/pdfwindow/PWL_SpecialButton.h" |
| 9 #include "fpdfsdk/pdfwindow/PWL_Utils.h" | 9 #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
| 10 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" | 10 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 void CPWL_CheckBox::SetCheck(bool bCheck) { | 32 void CPWL_CheckBox::SetCheck(bool bCheck) { |
| 33 m_bChecked = bCheck; | 33 m_bChecked = bCheck; |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool CPWL_CheckBox::IsChecked() const { | 36 bool CPWL_CheckBox::IsChecked() const { |
| 37 return m_bChecked; | 37 return m_bChecked; |
| 38 } | 38 } |
| 39 | 39 |
| 40 FX_BOOL CPWL_CheckBox::OnLButtonUp(const CFX_FloatPoint& point, | 40 bool CPWL_CheckBox::OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) { |
| 41 uint32_t nFlag) { | |
| 42 if (IsReadOnly()) | 41 if (IsReadOnly()) |
| 43 return FALSE; | 42 return false; |
| 44 | 43 |
| 45 SetCheck(!IsChecked()); | 44 SetCheck(!IsChecked()); |
| 46 return TRUE; | 45 return true; |
| 47 } | 46 } |
| 48 | 47 |
| 49 FX_BOOL CPWL_CheckBox::OnChar(uint16_t nChar, uint32_t nFlag) { | 48 bool CPWL_CheckBox::OnChar(uint16_t nChar, uint32_t nFlag) { |
| 50 SetCheck(!IsChecked()); | 49 SetCheck(!IsChecked()); |
| 51 return TRUE; | 50 return true; |
| 52 } | 51 } |
| 53 | 52 |
| 54 CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false) {} | 53 CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false) {} |
| 55 | 54 |
| 56 CPWL_RadioButton::~CPWL_RadioButton() {} | 55 CPWL_RadioButton::~CPWL_RadioButton() {} |
| 57 | 56 |
| 58 CFX_ByteString CPWL_RadioButton::GetClassName() const { | 57 CFX_ByteString CPWL_RadioButton::GetClassName() const { |
| 59 return "CPWL_RadioButton"; | 58 return "CPWL_RadioButton"; |
| 60 } | 59 } |
| 61 | 60 |
| 62 FX_BOOL CPWL_RadioButton::OnLButtonUp(const CFX_FloatPoint& point, | 61 bool CPWL_RadioButton::OnLButtonUp(const CFX_FloatPoint& point, |
| 63 uint32_t nFlag) { | 62 uint32_t nFlag) { |
| 64 if (IsReadOnly()) | 63 if (IsReadOnly()) |
| 65 return FALSE; | 64 return false; |
| 66 | 65 |
| 67 SetCheck(TRUE); | 66 SetCheck(true); |
| 68 return TRUE; | 67 return true; |
| 69 } | 68 } |
| 70 | 69 |
| 71 void CPWL_RadioButton::SetCheck(bool bCheck) { | 70 void CPWL_RadioButton::SetCheck(bool bCheck) { |
| 72 m_bChecked = bCheck; | 71 m_bChecked = bCheck; |
| 73 } | 72 } |
| 74 | 73 |
| 75 bool CPWL_RadioButton::IsChecked() const { | 74 bool CPWL_RadioButton::IsChecked() const { |
| 76 return m_bChecked; | 75 return m_bChecked; |
| 77 } | 76 } |
| 78 | 77 |
| 79 FX_BOOL CPWL_RadioButton::OnChar(uint16_t nChar, uint32_t nFlag) { | 78 bool CPWL_RadioButton::OnChar(uint16_t nChar, uint32_t nFlag) { |
| 80 SetCheck(TRUE); | 79 SetCheck(true); |
| 81 return TRUE; | 80 return true; |
| 82 } | 81 } |
| OLD | NEW |