| 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/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
| 8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
| 9 #include "../../include/pdfwindow/PWL_EditCtrl.h" | 9 #include "../../include/pdfwindow/PWL_EditCtrl.h" |
| 10 #include "../../include/pdfwindow/PWL_Edit.h" | 10 #include "../../include/pdfwindow/PWL_Edit.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 FX_BOOL bExit = FALSE; | 41 FX_BOOL bExit = FALSE; |
| 42 OnNotifySelChanged(FALSE,bExit, nFlag); | 42 OnNotifySelChanged(FALSE,bExit, nFlag); |
| 43 if (bExit) return FALSE; | 43 if (bExit) return FALSE; |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 return TRUE; | 47 return TRUE; |
| 48 } | 48 } |
| 49 | 49 |
| 50 FX_BOOL CPWL_CBListBox::OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag
) | 50 FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWO
RD nFlag) |
| 51 { | 51 { |
| 52 if (!m_pList) return FALSE; | 52 if (!m_pList) return FALSE; |
| 53 | 53 |
| 54 switch (nChar) | 54 switch (nChar) |
| 55 { | 55 { |
| 56 default: | 56 default: |
| 57 return FALSE; | 57 return FALSE; |
| 58 case FWL_VKEY_Up: | 58 case FWL_VKEY_Up: |
| 59 case FWL_VKEY_Down: | 59 case FWL_VKEY_Down: |
| 60 case FWL_VKEY_Home: | 60 case FWL_VKEY_Home: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 86 break; | 86 break; |
| 87 case FWL_VKEY_Delete: | 87 case FWL_VKEY_Delete: |
| 88 break; | 88 break; |
| 89 } | 89 } |
| 90 | 90 |
| 91 OnNotifySelChanged(TRUE,bExit, nFlag); | 91 OnNotifySelChanged(TRUE,bExit, nFlag); |
| 92 | 92 |
| 93 return TRUE; | 93 return TRUE; |
| 94 } | 94 } |
| 95 | 95 |
| 96 FX_BOOL»CPWL_CBListBox::OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag) | 96 FX_BOOL»CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD
nFlag) |
| 97 { | 97 { |
| 98 if (!m_pList) return FALSE; | 98 if (!m_pList) return FALSE; |
| 99 | 99 |
| 100 if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag)))
return FALSE; | 100 if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag)))
return FALSE; |
| 101 | 101 |
| 102 if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow()) | 102 if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow()) |
| 103 { | 103 { |
| 104 pComboBox->SetSelectText(); | 104 pComboBox->SetSelectText(); |
| 105 } | 105 } |
| 106 | 106 |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 if (!m_pEdit) return FALSE; | 545 if (!m_pEdit) return FALSE; |
| 546 | 546 |
| 547 m_nSelectItem = -1; | 547 m_nSelectItem = -1; |
| 548 | 548 |
| 549 switch (nChar) | 549 switch (nChar) |
| 550 { | 550 { |
| 551 case FWL_VKEY_Up: | 551 case FWL_VKEY_Up: |
| 552 if (m_pList->GetCurSel() > 0) | 552 if (m_pList->GetCurSel() > 0) |
| 553 { | 553 { |
| 554 FX_BOOL bExit = FALSE; | 554 FX_BOOL bExit = FALSE; |
| 555 » » » if (m_pList->OnKeyDown(nChar,bExit,nFlag)) | 555 » » » if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag)) |
| 556 { | 556 { |
| 557 if (bExit) return FALSE; | 557 if (bExit) return FALSE; |
| 558 SetSelectText(); | 558 SetSelectText(); |
| 559 } | 559 } |
| 560 } | 560 } |
| 561 return TRUE; | 561 return TRUE; |
| 562 case FWL_VKEY_Down: | 562 case FWL_VKEY_Down: |
| 563 if (m_pList->GetCurSel() < m_pList->GetCount() - 1) | 563 if (m_pList->GetCurSel() < m_pList->GetCount() - 1) |
| 564 { | 564 { |
| 565 FX_BOOL bExit = FALSE; | 565 FX_BOOL bExit = FALSE; |
| 566 » » » if (m_pList->OnKeyDown(nChar,bExit,nFlag)) | 566 » » » if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag)) |
| 567 { | 567 { |
| 568 if (bExit) return FALSE; | 568 if (bExit) return FALSE; |
| 569 SetSelectText(); | 569 SetSelectText(); |
| 570 } | 570 } |
| 571 } | 571 } |
| 572 return TRUE; | 572 return TRUE; |
| 573 } | 573 } |
| 574 | 574 |
| 575 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) | 575 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) |
| 576 return m_pEdit->OnKeyDown(nChar,nFlag); | 576 return m_pEdit->OnKeyDown(nChar,nFlag); |
| 577 else | 577 else |
| 578 return FALSE; | 578 return FALSE; |
| 579 } | 579 } |
| 580 | 580 |
| 581 FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) | 581 FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) |
| 582 { | 582 { |
| 583 if (!m_pList) return FALSE; | 583 if (!m_pList) return FALSE; |
| 584 if (!m_pEdit) return FALSE; | 584 if (!m_pEdit) return FALSE; |
| 585 | 585 |
| 586 m_nSelectItem = -1; | 586 m_nSelectItem = -1; |
| 587 FX_BOOL bExit = FALSE; | 587 FX_BOOL bExit = FALSE; |
| 588 | 588 |
| 589 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) | 589 if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) |
| 590 { | 590 { |
| 591 return m_pEdit->OnChar(nChar,nFlag); | 591 return m_pEdit->OnChar(nChar,nFlag); |
| 592 } | 592 } |
| 593 else | 593 else |
| 594 { | 594 { |
| 595 » » if (m_pList->OnChar(nChar,bExit,nFlag)) | 595 » » if (m_pList->OnCharWithExit(nChar,bExit,nFlag)) |
| 596 { | 596 { |
| 597 return bExit; | 597 return bExit; |
| 598 } | 598 } |
| 599 else | 599 else |
| 600 return FALSE; | 600 return FALSE; |
| 601 } | 601 } |
| 602 } | 602 } |
| 603 | 603 |
| 604 void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_
INTPTR lParam) | 604 void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_
INTPTR lParam) |
| 605 { | 605 { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 { | 653 { |
| 654 m_pFillerNotify = pNotify; | 654 m_pFillerNotify = pNotify; |
| 655 | 655 |
| 656 if (m_pEdit) | 656 if (m_pEdit) |
| 657 m_pEdit->SetFillerNotify(pNotify); | 657 m_pEdit->SetFillerNotify(pNotify); |
| 658 | 658 |
| 659 if (m_pList) | 659 if (m_pList) |
| 660 m_pList->SetFillerNotify(pNotify); | 660 m_pList->SetFillerNotify(pNotify); |
| 661 } | 661 } |
| 662 | 662 |
| OLD | NEW |