| 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_COMBOBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_COMBOBOX_H_ |
| 8 #define XFA_FWL_CORE_IFWL_COMBOBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_COMBOBOX_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "xfa/fwl/core/ifwl_comboboxproxy.h" | 12 #include "xfa/fwl/core/cfwl_comboboxproxy.h" |
| 13 #include "xfa/fwl/core/ifwl_comboedit.h" | 13 #include "xfa/fwl/core/cfwl_comboedit.h" |
| 14 #include "xfa/fwl/core/ifwl_combolist.h" | 14 #include "xfa/fwl/core/cfwl_combolist.h" |
| 15 #include "xfa/fwl/core/ifwl_form.h" | 15 #include "xfa/fwl/core/cfwl_form.h" |
| 16 #include "xfa/fwl/core/ifwl_listbox.h" | 16 #include "xfa/fwl/core/ifwl_listbox.h" |
| 17 #include "xfa/fxgraphics/cfx_graphics.h" | 17 #include "xfa/fxgraphics/cfx_graphics.h" |
| 18 | 18 |
| 19 class CFWL_WidgetProperties; | 19 class CFWL_WidgetProperties; |
| 20 class IFWL_ComboBox; | 20 class IFWL_ComboBox; |
| 21 class IFWL_ComboBoxProxy; | 21 class CFWL_ComboBoxProxy; |
| 22 class IFWL_FormProxy; | 22 class CFWL_FormProxy; |
| 23 class IFWL_ListBox; | 23 class IFWL_ListBox; |
| 24 class IFWL_Widget; | 24 class IFWL_Widget; |
| 25 | 25 |
| 26 #define FWL_STYLEEXT_CMB_DropList (0L << 0) | 26 #define FWL_STYLEEXT_CMB_DropList (0L << 0) |
| 27 #define FWL_STYLEEXT_CMB_DropDown (1L << 0) | 27 #define FWL_STYLEEXT_CMB_DropDown (1L << 0) |
| 28 #define FWL_STYLEEXT_CMB_Sort (1L << 1) | 28 #define FWL_STYLEEXT_CMB_Sort (1L << 1) |
| 29 #define FWL_STYLEEXT_CMB_ListDrag (1L << 2) | 29 #define FWL_STYLEEXT_CMB_ListDrag (1L << 2) |
| 30 #define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) | 30 #define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) |
| 31 #define FWL_STYLEEXT_CMB_EditHNear (0L << 4) | 31 #define FWL_STYLEEXT_CMB_EditHNear (0L << 4) |
| 32 #define FWL_STYLEEXT_CMB_EditHCenter (1L << 4) | 32 #define FWL_STYLEEXT_CMB_EditHCenter (1L << 4) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void GetBBox(CFX_RectF& rect) const; | 107 void GetBBox(CFX_RectF& rect) const; |
| 108 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); | 108 void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); |
| 109 | 109 |
| 110 void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); | 110 void DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); |
| 111 bool IsDropListVisible() const { | 111 bool IsDropListVisible() const { |
| 112 return m_pComboBoxProxy && | 112 return m_pComboBoxProxy && |
| 113 !(m_pComboBoxProxy->GetStates() & FWL_WGTSTATE_Invisible); | 113 !(m_pComboBoxProxy->GetStates() & FWL_WGTSTATE_Invisible); |
| 114 } | 114 } |
| 115 void ShowDropList(bool bActivate); | 115 void ShowDropList(bool bActivate); |
| 116 | 116 |
| 117 IFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); } | 117 CFWL_ComboEdit* GetComboEdit() const { return m_pEdit.get(); } |
| 118 | 118 |
| 119 void ProcessSelChanged(bool bLButtonUp); | 119 void ProcessSelChanged(bool bLButtonUp); |
| 120 int32_t GetCurrentSelection() const { return m_iCurSel; } | 120 int32_t GetCurrentSelection() const { return m_iCurSel; } |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 bool IsDropDownStyle() const { | 123 bool IsDropDownStyle() const { |
| 124 return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown); | 124 return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown); |
| 125 } | 125 } |
| 126 void MatchEditText(); | 126 void MatchEditText(); |
| 127 void SyncEditText(int32_t iListItem); | 127 void SyncEditText(int32_t iListItem); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 155 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); | 155 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 156 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); | 156 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); |
| 157 void DisForm_OnKey(CFWL_MsgKey* pMsg); | 157 void DisForm_OnKey(CFWL_MsgKey* pMsg); |
| 158 | 158 |
| 159 CFX_RectF m_rtClient; | 159 CFX_RectF m_rtClient; |
| 160 CFX_RectF m_rtContent; | 160 CFX_RectF m_rtContent; |
| 161 CFX_RectF m_rtBtn; | 161 CFX_RectF m_rtBtn; |
| 162 CFX_RectF m_rtList; | 162 CFX_RectF m_rtList; |
| 163 CFX_RectF m_rtProxy; | 163 CFX_RectF m_rtProxy; |
| 164 CFX_RectF m_rtHandler; | 164 CFX_RectF m_rtHandler; |
| 165 std::unique_ptr<IFWL_ComboEdit> m_pEdit; | 165 std::unique_ptr<CFWL_ComboEdit> m_pEdit; |
| 166 std::unique_ptr<IFWL_ComboList> m_pListBox; | 166 std::unique_ptr<CFWL_ComboList> m_pListBox; |
| 167 IFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? | 167 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? |
| 168 bool m_bLButtonDown; | 168 bool m_bLButtonDown; |
| 169 bool m_bUpFormHandler; | 169 bool m_bUpFormHandler; |
| 170 int32_t m_iCurSel; | 170 int32_t m_iCurSel; |
| 171 int32_t m_iBtnState; | 171 int32_t m_iBtnState; |
| 172 FX_FLOAT m_fComboFormHandler; | 172 FX_FLOAT m_fComboFormHandler; |
| 173 FX_FLOAT m_fItemHeight; | 173 FX_FLOAT m_fItemHeight; |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 #endif // XFA_FWL_CORE_IFWL_COMBOBOX_H_ | 176 #endif // XFA_FWL_CORE_IFWL_COMBOBOX_H_ |
| OLD | NEW |