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 "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
8 #include "../core/include/fwl_targetimp.h" | 8 #include "../core/include/fwl_targetimp.h" |
9 #include "../core/include/fwl_noteimp.h" | 9 #include "../core/include/fwl_noteimp.h" |
10 #include "../core/include/fwl_widgetimp.h" | 10 #include "../core/include/fwl_widgetimp.h" |
11 #include "include/fwl_scrollbarimp.h" | 11 #include "include/fwl_scrollbarimp.h" |
12 #include "include/fwl_listboximp.h" | 12 #include "include/fwl_listboximp.h" |
13 #define FWL_LISTBOX_ItemTextMargin 2 | 13 #define FWL_LISTBOX_ItemTextMargin 2 |
14 IFWL_ListBox* IFWL_ListBox::Create() { | 14 IFWL_ListBox* IFWL_ListBox::Create() { |
15 return new IFWL_ListBox; | 15 return new IFWL_ListBox; |
16 } | 16 } |
17 IFWL_ListBox::IFWL_ListBox() { | 17 IFWL_ListBox::IFWL_ListBox() { |
18 } | 18 } |
19 FWL_ERR IFWL_ListBox::Initialize(IFWL_Widget* pOuter) { | |
20 CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(pOuter); | |
21 SetImpl(pListBoxImpl); | |
22 pListBoxImpl->SetInterface(this); | |
23 return pListBoxImpl->Initialize(); | |
24 } | |
25 FWL_ERR IFWL_ListBox::Initialize(const CFWL_WidgetImpProperties& properties, | 19 FWL_ERR IFWL_ListBox::Initialize(const CFWL_WidgetImpProperties& properties, |
26 IFWL_Widget* pOuter) { | 20 IFWL_Widget* pOuter) { |
27 CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(properties, pOuter); | 21 CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(properties, pOuter); |
28 SetImpl(pListBoxImpl); | 22 SetImpl(pListBoxImpl); |
29 pListBoxImpl->SetInterface(this); | 23 pListBoxImpl->SetInterface(this); |
30 return pListBoxImpl->Initialize(); | 24 return pListBoxImpl->Initialize(); |
31 } | 25 } |
32 int32_t IFWL_ListBox::CountSelItems() { | 26 int32_t IFWL_ListBox::CountSelItems() { |
33 return static_cast<CFWL_ListBoxImp*>(GetImpl())->CountSelItems(); | 27 return static_cast<CFWL_ListBoxImp*>(GetImpl())->CountSelItems(); |
34 } | 28 } |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 pScrollBar->SetTrackPos(fPos); | 1199 pScrollBar->SetTrackPos(fPos); |
1206 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1200 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
1207 } | 1201 } |
1208 return TRUE; | 1202 return TRUE; |
1209 } | 1203 } |
1210 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { | 1204 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { |
1211 CFWL_EvtLtbSelChanged ev; | 1205 CFWL_EvtLtbSelChanged ev; |
1212 ev.m_pSrcTarget = m_pOwner->m_pInterface; | 1206 ev.m_pSrcTarget = m_pOwner->m_pInterface; |
1213 m_pOwner->DispatchEvent(&ev); | 1207 m_pOwner->DispatchEvent(&ev); |
1214 } | 1208 } |
OLD | NEW |