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 17 matching lines...) Expand all Loading... |
28 CXFA_WidgetAcc* pDataAcc) | 28 CXFA_WidgetAcc* pDataAcc) |
29 : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} | 29 : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} |
30 CXFA_FFTextEdit::~CXFA_FFTextEdit() { | 30 CXFA_FFTextEdit::~CXFA_FFTextEdit() { |
31 if (m_pNormalWidget) { | 31 if (m_pNormalWidget) { |
32 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 32 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); |
33 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 33 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
34 pNoteDriver->UnregisterEventTarget(pWidget); | 34 pNoteDriver->UnregisterEventTarget(pWidget); |
35 } | 35 } |
36 } | 36 } |
37 FX_BOOL CXFA_FFTextEdit::LoadWidget() { | 37 FX_BOOL CXFA_FFTextEdit::LoadWidget() { |
38 CFWL_Edit* pFWLEdit = CFWL_Edit::Create(); | 38 CFWL_Edit* pFWLEdit = new CFWL_Edit; |
39 pFWLEdit->Initialize(); | 39 pFWLEdit->Initialize(); |
40 m_pNormalWidget = pFWLEdit; | 40 m_pNormalWidget = pFWLEdit; |
41 m_pNormalWidget->SetLayoutItem(this); | 41 m_pNormalWidget->SetLayoutItem(this); |
42 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 42 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); |
43 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 43 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
44 pNoteDriver->RegisterEventTarget(pWidget, pWidget); | 44 pNoteDriver->RegisterEventTarget(pWidget, pWidget); |
45 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); | 45 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); |
46 m_pNormalWidget->LockUpdate(); | 46 m_pNormalWidget->LockUpdate(); |
47 UpdateWidgetProperty(); | 47 UpdateWidgetProperty(); |
48 CFX_WideString wsText; | 48 CFX_WideString wsText; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 void CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics, | 429 void CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics, |
430 const CFX_Matrix* pMatrix) { | 430 const CFX_Matrix* pMatrix) { |
431 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); | 431 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); |
432 } | 432 } |
433 | 433 |
434 CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, | 434 CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView, |
435 CXFA_WidgetAcc* pDataAcc) | 435 CXFA_WidgetAcc* pDataAcc) |
436 : CXFA_FFTextEdit(pPageView, pDataAcc) {} | 436 : CXFA_FFTextEdit(pPageView, pDataAcc) {} |
437 CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {} | 437 CXFA_FFNumericEdit::~CXFA_FFNumericEdit() {} |
438 FX_BOOL CXFA_FFNumericEdit::LoadWidget() { | 438 FX_BOOL CXFA_FFNumericEdit::LoadWidget() { |
439 CFWL_Edit* pWidget = CFWL_Edit::Create(); | 439 CFWL_Edit* pWidget = new CFWL_Edit; |
440 pWidget->Initialize(); | 440 pWidget->Initialize(); |
441 m_pNormalWidget = pWidget; | 441 m_pNormalWidget = pWidget; |
442 IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); | 442 IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); |
443 m_pNormalWidget->SetLayoutItem(this); | 443 m_pNormalWidget->SetLayoutItem(this); |
444 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 444 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
445 pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); | 445 pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); |
446 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); | 446 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); |
447 m_pNormalWidget->LockUpdate(); | 447 m_pNormalWidget->LockUpdate(); |
448 CFX_WideString wsText; | 448 CFX_WideString wsText; |
449 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); | 449 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc); | 503 CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(m_pDataAcc); |
504 widgetValue.GetNumbericFormat(wsFormat, iLeads, iFracs); | 504 widgetValue.GetNumbericFormat(wsFormat, iLeads, iFracs); |
505 return widgetValue.ValidateNumericTemp(wsText, wsFormat, | 505 return widgetValue.ValidateNumericTemp(wsText, wsFormat, |
506 m_pDataAcc->GetLocal()); | 506 m_pDataAcc->GetLocal()); |
507 } | 507 } |
508 CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView, | 508 CXFA_FFPasswordEdit::CXFA_FFPasswordEdit(CXFA_FFPageView* pPageView, |
509 CXFA_WidgetAcc* pDataAcc) | 509 CXFA_WidgetAcc* pDataAcc) |
510 : CXFA_FFTextEdit(pPageView, pDataAcc) {} | 510 : CXFA_FFTextEdit(pPageView, pDataAcc) {} |
511 CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {} | 511 CXFA_FFPasswordEdit::~CXFA_FFPasswordEdit() {} |
512 FX_BOOL CXFA_FFPasswordEdit::LoadWidget() { | 512 FX_BOOL CXFA_FFPasswordEdit::LoadWidget() { |
513 CFWL_Edit* pWidget = CFWL_Edit::Create(); | 513 CFWL_Edit* pWidget = new CFWL_Edit; |
514 pWidget->Initialize(); | 514 pWidget->Initialize(); |
515 m_pNormalWidget = pWidget; | 515 m_pNormalWidget = pWidget; |
516 m_pNormalWidget->SetLayoutItem(this); | 516 m_pNormalWidget->SetLayoutItem(this); |
517 IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); | 517 IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); |
518 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 518 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
519 pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); | 519 pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); |
520 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); | 520 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); |
521 m_pNormalWidget->LockUpdate(); | 521 m_pNormalWidget->LockUpdate(); |
522 CFX_WideString wsText; | 522 CFX_WideString wsText; |
523 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); | 523 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 return FALSE; | 569 return FALSE; |
570 } | 570 } |
571 CFX_RectF rtWidget; | 571 CFX_RectF rtWidget; |
572 ((CFWL_DateTimePicker*)m_pNormalWidget)->GetBBox(rtWidget); | 572 ((CFWL_DateTimePicker*)m_pNormalWidget)->GetBBox(rtWidget); |
573 if (rtWidget.Contains(fx, fy)) { | 573 if (rtWidget.Contains(fx, fy)) { |
574 return TRUE; | 574 return TRUE; |
575 } | 575 } |
576 return FALSE; | 576 return FALSE; |
577 } | 577 } |
578 FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { | 578 FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() { |
579 CFWL_DateTimePicker* pWidget = CFWL_DateTimePicker::Create(); | 579 CFWL_DateTimePicker* pWidget = new CFWL_DateTimePicker; |
580 pWidget->Initialize(); | 580 pWidget->Initialize(); |
581 m_pNormalWidget = pWidget; | 581 m_pNormalWidget = pWidget; |
582 m_pNormalWidget->SetLayoutItem(this); | 582 m_pNormalWidget->SetLayoutItem(this); |
583 IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); | 583 IFWL_Widget* pIWidget = m_pNormalWidget->GetWidget(); |
584 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 584 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
585 pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); | 585 pNoteDriver->RegisterEventTarget(pIWidget, pIWidget); |
586 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); | 586 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); |
587 m_pNormalWidget->LockUpdate(); | 587 m_pNormalWidget->LockUpdate(); |
588 CFX_WideString wsText; | 588 CFX_WideString wsText; |
589 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); | 589 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 | 782 |
783 void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) { | 783 void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) { |
784 if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) { | 784 if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) { |
785 CFWL_Event_DtpSelectChanged* event = (CFWL_Event_DtpSelectChanged*)pEvent; | 785 CFWL_Event_DtpSelectChanged* event = (CFWL_Event_DtpSelectChanged*)pEvent; |
786 OnSelectChanged(m_pNormalWidget->GetWidget(), event->iYear, event->iMonth, | 786 OnSelectChanged(m_pNormalWidget->GetWidget(), event->iYear, event->iMonth, |
787 event->iDay); | 787 event->iDay); |
788 return; | 788 return; |
789 } | 789 } |
790 CXFA_FFTextEdit::OnProcessEvent(pEvent); | 790 CXFA_FFTextEdit::OnProcessEvent(pEvent); |
791 } | 791 } |
OLD | NEW |