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_combobox.h" | 7 #include "xfa/fwl/core/ifwl_combobox.h" |
8 | 8 |
9 #include "xfa/fde/cfde_txtedtengine.h" | 9 #include "xfa/fde/cfde_txtedtengine.h" |
10 #include "xfa/fde/tto/fde_textout.h" | 10 #include "xfa/fde/tto/fde_textout.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 m_iBtnState(CFWL_PartState_Normal), | 28 m_iBtnState(CFWL_PartState_Normal), |
29 m_fComboFormHandler(0), | 29 m_fComboFormHandler(0), |
30 m_bNeedShowList(FALSE) { | 30 m_bNeedShowList(FALSE) { |
31 m_rtClient.Reset(); | 31 m_rtClient.Reset(); |
32 m_rtBtn.Reset(); | 32 m_rtBtn.Reset(); |
33 m_rtHandler.Reset(); | 33 m_rtHandler.Reset(); |
34 } | 34 } |
35 | 35 |
36 IFWL_ComboBox::~IFWL_ComboBox() {} | 36 IFWL_ComboBox::~IFWL_ComboBox() {} |
37 | 37 |
38 FWL_Error IFWL_ComboBox::GetClassName(CFX_WideString& wsClass) const { | |
39 wsClass = FWL_CLASS_ComboBox; | |
40 return FWL_Error::Succeeded; | |
41 } | |
42 | |
43 FWL_Type IFWL_ComboBox::GetClassID() const { | 38 FWL_Type IFWL_ComboBox::GetClassID() const { |
44 return FWL_Type::ComboBox; | 39 return FWL_Type::ComboBox; |
45 } | 40 } |
46 | 41 |
47 FWL_Error IFWL_ComboBox::Initialize() { | 42 FWL_Error IFWL_ComboBox::Initialize() { |
48 if (m_pWidgetMgr->IsFormDisabled()) | 43 if (m_pWidgetMgr->IsFormDisabled()) |
49 return DisForm_Initialize(); | 44 return DisForm_Initialize(); |
50 | 45 |
51 if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) | 46 if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) |
52 return FWL_Error::Indefinite; | 47 return FWL_Error::Indefinite; |
(...skipping 14 matching lines...) Expand all Loading... |
67 m_pEdit->Initialize(); | 62 m_pEdit->Initialize(); |
68 m_pEdit->SetOuter(this); | 63 m_pEdit->SetOuter(this); |
69 } | 64 } |
70 if (m_pEdit) | 65 if (m_pEdit) |
71 m_pEdit->SetParent(this); | 66 m_pEdit->SetParent(this); |
72 | 67 |
73 SetStates(m_pProperties->m_dwStates); | 68 SetStates(m_pProperties->m_dwStates); |
74 return FWL_Error::Succeeded; | 69 return FWL_Error::Succeeded; |
75 } | 70 } |
76 | 71 |
77 FWL_Error IFWL_ComboBox::Finalize() { | 72 void IFWL_ComboBox::Finalize() { |
78 if (m_pEdit) { | 73 if (m_pEdit) |
79 m_pEdit->Finalize(); | 74 m_pEdit->Finalize(); |
80 } | 75 |
81 m_pListBox->Finalize(); | 76 m_pListBox->Finalize(); |
82 delete m_pDelegate; | 77 delete m_pDelegate; |
83 m_pDelegate = nullptr; | 78 m_pDelegate = nullptr; |
84 return IFWL_Widget::Finalize(); | 79 IFWL_Widget::Finalize(); |
85 } | 80 } |
86 | 81 |
87 FWL_Error IFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 82 FWL_Error IFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
88 if (bAutoSize) { | 83 if (bAutoSize) { |
89 rect.Reset(); | 84 rect.Reset(); |
90 FX_BOOL bIsDropDown = IsDropDownStyle(); | 85 FX_BOOL bIsDropDown = IsDropDownStyle(); |
91 if (bIsDropDown && m_pEdit) { | 86 if (bIsDropDown && m_pEdit) { |
92 m_pEdit->GetWidgetRect(rect, TRUE); | 87 m_pEdit->GetWidgetRect(rect, TRUE); |
93 } else { | 88 } else { |
94 rect.width = 100; | 89 rect.width = 100; |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 } | 1424 } |
1430 | 1425 |
1431 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, | 1426 void CFWL_ComboProxyImpDelegate::OnFocusChanged(CFWL_MsgKillFocus* pMsg, |
1432 FX_BOOL bSet) { | 1427 FX_BOOL bSet) { |
1433 if (!bSet) { | 1428 if (!bSet) { |
1434 if (!pMsg->m_pSetFocus) { | 1429 if (!pMsg->m_pSetFocus) { |
1435 m_pComboBox->ShowDropList(FALSE); | 1430 m_pComboBox->ShowDropList(FALSE); |
1436 } | 1431 } |
1437 } | 1432 } |
1438 } | 1433 } |
OLD | NEW |