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 | 10 |
11 #include "xfa/fde/tto/fde_textout.h" | 11 #include "xfa/fde/tto/fde_textout.h" |
12 #include "xfa/fwl/core/cfwl_message.h" | 12 #include "xfa/fwl/core/cfwl_message.h" |
13 #include "xfa/fwl/core/cfwl_themebackground.h" | 13 #include "xfa/fwl/core/cfwl_themebackground.h" |
14 #include "xfa/fwl/core/cfwl_themetext.h" | 14 #include "xfa/fwl/core/cfwl_themetext.h" |
15 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 15 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
16 #include "xfa/fwl/core/fwl_noteimp.h" | 16 #include "xfa/fwl/core/fwl_noteimp.h" |
17 #include "xfa/fwl/core/ifwl_checkbox.h" | 17 #include "xfa/fwl/core/ifwl_checkbox.h" |
18 #include "xfa/fwl/core/ifwl_themeprovider.h" | 18 #include "xfa/fwl/core/ifwl_themeprovider.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const int kCaptionMargin = 5; | 22 const int kCaptionMargin = 5; |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 // static | 26 IFWL_CheckBox::IFWL_CheckBox(const CFWL_WidgetImpProperties& properties) |
27 IFWL_CheckBox* IFWL_CheckBox::Create(const CFWL_WidgetImpProperties& properties, | 27 : IFWL_Widget(properties, nullptr), |
28 IFWL_Widget* pOuter) { | |
29 return new IFWL_CheckBox(properties, pOuter); | |
30 } | |
31 | |
32 IFWL_CheckBox::IFWL_CheckBox(const CFWL_WidgetImpProperties& properties, | |
33 IFWL_Widget* pOuter) | |
34 : IFWL_Widget(properties, pOuter), | |
35 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), | 28 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), |
36 m_iTTOAlign(FDE_TTOALIGNMENT_Center), | 29 m_iTTOAlign(FDE_TTOALIGNMENT_Center), |
37 m_bBtnDown(FALSE) { | 30 m_bBtnDown(FALSE) { |
38 m_rtClient.Reset(); | 31 m_rtClient.Reset(); |
39 m_rtBox.Reset(); | 32 m_rtBox.Reset(); |
40 m_rtCaption.Reset(); | 33 m_rtCaption.Reset(); |
41 m_rtFocus.Reset(); | 34 m_rtFocus.Reset(); |
42 } | 35 } |
43 | 36 |
44 IFWL_CheckBox::~IFWL_CheckBox() {} | 37 IFWL_CheckBox::~IFWL_CheckBox() {} |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { | 558 void CFWL_CheckBoxImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { |
566 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { | 559 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) { |
567 m_pOwner->DispatchKeyEvent(pMsg); | 560 m_pOwner->DispatchKeyEvent(pMsg); |
568 return; | 561 return; |
569 } | 562 } |
570 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 563 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
571 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 564 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
572 m_pOwner->NextStates(); | 565 m_pOwner->NextStates(); |
573 } | 566 } |
574 } | 567 } |
OLD | NEW |