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/basewidget/fwl_listboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_listboximp.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" | 10 #include "xfa/fwl/basewidget/fwl_comboboximp.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 m_dwTTOStyles(0), | 69 m_dwTTOStyles(0), |
70 m_iTTOAligns(0), | 70 m_iTTOAligns(0), |
71 m_hAnchor(NULL), | 71 m_hAnchor(NULL), |
72 m_fScorllBarWidth(0), | 72 m_fScorllBarWidth(0), |
73 m_bLButtonDown(FALSE), | 73 m_bLButtonDown(FALSE), |
74 m_pScrollBarTP(NULL) { | 74 m_pScrollBarTP(NULL) { |
75 m_rtClient.Reset(); | 75 m_rtClient.Reset(); |
76 m_rtConent.Reset(); | 76 m_rtConent.Reset(); |
77 m_rtStatic.Reset(); | 77 m_rtStatic.Reset(); |
78 } | 78 } |
| 79 |
79 CFWL_ListBoxImp::~CFWL_ListBoxImp() {} | 80 CFWL_ListBoxImp::~CFWL_ListBoxImp() {} |
| 81 |
80 FWL_Error CFWL_ListBoxImp::GetClassName(CFX_WideString& wsClass) const { | 82 FWL_Error CFWL_ListBoxImp::GetClassName(CFX_WideString& wsClass) const { |
81 wsClass = FWL_CLASS_ListBox; | 83 wsClass = FWL_CLASS_ListBox; |
82 return FWL_Error::Succeeded; | 84 return FWL_Error::Succeeded; |
83 } | 85 } |
84 uint32_t CFWL_ListBoxImp::GetClassID() const { | 86 |
85 return FWL_CLASSHASH_ListBox; | 87 FWL_Type CFWL_ListBoxImp::GetClassID() const { |
| 88 return FWL_Type::ListBox; |
86 } | 89 } |
| 90 |
87 FWL_Error CFWL_ListBoxImp::Initialize() { | 91 FWL_Error CFWL_ListBoxImp::Initialize() { |
88 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 92 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
89 return FWL_Error::Indefinite; | 93 return FWL_Error::Indefinite; |
| 94 |
90 m_pDelegate = new CFWL_ListBoxImpDelegate(this); | 95 m_pDelegate = new CFWL_ListBoxImpDelegate(this); |
91 return FWL_Error::Succeeded; | 96 return FWL_Error::Succeeded; |
92 } | 97 } |
| 98 |
93 FWL_Error CFWL_ListBoxImp::Finalize() { | 99 FWL_Error CFWL_ListBoxImp::Finalize() { |
94 if (m_pVertScrollBar) { | 100 if (m_pVertScrollBar) { |
95 m_pVertScrollBar->Finalize(); | 101 m_pVertScrollBar->Finalize(); |
96 } | 102 } |
97 if (m_pHorzScrollBar) { | 103 if (m_pHorzScrollBar) { |
98 m_pHorzScrollBar->Finalize(); | 104 m_pHorzScrollBar->Finalize(); |
99 } | 105 } |
100 delete m_pDelegate; | 106 delete m_pDelegate; |
101 m_pDelegate = nullptr; | 107 m_pDelegate = nullptr; |
102 return CFWL_WidgetImp::Finalize(); | 108 return CFWL_WidgetImp::Finalize(); |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 pScrollBar->SetTrackPos(fPos); | 1226 pScrollBar->SetTrackPos(fPos); |
1221 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1227 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
1222 } | 1228 } |
1223 return TRUE; | 1229 return TRUE; |
1224 } | 1230 } |
1225 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { | 1231 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { |
1226 CFWL_EvtLtbSelChanged ev; | 1232 CFWL_EvtLtbSelChanged ev; |
1227 ev.m_pSrcTarget = m_pOwner->m_pInterface; | 1233 ev.m_pSrcTarget = m_pOwner->m_pInterface; |
1228 m_pOwner->DispatchEvent(&ev); | 1234 m_pOwner->DispatchEvent(&ev); |
1229 } | 1235 } |
OLD | NEW |