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

Side by Side Diff: xfa/fwl/core/ifwl_datetimepicker.cpp

Issue 2520063002: Split fwl/core class pt II. (Closed)
Patch Set: Rebase to master Created 4 years 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 | « xfa/fwl/core/ifwl_datetimepicker.h ('k') | xfa/fwl/core/ifwl_form.h » ('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 "xfa/fwl/core/ifwl_datetimepicker.h" 7 #include "xfa/fwl/core/ifwl_datetimepicker.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
11 11
12 #include "third_party/base/ptr_util.h" 12 #include "third_party/base/ptr_util.h"
13 #include "xfa/fwl/core/cfwl_evteditchanged.h" 13 #include "xfa/fwl/core/cfwl_evteditchanged.h"
14 #include "xfa/fwl/core/cfwl_evtselectchanged.h" 14 #include "xfa/fwl/core/cfwl_evtselectchanged.h"
15 #include "xfa/fwl/core/cfwl_msgmouse.h" 15 #include "xfa/fwl/core/cfwl_msgmouse.h"
16 #include "xfa/fwl/core/cfwl_msgsetfocus.h" 16 #include "xfa/fwl/core/cfwl_msgsetfocus.h"
17 #include "xfa/fwl/core/cfwl_notedriver.h"
17 #include "xfa/fwl/core/cfwl_themebackground.h" 18 #include "xfa/fwl/core/cfwl_themebackground.h"
18 #include "xfa/fwl/core/cfwl_widgetmgr.h" 19 #include "xfa/fwl/core/cfwl_widgetmgr.h"
19 #include "xfa/fwl/core/fwl_noteimp.h"
20 #include "xfa/fwl/core/ifwl_formproxy.h" 20 #include "xfa/fwl/core/ifwl_formproxy.h"
21 #include "xfa/fwl/core/ifwl_spinbutton.h" 21 #include "xfa/fwl/core/ifwl_spinbutton.h"
22 #include "xfa/fwl/core/ifwl_themeprovider.h" 22 #include "xfa/fwl/core/ifwl_themeprovider.h"
23 23
24 namespace { 24 namespace {
25 25
26 const int kDateTimePickerWidth = 100; 26 const int kDateTimePickerWidth = 100;
27 const int kDateTimePickerHeight = 20; 27 const int kDateTimePickerHeight = 20;
28 28
29 } // namespace 29 } // namespace
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 CFX_RectF rtEdit; 112 CFX_RectF rtEdit;
113 rtEdit.Set(m_rtClient.left, m_rtClient.top, m_rtClient.width - fBtn, 113 rtEdit.Set(m_rtClient.left, m_rtClient.top, m_rtClient.width - fBtn,
114 m_rtClient.height); 114 m_rtClient.height);
115 m_pEdit->SetWidgetRect(rtEdit); 115 m_pEdit->SetWidgetRect(rtEdit);
116 ResetEditAlignment(); 116 ResetEditAlignment();
117 m_pEdit->Update(); 117 m_pEdit->Update();
118 if (!(m_pMonthCal->GetThemeProvider())) 118 if (!(m_pMonthCal->GetThemeProvider()))
119 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider); 119 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider);
120 if (m_pProperties->m_pDataProvider) { 120 if (m_pProperties->m_pDataProvider) {
121 IFWL_DateTimePickerDP* pData = 121 IFWL_DateTimePicker::DataProvider* pData =
122 static_cast<IFWL_DateTimePickerDP*>(m_pProperties->m_pDataProvider); 122 static_cast<IFWL_DateTimePicker::DataProvider*>(
123 m_pProperties->m_pDataProvider);
123 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay); 124 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay);
124 } 125 }
125 126
126 CFX_RectF rtMonthCal; 127 CFX_RectF rtMonthCal;
127 m_pMonthCal->GetWidgetRect(rtMonthCal, true); 128 m_pMonthCal->GetWidgetRect(rtMonthCal, true);
128 CFX_RectF rtPopUp; 129 CFX_RectF rtPopUp;
129 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight, 130 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight,
130 rtMonthCal.width, rtMonthCal.height); 131 rtMonthCal.width, rtMonthCal.height);
131 m_pMonthCal->SetWidgetRect(rtPopUp); 132 m_pMonthCal->SetWidgetRect(rtPopUp);
132 m_pMonthCal->Update(); 133 m_pMonthCal->Update();
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 461
461 m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); 462 m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider);
462 GetClientRect(m_rtClient); 463 GetClientRect(m_rtClient);
463 m_pEdit->SetWidgetRect(m_rtClient); 464 m_pEdit->SetWidgetRect(m_rtClient);
464 ResetEditAlignment(); 465 ResetEditAlignment();
465 m_pEdit->Update(); 466 m_pEdit->Update();
466 467
467 if (!m_pMonthCal->GetThemeProvider()) 468 if (!m_pMonthCal->GetThemeProvider())
468 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider); 469 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider);
469 if (m_pProperties->m_pDataProvider) { 470 if (m_pProperties->m_pDataProvider) {
470 IFWL_DateTimePickerDP* pData = 471 IFWL_DateTimePicker::DataProvider* pData =
471 static_cast<IFWL_DateTimePickerDP*>(m_pProperties->m_pDataProvider); 472 static_cast<IFWL_DateTimePicker::DataProvider*>(
473 m_pProperties->m_pDataProvider);
472 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay); 474 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay);
473 } 475 }
474 476
475 FX_FLOAT* pWidth = static_cast<FX_FLOAT*>( 477 FX_FLOAT* pWidth = static_cast<FX_FLOAT*>(
476 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); 478 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
477 if (!pWidth) 479 if (!pWidth)
478 return; 480 return;
479 481
480 m_fBtn = *pWidth; 482 m_fBtn = *pWidth;
481 CFX_RectF rtMonthCal; 483 CFX_RectF rtMonthCal;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 return m_iCurDay; 682 return m_iCurDay;
681 } 683 }
682 684
683 int32_t IFWL_DateTimePicker::GetCurMonth(IFWL_Widget* pWidget) { 685 int32_t IFWL_DateTimePicker::GetCurMonth(IFWL_Widget* pWidget) {
684 return m_iCurMonth; 686 return m_iCurMonth;
685 } 687 }
686 688
687 int32_t IFWL_DateTimePicker::GetCurYear(IFWL_Widget* pWidget) { 689 int32_t IFWL_DateTimePicker::GetCurYear(IFWL_Widget* pWidget) {
688 return m_iCurYear; 690 return m_iCurYear;
689 } 691 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_datetimepicker.h ('k') | xfa/fwl/core/ifwl_form.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698