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_CFWL_COMBOBOX_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
8 #define XFA_FWL_CORE_CFWL_COMBOBOX_H_ | 8 #define XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 void GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) const; | 71 void GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) const; |
72 int32_t GetCurSel() const { return m_iCurSel; } | 72 int32_t GetCurSel() const { return m_iCurSel; } |
73 void SetCurSel(int32_t iSel); | 73 void SetCurSel(int32_t iSel); |
74 | 74 |
75 void AddString(const CFX_WideStringC& wsText); | 75 void AddString(const CFX_WideStringC& wsText); |
76 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. | 76 bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. |
77 void RemoveAll(); | 77 void RemoveAll(); |
78 | 78 |
79 void SetEditText(const CFX_WideString& wsText); | 79 void SetEditText(const CFX_WideString& wsText); |
80 CFX_WideString GetEditText(int32_t nStart = 0, int32_t nCount = -1) const; | 80 CFX_WideString GetEditText() const; |
81 | 81 |
82 void OpenDropDownList(bool bActivate); | 82 void OpenDropDownList(bool bActivate); |
83 | 83 |
84 bool EditCanUndo() const { return m_pEdit->CanUndo(); } | 84 bool EditCanUndo() const { return m_pEdit->CanUndo(); } |
85 bool EditCanRedo() const { return m_pEdit->CanRedo(); } | 85 bool EditCanRedo() const { return m_pEdit->CanRedo(); } |
86 bool EditUndo() { return m_pEdit->Undo(); } | 86 bool EditUndo() { return m_pEdit->Undo(); } |
87 bool EditRedo() { return m_pEdit->Redo(); } | 87 bool EditRedo() { return m_pEdit->Redo(); } |
88 bool EditCanCopy() const { return m_pEdit->CountSelRanges() > 0; } | 88 bool EditCanCopy() const { return m_pEdit->CountSelRanges() > 0; } |
89 bool EditCanCut() const { | 89 bool EditCanCut() const { |
90 if (m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) | 90 if (m_pEdit->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) |
(...skipping 29 matching lines...) Expand all Loading... |
120 bool IsDropDownStyle() const { | 120 bool IsDropDownStyle() const { |
121 return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown); | 121 return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown); |
122 } | 122 } |
123 void MatchEditText(); | 123 void MatchEditText(); |
124 void SyncEditText(int32_t iListItem); | 124 void SyncEditText(int32_t iListItem); |
125 void Layout(); | 125 void Layout(); |
126 void ResetTheme(); | 126 void ResetTheme(); |
127 void ResetEditAlignment(); | 127 void ResetEditAlignment(); |
128 void ResetListItemAlignment(); | 128 void ResetListItemAlignment(); |
129 void InitProxyForm(); | 129 void InitProxyForm(); |
| 130 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
| 131 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 132 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 133 void OnMouseMove(CFWL_MsgMouse* pMsg); |
| 134 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
| 135 void OnKey(CFWL_MsgKey* pMsg); |
| 136 void DoSubCtrlKey(CFWL_MsgKey* pMsg); |
| 137 |
130 void DisForm_InitComboList(); | 138 void DisForm_InitComboList(); |
131 void DisForm_InitComboEdit(); | 139 void DisForm_InitComboEdit(); |
132 void DisForm_ShowDropList(bool bActivate); | 140 void DisForm_ShowDropList(bool bActivate); |
133 bool DisForm_IsDropListVisible() const { | 141 bool DisForm_IsDropListVisible() const { |
134 return !(m_pListBox->GetStates() & FWL_WGTSTATE_Invisible); | 142 return !(m_pListBox->GetStates() & FWL_WGTSTATE_Invisible); |
135 } | 143 } |
136 void DisForm_ModifyStylesEx(uint32_t dwStylesExAdded, | 144 void DisForm_ModifyStylesEx(uint32_t dwStylesExAdded, |
137 uint32_t dwStylesExRemoved); | 145 uint32_t dwStylesExRemoved); |
138 void DisForm_Update(); | 146 void DisForm_Update(); |
139 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); | 147 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); |
140 void DisForm_DrawWidget(CFX_Graphics* pGraphics, | 148 void DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); |
141 const CFX_Matrix* pMatrix = nullptr); | |
142 void DisForm_GetBBox(CFX_RectF& rect) const; | 149 void DisForm_GetBBox(CFX_RectF& rect) const; |
143 void DisForm_Layout(); | 150 void DisForm_Layout(); |
144 void OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); | |
145 void OnLButtonDown(CFWL_MsgMouse* pMsg); | |
146 void OnLButtonUp(CFWL_MsgMouse* pMsg); | |
147 void OnMouseMove(CFWL_MsgMouse* pMsg); | |
148 void OnMouseLeave(CFWL_MsgMouse* pMsg); | |
149 void OnKey(CFWL_MsgKey* pMsg); | |
150 void DoSubCtrlKey(CFWL_MsgKey* pMsg); | |
151 void DisForm_OnProcessMessage(CFWL_Message* pMessage); | 151 void DisForm_OnProcessMessage(CFWL_Message* pMessage); |
152 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); | 152 void DisForm_OnLButtonDown(CFWL_MsgMouse* pMsg); |
153 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet = true); | 153 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
154 void DisForm_OnKey(CFWL_MsgKey* pMsg); | 154 void DisForm_OnKey(CFWL_MsgKey* pMsg); |
155 | 155 |
156 CFX_RectF m_rtClient; | 156 CFX_RectF m_rtClient; |
157 CFX_RectF m_rtContent; | 157 CFX_RectF m_rtContent; |
158 CFX_RectF m_rtBtn; | 158 CFX_RectF m_rtBtn; |
159 CFX_RectF m_rtList; | 159 CFX_RectF m_rtList; |
160 CFX_RectF m_rtProxy; | 160 CFX_RectF m_rtProxy; |
161 CFX_RectF m_rtHandler; | 161 CFX_RectF m_rtHandler; |
162 std::unique_ptr<CFWL_ComboEdit> m_pEdit; | 162 std::unique_ptr<CFWL_ComboEdit> m_pEdit; |
163 std::unique_ptr<CFWL_ComboList> m_pListBox; | 163 std::unique_ptr<CFWL_ComboList> m_pListBox; |
164 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? | 164 CFWL_ComboBoxProxy* m_pComboBoxProxy; // Can this be a unique_ptr? |
165 bool m_bLButtonDown; | 165 bool m_bLButtonDown; |
166 bool m_bUpFormHandler; | 166 bool m_bUpFormHandler; |
167 int32_t m_iCurSel; | 167 int32_t m_iCurSel; |
168 int32_t m_iBtnState; | 168 int32_t m_iBtnState; |
169 FX_FLOAT m_fComboFormHandler; | 169 FX_FLOAT m_fComboFormHandler; |
170 FX_FLOAT m_fItemHeight; | 170 FX_FLOAT m_fItemHeight; |
171 }; | 171 }; |
172 | 172 |
173 #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ | 173 #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ |
OLD | NEW |