| 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/pdfwindow/PWL_ListBox.h" | 7 #include "fpdfsdk/pdfwindow/PWL_ListBox.h" |
| 8 | 8 |
| 9 #include "fpdfsdk/pdfwindow/PWL_Edit.h" | 9 #include "fpdfsdk/pdfwindow/PWL_Edit.h" |
| 10 #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" | 10 #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); | 174 CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f); |
| 175 if (IFX_Edit* pEdit = m_pList->GetItemEdit(i)) { | 175 if (IFX_Edit* pEdit = m_pList->GetItemEdit(i)) { |
| 176 CFX_FloatRect rcContent = pEdit->GetContentRect(); | 176 CFX_FloatRect rcContent = pEdit->GetContentRect(); |
| 177 if (rcContent.Width() > rcClient.Width()) | 177 if (rcContent.Width() > rcClient.Width()) |
| 178 rcItem.Intersect(rcList); | 178 rcItem.Intersect(rcList); |
| 179 else | 179 else |
| 180 rcItem.Intersect(rcClient); | 180 rcItem.Intersect(rcClient); |
| 181 } | 181 } |
| 182 | 182 |
| 183 if (m_pList->IsItemSelected(i)) { | 183 if (m_pList->IsItemSelected(i)) { |
| 184 IFX_SystemHandler* pSysHandler = GetSystemHandler(); | 184 CFX_SystemHandler* pSysHandler = GetSystemHandler(); |
| 185 if (pSysHandler && pSysHandler->IsSelectionImplemented()) { | 185 if (pSysHandler && pSysHandler->IsSelectionImplemented()) { |
| 186 IFX_Edit::DrawEdit( | 186 IFX_Edit::DrawEdit( |
| 187 pDevice, pUser2Device, m_pList->GetItemEdit(i), | 187 pDevice, pUser2Device, m_pList->GetItemEdit(i), |
| 188 CPWL_Utils::PWLColorToFXColor(GetTextColor()), | 188 CPWL_Utils::PWLColorToFXColor(GetTextColor()), |
| 189 CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()), rcList, | 189 CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()), rcList, |
| 190 ptOffset, NULL, pSysHandler, m_pFormFiller); | 190 ptOffset, NULL, pSysHandler, m_pFormFiller); |
| 191 pSysHandler->OutputSelectedRect(m_pFormFiller, rcItem); | 191 pSysHandler->OutputSelectedRect(m_pFormFiller, rcItem); |
| 192 } else { | 192 } else { |
| 193 CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem, | 193 CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem, |
| 194 ArgbEncode(255, 0, 51, 113)); | 194 ArgbEncode(255, 0, 51, 113)); |
| 195 IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), | 195 IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), |
| 196 ArgbEncode(255, 255, 255, 255), 0, rcList, | 196 ArgbEncode(255, 255, 255, 255), 0, rcList, |
| 197 ptOffset, NULL, pSysHandler, m_pFormFiller); | 197 ptOffset, NULL, pSysHandler, m_pFormFiller); |
| 198 } | 198 } |
| 199 } else { | 199 } else { |
| 200 IFX_SystemHandler* pSysHandler = GetSystemHandler(); | 200 CFX_SystemHandler* pSysHandler = GetSystemHandler(); |
| 201 IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), | 201 IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), |
| 202 CPWL_Utils::PWLColorToFXColor(GetTextColor()), | 202 CPWL_Utils::PWLColorToFXColor(GetTextColor()), |
| 203 CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()), | 203 CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()), |
| 204 rcList, ptOffset, NULL, pSysHandler, NULL); | 204 rcList, ptOffset, NULL, pSysHandler, NULL); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 FX_BOOL CPWL_ListBox::OnKeyDown(uint16_t nChar, uint32_t nFlag) { | 210 FX_BOOL CPWL_ListBox::OnKeyDown(uint16_t nChar, uint32_t nFlag) { |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 if (zDelta < 0) { | 528 if (zDelta < 0) { |
| 529 m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); | 529 m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); |
| 530 } else { | 530 } else { |
| 531 m_pList->OnVK_UP(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); | 531 m_pList->OnVK_UP(IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); |
| 532 } | 532 } |
| 533 | 533 |
| 534 FX_BOOL bExit = FALSE; | 534 FX_BOOL bExit = FALSE; |
| 535 OnNotifySelChanged(FALSE, bExit, nFlag); | 535 OnNotifySelChanged(FALSE, bExit, nFlag); |
| 536 return TRUE; | 536 return TRUE; |
| 537 } | 537 } |
| OLD | NEW |