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_monthcalendar.h" | 7 #include "xfa/fwl/core/ifwl_monthcalendar.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::November)); | 111 pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::November)); |
112 } | 112 } |
113 | 113 |
114 return static_cast<CFX_WideString*>( | 114 return static_cast<CFX_WideString*>( |
115 pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::December)); | 115 pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::December)); |
116 } | 116 } |
117 | 117 |
118 } // namespace | 118 } // namespace |
119 | 119 |
120 IFWL_MonthCalendar::IFWL_MonthCalendar( | 120 IFWL_MonthCalendar::IFWL_MonthCalendar( |
| 121 const IFWL_App* app, |
121 const CFWL_WidgetImpProperties& properties, | 122 const CFWL_WidgetImpProperties& properties, |
122 IFWL_Widget* pOuter) | 123 IFWL_Widget* pOuter) |
123 : IFWL_Widget(properties, pOuter), | 124 : IFWL_Widget(app, properties, pOuter), |
124 m_bInit(FALSE), | 125 m_bInit(FALSE), |
125 m_pDateTime(new CFX_DateTime), | 126 m_pDateTime(new CFX_DateTime), |
126 m_iCurYear(2011), | 127 m_iCurYear(2011), |
127 m_iCurMonth(1), | 128 m_iCurMonth(1), |
128 m_iYear(2011), | 129 m_iYear(2011), |
129 m_iMonth(1), | 130 m_iMonth(1), |
130 m_iDay(1), | 131 m_iDay(1), |
131 m_iHovered(-1), | 132 m_iHovered(-1), |
132 m_iLBtnPartStates(CFWL_PartState_Normal), | 133 m_iLBtnPartStates(CFWL_PartState_Normal), |
133 m_iRBtnPartStates(CFWL_PartState_Normal), | 134 m_iRBtnPartStates(CFWL_PartState_Normal), |
(...skipping 10 matching lines...) Expand all Loading... |
144 m_rtClient.Reset(); | 145 m_rtClient.Reset(); |
145 m_rtWeekNum.Reset(); | 146 m_rtWeekNum.Reset(); |
146 m_rtWeekNumSep.Reset(); | 147 m_rtWeekNumSep.Reset(); |
147 } | 148 } |
148 | 149 |
149 IFWL_MonthCalendar::~IFWL_MonthCalendar() { | 150 IFWL_MonthCalendar::~IFWL_MonthCalendar() { |
150 ClearDateItem(); | 151 ClearDateItem(); |
151 m_arrSelDays.RemoveAll(); | 152 m_arrSelDays.RemoveAll(); |
152 } | 153 } |
153 | 154 |
154 FWL_Type IFWL_MonthCalendar::GetClassID() const { | 155 void IFWL_MonthCalendar::Initialize() { |
155 return FWL_Type::MonthCalendar; | 156 IFWL_Widget::Initialize(); |
156 } | |
157 | |
158 FWL_Error IFWL_MonthCalendar::Initialize() { | |
159 if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) | |
160 return FWL_Error::Indefinite; | |
161 | |
162 m_pDelegate = new CFWL_MonthCalendarImpDelegate(this); | 157 m_pDelegate = new CFWL_MonthCalendarImpDelegate(this); |
163 return FWL_Error::Succeeded; | |
164 } | 158 } |
165 | 159 |
166 void IFWL_MonthCalendar::Finalize() { | 160 void IFWL_MonthCalendar::Finalize() { |
167 delete m_pDelegate; | 161 delete m_pDelegate; |
168 m_pDelegate = nullptr; | 162 m_pDelegate = nullptr; |
169 IFWL_Widget::Finalize(); | 163 IFWL_Widget::Finalize(); |
170 } | 164 } |
171 | 165 |
| 166 FWL_Type IFWL_MonthCalendar::GetClassID() const { |
| 167 return FWL_Type::MonthCalendar; |
| 168 } |
| 169 |
172 FWL_Error IFWL_MonthCalendar::GetWidgetRect(CFX_RectF& rect, | 170 FWL_Error IFWL_MonthCalendar::GetWidgetRect(CFX_RectF& rect, |
173 FX_BOOL bAutoSize) { | 171 FX_BOOL bAutoSize) { |
174 if (bAutoSize) { | 172 if (bAutoSize) { |
175 CFX_SizeF fs = CalcSize(TRUE); | 173 CFX_SizeF fs = CalcSize(TRUE); |
176 rect.Set(0, 0, fs.x, fs.y); | 174 rect.Set(0, 0, fs.x, fs.y); |
177 IFWL_Widget::GetWidgetRect(rect, TRUE); | 175 IFWL_Widget::GetWidgetRect(rect, TRUE); |
178 } else { | 176 } else { |
179 rect = m_pProperties->m_rtWidget; | 177 rect = m_pProperties->m_rtWidget; |
180 } | 178 } |
181 return FWL_Error::Succeeded; | 179 return FWL_Error::Succeeded; |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 uint32_t dwSt, | 1209 uint32_t dwSt, |
1212 CFX_RectF rc, | 1210 CFX_RectF rc, |
1213 CFX_WideString& wsday) | 1211 CFX_WideString& wsday) |
1214 : iDay(day), | 1212 : iDay(day), |
1215 iDayOfWeek(dayofweek), | 1213 iDayOfWeek(dayofweek), |
1216 dwStates(dwSt), | 1214 dwStates(dwSt), |
1217 rect(rc), | 1215 rect(rc), |
1218 wsDay(wsday) {} | 1216 wsDay(wsday) {} |
1219 | 1217 |
1220 FWL_DATEINFO::~FWL_DATEINFO() {} | 1218 FWL_DATEINFO::~FWL_DATEINFO() {} |
OLD | NEW |