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/fxfa/app/xfa_fftextedit.h" | 7 #include "xfa/fxfa/app/xfa_fftextedit.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 ValidateNumberField(wsText); | 187 ValidateNumberField(wsText); |
188 return FALSE; | 188 return FALSE; |
189 } | 189 } |
190 void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { | 190 void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { |
191 CXFA_WidgetAcc* pAcc = GetDataAcc(); | 191 CXFA_WidgetAcc* pAcc = GetDataAcc(); |
192 if (pAcc && pAcc->GetUIType() == XFA_ELEMENT_NumericEdit) { | 192 if (pAcc && pAcc->GetUIType() == XFA_ELEMENT_NumericEdit) { |
193 IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider(); | 193 IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider(); |
194 if (pAppProvider) { | 194 if (pAppProvider) { |
195 CFX_WideString wsTitle; | 195 CFX_WideString wsTitle; |
196 pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); | 196 pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); |
197 CFX_WideString wsMessage; | |
198 CFX_WideString wsError; | 197 CFX_WideString wsError; |
199 pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError); | 198 pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError); |
200 CFX_WideString wsSomField; | 199 CFX_WideString wsSomField; |
201 pAcc->GetNode()->GetSOMExpression(wsSomField); | 200 pAcc->GetNode()->GetSOMExpression(wsSomField); |
| 201 CFX_WideString wsMessage; |
202 wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str()); | 202 wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str()); |
203 pAppProvider->MsgBox(wsMessage.AsStringC(), wsTitle.AsStringC(), | 203 pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Error, XFA_MB_OK); |
204 XFA_MBICON_Error, XFA_MB_OK); | |
205 } | 204 } |
206 } | 205 } |
207 } | 206 } |
208 FX_BOOL CXFA_FFTextEdit::IsDataChanged() { | 207 FX_BOOL CXFA_FFTextEdit::IsDataChanged() { |
209 return (m_dwStatus & XFA_WIDGETSTATUS_TextEditValueChanged) != 0; | 208 return (m_dwStatus & XFA_WIDGETSTATUS_TextEditValueChanged) != 0; |
210 } | 209 } |
211 uint32_t CXFA_FFTextEdit::GetAlignment() { | 210 uint32_t CXFA_FFTextEdit::GetAlignment() { |
212 uint32_t dwExtendedStyle = 0; | 211 uint32_t dwExtendedStyle = 0; |
213 if (CXFA_Para para = m_pDataAcc->GetPara()) { | 212 if (CXFA_Para para = m_pDataAcc->GetPara()) { |
214 int32_t iHorz = para.GetHorizontalAlign(); | 213 int32_t iHorz = para.GetHorizontalAlign(); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 | 792 |
794 void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) { | 793 void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) { |
795 if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) { | 794 if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) { |
796 CFWL_Event_DtpSelectChanged* event = (CFWL_Event_DtpSelectChanged*)pEvent; | 795 CFWL_Event_DtpSelectChanged* event = (CFWL_Event_DtpSelectChanged*)pEvent; |
797 OnSelectChanged(m_pNormalWidget->GetWidget(), event->iYear, event->iMonth, | 796 OnSelectChanged(m_pNormalWidget->GetWidget(), event->iYear, event->iMonth, |
798 event->iDay); | 797 event->iDay); |
799 return; | 798 return; |
800 } | 799 } |
801 CXFA_FFTextEdit::OnProcessEvent(pEvent); | 800 CXFA_FFTextEdit::OnProcessEvent(pEvent); |
802 } | 801 } |
OLD | NEW |