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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void OnDrawWidget(CFX_Graphics* pGraphics, | 112 void OnDrawWidget(CFX_Graphics* pGraphics, |
113 const CFX_Matrix* pMatrix) override; | 113 const CFX_Matrix* pMatrix) override; |
114 | 114 |
115 int32_t CountSelItems(); | 115 int32_t CountSelItems(); |
116 CFWL_ListItem* GetSelItem(int32_t nIndexSel); | 116 CFWL_ListItem* GetSelItem(int32_t nIndexSel); |
117 int32_t GetSelIndex(int32_t nIndex); | 117 int32_t GetSelIndex(int32_t nIndex); |
118 void SetSelItem(CFWL_ListItem* hItem, bool bSelect = true); | 118 void SetSelItem(CFWL_ListItem* hItem, bool bSelect = true); |
119 void GetItemText(CFWL_ListItem* hItem, CFX_WideString& wsText); | 119 void GetItemText(CFWL_ListItem* hItem, CFX_WideString& wsText); |
120 void GetScrollPos(FX_FLOAT& fPos, bool bVert = true); | 120 void GetScrollPos(FX_FLOAT& fPos, bool bVert = true); |
121 | 121 |
| 122 FX_FLOAT GetItemHeight() const { return m_fItemHeight; } |
| 123 FX_FLOAT CalcItemHeight(); |
| 124 |
122 protected: | 125 protected: |
123 CFWL_ListItem* GetItem(CFWL_ListItem* hItem, uint32_t dwKeyCode); | 126 CFWL_ListItem* GetItem(CFWL_ListItem* hItem, uint32_t dwKeyCode); |
124 void SetSelection(CFWL_ListItem* hStart, CFWL_ListItem* hEnd, bool bSelected); | 127 void SetSelection(CFWL_ListItem* hStart, CFWL_ListItem* hEnd, bool bSelected); |
125 CFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); | 128 CFWL_ListItem* GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); |
126 bool ScrollToVisible(CFWL_ListItem* hItem); | 129 bool ScrollToVisible(CFWL_ListItem* hItem); |
127 FX_FLOAT CalcItemHeight(); | |
128 void InitScrollBar(bool bVert = true); | 130 void InitScrollBar(bool bVert = true); |
129 bool IsShowScrollBar(bool bVert); | 131 bool IsShowScrollBar(bool bVert); |
130 FX_FLOAT GetItemHeight() const { return m_fItemHeight; } | |
131 IFWL_ScrollBar* GetVertScrollBar() const { return m_pVertScrollBar.get(); } | 132 IFWL_ScrollBar* GetVertScrollBar() const { return m_pVertScrollBar.get(); } |
132 const CFX_RectF& GetRTClient() const { return m_rtClient; } | 133 const CFX_RectF& GetRTClient() const { return m_rtClient; } |
133 | 134 |
134 private: | 135 private: |
135 void SetSelectionDirect(CFWL_ListItem* hItem, bool bSelect); | 136 void SetSelectionDirect(CFWL_ListItem* hItem, bool bSelect); |
136 bool IsItemSelected(CFWL_ListItem* hItem); | 137 bool IsItemSelected(CFWL_ListItem* hItem); |
137 void ClearSelection(); | 138 void ClearSelection(); |
138 void SelectAll(); | 139 void SelectAll(); |
139 CFWL_ListItem* GetFocusedItem(); | 140 CFWL_ListItem* GetFocusedItem(); |
140 void SetFocusItem(CFWL_ListItem* hItem); | 141 void SetFocusItem(CFWL_ListItem* hItem); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 uint32_t m_dwTTOStyles; | 181 uint32_t m_dwTTOStyles; |
181 int32_t m_iTTOAligns; | 182 int32_t m_iTTOAligns; |
182 CFWL_ListItem* m_hAnchor; | 183 CFWL_ListItem* m_hAnchor; |
183 FX_FLOAT m_fItemHeight; | 184 FX_FLOAT m_fItemHeight; |
184 FX_FLOAT m_fScorllBarWidth; | 185 FX_FLOAT m_fScorllBarWidth; |
185 bool m_bLButtonDown; | 186 bool m_bLButtonDown; |
186 IFWL_ThemeProvider* m_pScrollBarTP; | 187 IFWL_ThemeProvider* m_pScrollBarTP; |
187 }; | 188 }; |
188 | 189 |
189 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ | 190 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ |
OLD | NEW |