| 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 14 matching lines...) Expand all Loading... |
| 25 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) | 25 #define FWL_STYLEEXT_LTB_MultiLine (1L << 6) |
| 26 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) | 26 #define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) |
| 27 #define FWL_STYLEEXT_LTB_Icon (1L << 8) | 27 #define FWL_STYLEEXT_LTB_Icon (1L << 8) |
| 28 #define FWL_STYLEEXT_LTB_Check (1L << 9) | 28 #define FWL_STYLEEXT_LTB_Check (1L << 9) |
| 29 #define FWL_STYLEEXT_LTB_AlignMask (3L << 4) | 29 #define FWL_STYLEEXT_LTB_AlignMask (3L << 4) |
| 30 #define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) | 30 #define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) |
| 31 #define FWL_ITEMSTATE_LTB_Selected (1L << 0) | 31 #define FWL_ITEMSTATE_LTB_Selected (1L << 0) |
| 32 #define FWL_ITEMSTATE_LTB_Focused (1L << 1) | 32 #define FWL_ITEMSTATE_LTB_Focused (1L << 1) |
| 33 #define FWL_ITEMSTATE_LTB_Checked (1L << 2) | 33 #define FWL_ITEMSTATE_LTB_Checked (1L << 2) |
| 34 | 34 |
| 35 class CFWL_ListBoxImpDelegate; | |
| 36 class CFWL_MsgKillFocus; | 35 class CFWL_MsgKillFocus; |
| 37 class CFWL_MsgMouse; | 36 class CFWL_MsgMouse; |
| 38 class CFWL_MsgMouseWheel; | 37 class CFWL_MsgMouseWheel; |
| 39 class CFX_DIBitmap; | 38 class CFX_DIBitmap; |
| 40 | 39 |
| 41 FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, | 40 FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, |
| 42 CFWL_EventType::SelectChanged, | 41 CFWL_EventType::SelectChanged, |
| 43 CFX_Int32Array iarraySels;) | 42 CFX_Int32Array iarraySels;) |
| 44 | 43 |
| 45 FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, | 44 FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ~IFWL_ListBox() override; | 107 ~IFWL_ListBox() override; |
| 109 | 108 |
| 110 // IFWL_Widget | 109 // IFWL_Widget |
| 111 FWL_Type GetClassID() const override; | 110 FWL_Type GetClassID() const override; |
| 112 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 111 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
| 113 FWL_Error Update() override; | 112 FWL_Error Update() override; |
| 114 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 113 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
| 115 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 114 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 116 const CFX_Matrix* pMatrix = nullptr) override; | 115 const CFX_Matrix* pMatrix = nullptr) override; |
| 117 FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; | 116 FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; |
| 117 void OnProcessMessage(CFWL_Message* pMessage) override; |
| 118 void OnProcessEvent(CFWL_Event* pEvent) override; |
| 119 void OnDrawWidget(CFX_Graphics* pGraphics, |
| 120 const CFX_Matrix* pMatrix) override; |
| 118 | 121 |
| 119 int32_t CountSelItems(); | 122 int32_t CountSelItems(); |
| 120 IFWL_ListItem* GetSelItem(int32_t nIndexSel); | 123 IFWL_ListItem* GetSelItem(int32_t nIndexSel); |
| 121 int32_t GetSelIndex(int32_t nIndex); | 124 int32_t GetSelIndex(int32_t nIndex); |
| 122 FWL_Error SetSelItem(IFWL_ListItem* hItem, FX_BOOL bSelect = TRUE); | 125 FWL_Error SetSelItem(IFWL_ListItem* hItem, FX_BOOL bSelect = TRUE); |
| 123 FWL_Error GetItemText(IFWL_ListItem* hItem, CFX_WideString& wsText); | 126 FWL_Error GetItemText(IFWL_ListItem* hItem, CFX_WideString& wsText); |
| 124 FWL_Error GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); | 127 FWL_Error GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); |
| 125 FWL_Error* Sort(IFWL_ListBoxCompare* pCom); | 128 FWL_Error* Sort(IFWL_ListBoxCompare* pCom); |
| 126 | 129 |
| 127 protected: | 130 protected: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 CFX_RectF m_rtConent; | 176 CFX_RectF m_rtConent; |
| 174 std::unique_ptr<IFWL_ScrollBar> m_pHorzScrollBar; | 177 std::unique_ptr<IFWL_ScrollBar> m_pHorzScrollBar; |
| 175 std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar; | 178 std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar; |
| 176 uint32_t m_dwTTOStyles; | 179 uint32_t m_dwTTOStyles; |
| 177 int32_t m_iTTOAligns; | 180 int32_t m_iTTOAligns; |
| 178 IFWL_ListItem* m_hAnchor; | 181 IFWL_ListItem* m_hAnchor; |
| 179 FX_FLOAT m_fItemHeight; | 182 FX_FLOAT m_fItemHeight; |
| 180 FX_FLOAT m_fScorllBarWidth; | 183 FX_FLOAT m_fScorllBarWidth; |
| 181 FX_BOOL m_bLButtonDown; | 184 FX_BOOL m_bLButtonDown; |
| 182 IFWL_ThemeProvider* m_pScrollBarTP; | 185 IFWL_ThemeProvider* m_pScrollBarTP; |
| 183 }; | |
| 184 | 186 |
| 185 class CFWL_ListBoxImpDelegate : public CFWL_WidgetImpDelegate { | 187 private: |
| 186 public: | |
| 187 CFWL_ListBoxImpDelegate(IFWL_ListBox* pOwner); | |
| 188 void OnProcessMessage(CFWL_Message* pMessage) override; | |
| 189 void OnProcessEvent(CFWL_Event* pEvent) override; | |
| 190 void OnDrawWidget(CFX_Graphics* pGraphics, | |
| 191 const CFX_Matrix* pMatrix = nullptr) override; | |
| 192 | |
| 193 protected: | |
| 194 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 188 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
| 195 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 189 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 196 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 190 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 197 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); | 191 void OnMouseWheel(CFWL_MsgMouseWheel* pMsg); |
| 198 void OnKeyDown(CFWL_MsgKey* pMsg); | 192 void OnKeyDown(CFWL_MsgKey* pMsg); |
| 199 void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl); | 193 void OnVK(IFWL_ListItem* hItem, FX_BOOL bShift, FX_BOOL bCtrl); |
| 200 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); | 194 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); |
| 201 void DispatchSelChangedEv(); | 195 void DispatchSelChangedEv(); |
| 202 IFWL_ListBox* m_pOwner; | |
| 203 }; | 196 }; |
| 204 | 197 |
| 205 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ | 198 #endif // XFA_FWL_CORE_IFWL_LISTBOX_H_ |
| OLD | NEW |