| 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 "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
| 8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
| 9 #include "../../include/pdfwindow/PWL_Button.h" | 9 #include "../../include/pdfwindow/PWL_Button.h" |
| 10 #include "../../include/pdfwindow/PWL_EditCtrl.h" | 10 #include "../../include/pdfwindow/PWL_EditCtrl.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 { | 75 { |
| 76 m_pText = new CPWL_Label; | 76 m_pText = new CPWL_Label; |
| 77 PWL_CREATEPARAM tcp = cp; | 77 PWL_CREATEPARAM tcp = cp; |
| 78 tcp.pParentWnd = this; | 78 tcp.pParentWnd = this; |
| 79 tcp.dwFlags = PWS_CHILD | PWS_VISIBLE; | 79 tcp.dwFlags = PWS_CHILD | PWS_VISIBLE; |
| 80 m_pText->Create(tcp); | 80 m_pText->Create(tcp); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void CPWL_Note_Options::SetText(const CFX_WideString& sText) | 83 void CPWL_Note_Options::SetText(const CFX_WideString& sText) |
| 84 { | 84 { |
| 85 » m_pText->SetText(sText); | 85 » m_pText->SetText(sText.c_str()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matri
x* pUser2Device) | 88 void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matri
x* pUser2Device) |
| 89 { | 89 { |
| 90 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); | 90 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); |
| 91 | 91 |
| 92 CPDF_Rect rcClient = GetClientRect(); | 92 CPDF_Rect rcClient = GetClientRect(); |
| 93 rcClient.left = rcClient.right - 15.0f; | 93 rcClient.left = rcClient.right - 15.0f; |
| 94 | 94 |
| 95 CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f
, (rcClient.top + rcClient.bottom) * 0.5f); | 95 CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f
, (rcClient.top + rcClient.bottom) * 0.5f); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 m_pEdit->EnableNotify(FALSE); | 436 m_pEdit->EnableNotify(FALSE); |
| 437 m_pEdit->Create(ecp); | 437 m_pEdit->Create(ecp); |
| 438 m_pEdit->EnableNotify(TRUE); | 438 m_pEdit->EnableNotify(TRUE); |
| 439 } | 439 } |
| 440 | 440 |
| 441 void CPWL_Note_Contents::SetText(const CFX_WideString& sText) | 441 void CPWL_Note_Contents::SetText(const CFX_WideString& sText) |
| 442 { | 442 { |
| 443 if (m_pEdit) | 443 if (m_pEdit) |
| 444 { | 444 { |
| 445 m_pEdit->EnableNotify(FALSE); | 445 m_pEdit->EnableNotify(FALSE); |
| 446 » » m_pEdit->SetText(sText); | 446 » » m_pEdit->SetText(sText.c_str()); |
| 447 m_pEdit->EnableNotify(TRUE); | 447 m_pEdit->EnableNotify(TRUE); |
| 448 » » OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0);» » | 448 » » OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 CFX_WideString CPWL_Note_Contents::GetText() const | 452 CFX_WideString CPWL_Note_Contents::GetText() const |
| 453 { | 453 { |
| 454 if (m_pEdit) | 454 if (m_pEdit) |
| 455 return m_pEdit->GetText(); | 455 return m_pEdit->GetText(); |
| 456 | 456 |
| 457 return L""; | 457 return L""; |
| 458 } | 458 } |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) | 804 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) |
| 805 { | 805 { |
| 806 pNotify->OnSetBkColor(this); | 806 pNotify->OnSetBkColor(this); |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 | 809 |
| 810 void CPWL_NoteItem::SetSubjectName(const CFX_WideString& sName) | 810 void CPWL_NoteItem::SetSubjectName(const CFX_WideString& sName) |
| 811 { | 811 { |
| 812 if (m_pSubject) | 812 if (m_pSubject) |
| 813 { | 813 { |
| 814 » » m_pSubject->SetText(sName);» | 814 » » m_pSubject->SetText(sName.c_str()); |
| 815 } | 815 } |
| 816 | 816 |
| 817 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) | 817 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) |
| 818 { | 818 { |
| 819 pNotify->OnSetSubjectName(this); | 819 pNotify->OnSetSubjectName(this); |
| 820 } | 820 } |
| 821 } | 821 } |
| 822 | 822 |
| 823 void CPWL_NoteItem::SetAuthorName(const CFX_WideString& sName) | 823 void CPWL_NoteItem::SetAuthorName(const CFX_WideString& sName) |
| 824 { | 824 { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 841 | 841 |
| 842 CPWL_Note_Contents* pContents = (CPWL_Note_Contents*)pPa
rent; | 842 CPWL_Note_Contents* pContents = (CPWL_Note_Contents*)pPa
rent; |
| 843 nItemIndex = pContents->GetItemIndex(this); | 843 nItemIndex = pContents->GetItemIndex(this); |
| 844 } | 844 } |
| 845 } | 845 } |
| 846 | 846 |
| 847 const CPWL_Note* pNote = GetNote(); | 847 const CPWL_Note* pNote = GetNote(); |
| 848 ASSERT(pNote != NULL); | 848 ASSERT(pNote != NULL); |
| 849 | 849 |
| 850 CFX_WideString sSubject; | 850 CFX_WideString sSubject; |
| 851 » sSubject.Format(pNote->GetReplyString(), nItemIndex); | 851 » sSubject.Format(pNote->GetReplyString().c_str(), nItemIndex); |
| 852 | 852 |
| 853 if (!m_sAuthor.IsEmpty()) | 853 if (!m_sAuthor.IsEmpty()) |
| 854 { | 854 { |
| 855 | |
| 856 sSubject += L" - "; | 855 sSubject += L" - "; |
| 857 sSubject += m_sAuthor; | 856 sSubject += m_sAuthor; |
| 858 } | 857 } |
| 859 this->SetSubjectName(sSubject); | 858 this->SetSubjectName(sSubject); |
| 860 this->RePosChildWnd(); | 859 this->RePosChildWnd(); |
| 861 } | 860 } |
| 862 | 861 |
| 863 void CPWL_NoteItem::SetDateTime(FX_SYSTEMTIME time) | 862 void CPWL_NoteItem::SetDateTime(FX_SYSTEMTIME time) |
| 864 { | 863 { |
| 865 m_dtNote = time; | 864 m_dtNote = time; |
| 866 » | 865 |
| 867 CFX_WideString swTime; | 866 CFX_WideString swTime; |
| 868 swTime.Format(L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth,
time.wDay, time.wHour, time.wMinute, time.wSecond); | 867 swTime.Format(L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth,
time.wDay, time.wHour, time.wMinute, time.wSecond); |
| 869 if (m_pDateTime) | 868 if (m_pDateTime) |
| 870 { | 869 { |
| 871 » » m_pDateTime->SetText(swTime); | 870 » » m_pDateTime->SetText(swTime.c_str()); |
| 872 } | 871 } |
| 873 | 872 |
| 874 this->RePosChildWnd(); | 873 this->RePosChildWnd(); |
| 875 | 874 |
| 876 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) | 875 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) |
| 877 { | 876 { |
| 878 pNotify->OnSetDateTime(this); | 877 pNotify->OnSetDateTime(this); |
| 879 } | 878 } |
| 880 } | 879 } |
| 881 | 880 |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 void CPWL_Note::SetSubjectName(const CFX_WideString& sName) | 1520 void CPWL_Note::SetSubjectName(const CFX_WideString& sName) |
| 1522 { | 1521 { |
| 1523 CPWL_NoteItem::SetSubjectName(sName); | 1522 CPWL_NoteItem::SetSubjectName(sName); |
| 1524 RePosChildWnd(); | 1523 RePosChildWnd(); |
| 1525 } | 1524 } |
| 1526 | 1525 |
| 1527 void CPWL_Note::SetAuthorName(const CFX_WideString& sName) | 1526 void CPWL_Note::SetAuthorName(const CFX_WideString& sName) |
| 1528 { | 1527 { |
| 1529 if (m_pAuthor) | 1528 if (m_pAuthor) |
| 1530 { | 1529 { |
| 1531 » » m_pAuthor->SetText(sName); | 1530 » » m_pAuthor->SetText(sName.c_str()); |
| 1532 RePosChildWnd(); | 1531 RePosChildWnd(); |
| 1533 } | 1532 } |
| 1534 | 1533 |
| 1535 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) | 1534 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) |
| 1536 { | 1535 { |
| 1537 pNotify->OnSetAuthorName(this); | 1536 pNotify->OnSetAuthorName(this); |
| 1538 » }» | 1537 » } |
| 1539 } | 1538 } |
| 1540 | 1539 |
| 1541 CFX_WideString CPWL_Note::GetAuthorName() const | 1540 CFX_WideString CPWL_Note::GetAuthorName() const |
| 1542 { | 1541 { |
| 1543 if (m_pAuthor) | 1542 if (m_pAuthor) |
| 1544 return m_pAuthor->GetText(); | 1543 return m_pAuthor->GetText(); |
| 1545 | 1544 |
| 1546 return L""; | 1545 return L""; |
| 1547 } | 1546 } |
| 1548 | 1547 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 CFX_WideString CPWL_Note::GetReplyString() const | 1768 CFX_WideString CPWL_Note::GetReplyString() const |
| 1770 { | 1769 { |
| 1771 return m_sReplyString; | 1770 return m_sReplyString; |
| 1772 } | 1771 } |
| 1773 | 1772 |
| 1774 void CPWL_Note::SetReplyString(const CFX_WideString& string) | 1773 void CPWL_Note::SetReplyString(const CFX_WideString& string) |
| 1775 { | 1774 { |
| 1776 m_sReplyString = string; | 1775 m_sReplyString = string; |
| 1777 } | 1776 } |
| 1778 | 1777 |
| OLD | NEW |