| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (m_pEdit) | 249 if (m_pEdit) |
| 250 m_pEdit->SetText(text); | 250 m_pEdit->SetText(text); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void CPWL_ComboBox::AddString(FX_LPCWSTR string) | 253 void CPWL_ComboBox::AddString(FX_LPCWSTR string) |
| 254 { | 254 { |
| 255 if (m_pList) | 255 if (m_pList) |
| 256 m_pList->AddString(string); | 256 m_pList->AddString(string); |
| 257 } | 257 } |
| 258 | 258 |
| 259 FX_INT32 CPWL_ComboBox::GetSelect() const | 259 int32_t CPWL_ComboBox::GetSelect() const |
| 260 { | 260 { |
| 261 return m_nSelectItem; | 261 return m_nSelectItem; |
| 262 } | 262 } |
| 263 | 263 |
| 264 void CPWL_ComboBox::SetSelect(FX_INT32 nItemIndex) | 264 void CPWL_ComboBox::SetSelect(int32_t nItemIndex) |
| 265 { | 265 { |
| 266 if (m_pList) | 266 if (m_pList) |
| 267 m_pList->Select(nItemIndex); | 267 m_pList->Select(nItemIndex); |
| 268 | 268 |
| 269 m_pEdit->SetText(m_pList->GetText().c_str()); | 269 m_pEdit->SetText(m_pList->GetText().c_str()); |
| 270 | 270 |
| 271 m_nSelectItem = nItemIndex; | 271 m_nSelectItem = nItemIndex; |
| 272 } | 272 } |
| 273 | 273 |
| 274 void CPWL_ComboBox::SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar) | 274 void CPWL_ComboBox::SetEditSel(int32_t nStartChar,int32_t nEndChar) |
| 275 { | 275 { |
| 276 if (m_pEdit) | 276 if (m_pEdit) |
| 277 { | 277 { |
| 278 m_pEdit->SetSel(nStartChar,nEndChar); | 278 m_pEdit->SetSel(nStartChar,nEndChar); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 void CPWL_ComboBox::GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const | 282 void CPWL_ComboBox::GetEditSel(int32_t & nStartChar, int32_t & nEndChar) const |
| 283 { | 283 { |
| 284 nStartChar = -1; | 284 nStartChar = -1; |
| 285 nEndChar = -1; | 285 nEndChar = -1; |
| 286 | 286 |
| 287 if (m_pEdit) | 287 if (m_pEdit) |
| 288 { | 288 { |
| 289 m_pEdit->GetSel(nStartChar,nEndChar); | 289 m_pEdit->GetSel(nStartChar,nEndChar); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 { | 495 { |
| 496 if (!m_pList) return; | 496 if (!m_pList) return; |
| 497 if (bPopup == m_bPopup) return; | 497 if (bPopup == m_bPopup) return; |
| 498 FX_FLOAT fListHeight = m_pList->GetContentRect().Height(); | 498 FX_FLOAT fListHeight = m_pList->GetContentRect().Height(); |
| 499 if (!IsFloatBigger(fListHeight,0.0f)) return; | 499 if (!IsFloatBigger(fListHeight,0.0f)) return; |
| 500 | 500 |
| 501 if (bPopup) | 501 if (bPopup) |
| 502 { | 502 { |
| 503 if (m_pFillerNotify) | 503 if (m_pFillerNotify) |
| 504 { | 504 { |
| 505 » » » FX_INT32 nWhere = 0; | 505 » » » int32_t nWhere = 0; |
| 506 FX_FLOAT fPopupRet = 0.0f; | 506 FX_FLOAT fPopupRet = 0.0f; |
| 507 FX_FLOAT fPopupMin = 0.0f; | 507 FX_FLOAT fPopupMin = 0.0f; |
| 508 if (m_pList->GetCount() > 3) | 508 if (m_pList->GetCount() > 3) |
| 509 fPopupMin = m_pList->GetFirstHeight() * 3 + m_pL
ist->GetBorderWidth() * 2; | 509 fPopupMin = m_pList->GetFirstHeight() * 3 + m_pL
ist->GetBorderWidth() * 2; |
| 510 FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWid
th() * 2; | 510 FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWid
th() * 2; |
| 511 m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPop
upMin,fPopupMax,nWhere,fPopupRet); | 511 m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPop
upMin,fPopupMax,nWhere,fPopupRet); |
| 512 | 512 |
| 513 if (IsFloatBigger(fPopupRet,0.0f)) | 513 if (IsFloatBigger(fPopupRet,0.0f)) |
| 514 { | 514 { |
| 515 m_bPopup = bPopup; | 515 m_bPopup = bPopup; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 { | 594 { |
| 595 if (m_pList->OnCharWithExit(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, intptr_t wParam, intp
tr_t lParam) |
| 605 { | 605 { |
| 606 switch (msg) | 606 switch (msg) |
| 607 { | 607 { |
| 608 case PNM_LBUTTONDOWN: | 608 case PNM_LBUTTONDOWN: |
| 609 if (pWnd == m_pButton) | 609 if (pWnd == m_pButton) |
| 610 { | 610 { |
| 611 SetPopup(!m_bPopup); | 611 SetPopup(!m_bPopup); |
| 612 return; | 612 return; |
| 613 } | 613 } |
| 614 break; | 614 break; |
| (...skipping 38 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 |