| 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 "fpdfsdk/include/pdfwindow/PWL_ComboBox.h" | 7 #include "fpdfsdk/include/pdfwindow/PWL_ComboBox.h" |
| 8 | 8 |
| 9 #include "core/include/fxge/fx_ge.h" | 9 #include "core/include/fxge/fx_ge.h" |
| 10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" | 10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 FX_BOOL bExit = FALSE; | 38 FX_BOOL bExit = FALSE; |
| 39 OnNotifySelChanged(FALSE, bExit, nFlag); | 39 OnNotifySelChanged(FALSE, bExit, nFlag); |
| 40 if (bExit) | 40 if (bExit) |
| 41 return FALSE; | 41 return FALSE; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 return TRUE; | 45 return TRUE; |
| 46 } | 46 } |
| 47 | 47 |
| 48 FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, | 48 FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(uint16_t nChar, |
| 49 FX_BOOL& bExit, | 49 FX_BOOL& bExit, |
| 50 FX_DWORD nFlag) { | 50 FX_DWORD nFlag) { |
| 51 if (!m_pList) | 51 if (!m_pList) |
| 52 return FALSE; | 52 return FALSE; |
| 53 | 53 |
| 54 switch (nChar) { | 54 switch (nChar) { |
| 55 default: | 55 default: |
| 56 return FALSE; | 56 return FALSE; |
| 57 case FWL_VKEY_Up: | 57 case FWL_VKEY_Up: |
| 58 case FWL_VKEY_Down: | 58 case FWL_VKEY_Down: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 84 break; | 84 break; |
| 85 case FWL_VKEY_Delete: | 85 case FWL_VKEY_Delete: |
| 86 break; | 86 break; |
| 87 } | 87 } |
| 88 | 88 |
| 89 OnNotifySelChanged(TRUE, bExit, nFlag); | 89 OnNotifySelChanged(TRUE, bExit, nFlag); |
| 90 | 90 |
| 91 return TRUE; | 91 return TRUE; |
| 92 } | 92 } |
| 93 | 93 |
| 94 FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, | 94 FX_BOOL CPWL_CBListBox::OnCharWithExit(uint16_t nChar, |
| 95 FX_BOOL& bExit, | 95 FX_BOOL& bExit, |
| 96 FX_DWORD nFlag) { | 96 FX_DWORD nFlag) { |
| 97 if (!m_pList) | 97 if (!m_pList) |
| 98 return FALSE; | 98 return FALSE; |
| 99 | 99 |
| 100 if (!m_pList->OnChar(nChar, IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag))) | 100 if (!m_pList->OnChar(nChar, IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag))) |
| 101 return FALSE; | 101 return FALSE; |
| 102 | 102 |
| 103 if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow()) { | 103 if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow()) { |
| 104 pComboBox->SetSelectText(); | 104 pComboBox->SetSelectText(); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 return; | 510 return; |
| 511 #endif // PDF_ENABLE_XFA | 511 #endif // PDF_ENABLE_XFA |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 } else { | 514 } else { |
| 515 m_bPopup = bPopup; | 515 m_bPopup = bPopup; |
| 516 Move(m_rcOldWindow, TRUE, TRUE); | 516 Move(m_rcOldWindow, TRUE, TRUE); |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 | 519 |
| 520 FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) { | 520 FX_BOOL CPWL_ComboBox::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) { |
| 521 if (!m_pList) | 521 if (!m_pList) |
| 522 return FALSE; | 522 return FALSE; |
| 523 if (!m_pEdit) | 523 if (!m_pEdit) |
| 524 return FALSE; | 524 return FALSE; |
| 525 | 525 |
| 526 m_nSelectItem = -1; | 526 m_nSelectItem = -1; |
| 527 | 527 |
| 528 switch (nChar) { | 528 switch (nChar) { |
| 529 case FWL_VKEY_Up: | 529 case FWL_VKEY_Up: |
| 530 if (m_pList->GetCurSel() > 0) { | 530 if (m_pList->GetCurSel() > 0) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 } | 569 } |
| 570 return TRUE; | 570 return TRUE; |
| 571 } | 571 } |
| 572 | 572 |
| 573 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) | 573 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) |
| 574 return m_pEdit->OnKeyDown(nChar, nFlag); | 574 return m_pEdit->OnKeyDown(nChar, nFlag); |
| 575 | 575 |
| 576 return FALSE; | 576 return FALSE; |
| 577 } | 577 } |
| 578 | 578 |
| 579 FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) { | 579 FX_BOOL CPWL_ComboBox::OnChar(uint16_t nChar, FX_DWORD nFlag) { |
| 580 if (!m_pList) | 580 if (!m_pList) |
| 581 return FALSE; | 581 return FALSE; |
| 582 | 582 |
| 583 if (!m_pEdit) | 583 if (!m_pEdit) |
| 584 return FALSE; | 584 return FALSE; |
| 585 | 585 |
| 586 m_nSelectItem = -1; | 586 m_nSelectItem = -1; |
| 587 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) | 587 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) |
| 588 return m_pEdit->OnChar(nChar, nFlag); | 588 return m_pEdit->OnChar(nChar, nFlag); |
| 589 | 589 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 643 |
| 644 void CPWL_ComboBox::SetFillerNotify(IPWL_Filler_Notify* pNotify) { | 644 void CPWL_ComboBox::SetFillerNotify(IPWL_Filler_Notify* pNotify) { |
| 645 m_pFillerNotify = pNotify; | 645 m_pFillerNotify = pNotify; |
| 646 | 646 |
| 647 if (m_pEdit) | 647 if (m_pEdit) |
| 648 m_pEdit->SetFillerNotify(pNotify); | 648 m_pEdit->SetFillerNotify(pNotify); |
| 649 | 649 |
| 650 if (m_pList) | 650 if (m_pList) |
| 651 m_pList->SetFillerNotify(pNotify); | 651 m_pList->SetFillerNotify(pNotify); |
| 652 } | 652 } |
| OLD | NEW |