LoadMember(&ContactEditorData.GroupsList);
+ // Process the address (ADR) (frmContactEditor-LoadAddress.cpp)
+
+ LoadAddress(&ContactEditorData.GeneralAddressList,
+ &ContactEditorData.GeneralAddressListTown,
+ &ContactEditorData.GeneralAddressListCounty,
+ &ContactEditorData.GeneralAddressListPostCode,
+ &ContactEditorData.GeneralAddressListPref,
+ &ContactEditorData.HomeAddressList,
+ &ContactEditorData.HomeAddressListTown,
+ &ContactEditorData.HomeAddressListCounty,
+ &ContactEditorData.HomeAddressListPostCode,
+ &ContactEditorData.HomeAddressListPref,
+ &ContactEditorData.BusinessAddressList,
+ &ContactEditorData.BusinessAddressListTown,
+ &ContactEditorData.BusinessAddressListCounty,
+ &ContactEditorData.BusinessAddressListPostCode,
+ &ContactEditorData.BusinessAddressListPref,
+ &ADRCount);
+
for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
iter != ContactFileLines.end(); ++iter){
LoadTimeZone(wxSPropertySeg1, wxSPropertySeg2, &TZCount);
- } else if (wxSProperty == wxT("ADR")){
+ }/* else if (wxSProperty == wxT("ADR")){
// See frmContactEditor-LoadAddress.cpp
LoadADR(wxSPropertySeg1, wxSPropertySeg2, &ADRCount);
- } else if (wxSProperty == wxT("EMAIL")){
+ }*/ else if (wxSProperty == wxT("EMAIL")){
// See frmContactEditor-LoadEmail.cpp
#include "frmContactEditor.h"
+void frmContactEditor::LoadAddress(std::map<int, wxString> *GeneralAddressList,
+ std::map<int, wxString> *GeneralAddressListTown,
+ std::map<int, wxString> *GeneralAddressListCounty,
+ std::map<int, wxString> *GeneralAddressListPostCode,
+ std::map<int, int> *GeneralAddressListPref,
+ std::map<int, wxString> *HomeAddressList,
+ std::map<int, wxString> *HomeAddressListTown,
+ std::map<int, wxString> *HomeAddressListCounty,
+ std::map<int, wxString> *HomeAddressListPostCode,
+ std::map<int, int> *HomeAddressListPref,
+ std::map<int, wxString> *BusinessAddressList,
+ std::map<int, wxString> *BusinessAddressListTown,
+ std::map<int, wxString> *BusinessAddressListCounty,
+ std::map<int, wxString> *BusinessAddressListPostCode,
+ std::map<int, int> *BusinessAddressListPref,
+ int *AddressCount){
+
+ long ListCtrlIndex = -1;
+
+ // Deal with the general addresses.
+
+ for (std::map<int,wxString>::iterator GenAdrListIter = GeneralAddressList->begin();
+ GenAdrListIter != GeneralAddressList->end();
+ GenAdrListIter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*AddressCount);
+ coldata.SetData(*AddressCount);
+ coldata.SetText(GenAdrListIter->second);
+
+ ListCtrlIndex = lboAddresses->InsertItem(coldata);
+
+ if (MapDataExists(AddressCount, GeneralAddressListTown)){
+
+ lboAddresses->SetItem(ListCtrlIndex, 1, GeneralAddressListTown->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, GeneralAddressListCounty)){
+
+ lboAddresses->SetItem(ListCtrlIndex, 2, GeneralAddressListCounty->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, GeneralAddressListPostCode)){
+
+ lboAddresses->SetItem(ListCtrlIndex, 3, GeneralAddressListPostCode->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, GeneralAddressListPref)){
+
+ lboAddresses->SetItem(ListCtrlIndex, 4, wxString::Format("%i", GeneralAddressListPref->find(*AddressCount)->second));
+
+ }
+
+ (*AddressCount)++;
+
+ }
+
+ // Deal with the home addresses.
+
+ for (std::map<int,wxString>::iterator GenAdrListIter = HomeAddressList->begin();
+ GenAdrListIter != HomeAddressList->end();
+ GenAdrListIter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*AddressCount);
+ coldata.SetData(*AddressCount);
+ coldata.SetText(GenAdrListIter->second);
+
+ ListCtrlIndex = lboHomeAddresses->InsertItem(coldata);
+
+ if (MapDataExists(AddressCount, HomeAddressListTown)){
+
+ lboHomeAddresses->SetItem(ListCtrlIndex, 1, HomeAddressListTown->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, HomeAddressListCounty)){
+
+ lboHomeAddresses->SetItem(ListCtrlIndex, 2, HomeAddressListCounty->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, HomeAddressListPostCode)){
+
+ lboHomeAddresses->SetItem(ListCtrlIndex, 3, HomeAddressListPostCode->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, HomeAddressListPref)){
+
+ lboHomeAddresses->SetItem(ListCtrlIndex, 4, wxString::Format("%i", HomeAddressListPref->find(*AddressCount)->second));
+
+ }
+
+ (*AddressCount)++;
+
+ }
+
+ // Deal with the work addresses.
+
+ for (std::map<int,wxString>::iterator GenAdrListIter = BusinessAddressList->begin();
+ GenAdrListIter != BusinessAddressList->end();
+ GenAdrListIter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*AddressCount);
+ coldata.SetData(*AddressCount);
+ coldata.SetText(GenAdrListIter->second);
+
+ ListCtrlIndex = lboBusinessAddresses->InsertItem(coldata);
+
+ if (MapDataExists(AddressCount, BusinessAddressListTown)){
+
+ lboBusinessAddresses->SetItem(ListCtrlIndex, 1, BusinessAddressListTown->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, BusinessAddressListCounty)){
+
+ lboBusinessAddresses->SetItem(ListCtrlIndex, 2, BusinessAddressListCounty->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, BusinessAddressListPostCode)){
+
+ lboBusinessAddresses->SetItem(ListCtrlIndex, 3, BusinessAddressListPostCode->find(*AddressCount)->second);
+
+ }
+
+ if (MapDataExists(AddressCount, BusinessAddressListPref)){
+
+ lboBusinessAddresses->SetItem(ListCtrlIndex, 4, wxString::Format("%i", BusinessAddressListPref->find(*AddressCount)->second));
+
+ }
+
+ (*AddressCount)++;
+
+ }
+
+}
+
void frmContactEditor::LoadADR(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *ADRCount){
size_t intPropertyLen = wxSPropertySeg1.Len();
wxString *NameSurname, wxString *NameOtherNames,
wxString *NameSuffix);
void LoadMember(std::map<int,wxString> *GroupsList);
+ void LoadAddress(std::map<int, wxString> *GeneralAddressList,
+ std::map<int, wxString> *GeneralAddressListTown,
+ std::map<int, wxString> *GeneralAddressListCounty,
+ std::map<int, wxString> *GeneralAddressListPostCode,
+ std::map<int, int> *GeneralAddressListPref,
+ std::map<int, wxString> *HomeAddressList,
+ std::map<int, wxString> *HomeAddressListTown,
+ std::map<int, wxString> *HomeAddressListCounty,
+ std::map<int, wxString> *HomeAddressListPostCode,
+ std::map<int, int> *HomeAddressListPref,
+ std::map<int, wxString> *BusinessAddressList,
+ std::map<int, wxString> *BusinessAddressListTown,
+ std::map<int, wxString> *BusinessAddressListCounty,
+ std::map<int, wxString> *BusinessAddressListPostCode,
+ std::map<int, int> *BusinessAddressListPref,
+ int *AddressCount);
int intValueSeek = 1;
bool IsGroup = FALSE;