+// frmContactEditor-LoadEmail.cpp - frmContactEditor load email 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 <http://www.gnu.org/licenses/>
+
#include "frmContactEditor.h"
+void frmContactEditor::LoadEmail(std::map<int, wxString> *GeneralEmailListPtr,
+ std::map<int, int> *GeneralEmailListPrefPtr,
+ std::map<int, wxString> *HomeEmailListPtr,
+ std::map<int, int> *HomeEmailListPrefPtr,
+ std::map<int, wxString> *BusinessEmailListPtr,
+ std::map<int, int> *BusinessEmailListPrefPtr,
+ int *EmailCount){
+
+ long ListCtrlIndex = -1;
+
+ // Deal with the general addresses.
+
+ for (std::map<int,wxString>::iterator Iter = GeneralEmailListPtr->begin();
+ Iter != GeneralEmailListPtr->end();
+ Iter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*EmailCount);
+ coldata.SetData(*EmailCount);
+ coldata.SetText(Iter->second);
+
+ ListCtrlIndex = lboEmails->InsertItem(coldata);
+
+ if (MapDataExists(EmailCount, GeneralEmailListPrefPtr)){
+
+ lboEmails->SetItem(ListCtrlIndex, 1, wxString::Format("%i", GeneralEmailListPrefPtr->find(*EmailCount)->second));
+
+ }
+
+ (*EmailCount)++;
+
+ }
+
+ // Deal with the home addresses.
+
+ for (std::map<int,wxString>::iterator Iter = HomeEmailListPtr->begin();
+ Iter != HomeEmailListPtr->end();
+ Iter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*EmailCount);
+ coldata.SetData(*EmailCount);
+ coldata.SetText(Iter->second);
+
+ ListCtrlIndex = lboHomeEmails->InsertItem(coldata);
+
+ if (MapDataExists(EmailCount, HomeEmailListPrefPtr)){
+
+ lboHomeEmails->SetItem(ListCtrlIndex, 1, wxString::Format("%i", HomeEmailListPrefPtr->find(*EmailCount)->second));
+
+ }
+
+ (*EmailCount)++;
+
+ }
+
+ // Deal with the work addresses.
+
+ for (std::map<int,wxString>::iterator Iter = BusinessEmailListPtr->begin();
+ Iter != BusinessEmailListPtr->end();
+ Iter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*EmailCount);
+ coldata.SetData(*EmailCount);
+ coldata.SetText(Iter->second);
+
+ ListCtrlIndex = lboBusinessEmail->InsertItem(coldata);
+
+ if (MapDataExists(EmailCount, BusinessEmailListPrefPtr)){
+
+ lboBusinessEmail->SetItem(ListCtrlIndex, 1, wxString::Format("%i", BusinessEmailListPrefPtr->find(*EmailCount)->second));
+
+ }
+
+ (*EmailCount)++;
+
+ }
+
+}
+
void frmContactEditor::LoadEmail(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *EmailCount){
size_t intPropertyLen = wxSPropertySeg1.Len();