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 "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
9 #include "../../include/pdfwindow/PWL_Button.h" | 9 #include "../../include/pdfwindow/PWL_Button.h" |
10 #include "../../include/pdfwindow/PWL_SpecialButton.h" | 10 #include "../../include/pdfwindow/PWL_SpecialButton.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 return "CPWL_PushButton"; | 25 return "CPWL_PushButton"; |
26 } | 26 } |
27 | 27 |
28 CPDF_Rect CPWL_PushButton::GetFocusRect() const | 28 CPDF_Rect CPWL_PushButton::GetFocusRect() const |
29 { | 29 { |
30 return CPWL_Utils::DeflateRect(GetWindowRect(), (FX_FLOAT)GetBorderWidth()); | 30 return CPWL_Utils::DeflateRect(GetWindowRect(), (FX_FLOAT)GetBorderWidth()); |
31 } | 31 } |
32 | 32 |
33 /* --------------------------- CPWL_CheckBox ---------------------------- */ | 33 /* --------------------------- CPWL_CheckBox ---------------------------- */ |
34 | 34 |
35 CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(FALSE) | 35 CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false) |
36 { | 36 { |
37 } | 37 } |
38 | 38 |
39 CPWL_CheckBox::~CPWL_CheckBox() | 39 CPWL_CheckBox::~CPWL_CheckBox() |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 CFX_ByteString CPWL_CheckBox::GetClassName() const | 43 CFX_ByteString CPWL_CheckBox::GetClassName() const |
44 { | 44 { |
45 return "CPWL_CheckBox"; | 45 return "CPWL_CheckBox"; |
46 } | 46 } |
47 | 47 |
48 void CPWL_CheckBox::SetCheck(FX_BOOL bCheck) | 48 void CPWL_CheckBox::SetCheck(bool bCheck) |
49 { | 49 { |
50 m_bChecked = bCheck; | 50 m_bChecked = bCheck; |
51 } | 51 } |
52 | 52 |
53 FX_BOOL CPWL_CheckBox::IsChecked() const | 53 bool CPWL_CheckBox::IsChecked() const |
54 { | 54 { |
55 return m_bChecked; | 55 return m_bChecked; |
56 } | 56 } |
57 | 57 |
58 FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) | 58 bool CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) |
59 { | 59 { |
60 » if (IsReadOnly()) return FALSE; | 60 » if (IsReadOnly()) return false; |
61 | 61 |
62 SetCheck(!IsChecked()); | 62 SetCheck(!IsChecked()); |
63 » return TRUE; | 63 » return true; |
64 } | 64 } |
65 | 65 |
66 FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) | 66 bool CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) |
67 { | 67 { |
68 SetCheck(!IsChecked()); | 68 SetCheck(!IsChecked()); |
69 » return TRUE; | 69 » return true; |
70 } | 70 } |
71 | 71 |
72 /* --------------------------- CPWL_RadioButton ---------------------------- */ | 72 /* --------------------------- CPWL_RadioButton ---------------------------- */ |
73 | 73 |
74 CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(FALSE) | 74 CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false) |
75 { | 75 { |
76 } | 76 } |
77 | 77 |
78 CPWL_RadioButton::~CPWL_RadioButton() | 78 CPWL_RadioButton::~CPWL_RadioButton() |
79 { | 79 { |
80 } | 80 } |
81 | 81 |
82 CFX_ByteString CPWL_RadioButton::GetClassName() const | 82 CFX_ByteString CPWL_RadioButton::GetClassName() const |
83 { | 83 { |
84 return "CPWL_RadioButton"; | 84 return "CPWL_RadioButton"; |
85 } | 85 } |
86 | 86 |
87 FX_BOOL»CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) | 87 bool» CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) |
88 { | 88 { |
89 » if (IsReadOnly()) return FALSE; | 89 » if (IsReadOnly()) return false; |
90 | 90 |
91 » SetCheck(TRUE); | 91 » SetCheck(true); |
92 » return TRUE; | 92 » return true; |
93 } | 93 } |
94 | 94 |
95 void CPWL_RadioButton::SetCheck(FX_BOOL bCheck) | 95 void CPWL_RadioButton::SetCheck(bool bCheck) |
96 { | 96 { |
97 m_bChecked = bCheck; | 97 m_bChecked = bCheck; |
98 } | 98 } |
99 | 99 |
100 FX_BOOL CPWL_RadioButton::IsChecked() const | 100 bool CPWL_RadioButton::IsChecked() const |
101 { | 101 { |
102 return m_bChecked; | 102 return m_bChecked; |
103 } | 103 } |
104 | 104 |
105 FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag) | 105 bool CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag) |
106 { | 106 { |
107 » SetCheck(TRUE); | 107 » SetCheck(true); |
108 » return TRUE; | 108 » return true; |
109 } | 109 } |
110 | 110 |
OLD | NEW |