Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/javascript/util.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Edit.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_BOOL bExit = FALSE; 505 FX_BOOL bExit = FALSE;
506 m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit , 0); 506 m_pFillerNotify->OnPopupPreOpen(GetAttachedData(), bExit , 0);
507 if (bExit) return; 507 if (bExit) return;
508 508
509 » » » FX_INT32 nWhere = 0; 509 » » » int32_t nWhere = 0;
510 FX_FLOAT fPopupRet = 0.0f; 510 FX_FLOAT fPopupRet = 0.0f;
511 FX_FLOAT fPopupMin = 0.0f; 511 FX_FLOAT fPopupMin = 0.0f;
512 if (m_pList->GetCount() > 3) 512 if (m_pList->GetCount() > 3)
513 fPopupMin = m_pList->GetFirstHeight() * 3 + m_pL ist->GetBorderWidth() * 2; 513 fPopupMin = m_pList->GetFirstHeight() * 3 + m_pL ist->GetBorderWidth() * 2;
514 FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWid th() * 2; 514 FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWid th() * 2;
515 m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPop upMin,fPopupMax,nWhere,fPopupRet); 515 m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPop upMin,fPopupMax,nWhere,fPopupRet);
516 516
517 if (IsFloatBigger(fPopupRet,0.0f)) 517 if (IsFloatBigger(fPopupRet,0.0f))
518 { 518 {
519 m_bPopup = bPopup; 519 m_bPopup = bPopup;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 } 630 }
631 if (m_pList->OnCharWithExit(nChar,bExit,nFlag)) 631 if (m_pList->OnCharWithExit(nChar,bExit,nFlag))
632 { 632 {
633 return bExit; 633 return bExit;
634 } 634 }
635 else 635 else
636 return FALSE; 636 return FALSE;
637 } 637 }
638 } 638 }
639 639
640 void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_ INTPTR lParam) 640 void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp tr_t lParam)
641 { 641 {
642 switch (msg) 642 switch (msg)
643 { 643 {
644 case PNM_LBUTTONDOWN: 644 case PNM_LBUTTONDOWN:
645 if (pWnd == m_pButton) 645 if (pWnd == m_pButton)
646 { 646 {
647 SetPopup(!m_bPopup); 647 SetPopup(!m_bPopup);
648 return; 648 return;
649 } 649 }
650 break; 650 break;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 { 689 {
690 m_pFillerNotify = pNotify; 690 m_pFillerNotify = pNotify;
691 691
692 if (m_pEdit) 692 if (m_pEdit)
693 m_pEdit->SetFillerNotify(pNotify); 693 m_pEdit->SetFillerNotify(pNotify);
694 694
695 if (m_pList) 695 if (m_pList)
696 m_pList->SetFillerNotify(pNotify); 696 m_pList->SetFillerNotify(pNotify);
697 } 697 }
698 698
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/util.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698