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/basewidget/fwl_editimp.h" | 7 #include "xfa/fwl/basewidget/fwl_editimp.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if (m_pEdtEngine) { | 224 if (m_pEdtEngine) { |
225 m_pEdtEngine->Release(); | 225 m_pEdtEngine->Release(); |
226 m_pEdtEngine = NULL; | 226 m_pEdtEngine = NULL; |
227 } | 227 } |
228 ClearRecord(); | 228 ClearRecord(); |
229 } | 229 } |
230 FWL_ERR CFWL_EditImp::GetClassName(CFX_WideString& wsClass) const { | 230 FWL_ERR CFWL_EditImp::GetClassName(CFX_WideString& wsClass) const { |
231 wsClass = FWL_CLASS_Edit; | 231 wsClass = FWL_CLASS_Edit; |
232 return FWL_ERR_Succeeded; | 232 return FWL_ERR_Succeeded; |
233 } | 233 } |
234 uint32_t CFWL_EditImp::GetClassID() const { | 234 |
235 return FWL_CLASSHASH_Edit; | |
236 } | |
237 FWL_ERR CFWL_EditImp::Initialize() { | 235 FWL_ERR CFWL_EditImp::Initialize() { |
238 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) | 236 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) |
239 return FWL_ERR_Indefinite; | 237 return FWL_ERR_Indefinite; |
240 if (!m_pDelegate) { | 238 if (!m_pDelegate) { |
241 m_pDelegate = new CFWL_EditImpDelegate(this); | 239 m_pDelegate = new CFWL_EditImpDelegate(this); |
242 } | 240 } |
243 InitCaret(); | 241 InitCaret(); |
244 if (!m_pEdtEngine) { | 242 if (!m_pEdtEngine) { |
245 InitEngine(); | 243 InitEngine(); |
246 } | 244 } |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 if (!pfWidth) | 1447 if (!pfWidth) |
1450 return; | 1448 return; |
1451 FX_FLOAT fWidth = *pfWidth; | 1449 FX_FLOAT fWidth = *pfWidth; |
1452 if (!m_pOuter) { | 1450 if (!m_pOuter) { |
1453 CFX_RectF* pUIMargin = static_cast<CFX_RectF*>( | 1451 CFX_RectF* pUIMargin = static_cast<CFX_RectF*>( |
1454 GetThemeCapacity(CFWL_WidgetCapacity::UIMargin)); | 1452 GetThemeCapacity(CFWL_WidgetCapacity::UIMargin)); |
1455 if (pUIMargin) { | 1453 if (pUIMargin) { |
1456 m_rtEngine.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, | 1454 m_rtEngine.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, |
1457 pUIMargin->height); | 1455 pUIMargin->height); |
1458 } | 1456 } |
1459 } else if (m_pOuter->GetClassID() == FWL_CLASSHASH_DateTimePicker) { | 1457 } else if (m_pOuter->GetClassID() == FWL_Type::DateTimePicker) { |
1460 CFWL_ThemePart part; | 1458 CFWL_ThemePart part; |
1461 part.m_pWidget = m_pOuter; | 1459 part.m_pWidget = m_pOuter; |
1462 CFX_RectF* pUIMargin = | 1460 CFX_RectF* pUIMargin = |
1463 static_cast<CFX_RectF*>(m_pOuter->GetThemeProvider()->GetCapacity( | 1461 static_cast<CFX_RectF*>(m_pOuter->GetThemeProvider()->GetCapacity( |
1464 &part, CFWL_WidgetCapacity::UIMargin)); | 1462 &part, CFWL_WidgetCapacity::UIMargin)); |
1465 if (pUIMargin) { | 1463 if (pUIMargin) { |
1466 m_rtEngine.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, | 1464 m_rtEngine.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, |
1467 pUIMargin->height); | 1465 pUIMargin->height); |
1468 } | 1466 } |
1469 } | 1467 } |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 } | 2151 } |
2154 CFX_RectF rect; | 2152 CFX_RectF rect; |
2155 m_pOwner->GetWidgetRect(rect); | 2153 m_pOwner->GetWidgetRect(rect); |
2156 CFX_RectF rtInvalidate; | 2154 CFX_RectF rtInvalidate; |
2157 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 2155 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
2158 m_pOwner->Repaint(&rtInvalidate); | 2156 m_pOwner->Repaint(&rtInvalidate); |
2159 } | 2157 } |
2160 return TRUE; | 2158 return TRUE; |
2161 } | 2159 } |
2162 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} | 2160 void CFWL_EditImpDelegate::DoCursor(CFWL_MsgMouse* pMsg) {} |
OLD | NEW |