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/src/fwl/src/basewidget/fwl_listboximp.h" | 7 #include "xfa/src/fwl/basewidget/fwl_listboximp.h" |
8 | 8 |
9 #include "xfa/include/fwl/core/fwl_theme.h" | 9 #include "xfa/include/fwl/core/fwl_theme.h" |
10 #include "xfa/src/fdp/include/fde_tto.h" | 10 #include "xfa/src/fdp/include/fde_tto.h" |
11 #include "xfa/src/fwl/src/basewidget/fwl_comboboximp.h" | 11 #include "xfa/src/fwl/basewidget/fwl_comboboximp.h" |
12 #include "xfa/src/fwl/src/basewidget/fwl_scrollbarimp.h" | 12 #include "xfa/src/fwl/basewidget/fwl_scrollbarimp.h" |
13 #include "xfa/src/fwl/src/core/fwl_noteimp.h" | 13 #include "xfa/src/fwl/core/fwl_noteimp.h" |
14 #include "xfa/src/fwl/src/core/fwl_targetimp.h" | 14 #include "xfa/src/fwl/core/fwl_targetimp.h" |
15 #include "xfa/src/fwl/src/core/fwl_widgetimp.h" | 15 #include "xfa/src/fwl/core/fwl_widgetimp.h" |
16 | 16 |
17 #define FWL_LISTBOX_ItemTextMargin 2 | 17 #define FWL_LISTBOX_ItemTextMargin 2 |
18 | 18 |
19 // static | 19 // static |
20 IFWL_ListBox* IFWL_ListBox::Create(const CFWL_WidgetImpProperties& properties, | 20 IFWL_ListBox* IFWL_ListBox::Create(const CFWL_WidgetImpProperties& properties, |
21 IFWL_Widget* pOuter) { | 21 IFWL_Widget* pOuter) { |
22 IFWL_ListBox* pListBox = new IFWL_ListBox; | 22 IFWL_ListBox* pListBox = new IFWL_ListBox; |
23 CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(properties, pOuter); | 23 CFWL_ListBoxImp* pListBoxImpl = new CFWL_ListBoxImp(properties, pOuter); |
24 pListBox->SetImpl(pListBoxImpl); | 24 pListBox->SetImpl(pListBoxImpl); |
25 pListBoxImpl->SetInterface(pListBox); | 25 pListBoxImpl->SetInterface(pListBox); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 m_dwTTOStyles(0), | 64 m_dwTTOStyles(0), |
65 m_iTTOAligns(0), | 65 m_iTTOAligns(0), |
66 m_hAnchor(NULL), | 66 m_hAnchor(NULL), |
67 m_fScorllBarWidth(0), | 67 m_fScorllBarWidth(0), |
68 m_bLButtonDown(FALSE), | 68 m_bLButtonDown(FALSE), |
69 m_pScrollBarTP(NULL) { | 69 m_pScrollBarTP(NULL) { |
70 m_rtClient.Reset(); | 70 m_rtClient.Reset(); |
71 m_rtConent.Reset(); | 71 m_rtConent.Reset(); |
72 m_rtStatic.Reset(); | 72 m_rtStatic.Reset(); |
73 } | 73 } |
74 CFWL_ListBoxImp::~CFWL_ListBoxImp() { | 74 CFWL_ListBoxImp::~CFWL_ListBoxImp() {} |
75 } | |
76 FWL_ERR CFWL_ListBoxImp::GetClassName(CFX_WideString& wsClass) const { | 75 FWL_ERR CFWL_ListBoxImp::GetClassName(CFX_WideString& wsClass) const { |
77 wsClass = FWL_CLASS_ListBox; | 76 wsClass = FWL_CLASS_ListBox; |
78 return FWL_ERR_Succeeded; | 77 return FWL_ERR_Succeeded; |
79 } | 78 } |
80 FX_DWORD CFWL_ListBoxImp::GetClassID() const { | 79 FX_DWORD CFWL_ListBoxImp::GetClassID() const { |
81 return FWL_CLASSHASH_ListBox; | 80 return FWL_CLASSHASH_ListBox; |
82 } | 81 } |
83 FWL_ERR CFWL_ListBoxImp::Initialize() { | 82 FWL_ERR CFWL_ListBoxImp::Initialize() { |
84 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) | 83 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) |
85 return FWL_ERR_Indefinite; | 84 return FWL_ERR_Indefinite; |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 pScrollBar->SetTrackPos(fPos); | 1232 pScrollBar->SetTrackPos(fPos); |
1234 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 1233 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
1235 } | 1234 } |
1236 return TRUE; | 1235 return TRUE; |
1237 } | 1236 } |
1238 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { | 1237 void CFWL_ListBoxImpDelegate::DispatchSelChangedEv() { |
1239 CFWL_EvtLtbSelChanged ev; | 1238 CFWL_EvtLtbSelChanged ev; |
1240 ev.m_pSrcTarget = m_pOwner->m_pInterface; | 1239 ev.m_pSrcTarget = m_pOwner->m_pInterface; |
1241 m_pOwner->DispatchEvent(&ev); | 1240 m_pOwner->DispatchEvent(&ev); |
1242 } | 1241 } |
OLD | NEW |