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 #include "../../include/formfiller/FormFiller.h" | 7 #include "../../include/formfiller/FormFiller.h" |
8 #include "../../include/formfiller/FFL_FormFiller.h" | 8 #include "../../include/formfiller/FFL_FormFiller.h" |
9 #include "../../include/formfiller/FFL_IFormFiller.h" | 9 #include "../../include/formfiller/FFL_IFormFiller.h" |
10 #include "../../include/formfiller/FFL_CBA_Fontmap.h" | 10 #include "../../include/formfiller/FFL_CBA_Fontmap.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 RestoreState(pPageView); | 249 RestoreState(pPageView); |
250 pRet = GetPDFWindow(pPageView, FALSE); | 250 pRet = GetPDFWindow(pPageView, FALSE); |
251 } else | 251 } else |
252 pRet = GetPDFWindow(pPageView, TRUE); | 252 pRet = GetPDFWindow(pPageView, TRUE); |
253 | 253 |
254 m_pWidget->UpdateField(); | 254 m_pWidget->UpdateField(); |
255 | 255 |
256 return pRet; | 256 return pRet; |
257 } | 257 } |
258 | 258 |
259 void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag) { | |
260 ASSERT(m_pWidget != NULL); | |
261 | |
262 int nFlags = m_pWidget->GetFieldFlags(); | |
263 | |
264 if (nFlags & FIELDFLAG_COMMITONSELCHANGE) { | |
265 if (m_bValid) { | |
266 CPDFSDK_PageView* pPageView = GetCurPageView(); | |
267 ASSERT(pPageView != NULL); | |
268 | |
269 if (CommitData(pPageView, nFlag)) { | |
270 DestroyPDFWindow(pPageView); | |
271 m_bValid = FALSE; | |
272 } | |
273 } | |
274 } | |
275 } | |
276 | |
277 FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) { | 259 FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) { |
278 if (CPWL_ComboBox* pComboBox = | 260 if (CPWL_ComboBox* pComboBox = |
279 (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { | 261 (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { |
280 if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { | 262 if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { |
281 return pEdit->IsTextFull(); | 263 return pEdit->IsTextFull(); |
282 } | 264 } |
283 } | 265 } |
284 | 266 |
285 return FALSE; | 267 return FALSE; |
286 } | 268 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 if (nExport >= 0) { | 310 if (nExport >= 0) { |
329 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { | 311 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { |
330 swRet = pFormField->GetOptionValue(nExport); | 312 swRet = pFormField->GetOptionValue(nExport); |
331 if (swRet.IsEmpty()) | 313 if (swRet.IsEmpty()) |
332 swRet = pFormField->GetOptionLabel(nExport); | 314 swRet = pFormField->GetOptionLabel(nExport); |
333 } | 315 } |
334 } | 316 } |
335 | 317 |
336 return swRet; | 318 return swRet; |
337 } | 319 } |
OLD | NEW |