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 "xfa/fwl/core/cfwl_datetimepicker.h" | 7 #include "xfa/fwl/core/cfwl_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_event.h" |
14 #include "xfa/fwl/core/cfwl_evtselectchanged.h" | 14 #include "xfa/fwl/core/cfwl_evtselectchanged.h" |
15 #include "xfa/fwl/core/cfwl_formproxy.h" | 15 #include "xfa/fwl/core/cfwl_formproxy.h" |
16 #include "xfa/fwl/core/cfwl_msgmouse.h" | 16 #include "xfa/fwl/core/cfwl_msgmouse.h" |
17 #include "xfa/fwl/core/cfwl_msgsetfocus.h" | 17 #include "xfa/fwl/core/cfwl_msgsetfocus.h" |
18 #include "xfa/fwl/core/cfwl_notedriver.h" | 18 #include "xfa/fwl/core/cfwl_notedriver.h" |
19 #include "xfa/fwl/core/cfwl_spinbutton.h" | 19 #include "xfa/fwl/core/cfwl_spinbutton.h" |
20 #include "xfa/fwl/core/cfwl_themebackground.h" | 20 #include "xfa/fwl/core/cfwl_themebackground.h" |
21 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 21 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
22 #include "xfa/fwl/core/ifwl_themeprovider.h" | 22 #include "xfa/fwl/core/ifwl_themeprovider.h" |
23 | 23 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 m_pMonthCal->SetSelect(iYear, iMonth, iDay); | 185 m_pMonthCal->SetSelect(iYear, iMonth, iDay); |
186 } | 186 } |
187 | 187 |
188 void CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { | 188 void CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) { |
189 if (!m_pEdit) | 189 if (!m_pEdit) |
190 return; | 190 return; |
191 | 191 |
192 m_pEdit->SetText(wsText); | 192 m_pEdit->SetText(wsText); |
193 Repaint(&m_rtClient); | 193 Repaint(&m_rtClient); |
194 | 194 |
195 CFWL_EvtEditChanged ev; | 195 CFWL_Event ev(CFWL_EventType::EditChanged); |
196 DispatchEvent(&ev); | 196 DispatchEvent(&ev); |
197 } | 197 } |
198 | 198 |
199 CFX_WideString CFWL_DateTimePicker::GetEditText(int32_t nStart, | 199 CFX_WideString CFWL_DateTimePicker::GetEditText(int32_t nStart, |
200 int32_t nCount) const { | 200 int32_t nCount) const { |
201 return m_pEdit ? m_pEdit->GetText(nStart, nCount) : L""; | 201 return m_pEdit ? m_pEdit->GetText(nStart, nCount) : L""; |
202 } | 202 } |
203 | 203 |
204 void CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const { | 204 void CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const { |
205 if (m_pWidgetMgr->IsFormDisabled()) { | 205 if (m_pWidgetMgr->IsFormDisabled()) { |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 if (DisForm_IsMonthCalendarVisible()) | 647 if (DisForm_IsMonthCalendarVisible()) |
648 ShowMonthCalendar(false); | 648 ShowMonthCalendar(false); |
649 if (m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { | 649 if (m_pEdit->GetStates() & FWL_WGTSTATE_Focused) { |
650 pMsg->m_pSrcTarget = m_pEdit.get(); | 650 pMsg->m_pSrcTarget = m_pEdit.get(); |
651 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); | 651 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); |
652 } | 652 } |
653 } | 653 } |
654 rtInvalidate.Inflate(2, 2); | 654 rtInvalidate.Inflate(2, 2); |
655 Repaint(&rtInvalidate); | 655 Repaint(&rtInvalidate); |
656 } | 656 } |
OLD | NEW |