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 #ifndef XFA_FWL_CORE_CFWL_LISTBOX_H_ | 7 #ifndef XFA_FWL_CFWL_LISTBOX_H_ |
8 #define XFA_FWL_CORE_CFWL_LISTBOX_H_ | 8 #define XFA_FWL_CFWL_LISTBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "xfa/fwl/core/cfwl_edit.h" | 13 #include "xfa/fwl/cfwl_edit.h" |
14 #include "xfa/fwl/core/cfwl_event.h" | 14 #include "xfa/fwl/cfwl_event.h" |
15 #include "xfa/fwl/core/cfwl_listbox.h" | 15 #include "xfa/fwl/cfwl_listbox.h" |
16 #include "xfa/fwl/core/cfwl_listitem.h" | 16 #include "xfa/fwl/cfwl_listitem.h" |
17 #include "xfa/fwl/core/cfwl_widget.h" | 17 #include "xfa/fwl/cfwl_widget.h" |
18 #include "xfa/fwl/core/cfwl_widgetproperties.h" | 18 #include "xfa/fwl/cfwl_widgetproperties.h" |
19 | 19 |
20 #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) | 20 #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) |
21 #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) | 21 #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) |
22 #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) | 22 #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) |
23 #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) | 23 #define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) |
24 #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) | 24 #define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) |
25 #define FWL_STYLEEXT_LTB_RightAlign (2L << 4) | 25 #define FWL_STYLEEXT_LTB_RightAlign (2L << 4) |
26 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) | 26 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) |
27 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) | 27 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) |
28 #define FWL_STYLEEXT_LTB_Icon (1L << 8) | 28 #define FWL_STYLEEXT_LTB_Icon (1L << 8) |
29 #define FWL_STYLEEXT_LTB_Check (1L << 9) | 29 #define FWL_STYLEEXT_LTB_Check (1L << 9) |
30 #define FWL_STYLEEXT_LTB_AlignMask (3L << 4) | 30 #define FWL_STYLEEXT_LTB_AlignMask (3L << 4) |
31 #define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) | 31 #define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) |
32 #define FWL_ITEMSTATE_LTB_Selected (1L << 0) | 32 #define FWL_ITEMSTATE_LTB_Selected (1L << 0) |
33 #define FWL_ITEMSTATE_LTB_Focused (1L << 1) | 33 #define FWL_ITEMSTATE_LTB_Focused (1L << 1) |
34 #define FWL_ITEMSTATE_LTB_Checked (1L << 2) | 34 #define FWL_ITEMSTATE_LTB_Checked (1L << 2) |
35 | 35 |
36 class CFWL_MsgKillFocus; | 36 class CFWL_MessageKillFocus; |
37 class CFWL_MsgMouse; | 37 class CFWL_MessageMouse; |
38 class CFWL_MsgMouseWheel; | 38 class CFWL_MessageMouseWheel; |
39 class CFX_DIBitmap; | 39 class CFX_DIBitmap; |
40 | 40 |
41 class CFWL_ListBox : public CFWL_Widget { | 41 class CFWL_ListBox : public CFWL_Widget { |
42 public: | 42 public: |
43 explicit CFWL_ListBox(const CFWL_App* pApp, | 43 explicit CFWL_ListBox(const CFWL_App* pApp, |
44 std::unique_ptr<CFWL_WidgetProperties> properties, | 44 std::unique_ptr<CFWL_WidgetProperties> properties, |
45 CFWL_Widget* pOuter); | 45 CFWL_Widget* pOuter); |
46 ~CFWL_ListBox() override; | 46 ~CFWL_ListBox() override; |
47 | 47 |
48 // CFWL_Widget | 48 // CFWL_Widget |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 CFX_SizeF CalcSize(bool bAutoSize); | 135 CFX_SizeF CalcSize(bool bAutoSize); |
136 void GetItemSize(CFX_SizeF& size, | 136 void GetItemSize(CFX_SizeF& size, |
137 CFWL_ListItem* hItem, | 137 CFWL_ListItem* hItem, |
138 FX_FLOAT fWidth, | 138 FX_FLOAT fWidth, |
139 FX_FLOAT fHeight, | 139 FX_FLOAT fHeight, |
140 bool bAutoSize); | 140 bool bAutoSize); |
141 FX_FLOAT GetMaxTextWidth(); | 141 FX_FLOAT GetMaxTextWidth(); |
142 FX_FLOAT GetScrollWidth(); | 142 FX_FLOAT GetScrollWidth(); |
143 | 143 |
144 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); | 144 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
145 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 145 void OnLButtonDown(CFWL_MessageMouse* pMsg); |
146 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 146 void OnLButtonUp(CFWL_MessageMouse* pMsg); |
147 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); | 147 void OnMouseWheel(CFWL_MessageMouseWheel* pMsg); |
148 void OnKeyDown(CFWL_MsgKey* pMsg); | 148 void OnKeyDown(CFWL_MessageKey* pMsg); |
149 void OnVK(CFWL_ListItem* hItem, bool bShift, bool bCtrl); | 149 void OnVK(CFWL_ListItem* hItem, bool bShift, bool bCtrl); |
150 bool OnScroll(CFWL_ScrollBar* pScrollBar, | 150 bool OnScroll(CFWL_ScrollBar* pScrollBar, |
151 CFWL_EvtScroll::Code dwCode, | 151 CFWL_EventScroll::Code dwCode, |
152 FX_FLOAT fPos); | 152 FX_FLOAT fPos); |
153 | 153 |
154 CFX_RectF m_rtClient; | 154 CFX_RectF m_rtClient; |
155 CFX_RectF m_rtStatic; | 155 CFX_RectF m_rtStatic; |
156 CFX_RectF m_rtConent; | 156 CFX_RectF m_rtConent; |
157 std::unique_ptr<CFWL_ScrollBar> m_pHorzScrollBar; | 157 std::unique_ptr<CFWL_ScrollBar> m_pHorzScrollBar; |
158 std::unique_ptr<CFWL_ScrollBar> m_pVertScrollBar; | 158 std::unique_ptr<CFWL_ScrollBar> m_pVertScrollBar; |
159 uint32_t m_dwTTOStyles; | 159 uint32_t m_dwTTOStyles; |
160 int32_t m_iTTOAligns; | 160 int32_t m_iTTOAligns; |
161 CFWL_ListItem* m_hAnchor; | 161 CFWL_ListItem* m_hAnchor; |
162 FX_FLOAT m_fItemHeight; | 162 FX_FLOAT m_fItemHeight; |
163 FX_FLOAT m_fScorllBarWidth; | 163 FX_FLOAT m_fScorllBarWidth; |
164 bool m_bLButtonDown; | 164 bool m_bLButtonDown; |
165 IFWL_ThemeProvider* m_pScrollBarTP; | 165 IFWL_ThemeProvider* m_pScrollBarTP; |
166 std::vector<std::unique_ptr<CFWL_ListItem>> m_ItemArray; | 166 std::vector<std::unique_ptr<CFWL_ListItem>> m_ItemArray; |
167 }; | 167 }; |
168 | 168 |
169 #endif // XFA_FWL_CORE_CFWL_LISTBOX_H_ | 169 #endif // XFA_FWL_CFWL_LISTBOX_H_ |
OLD | NEW |