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 20 matching lines...) Expand all Loading... |
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 FX_BOOL CPWL_CheckBox::OnLButtonUp(const CFX_FloatPoint& point, |
41 FX_DWORD nFlag) { | 41 uint32_t nFlag) { |
42 if (IsReadOnly()) | 42 if (IsReadOnly()) |
43 return FALSE; | 43 return FALSE; |
44 | 44 |
45 SetCheck(!IsChecked()); | 45 SetCheck(!IsChecked()); |
46 return TRUE; | 46 return TRUE; |
47 } | 47 } |
48 | 48 |
49 FX_BOOL CPWL_CheckBox::OnChar(uint16_t nChar, FX_DWORD nFlag) { | 49 FX_BOOL CPWL_CheckBox::OnChar(uint16_t nChar, uint32_t nFlag) { |
50 SetCheck(!IsChecked()); | 50 SetCheck(!IsChecked()); |
51 return TRUE; | 51 return TRUE; |
52 } | 52 } |
53 | 53 |
54 CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false) {} | 54 CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false) {} |
55 | 55 |
56 CPWL_RadioButton::~CPWL_RadioButton() {} | 56 CPWL_RadioButton::~CPWL_RadioButton() {} |
57 | 57 |
58 CFX_ByteString CPWL_RadioButton::GetClassName() const { | 58 CFX_ByteString CPWL_RadioButton::GetClassName() const { |
59 return "CPWL_RadioButton"; | 59 return "CPWL_RadioButton"; |
60 } | 60 } |
61 | 61 |
62 FX_BOOL CPWL_RadioButton::OnLButtonUp(const CFX_FloatPoint& point, | 62 FX_BOOL CPWL_RadioButton::OnLButtonUp(const CFX_FloatPoint& point, |
63 FX_DWORD nFlag) { | 63 uint32_t nFlag) { |
64 if (IsReadOnly()) | 64 if (IsReadOnly()) |
65 return FALSE; | 65 return FALSE; |
66 | 66 |
67 SetCheck(TRUE); | 67 SetCheck(TRUE); |
68 return TRUE; | 68 return TRUE; |
69 } | 69 } |
70 | 70 |
71 void CPWL_RadioButton::SetCheck(bool bCheck) { | 71 void CPWL_RadioButton::SetCheck(bool bCheck) { |
72 m_bChecked = bCheck; | 72 m_bChecked = bCheck; |
73 } | 73 } |
74 | 74 |
75 bool CPWL_RadioButton::IsChecked() const { | 75 bool CPWL_RadioButton::IsChecked() const { |
76 return m_bChecked; | 76 return m_bChecked; |
77 } | 77 } |
78 | 78 |
79 FX_BOOL CPWL_RadioButton::OnChar(uint16_t nChar, FX_DWORD nFlag) { | 79 FX_BOOL CPWL_RadioButton::OnChar(uint16_t nChar, uint32_t nFlag) { |
80 SetCheck(TRUE); | 80 SetCheck(TRUE); |
81 return TRUE; | 81 return TRUE; |
82 } | 82 } |
OLD | NEW |