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

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

Issue 1980973002: Convert border style defines to an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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
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 "fpdfsdk/pdfwindow/PWL_ComboBox.h" 7 #include "fpdfsdk/pdfwindow/PWL_ComboBox.h"
8 8
9 #include "core/fxge/include/fx_ge.h" 9 #include "core/fxge/include/fx_ge.h"
10 #include "fpdfsdk/pdfwindow/PWL_Edit.h" 10 #include "fpdfsdk/pdfwindow/PWL_Edit.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 PES_AUTOSCROLL | PES_UNDO; 296 PES_AUTOSCROLL | PES_UNDO;
297 297
298 if (HasFlag(PWS_AUTOFONTSIZE)) 298 if (HasFlag(PWS_AUTOFONTSIZE))
299 ecp.dwFlags |= PWS_AUTOFONTSIZE; 299 ecp.dwFlags |= PWS_AUTOFONTSIZE;
300 300
301 if (!HasFlag(PCBS_ALLOWCUSTOMTEXT)) 301 if (!HasFlag(PCBS_ALLOWCUSTOMTEXT))
302 ecp.dwFlags |= PWS_READONLY; 302 ecp.dwFlags |= PWS_READONLY;
303 303
304 ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); 304 ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0);
305 ecp.dwBorderWidth = 0; 305 ecp.dwBorderWidth = 0;
306 ecp.nBorderStyle = PBS_SOLID; 306 ecp.nBorderStyle = BorderStyle::SOLID;
307 307
308 m_pEdit->Create(ecp); 308 m_pEdit->Create(ecp);
309 } 309 }
310 } 310 }
311 311
312 void CPWL_ComboBox::CreateButton(const PWL_CREATEPARAM& cp) { 312 void CPWL_ComboBox::CreateButton(const PWL_CREATEPARAM& cp) {
313 if (!m_pButton) { 313 if (!m_pButton) {
314 m_pButton = new CPWL_CBButton; 314 m_pButton = new CPWL_CBButton;
315 315
316 PWL_CREATEPARAM bcp = cp; 316 PWL_CREATEPARAM bcp = cp;
317 bcp.pParentWnd = this; 317 bcp.pParentWnd = this;
318 bcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND; 318 bcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND;
319 bcp.sBackgroundColor = PWL_SCROLLBAR_BKCOLOR; 319 bcp.sBackgroundColor = PWL_SCROLLBAR_BKCOLOR;
320 bcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR; 320 bcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;
321 bcp.dwBorderWidth = 2; 321 bcp.dwBorderWidth = 2;
322 bcp.nBorderStyle = PBS_BEVELED; 322 bcp.nBorderStyle = BorderStyle::BEVELED;
323 bcp.eCursorType = FXCT_ARROW; 323 bcp.eCursorType = FXCT_ARROW;
324 324
325 m_pButton->Create(bcp); 325 m_pButton->Create(bcp);
326 } 326 }
327 } 327 }
328 328
329 void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) { 329 void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) {
330 if (!m_pList) { 330 if (!m_pList) {
331 m_pList = new CPWL_CBListBox; 331 m_pList = new CPWL_CBListBox;
332 m_pList->AttachFFLData(m_pFormFiller); 332 m_pList->AttachFFLData(m_pFormFiller);
333 PWL_CREATEPARAM lcp = cp; 333 PWL_CREATEPARAM lcp = cp;
334 lcp.pParentWnd = this; 334 lcp.pParentWnd = this;
335 lcp.dwFlags = 335 lcp.dwFlags =
336 PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PLBS_HOVERSEL | PWS_VSCROLL; 336 PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PLBS_HOVERSEL | PWS_VSCROLL;
337 lcp.nBorderStyle = PBS_SOLID; 337 lcp.nBorderStyle = BorderStyle::SOLID;
338 lcp.dwBorderWidth = 1; 338 lcp.dwBorderWidth = 1;
339 lcp.eCursorType = FXCT_ARROW; 339 lcp.eCursorType = FXCT_ARROW;
340 lcp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); 340 lcp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0);
341 341
342 if (cp.dwFlags & PWS_AUTOFONTSIZE) 342 if (cp.dwFlags & PWS_AUTOFONTSIZE)
343 lcp.fFontSize = PWLCB_DEFAULTFONTSIZE; 343 lcp.fFontSize = PWLCB_DEFAULTFONTSIZE;
344 else 344 else
345 lcp.fFontSize = cp.fFontSize; 345 lcp.fFontSize = cp.fFontSize;
346 346
347 if (cp.sBorderColor.nColorType == COLORTYPE_TRANSPARENT) 347 if (cp.sBorderColor.nColorType == COLORTYPE_TRANSPARENT)
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698