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/ifwl_datetimepicker.h" | 7 #include "xfa/fwl/core/ifwl_datetimepicker.h" |
8 | 8 |
9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
11 #include "xfa/fwl/core/cfwl_themebackground.h" | 11 #include "xfa/fwl/core/cfwl_themebackground.h" |
12 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 12 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
13 #include "xfa/fwl/core/fwl_noteimp.h" | 13 #include "xfa/fwl/core/fwl_noteimp.h" |
14 #include "xfa/fwl/core/ifwl_datetimeedit.h" | |
15 #include "xfa/fwl/core/ifwl_formproxy.h" | 14 #include "xfa/fwl/core/ifwl_formproxy.h" |
16 #include "xfa/fwl/core/ifwl_spinbutton.h" | 15 #include "xfa/fwl/core/ifwl_spinbutton.h" |
17 #include "xfa/fwl/core/ifwl_themeprovider.h" | 16 #include "xfa/fwl/core/ifwl_themeprovider.h" |
18 | 17 |
19 namespace { | 18 namespace { |
20 | 19 |
21 const int kDateTimePickerWidth = 100; | 20 const int kDateTimePickerWidth = 100; |
22 const int kDateTimePickerHeight = 20; | 21 const int kDateTimePickerHeight = 20; |
23 | 22 |
24 } // namespace | 23 } // namespace |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 | 66 |
68 FWL_Type IFWL_DateTimePicker::GetClassID() const { | 67 FWL_Type IFWL_DateTimePicker::GetClassID() const { |
69 return FWL_Type::DateTimePicker; | 68 return FWL_Type::DateTimePicker; |
70 } | 69 } |
71 | 70 |
72 void IFWL_DateTimePicker::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { | 71 void IFWL_DateTimePicker::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { |
73 if (m_pWidgetMgr->IsFormDisabled()) { | 72 if (m_pWidgetMgr->IsFormDisabled()) { |
74 DisForm_GetWidgetRect(rect, bAutoSize); | 73 DisForm_GetWidgetRect(rect, bAutoSize); |
75 return; | 74 return; |
76 } | 75 } |
77 if (bAutoSize) { | 76 if (!bAutoSize) { |
78 rect.Set(0, 0, kDateTimePickerWidth, kDateTimePickerHeight); | |
79 IFWL_Widget::GetWidgetRect(rect, true); | |
80 } else { | |
81 rect = m_pProperties->m_rtWidget; | 77 rect = m_pProperties->m_rtWidget; |
78 return; | |
82 } | 79 } |
80 | |
81 rect.Set(0, 0, kDateTimePickerWidth, kDateTimePickerHeight); | |
82 IFWL_Widget::GetWidgetRect(rect, true); | |
83 } | 83 } |
84 | 84 |
85 void IFWL_DateTimePicker::Update() { | 85 void IFWL_DateTimePicker::Update() { |
86 if (m_pWidgetMgr->IsFormDisabled()) { | 86 if (m_pWidgetMgr->IsFormDisabled()) { |
87 DisForm_Update(); | 87 DisForm_Update(); |
88 return; | 88 return; |
89 } | 89 } |
90 if (m_iLock) { | 90 if (m_iLock) |
91 return; | 91 return; |
92 } | 92 if (!m_pProperties->m_pThemeProvider) |
93 if (!m_pProperties->m_pThemeProvider) { | |
94 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 93 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
95 } | 94 |
96 m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); | 95 m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); |
97 GetClientRect(m_rtClient); | 96 GetClientRect(m_rtClient); |
98 FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( | 97 FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( |
99 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); | 98 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); |
100 if (!pFWidth) | 99 if (!pFWidth) |
101 return; | 100 return; |
101 | |
102 FX_FLOAT fBtn = *pFWidth; | 102 FX_FLOAT fBtn = *pFWidth; |
103 m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top, fBtn - 1, | 103 m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top, fBtn - 1, |
104 m_rtClient.height - 1); | 104 m_rtClient.height - 1); |
105 | |
105 CFX_RectF rtEdit; | 106 CFX_RectF rtEdit; |
106 rtEdit.Set(m_rtClient.left, m_rtClient.top, m_rtClient.width - fBtn, | 107 rtEdit.Set(m_rtClient.left, m_rtClient.top, m_rtClient.width - fBtn, |
107 m_rtClient.height); | 108 m_rtClient.height); |
108 m_pEdit->SetWidgetRect(rtEdit); | 109 m_pEdit->SetWidgetRect(rtEdit); |
109 ResetEditAlignment(); | 110 ResetEditAlignment(); |
110 m_pEdit->Update(); | 111 m_pEdit->Update(); |
111 if (!(m_pMonthCal->GetThemeProvider())) { | 112 if (!(m_pMonthCal->GetThemeProvider())) |
112 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider); | 113 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider); |
113 } | |
114 if (m_pProperties->m_pDataProvider) { | 114 if (m_pProperties->m_pDataProvider) { |
115 IFWL_DateTimePickerDP* pData = | 115 IFWL_DateTimePickerDP* pData = |
116 static_cast<IFWL_DateTimePickerDP*>(m_pProperties->m_pDataProvider); | 116 static_cast<IFWL_DateTimePickerDP*>(m_pProperties->m_pDataProvider); |
117 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay); | 117 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay); |
118 } | 118 } |
119 | |
119 CFX_RectF rtMonthCal; | 120 CFX_RectF rtMonthCal; |
120 m_pMonthCal->GetWidgetRect(rtMonthCal, true); | 121 m_pMonthCal->GetWidgetRect(rtMonthCal, true); |
121 CFX_RectF rtPopUp; | 122 CFX_RectF rtPopUp; |
122 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight, | 123 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight, |
123 rtMonthCal.width, rtMonthCal.height); | 124 rtMonthCal.width, rtMonthCal.height); |
124 m_pMonthCal->SetWidgetRect(rtPopUp); | 125 m_pMonthCal->SetWidgetRect(rtPopUp); |
125 m_pMonthCal->Update(); | 126 m_pMonthCal->Update(); |
126 return; | 127 return; |
127 } | 128 } |
128 | 129 |
129 int32_t IFWL_DateTimePicker::CountSelRanges() { | 130 int32_t IFWL_DateTimePicker::CountSelRanges() const { |
130 return m_pEdit->CountSelRanges(); | 131 return m_pEdit->CountSelRanges(); |
131 } | 132 } |
132 | 133 |
133 int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) { | 134 int32_t IFWL_DateTimePicker::GetSelRange(int32_t nIndex, |
npm
2016/11/16 18:37:57
If you're moving one-liners to headers, you could
dsinclair
2016/11/16 18:57:14
Done.
| |
135 int32_t& nStart) const { | |
134 return m_pEdit->GetSelRange(nIndex, nStart); | 136 return m_pEdit->GetSelRange(nIndex, nStart); |
135 } | 137 } |
136 | 138 |
137 FWL_WidgetHit IFWL_DateTimePicker::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 139 FWL_WidgetHit IFWL_DateTimePicker::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
138 if (m_pWidgetMgr->IsFormDisabled()) | 140 if (m_pWidgetMgr->IsFormDisabled()) |
139 return DisForm_HitTest(fx, fy); | 141 return DisForm_HitTest(fx, fy); |
140 if (m_rtClient.Contains(fx, fy)) | 142 if (m_rtClient.Contains(fx, fy)) |
141 return FWL_WidgetHit::Client; | 143 return FWL_WidgetHit::Client; |
142 if (IsMonthCalendarVisible()) { | 144 if (IsMonthCalendarVisible()) { |
143 CFX_RectF rect; | 145 CFX_RectF rect; |
144 m_pMonthCal->GetWidgetRect(rect); | 146 m_pMonthCal->GetWidgetRect(rect); |
145 if (rect.Contains(fx, fy)) | 147 if (rect.Contains(fx, fy)) |
146 return FWL_WidgetHit::Client; | 148 return FWL_WidgetHit::Client; |
147 } | 149 } |
148 return FWL_WidgetHit::Unknown; | 150 return FWL_WidgetHit::Unknown; |
149 } | 151 } |
150 | 152 |
151 void IFWL_DateTimePicker::DrawWidget(CFX_Graphics* pGraphics, | 153 void IFWL_DateTimePicker::DrawWidget(CFX_Graphics* pGraphics, |
152 const CFX_Matrix* pMatrix) { | 154 const CFX_Matrix* pMatrix) { |
153 if (!pGraphics) | 155 if (!pGraphics) |
154 return; | 156 return; |
155 if (!m_pProperties->m_pThemeProvider) | 157 if (!m_pProperties->m_pThemeProvider) |
156 return; | 158 return; |
159 | |
157 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; | 160 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; |
158 if (HasBorder()) { | 161 if (HasBorder()) |
159 DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); | 162 DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); |
160 } | 163 if (HasEdge()) |
161 if (HasEdge()) { | |
162 DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); | 164 DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); |
163 } | 165 if (!m_rtBtn.IsEmpty()) |
164 if (!m_rtBtn.IsEmpty()) { | |
165 DrawDropDownButton(pGraphics, pTheme, pMatrix); | 166 DrawDropDownButton(pGraphics, pTheme, pMatrix); |
166 } | |
167 if (m_pWidgetMgr->IsFormDisabled()) { | 167 if (m_pWidgetMgr->IsFormDisabled()) { |
168 DisForm_DrawWidget(pGraphics, pMatrix); | 168 DisForm_DrawWidget(pGraphics, pMatrix); |
169 return; | 169 return; |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 void IFWL_DateTimePicker::SetThemeProvider(IFWL_ThemeProvider* pTP) { | 173 void IFWL_DateTimePicker::SetThemeProvider(IFWL_ThemeProvider* pTP) { |
174 m_pProperties->m_pThemeProvider = pTP; | 174 m_pProperties->m_pThemeProvider = pTP; |
175 m_pMonthCal->SetThemeProvider(pTP); | 175 m_pMonthCal->SetThemeProvider(pTP); |
176 } | 176 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 DispatchEvent(&ev); | 210 DispatchEvent(&ev); |
211 } | 211 } |
212 | 212 |
213 void IFWL_DateTimePicker::GetEditText(CFX_WideString& wsText, | 213 void IFWL_DateTimePicker::GetEditText(CFX_WideString& wsText, |
214 int32_t nStart, | 214 int32_t nStart, |
215 int32_t nCount) const { | 215 int32_t nCount) const { |
216 if (m_pEdit) | 216 if (m_pEdit) |
217 m_pEdit->GetText(wsText, nStart, nCount); | 217 m_pEdit->GetText(wsText, nStart, nCount); |
218 } | 218 } |
219 | 219 |
220 void IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) { | 220 void IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const { |
221 if (m_pWidgetMgr->IsFormDisabled()) { | 221 if (m_pWidgetMgr->IsFormDisabled()) { |
222 DisForm_GetBBox(rect); | 222 DisForm_GetBBox(rect); |
223 return; | 223 return; |
224 } | 224 } |
225 | |
225 rect = m_pProperties->m_rtWidget; | 226 rect = m_pProperties->m_rtWidget; |
226 if (IsMonthCalendarVisible()) { | 227 if (IsMonthCalendarVisible()) { |
227 CFX_RectF rtMonth; | 228 CFX_RectF rtMonth; |
228 m_pMonthCal->GetWidgetRect(rtMonth); | 229 m_pMonthCal->GetWidgetRect(rtMonth); |
229 rtMonth.Offset(m_pProperties->m_rtWidget.left, | 230 rtMonth.Offset(m_pProperties->m_rtWidget.left, |
230 m_pProperties->m_rtWidget.top); | 231 m_pProperties->m_rtWidget.top); |
231 rect.Union(rtMonth); | 232 rect.Union(rtMonth); |
232 } | 233 } |
233 } | 234 } |
234 | 235 |
235 void IFWL_DateTimePicker::SetEditLimit(int32_t nLimit) { | |
236 m_pEdit->SetLimit(nLimit); | |
237 } | |
238 | |
239 void IFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded, | 236 void IFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded, |
240 uint32_t dwStylesExRemoved) { | 237 uint32_t dwStylesExRemoved) { |
241 m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | 238 m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
242 } | 239 } |
243 | 240 |
244 void IFWL_DateTimePicker::DrawDropDownButton(CFX_Graphics* pGraphics, | 241 void IFWL_DateTimePicker::DrawDropDownButton(CFX_Graphics* pGraphics, |
245 IFWL_ThemeProvider* pTheme, | 242 IFWL_ThemeProvider* pTheme, |
246 const CFX_Matrix* pMatrix) { | 243 const CFX_Matrix* pMatrix) { |
247 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_Spin) == | 244 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_Spin) == |
248 FWL_STYLEEXT_DTP_Spin) { | 245 FWL_STYLEEXT_DTP_Spin) { |
249 return; | 246 return; |
250 } | 247 } |
251 | 248 |
252 CFWL_ThemeBackground param; | 249 CFWL_ThemeBackground param; |
253 param.m_pWidget = this; | 250 param.m_pWidget = this; |
254 param.m_iPart = CFWL_Part::DropDownButton; | 251 param.m_iPart = CFWL_Part::DropDownButton; |
255 param.m_dwStates = m_iBtnState; | 252 param.m_dwStates = m_iBtnState; |
256 param.m_pGraphics = pGraphics; | 253 param.m_pGraphics = pGraphics; |
257 param.m_rtPart = m_rtBtn; | 254 param.m_rtPart = m_rtBtn; |
258 if (pMatrix) | 255 if (pMatrix) |
259 param.m_matrix.Concat(*pMatrix); | 256 param.m_matrix.Concat(*pMatrix); |
260 | |
261 pTheme->DrawBackground(¶m); | 257 pTheme->DrawBackground(¶m); |
262 } | 258 } |
263 | 259 |
264 void IFWL_DateTimePicker::FormatDateString(int32_t iYear, | 260 void IFWL_DateTimePicker::FormatDateString(int32_t iYear, |
265 int32_t iMonth, | 261 int32_t iMonth, |
266 int32_t iDay, | 262 int32_t iDay, |
267 CFX_WideString& wsText) { | 263 CFX_WideString& wsText) { |
268 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_ShortDateFormat) == | 264 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_ShortDateFormat) == |
269 FWL_STYLEEXT_DTP_ShortDateFormat) { | 265 FWL_STYLEEXT_DTP_ShortDateFormat) { |
270 wsText.Format(L"%d-%d-%d", iYear, iMonth, iDay); | 266 wsText.Format(L"%d-%d-%d", iYear, iMonth, iDay); |
271 } else if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_LongDateFormat) == | 267 } else if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_LongDateFormat) == |
272 FWL_STYLEEXT_DTP_LongDateFormat) { | 268 FWL_STYLEEXT_DTP_LongDateFormat) { |
273 wsText.Format(L"%d Year %d Month %d Day", iYear, iMonth, iDay); | 269 wsText.Format(L"%d Year %d Month %d Day", iYear, iMonth, iDay); |
274 } else if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_TimeFormat) == | |
275 FWL_STYLEEXT_DTP_TimeFormat) { | |
276 } | 270 } |
277 } | 271 } |
278 | 272 |
279 void IFWL_DateTimePicker::ShowMonthCalendar(bool bActivate) { | 273 void IFWL_DateTimePicker::ShowMonthCalendar(bool bActivate) { |
280 if (m_pWidgetMgr->IsFormDisabled()) { | 274 if (m_pWidgetMgr->IsFormDisabled()) |
281 return DisForm_ShowMonthCalendar(bActivate); | 275 return DisForm_ShowMonthCalendar(bActivate); |
282 } | 276 if (IsMonthCalendarVisible() == bActivate) |
283 if (IsMonthCalendarVisible() == bActivate) { | 277 return; |
278 if (!m_pForm) | |
279 InitProxyForm(); | |
280 | |
281 if (!bActivate) { | |
282 m_pForm->EndDoModal(); | |
284 return; | 283 return; |
285 } | 284 } |
286 if (!m_pForm) { | 285 |
287 InitProxyForm(); | 286 CFX_RectF rtMonth; |
288 } | 287 m_pMonthCal->GetWidgetRect(rtMonth); |
289 if (bActivate) { | 288 |
290 CFX_RectF rtMonth; | 289 CFX_RectF rtAnchor; |
291 m_pMonthCal->GetWidgetRect(rtMonth); | 290 rtAnchor.Set(0, 0, m_pProperties->m_rtWidget.width, |
292 CFX_RectF rtAnchor; | 291 m_pProperties->m_rtWidget.height); |
293 rtAnchor.Set(0, 0, m_pProperties->m_rtWidget.width, | 292 GetPopupPos(0, rtMonth.height, rtAnchor, rtMonth); |
294 m_pProperties->m_rtWidget.height); | 293 m_pForm->SetWidgetRect(rtMonth); |
295 GetPopupPos(0, rtMonth.height, rtAnchor, rtMonth); | 294 |
296 m_pForm->SetWidgetRect(rtMonth); | 295 rtMonth.left = rtMonth.top = 0; |
297 rtMonth.left = rtMonth.top = 0; | 296 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); |
298 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); | 297 m_pMonthCal->SetWidgetRect(rtMonth); |
299 m_pMonthCal->SetWidgetRect(rtMonth); | 298 m_pMonthCal->Update(); |
300 m_pMonthCal->Update(); | 299 m_pForm->DoModal(); |
301 m_pForm->DoModal(); | |
302 } else { | |
303 m_pForm->EndDoModal(); | |
304 } | |
305 } | 300 } |
306 | 301 |
307 bool IFWL_DateTimePicker::IsMonthCalendarVisible() { | 302 bool IFWL_DateTimePicker::IsMonthCalendarVisible() const { |
308 if (m_pWidgetMgr->IsFormDisabled()) { | 303 if (m_pWidgetMgr->IsFormDisabled()) |
309 return DisForm_IsMonthCalendarVisible(); | 304 return DisForm_IsMonthCalendarVisible(); |
310 } | |
311 if (!m_pForm) | 305 if (!m_pForm) |
312 return false; | 306 return false; |
313 return !(m_pForm->GetStates() & FWL_WGTSTATE_Invisible); | 307 return !(m_pForm->GetStates() & FWL_WGTSTATE_Invisible); |
314 } | 308 } |
315 | 309 |
316 void IFWL_DateTimePicker::ResetEditAlignment() { | 310 void IFWL_DateTimePicker::ResetEditAlignment() { |
317 if (!m_pEdit) | 311 if (!m_pEdit) |
318 return; | 312 return; |
319 uint32_t dwStylExes = m_pProperties->m_dwStyleExes; | 313 |
320 uint32_t dwAdd = 0; | 314 uint32_t dwAdd = 0; |
321 switch (dwStylExes & FWL_STYLEEXT_DTP_EditHAlignMask) { | 315 switch (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_EditHAlignMask) { |
npm
2016/11/16 18:37:57
Don't see why we need to remove the dwStylExes var
dsinclair
2016/11/16 18:57:14
Seems a bit clearer. The method only ever modifies
| |
322 case FWL_STYLEEXT_DTP_EditHCenter: { | 316 case FWL_STYLEEXT_DTP_EditHCenter: { |
323 dwAdd |= FWL_STYLEEXT_EDT_HCenter; | 317 dwAdd |= FWL_STYLEEXT_EDT_HCenter; |
324 break; | 318 break; |
325 } | 319 } |
326 case FWL_STYLEEXT_DTP_EditHFar: { | 320 case FWL_STYLEEXT_DTP_EditHFar: { |
327 dwAdd |= FWL_STYLEEXT_EDT_HFar; | 321 dwAdd |= FWL_STYLEEXT_EDT_HFar; |
328 break; | 322 break; |
329 } | 323 } |
330 default: { dwAdd |= FWL_STYLEEXT_EDT_HNear; } | 324 default: { |
325 dwAdd |= FWL_STYLEEXT_EDT_HNear; | |
326 break; | |
327 } | |
331 } | 328 } |
332 switch (dwStylExes & FWL_STYLEEXT_DTP_EditVAlignMask) { | 329 switch (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_EditVAlignMask) { |
333 case FWL_STYLEEXT_DTP_EditVCenter: { | 330 case FWL_STYLEEXT_DTP_EditVCenter: { |
334 dwAdd |= FWL_STYLEEXT_EDT_VCenter; | 331 dwAdd |= FWL_STYLEEXT_EDT_VCenter; |
335 break; | 332 break; |
336 } | 333 } |
337 case FWL_STYLEEXT_DTP_EditVFar: { | 334 case FWL_STYLEEXT_DTP_EditVFar: { |
338 dwAdd |= FWL_STYLEEXT_EDT_VFar; | 335 dwAdd |= FWL_STYLEEXT_EDT_VFar; |
339 break; | 336 break; |
340 } | 337 } |
341 default: { dwAdd |= FWL_STYLEEXT_EDT_VNear; } | 338 default: { |
339 dwAdd |= FWL_STYLEEXT_EDT_VNear; | |
340 break; | |
341 } | |
342 } | 342 } |
343 if (dwStylExes & FWL_STYLEEXT_DTP_EditJustified) { | 343 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_EditJustified) |
344 dwAdd |= FWL_STYLEEXT_EDT_Justified; | 344 dwAdd |= FWL_STYLEEXT_EDT_Justified; |
345 } | 345 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_EditDistributed) |
346 if (dwStylExes & FWL_STYLEEXT_DTP_EditDistributed) { | |
347 dwAdd |= FWL_STYLEEXT_EDT_Distributed; | 346 dwAdd |= FWL_STYLEEXT_EDT_Distributed; |
348 } | 347 |
349 m_pEdit->ModifyStylesEx(dwAdd, FWL_STYLEEXT_EDT_HAlignMask | | 348 m_pEdit->ModifyStylesEx(dwAdd, FWL_STYLEEXT_EDT_HAlignMask | |
350 FWL_STYLEEXT_EDT_HAlignModeMask | | 349 FWL_STYLEEXT_EDT_HAlignModeMask | |
351 FWL_STYLEEXT_EDT_VAlignMask); | 350 FWL_STYLEEXT_EDT_VAlignMask); |
352 } | 351 } |
353 | 352 |
354 void IFWL_DateTimePicker::ProcessSelChanged(int32_t iYear, | 353 void IFWL_DateTimePicker::ProcessSelChanged(int32_t iYear, |
355 int32_t iMonth, | 354 int32_t iMonth, |
356 int32_t iDay) { | 355 int32_t iDay) { |
357 m_iYear = iYear; | 356 m_iYear = iYear; |
358 m_iMonth = iMonth; | 357 m_iMonth = iMonth; |
359 m_iDay = iDay; | 358 m_iDay = iDay; |
359 | |
360 CFX_WideString wsText; | 360 CFX_WideString wsText; |
361 FormatDateString(m_iYear, m_iMonth, m_iDay, wsText); | 361 FormatDateString(m_iYear, m_iMonth, m_iDay, wsText); |
362 m_pEdit->SetText(wsText); | 362 m_pEdit->SetText(wsText); |
363 m_pEdit->Update(); | 363 m_pEdit->Update(); |
364 Repaint(&m_rtClient); | 364 Repaint(&m_rtClient); |
365 | |
365 CFWL_Event_DtpSelectChanged ev; | 366 CFWL_Event_DtpSelectChanged ev; |
366 ev.m_pSrcTarget = this; | 367 ev.m_pSrcTarget = this; |
367 ev.iYear = m_iYear; | 368 ev.iYear = m_iYear; |
368 ev.iMonth = m_iMonth; | 369 ev.iMonth = m_iMonth; |
369 ev.iDay = m_iDay; | 370 ev.iDay = m_iDay; |
370 DispatchEvent(&ev); | 371 DispatchEvent(&ev); |
371 } | 372 } |
372 | 373 |
373 void IFWL_DateTimePicker::InitProxyForm() { | 374 void IFWL_DateTimePicker::InitProxyForm() { |
374 if (m_pForm) | 375 if (m_pForm) |
375 return; | 376 return; |
376 if (!m_pMonthCal) | 377 if (!m_pMonthCal) |
377 return; | 378 return; |
378 | 379 |
379 auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>(); | 380 auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>(); |
380 prop->m_dwStyles = FWL_WGTSTYLE_Popup; | 381 prop->m_dwStyles = FWL_WGTSTYLE_Popup; |
381 prop->m_dwStates = FWL_WGTSTATE_Invisible; | 382 prop->m_dwStates = FWL_WGTSTATE_Invisible; |
382 prop->m_pOwner = this; | 383 prop->m_pOwner = this; |
383 | 384 |
384 m_pForm.reset( | 385 m_pForm = pdfium::MakeUnique<IFWL_FormProxy>(m_pOwnerApp, std::move(prop), |
385 new IFWL_FormProxy(m_pOwnerApp, std::move(prop), m_pMonthCal.get())); | 386 m_pMonthCal.get()); |
386 m_pMonthCal->SetParent(m_pForm.get()); | 387 m_pMonthCal->SetParent(m_pForm.get()); |
387 } | 388 } |
388 | 389 |
389 bool IFWL_DateTimePicker::DisForm_IsMonthCalendarVisible() { | 390 bool IFWL_DateTimePicker::DisForm_IsMonthCalendarVisible() const { |
390 if (!m_pMonthCal) | 391 if (!m_pMonthCal) |
391 return false; | 392 return false; |
392 return !(m_pMonthCal->GetStates() & FWL_WGTSTATE_Invisible); | 393 return !(m_pMonthCal->GetStates() & FWL_WGTSTATE_Invisible); |
393 } | 394 } |
394 | 395 |
395 void IFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) { | 396 void IFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) { |
396 bool bShowed = IsMonthCalendarVisible(); | 397 if (IsMonthCalendarVisible() == bActivate) |
397 if (bShowed == bActivate) { | |
398 return; | 398 return; |
399 } | 399 |
400 if (bActivate) { | 400 if (bActivate) { |
401 CFX_RectF rtMonthCal; | 401 CFX_RectF rtMonthCal; |
402 m_pMonthCal->GetWidgetRect(rtMonthCal, true); | 402 m_pMonthCal->GetWidgetRect(rtMonthCal, true); |
403 FX_FLOAT fPopupMin = rtMonthCal.height; | 403 FX_FLOAT fPopupMin = rtMonthCal.height; |
404 FX_FLOAT fPopupMax = rtMonthCal.height; | 404 FX_FLOAT fPopupMax = rtMonthCal.height; |
405 CFX_RectF rtAnchor(m_pProperties->m_rtWidget); | 405 CFX_RectF rtAnchor(m_pProperties->m_rtWidget); |
406 rtAnchor.width = rtMonthCal.width; | 406 rtAnchor.width = rtMonthCal.width; |
407 rtMonthCal.left = m_rtClient.left; | 407 rtMonthCal.left = m_rtClient.left; |
408 rtMonthCal.top = rtAnchor.Height(); | 408 rtMonthCal.top = rtAnchor.Height(); |
409 GetPopupPos(fPopupMin, fPopupMax, rtAnchor, rtMonthCal); | 409 GetPopupPos(fPopupMin, fPopupMax, rtAnchor, rtMonthCal); |
410 m_pMonthCal->SetWidgetRect(rtMonthCal); | 410 m_pMonthCal->SetWidgetRect(rtMonthCal); |
411 if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0) { | 411 if (m_iYear > 0 && m_iMonth > 0 && m_iDay > 0) |
412 m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay); | 412 m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay); |
413 } | |
414 m_pMonthCal->Update(); | 413 m_pMonthCal->Update(); |
415 } | 414 } |
416 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); | 415 m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); |
416 | |
417 if (bActivate) { | 417 if (bActivate) { |
418 CFWL_MsgSetFocus msg; | 418 CFWL_MsgSetFocus msg; |
419 msg.m_pDstTarget = m_pMonthCal.get(); | 419 msg.m_pDstTarget = m_pMonthCal.get(); |
420 msg.m_pSrcTarget = m_pEdit.get(); | 420 msg.m_pSrcTarget = m_pEdit.get(); |
421 m_pEdit->GetDelegate()->OnProcessMessage(&msg); | 421 m_pEdit->GetDelegate()->OnProcessMessage(&msg); |
422 } | 422 } |
423 | |
423 CFX_RectF rtInvalidate, rtCal; | 424 CFX_RectF rtInvalidate, rtCal; |
424 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, | 425 rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, |
425 m_pProperties->m_rtWidget.height); | 426 m_pProperties->m_rtWidget.height); |
426 m_pMonthCal->GetWidgetRect(rtCal); | 427 m_pMonthCal->GetWidgetRect(rtCal); |
427 rtInvalidate.Union(rtCal); | 428 rtInvalidate.Union(rtCal); |
428 rtInvalidate.Inflate(2, 2); | 429 rtInvalidate.Inflate(2, 2); |
429 Repaint(&rtInvalidate); | 430 Repaint(&rtInvalidate); |
430 } | 431 } |
431 | 432 |
432 FWL_WidgetHit IFWL_DateTimePicker::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 433 FWL_WidgetHit IFWL_DateTimePicker::DisForm_HitTest(FX_FLOAT fx, |
434 FX_FLOAT fy) const { | |
433 CFX_RectF rect; | 435 CFX_RectF rect; |
434 rect.Set(0, 0, m_pProperties->m_rtWidget.width, | 436 rect.Set(0, 0, m_pProperties->m_rtWidget.width, |
435 m_pProperties->m_rtWidget.height); | 437 m_pProperties->m_rtWidget.height); |
436 if (rect.Contains(fx, fy)) | 438 if (rect.Contains(fx, fy)) |
437 return FWL_WidgetHit::Edit; | 439 return FWL_WidgetHit::Edit; |
438 if (DisForm_IsNeedShowButton()) | 440 if (DisForm_IsNeedShowButton()) |
439 rect.width += m_fBtn; | 441 rect.width += m_fBtn; |
440 if (rect.Contains(fx, fy)) | 442 if (rect.Contains(fx, fy)) |
441 return FWL_WidgetHit::Client; | 443 return FWL_WidgetHit::Client; |
442 if (IsMonthCalendarVisible()) { | 444 if (IsMonthCalendarVisible()) { |
443 m_pMonthCal->GetWidgetRect(rect); | 445 m_pMonthCal->GetWidgetRect(rect); |
444 if (rect.Contains(fx, fy)) | 446 if (rect.Contains(fx, fy)) |
445 return FWL_WidgetHit::Client; | 447 return FWL_WidgetHit::Client; |
446 } | 448 } |
447 return FWL_WidgetHit::Unknown; | 449 return FWL_WidgetHit::Unknown; |
448 } | 450 } |
449 | 451 |
450 bool IFWL_DateTimePicker::DisForm_IsNeedShowButton() { | 452 bool IFWL_DateTimePicker::DisForm_IsNeedShowButton() const { |
451 bool bFocus = m_pProperties->m_dwStates & FWL_WGTSTATE_Focused || | 453 return m_pProperties->m_dwStates & FWL_WGTSTATE_Focused || |
452 m_pMonthCal->GetStates() & FWL_WGTSTATE_Focused || | 454 m_pMonthCal->GetStates() & FWL_WGTSTATE_Focused || |
453 m_pEdit->GetStates() & FWL_WGTSTATE_Focused; | 455 m_pEdit->GetStates() & FWL_WGTSTATE_Focused; |
454 return bFocus; | |
455 } | 456 } |
456 | 457 |
457 void IFWL_DateTimePicker::DisForm_Update() { | 458 void IFWL_DateTimePicker::DisForm_Update() { |
458 if (m_iLock) | 459 if (m_iLock) |
459 return; | 460 return; |
460 if (!m_pProperties->m_pThemeProvider) | 461 if (!m_pProperties->m_pThemeProvider) |
461 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 462 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
462 | 463 |
463 m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); | 464 m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); |
464 GetClientRect(m_rtClient); | 465 GetClientRect(m_rtClient); |
465 m_pEdit->SetWidgetRect(m_rtClient); | 466 m_pEdit->SetWidgetRect(m_rtClient); |
466 ResetEditAlignment(); | 467 ResetEditAlignment(); |
467 m_pEdit->Update(); | 468 m_pEdit->Update(); |
469 | |
468 if (!m_pMonthCal->GetThemeProvider()) | 470 if (!m_pMonthCal->GetThemeProvider()) |
469 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider); | 471 m_pMonthCal->SetThemeProvider(m_pProperties->m_pThemeProvider); |
470 | |
471 if (m_pProperties->m_pDataProvider) { | 472 if (m_pProperties->m_pDataProvider) { |
472 IFWL_DateTimePickerDP* pData = | 473 IFWL_DateTimePickerDP* pData = |
473 static_cast<IFWL_DateTimePickerDP*>(m_pProperties->m_pDataProvider); | 474 static_cast<IFWL_DateTimePickerDP*>(m_pProperties->m_pDataProvider); |
474 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay); | 475 pData->GetToday(this, m_iCurYear, m_iCurMonth, m_iCurDay); |
475 } | 476 } |
477 | |
476 FX_FLOAT* pWidth = static_cast<FX_FLOAT*>( | 478 FX_FLOAT* pWidth = static_cast<FX_FLOAT*>( |
477 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); | 479 GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); |
478 if (!pWidth) | 480 if (!pWidth) |
479 return; | 481 return; |
480 | 482 |
481 m_fBtn = *pWidth; | 483 m_fBtn = *pWidth; |
482 CFX_RectF rtMonthCal; | 484 CFX_RectF rtMonthCal; |
483 m_pMonthCal->GetWidgetRect(rtMonthCal, true); | 485 m_pMonthCal->GetWidgetRect(rtMonthCal, true); |
486 | |
484 CFX_RectF rtPopUp; | 487 CFX_RectF rtPopUp; |
485 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight, | 488 rtPopUp.Set(rtMonthCal.left, rtMonthCal.top + kDateTimePickerHeight, |
486 rtMonthCal.width, rtMonthCal.height); | 489 rtMonthCal.width, rtMonthCal.height); |
487 m_pMonthCal->SetWidgetRect(rtPopUp); | 490 m_pMonthCal->SetWidgetRect(rtPopUp); |
488 m_pMonthCal->Update(); | 491 m_pMonthCal->Update(); |
489 } | 492 } |
490 | 493 |
491 void IFWL_DateTimePicker::DisForm_GetWidgetRect(CFX_RectF& rect, | 494 void IFWL_DateTimePicker::DisForm_GetWidgetRect(CFX_RectF& rect, |
492 bool bAutoSize) { | 495 bool bAutoSize) { |
493 rect = m_pProperties->m_rtWidget; | 496 rect = m_pProperties->m_rtWidget; |
494 if (DisForm_IsNeedShowButton()) { | 497 if (DisForm_IsNeedShowButton()) |
495 rect.width += m_fBtn; | 498 rect.width += m_fBtn; |
496 } | |
497 } | 499 } |
498 | 500 |
499 void IFWL_DateTimePicker::DisForm_GetBBox(CFX_RectF& rect) { | 501 void IFWL_DateTimePicker::DisForm_GetBBox(CFX_RectF& rect) const { |
500 rect = m_pProperties->m_rtWidget; | 502 rect = m_pProperties->m_rtWidget; |
501 if (DisForm_IsNeedShowButton()) { | 503 if (DisForm_IsNeedShowButton()) |
502 rect.width += m_fBtn; | 504 rect.width += m_fBtn; |
503 } | 505 if (!IsMonthCalendarVisible()) |
504 if (IsMonthCalendarVisible()) { | 506 return; |
505 CFX_RectF rtMonth; | 507 |
506 m_pMonthCal->GetWidgetRect(rtMonth); | 508 CFX_RectF rtMonth; |
507 rtMonth.Offset(m_pProperties->m_rtWidget.left, | 509 m_pMonthCal->GetWidgetRect(rtMonth); |
508 m_pProperties->m_rtWidget.top); | 510 rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top); |
509 rect.Union(rtMonth); | 511 rect.Union(rtMonth); |
510 } | |
511 } | 512 } |
512 | 513 |
513 void IFWL_DateTimePicker::DisForm_DrawWidget(CFX_Graphics* pGraphics, | 514 void IFWL_DateTimePicker::DisForm_DrawWidget(CFX_Graphics* pGraphics, |
514 const CFX_Matrix* pMatrix) { | 515 const CFX_Matrix* pMatrix) { |
515 if (!pGraphics) | 516 if (!pGraphics) |
516 return; | 517 return; |
517 if (m_pEdit) { | 518 if (m_pEdit) { |
518 CFX_RectF rtEdit; | 519 CFX_RectF rtEdit; |
519 m_pEdit->GetWidgetRect(rtEdit); | 520 m_pEdit->GetWidgetRect(rtEdit); |
521 | |
520 CFX_Matrix mt; | 522 CFX_Matrix mt; |
521 mt.Set(1, 0, 0, 1, rtEdit.left, rtEdit.top); | 523 mt.Set(1, 0, 0, 1, rtEdit.left, rtEdit.top); |
522 if (pMatrix) { | 524 if (pMatrix) |
523 mt.Concat(*pMatrix); | 525 mt.Concat(*pMatrix); |
524 } | |
525 m_pEdit->DrawWidget(pGraphics, &mt); | 526 m_pEdit->DrawWidget(pGraphics, &mt); |
526 } | 527 } |
527 if (IsMonthCalendarVisible()) { | 528 if (!IsMonthCalendarVisible()) |
528 CFX_RectF rtMonth; | 529 return; |
529 m_pMonthCal->GetWidgetRect(rtMonth); | 530 |
530 CFX_Matrix mt; | 531 CFX_RectF rtMonth; |
531 mt.Set(1, 0, 0, 1, rtMonth.left, rtMonth.top); | 532 m_pMonthCal->GetWidgetRect(rtMonth); |
532 if (pMatrix) { | 533 CFX_Matrix mt; |
533 mt.Concat(*pMatrix); | 534 mt.Set(1, 0, 0, 1, rtMonth.left, rtMonth.top); |
534 } | 535 if (pMatrix) |
535 m_pMonthCal->DrawWidget(pGraphics, &mt); | 536 mt.Concat(*pMatrix); |
536 } | 537 m_pMonthCal->DrawWidget(pGraphics, &mt); |
537 return; | |
538 } | 538 } |
539 | 539 |
540 void IFWL_DateTimePicker::OnProcessMessage(CFWL_Message* pMessage) { | 540 void IFWL_DateTimePicker::OnProcessMessage(CFWL_Message* pMessage) { |
541 if (!pMessage) | 541 if (!pMessage) |
542 return; | 542 return; |
543 | 543 |
544 switch (pMessage->GetClassID()) { | 544 switch (pMessage->GetClassID()) { |
545 case CFWL_MessageType::SetFocus: | 545 case CFWL_MessageType::SetFocus: |
546 OnFocusChanged(pMessage, true); | 546 OnFocusChanged(pMessage, true); |
547 break; | 547 break; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 ShowMonthCalendar(false); | 604 ShowMonthCalendar(false); |
605 } | 605 } |
606 Repaint(&m_rtClient); | 606 Repaint(&m_rtClient); |
607 } | 607 } |
608 | 608 |
609 void IFWL_DateTimePicker::OnLButtonDown(CFWL_MsgMouse* pMsg) { | 609 void IFWL_DateTimePicker::OnLButtonDown(CFWL_MsgMouse* pMsg) { |
610 if (!pMsg) | 610 if (!pMsg) |
611 return; | 611 return; |
612 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) | 612 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) |
613 SetFocus(true); | 613 SetFocus(true); |
614 if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { | 614 if (!m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) |
615 if (IsMonthCalendarVisible()) { | 615 return; |
616 ShowMonthCalendar(false); | 616 |
617 CFWL_Event_DtpCloseUp ev; | 617 if (IsMonthCalendarVisible()) { |
618 DispatchEvent(&ev); | 618 ShowMonthCalendar(false); |
619 } else { | 619 CFWL_Event_DtpCloseUp ev; |
620 if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_TimeFormat)) { | 620 DispatchEvent(&ev); |
621 ShowMonthCalendar(true); | 621 return; |
622 CFWL_Event_DtpDropDown ev; | |
623 DispatchEvent(&ev); | |
624 } | |
625 m_bLBtnDown = true; | |
626 Repaint(&m_rtClient); | |
627 } | |
628 } | 622 } |
623 | |
624 if (!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_TimeFormat)) { | |
625 ShowMonthCalendar(true); | |
626 CFWL_Event_DtpDropDown ev; | |
627 DispatchEvent(&ev); | |
628 } | |
629 m_bLBtnDown = true; | |
630 Repaint(&m_rtClient); | |
629 } | 631 } |
630 | 632 |
631 void IFWL_DateTimePicker::OnLButtonUp(CFWL_MsgMouse* pMsg) { | 633 void IFWL_DateTimePicker::OnLButtonUp(CFWL_MsgMouse* pMsg) { |
632 if (!pMsg) | 634 if (!pMsg) |
633 return; | 635 return; |
634 | 636 |
635 m_bLBtnDown = false; | 637 m_bLBtnDown = false; |
636 if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) | 638 if (m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) |
637 m_iBtnState = CFWL_PartState_Hovered; | 639 m_iBtnState = CFWL_PartState_Hovered; |
638 else | 640 else |
639 m_iBtnState = CFWL_PartState_Normal; | 641 m_iBtnState = CFWL_PartState_Normal; |
640 Repaint(&m_rtBtn); | 642 Repaint(&m_rtBtn); |
641 } | 643 } |
642 | 644 |
643 void IFWL_DateTimePicker::OnMouseMove(CFWL_MsgMouse* pMsg) { | 645 void IFWL_DateTimePicker::OnMouseMove(CFWL_MsgMouse* pMsg) { |
644 if (!m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) | 646 if (!m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) |
645 m_iBtnState = CFWL_PartState_Normal; | 647 m_iBtnState = CFWL_PartState_Normal; |
646 | |
647 Repaint(&m_rtBtn); | 648 Repaint(&m_rtBtn); |
648 } | 649 } |
649 | 650 |
650 void IFWL_DateTimePicker::OnMouseLeave(CFWL_MsgMouse* pMsg) { | 651 void IFWL_DateTimePicker::OnMouseLeave(CFWL_MsgMouse* pMsg) { |
651 if (!pMsg) | 652 if (!pMsg) |
652 return; | 653 return; |
653 m_iBtnState = CFWL_PartState_Normal; | 654 m_iBtnState = CFWL_PartState_Normal; |
654 Repaint(&m_rtBtn); | 655 Repaint(&m_rtBtn); |
655 } | 656 } |
656 | 657 |
(...skipping 30 matching lines...) Expand all Loading... | |
687 return m_iCurDay; | 688 return m_iCurDay; |
688 } | 689 } |
689 | 690 |
690 int32_t IFWL_DateTimePicker::GetCurMonth(IFWL_Widget* pWidget) { | 691 int32_t IFWL_DateTimePicker::GetCurMonth(IFWL_Widget* pWidget) { |
691 return m_iCurMonth; | 692 return m_iCurMonth; |
692 } | 693 } |
693 | 694 |
694 int32_t IFWL_DateTimePicker::GetCurYear(IFWL_Widget* pWidget) { | 695 int32_t IFWL_DateTimePicker::GetCurYear(IFWL_Widget* pWidget) { |
695 return m_iCurYear; | 696 return m_iCurYear; |
696 } | 697 } |
OLD | NEW |