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 void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { | 259 void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { |
278 ASSERT(m_pApp != NULL); | 260 ASSERT(m_pApp != NULL); |
279 | 261 |
280 ASSERT(pWnd != NULL); | 262 ASSERT(pWnd != NULL); |
281 | 263 |
282 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { | 264 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { |
283 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; | 265 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; |
284 pEdit->SetCharSet(134); | 266 pEdit->SetCharSet(134); |
285 pEdit->SetCodePage(936); | 267 pEdit->SetCodePage(936); |
286 | 268 |
(...skipping 30 matching lines...) Expand all Loading... |
317 if (nExport >= 0) { | 299 if (nExport >= 0) { |
318 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { | 300 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { |
319 swRet = pFormField->GetOptionValue(nExport); | 301 swRet = pFormField->GetOptionValue(nExport); |
320 if (swRet.IsEmpty()) | 302 if (swRet.IsEmpty()) |
321 swRet = pFormField->GetOptionLabel(nExport); | 303 swRet = pFormField->GetOptionLabel(nExport); |
322 } | 304 } |
323 } | 305 } |
324 | 306 |
325 return swRet; | 307 return swRet; |
326 } | 308 } |
OLD | NEW |