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_edit.h" | 7 #include "xfa/fwl/core/cfwl_edit.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 rect.Set(0, 0, 0, 0); | 112 rect.Set(0, 0, 0, 0); |
113 | 113 |
114 int32_t iTextLen = m_EdtEngine.GetTextLength(); | 114 int32_t iTextLen = m_EdtEngine.GetTextLength(); |
115 if (iTextLen > 0) { | 115 if (iTextLen > 0) { |
116 CFX_WideString wsText = m_EdtEngine.GetText(0, -1); | 116 CFX_WideString wsText = m_EdtEngine.GetText(0, -1); |
117 CFX_SizeF sz = CalcTextSize( | 117 CFX_SizeF sz = CalcTextSize( |
118 wsText, m_pProperties->m_pThemeProvider, | 118 wsText, m_pProperties->m_pThemeProvider, |
119 !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine)); | 119 !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine)); |
120 rect.Set(0, 0, sz.x, sz.y); | 120 rect.Set(0, 0, sz.x, sz.y); |
121 } | 121 } |
122 CFWL_Widget::GetWidgetRect(rect, true); | 122 InflateWidgetRect(rect); |
123 } | 123 } |
124 | 124 |
125 void CFWL_Edit::SetStates(uint32_t dwStates) { | 125 void CFWL_Edit::SetStates(uint32_t dwStates) { |
126 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) || | 126 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) || |
127 (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) { | 127 (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) { |
128 HideCaret(nullptr); | 128 HideCaret(nullptr); |
129 } | 129 } |
130 CFWL_Widget::SetStates(dwStates); | 130 CFWL_Widget::SetStates(dwStates); |
131 } | 131 } |
132 | 132 |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 UpdateOffset(pScrollBar, fPos - iCurPos); | 1646 UpdateOffset(pScrollBar, fPos - iCurPos); |
1647 UpdateCaret(); | 1647 UpdateCaret(); |
1648 | 1648 |
1649 CFX_RectF rect; | 1649 CFX_RectF rect; |
1650 GetWidgetRect(rect, false); | 1650 GetWidgetRect(rect, false); |
1651 CFX_RectF rtInvalidate; | 1651 CFX_RectF rtInvalidate; |
1652 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); | 1652 rtInvalidate.Set(0, 0, rect.width + 2, rect.height + 2); |
1653 Repaint(&rtInvalidate); | 1653 Repaint(&rtInvalidate); |
1654 return true; | 1654 return true; |
1655 } | 1655 } |
OLD | NEW |