X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-LoadBADays.cpp;h=4b3e66984956acd2a0163cebfbf95f86e16f7bd4;hb=97ebb2bdd18e21f4ed3e7a99e91b411cf5827324;hp=767f6ddd43dc6a76d23311f4fed969af48a9ed63;hpb=0f855c5d57f952d2aae11759a60de90146e03c68;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-LoadBADays.cpp b/source/contacteditor/frmContactEditor-LoadBADays.cpp index 767f6dd..4b3e669 100644 --- a/source/contacteditor/frmContactEditor-LoadBADays.cpp +++ b/source/contacteditor/frmContactEditor-LoadBADays.cpp @@ -1,5 +1,93 @@ +// frmContactEditor-LoadBADays.cpp - frmContactEditor load birthday/anniversary subroutines. +// +// (c) 2012-2015 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + #include "frmContactEditor.h" +void frmContactEditor::LoadBirthday(wxString *BirthdayData, bool *BirthdayText){ + + if (*BirthdayText == FALSE){ + + int DateYear = 0; + wxDateTime::Month DateMonth; + unsigned int DateDay; + + wxString wxSData; + + if (Birthday.Mid(0, 2) == wxT("--")){ + + // Skip year. + + } else { + + DateYear = wxAtoi(BirthdayData->Mid(0,4)); + + } + + DateMonth = (wxDateTime::Month)(wxAtoi(BirthdayData->Mid(4,2)) - 1); + DateDay = wxAtoi(BirthdayData->Mid(6,2)); + + wxDateTime BDayDate(DateDay,DateMonth,DateYear); + + dapBirthday->SetValue(BDayDate); + + } else { + + txtBirthday->SetValue(*BirthdayData); + + } + +} + +void frmContactEditor::LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText){ + + if (*AnniversaryText == FALSE){ + + int DateYear = 0; + wxDateTime::Month DateMonth; + int DateDay; + + wxString wxSData; + + if (Anniversary.Mid(0, 2) == wxT("--")){ + + // Skip year. + + } else { + + DateYear = wxAtoi(AnniversaryData->Mid(0,4)); + + } + + DateMonth = (wxDateTime::Month)(wxAtoi(AnniversaryData->Mid(4,2)) - 1); + DateDay = wxAtoi(AnniversaryData->Mid(6,2)); + + wxDateTime ADayDate(DateDay,DateMonth,DateYear); + + dapAnniversary->SetValue(ADayDate); + + } else { + + txtAnniversary->SetValue(*AnniversaryData); + + } + +} + void frmContactEditor::LoadBDay(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *BirthdayProcessed){ // Process date. Preserve the remainder in the string.