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_IFWL_LISTBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_LISTBOX_H_ |
8 #define XFA_FWL_CORE_IFWL_LISTBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_LISTBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 20 matching lines...) Expand all Loading... |
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_MsgKillFocus; |
37 class CFWL_MsgMouse; | 37 class CFWL_MsgMouse; |
38 class CFWL_MsgMouseWheel; | 38 class CFWL_MsgMouseWheel; |
39 class CFX_DIBitmap; | 39 class CFX_DIBitmap; |
40 | 40 |
41 FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, | |
42 CFWL_EventType::SelectChanged, | |
43 CFX_Int32Array iarraySels;) | |
44 | |
45 class IFWL_ListBoxDP : public IFWL_DataProvider { | 41 class IFWL_ListBoxDP : public IFWL_DataProvider { |
46 public: | 42 public: |
47 virtual int32_t CountItems(const IFWL_Widget* pWidget) const = 0; | 43 virtual int32_t CountItems(const IFWL_Widget* pWidget) const = 0; |
48 virtual CFWL_ListItem* GetItem(const IFWL_Widget* pWidget, | 44 virtual CFWL_ListItem* GetItem(const IFWL_Widget* pWidget, |
49 int32_t nIndex) const = 0; | 45 int32_t nIndex) const = 0; |
50 virtual int32_t GetItemIndex(IFWL_Widget* pWidget, CFWL_ListItem* pItem) = 0; | 46 virtual int32_t GetItemIndex(IFWL_Widget* pWidget, CFWL_ListItem* pItem) = 0; |
51 virtual uint32_t GetItemStyles(IFWL_Widget* pWidget, | 47 virtual uint32_t GetItemStyles(IFWL_Widget* pWidget, |
52 CFWL_ListItem* pItem) = 0; | 48 CFWL_ListItem* pItem) = 0; |
53 virtual void GetItemText(IFWL_Widget* pWidget, | 49 virtual void GetItemText(IFWL_Widget* pWidget, |
54 CFWL_ListItem* pItem, | 50 CFWL_ListItem* pItem, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const CFX_Matrix* pMatrix = nullptr); | 137 const CFX_Matrix* pMatrix = nullptr); |
142 void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); | 138 void DrawStatic(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); |
143 CFX_SizeF CalcSize(bool bAutoSize = false); | 139 CFX_SizeF CalcSize(bool bAutoSize = false); |
144 void GetItemSize(CFX_SizeF& size, | 140 void GetItemSize(CFX_SizeF& size, |
145 CFWL_ListItem* hItem, | 141 CFWL_ListItem* hItem, |
146 FX_FLOAT fWidth, | 142 FX_FLOAT fWidth, |
147 FX_FLOAT fHeight, | 143 FX_FLOAT fHeight, |
148 bool bAutoSize = false); | 144 bool bAutoSize = false); |
149 FX_FLOAT GetMaxTextWidth(); | 145 FX_FLOAT GetMaxTextWidth(); |
150 FX_FLOAT GetScrollWidth(); | 146 FX_FLOAT GetScrollWidth(); |
151 void ProcessSelChanged(); | 147 |
152 void OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); | 148 void OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); |
153 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 149 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
154 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 150 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
155 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); | 151 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); |
156 void OnKeyDown(CFWL_MsgKey* pMsg); | 152 void OnKeyDown(CFWL_MsgKey* pMsg); |
157 void OnVK(CFWL_ListItem* hItem, bool bShift, bool bCtrl); | 153 void OnVK(CFWL_ListItem* hItem, bool bShift, bool bCtrl); |
158 bool OnScroll(IFWL_ScrollBar* pScrollBar, FWL_SCBCODE dwCode, FX_FLOAT fPos); | 154 bool OnScroll(IFWL_ScrollBar* pScrollBar, FWL_SCBCODE dwCode, FX_FLOAT fPos); |
159 void DispatchSelChangedEv(); | |
160 | 155 |
161 CFX_RectF m_rtClient; | 156 CFX_RectF m_rtClient; |
162 CFX_RectF m_rtStatic; | 157 CFX_RectF m_rtStatic; |
163 CFX_RectF m_rtConent; | 158 CFX_RectF m_rtConent; |
164 std::unique_ptr<IFWL_ScrollBar> m_pHorzScrollBar; | 159 std::unique_ptr<IFWL_ScrollBar> m_pHorzScrollBar; |
165 std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar; | 160 std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar; |
166 uint32_t m_dwTTOStyles; | 161 uint32_t m_dwTTOStyles; |
167 int32_t m_iTTOAligns; | 162 int32_t m_iTTOAligns; |
168 CFWL_ListItem* m_hAnchor; | 163 CFWL_ListItem* m_hAnchor; |
169 FX_FLOAT m_fItemHeight; | 164 FX_FLOAT m_fItemHeight; |
170 FX_FLOAT m_fScorllBarWidth; | 165 FX_FLOAT m_fScorllBarWidth; |
171 bool m_bLButtonDown; | 166 bool m_bLButtonDown; |
172 IFWL_ThemeProvider* m_pScrollBarTP; | 167 IFWL_ThemeProvider* m_pScrollBarTP; |
173 }; | 168 }; |
174 | 169 |
175 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ | 170 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ |
OLD | NEW |