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_CFWL_COMBOBOX_H_ | 7 #ifndef XFA_FWL_CFWL_COMBOBOX_H_ |
8 #define XFA_FWL_CFWL_COMBOBOX_H_ | 8 #define XFA_FWL_CFWL_COMBOBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "xfa/fwl/cfwl_comboboxproxy.h" | 12 #include "xfa/fwl/cfwl_comboboxproxy.h" |
13 #include "xfa/fwl/cfwl_comboedit.h" | 13 #include "xfa/fwl/cfwl_comboedit.h" |
14 #include "xfa/fwl/cfwl_combolist.h" | 14 #include "xfa/fwl/cfwl_combolist.h" |
15 #include "xfa/fwl/cfwl_form.h" | 15 #include "xfa/fwl/cfwl_form.h" |
16 #include "xfa/fwl/cfwl_listbox.h" | 16 #include "xfa/fwl/cfwl_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 CFWL_ComboBox; | 20 class CFWL_ComboBox; |
21 class CFWL_ComboBoxProxy; | 21 class CFWL_ComboBoxProxy; |
22 class CFWL_FormProxy; | 22 class CFWL_FormProxy; |
23 class CFWL_ListBox; | 23 class CFWL_ListBox; |
24 class CFWL_Widget; | 24 class CFWL_Widget; |
25 | 25 |
26 #define FWL_STYLEEXT_CMB_DropList (0L << 0) | |
27 #define FWL_STYLEEXT_CMB_DropDown (1L << 0) | 26 #define FWL_STYLEEXT_CMB_DropDown (1L << 0) |
28 #define FWL_STYLEEXT_CMB_Sort (1L << 1) | 27 #define FWL_STYLEEXT_CMB_Sort (1L << 1) |
29 #define FWL_STYLEEXT_CMB_ListDrag (1L << 2) | |
30 #define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) | 28 #define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) |
31 #define FWL_STYLEEXT_CMB_EditHNear (0L << 4) | 29 #define FWL_STYLEEXT_CMB_EditHNear 0 |
32 #define FWL_STYLEEXT_CMB_EditHCenter (1L << 4) | 30 #define FWL_STYLEEXT_CMB_EditHCenter (1L << 4) |
33 #define FWL_STYLEEXT_CMB_EditHFar (2L << 4) | 31 #define FWL_STYLEEXT_CMB_EditVNear 0 |
34 #define FWL_STYLEEXT_CMB_EditVNear (0L << 6) | |
35 #define FWL_STYLEEXT_CMB_EditVCenter (1L << 6) | 32 #define FWL_STYLEEXT_CMB_EditVCenter (1L << 6) |
36 #define FWL_STYLEEXT_CMB_EditVFar (2L << 6) | 33 #define FWL_STYLEEXT_CMB_EditVFar (2L << 6) |
37 #define FWL_STYLEEXT_CMB_EditJustified (1L << 8) | 34 #define FWL_STYLEEXT_CMB_EditJustified (1L << 8) |
38 #define FWL_STYLEEXT_CMB_EditDistributed (2L << 8) | |
39 #define FWL_STYLEEXT_CMB_EditHAlignMask (3L << 4) | 35 #define FWL_STYLEEXT_CMB_EditHAlignMask (3L << 4) |
40 #define FWL_STYLEEXT_CMB_EditVAlignMask (3L << 6) | 36 #define FWL_STYLEEXT_CMB_EditVAlignMask (3L << 6) |
41 #define FWL_STYLEEXT_CMB_EditHAlignModeMask (3L << 8) | 37 #define FWL_STYLEEXT_CMB_ListItemLeftAlign 0 |
42 #define FWL_STYLEEXT_CMB_ListItemLeftAlign (0L << 10) | |
43 #define FWL_STYLEEXT_CMB_ListItemCenterAlign (1L << 10) | 38 #define FWL_STYLEEXT_CMB_ListItemCenterAlign (1L << 10) |
44 #define FWL_STYLEEXT_CMB_ListItemRightAlign (2L << 10) | |
45 #define FWL_STYLEEXT_CMB_ListItemAlignMask (3L << 10) | 39 #define FWL_STYLEEXT_CMB_ListItemAlignMask (3L << 10) |
46 #define FWL_STYLEEXT_CMB_ListItemText (0L << 12) | |
47 #define FWL_STYLEEXT_CMB_ReadOnly (1L << 13) | 40 #define FWL_STYLEEXT_CMB_ReadOnly (1L << 13) |
48 | 41 |
49 class CFWL_ComboBox : public CFWL_Widget { | 42 class CFWL_ComboBox : public CFWL_Widget { |
50 public: | 43 public: |
51 explicit CFWL_ComboBox(const CFWL_App* pApp); | 44 explicit CFWL_ComboBox(const CFWL_App* pApp); |
52 ~CFWL_ComboBox() override; | 45 ~CFWL_ComboBox() override; |
53 | 46 |
54 // CFWL_Widget | 47 // CFWL_Widget |
55 FWL_Type GetClassID() const override; | 48 FWL_Type GetClassID() const override; |
56 void ModifyStylesEx(uint32_t dwStylesExAdded, | 49 void ModifyStylesEx(uint32_t dwStylesExAdded, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 CFX_RectF m_rtClient; | 147 CFX_RectF m_rtClient; |
155 CFX_RectF m_rtContent; | 148 CFX_RectF m_rtContent; |
156 CFX_RectF m_rtBtn; | 149 CFX_RectF m_rtBtn; |
157 CFX_RectF m_rtList; | 150 CFX_RectF m_rtList; |
158 CFX_RectF m_rtProxy; | 151 CFX_RectF m_rtProxy; |
159 CFX_RectF m_rtHandler; | 152 CFX_RectF m_rtHandler; |
160 std::unique_ptr<CFWL_ComboEdit> m_pEdit; | 153 std::unique_ptr<CFWL_ComboEdit> m_pEdit; |
161 std::unique_ptr<CFWL_ComboList> m_pListBox; | 154 std::unique_ptr<CFWL_ComboList> m_pListBox; |
162 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? | 155 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? |
163 bool m_bLButtonDown; | 156 bool m_bLButtonDown; |
164 bool m_bUpFormHandler; | |
165 int32_t m_iCurSel; | 157 int32_t m_iCurSel; |
166 int32_t m_iBtnState; | 158 int32_t m_iBtnState; |
167 FX_FLOAT m_fComboFormHandler; | 159 FX_FLOAT m_fComboFormHandler; |
168 FX_FLOAT m_fItemHeight; | 160 FX_FLOAT m_fItemHeight; |
169 }; | 161 }; |
170 | 162 |
171 #endif // XFA_FWL_CFWL_COMBOBOX_H_ | 163 #endif // XFA_FWL_CFWL_COMBOBOX_H_ |
OLD | NEW |