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 "xfa/fwl/core/ifwl_checkbox.h" | 7 #include "xfa/fwl/core/ifwl_checkbox.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "third_party/base/ptr_util.h" | 13 #include "third_party/base/ptr_util.h" |
14 #include "xfa/fde/tto/fde_textout.h" | 14 #include "xfa/fde/tto/fde_textout.h" |
| 15 #include "xfa/fwl/core/cfwl_app.h" |
15 #include "xfa/fwl/core/cfwl_evtcheckstatechanged.h" | 16 #include "xfa/fwl/core/cfwl_evtcheckstatechanged.h" |
16 #include "xfa/fwl/core/cfwl_msgkey.h" | 17 #include "xfa/fwl/core/cfwl_msgkey.h" |
17 #include "xfa/fwl/core/cfwl_msgmouse.h" | 18 #include "xfa/fwl/core/cfwl_msgmouse.h" |
18 #include "xfa/fwl/core/cfwl_notedriver.h" | 19 #include "xfa/fwl/core/cfwl_notedriver.h" |
19 #include "xfa/fwl/core/cfwl_themebackground.h" | 20 #include "xfa/fwl/core/cfwl_themebackground.h" |
20 #include "xfa/fwl/core/cfwl_themetext.h" | 21 #include "xfa/fwl/core/cfwl_themetext.h" |
21 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 22 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
22 #include "xfa/fwl/core/ifwl_app.h" | |
23 #include "xfa/fwl/core/ifwl_themeprovider.h" | 23 #include "xfa/fwl/core/ifwl_themeprovider.h" |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 const int kCaptionMargin = 5; | 27 const int kCaptionMargin = 5; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 IFWL_CheckBox::IFWL_CheckBox(const IFWL_App* app, | 31 IFWL_CheckBox::IFWL_CheckBox(const CFWL_App* app, |
32 std::unique_ptr<CFWL_WidgetProperties> properties) | 32 std::unique_ptr<CFWL_WidgetProperties> properties) |
33 : IFWL_Widget(app, std::move(properties), nullptr), | 33 : IFWL_Widget(app, std::move(properties), nullptr), |
34 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), | 34 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), |
35 m_iTTOAlign(FDE_TTOALIGNMENT_Center), | 35 m_iTTOAlign(FDE_TTOALIGNMENT_Center), |
36 m_bBtnDown(false) { | 36 m_bBtnDown(false) { |
37 m_rtClient.Reset(); | 37 m_rtClient.Reset(); |
38 m_rtBox.Reset(); | 38 m_rtBox.Reset(); |
39 m_rtCaption.Reset(); | 39 m_rtCaption.Reset(); |
40 m_rtFocus.Reset(); | 40 m_rtFocus.Reset(); |
41 } | 41 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 void IFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { | 486 void IFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { |
487 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { | 487 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { |
488 DispatchKeyEvent(pMsg); | 488 DispatchKeyEvent(pMsg); |
489 return; | 489 return; |
490 } | 490 } |
491 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 491 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
492 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 492 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
493 NextStates(); | 493 NextStates(); |
494 } | 494 } |
495 } | 495 } |
OLD | NEW |