X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Home.cpp;h=33769e3dfe48e157feedc5264f79f02ea3015658;hb=bac054ea5eda94fe663d8b1a7c680ae80de8075c;hp=065b9afaab1347e3d8d0790d844202d286f65483;hpb=da64d37d0a13895554e4ad945c46dd0af6d1c0e6;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Home.cpp b/source/contacteditor/frmContactEditor-Home.cpp index 065b9af..33769e3 100644 --- a/source/contacteditor/frmContactEditor-Home.cpp +++ b/source/contacteditor/frmContactEditor-Home.cpp @@ -1,6 +1,6 @@ // frmContactEditor-Home.cpp - frmContactEditor Home tab subroutines. // -// (c) 2012-2015 Xestia Software Development. +// (c) 2012-2016 Xestia Software Development. // // This file is part of Xestia Address Book. // @@ -35,909 +35,1033 @@ void frmContactEditor::AddHomeNickname( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); - frameCENickname->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeNicknamesList); - frameCENickname->SetupPointers(&HomeNicknamesList, - &HomeNicknamesListAltID, - &HomeNicknamesListPID, - &HomeNicknamesListType, - &HomeNicknamesListLanguage, - &HomeNicknamesListTokens, - &HomeNicknamesListPref, - lboHomeNicknames, - (intValueSeek)); - frameCENickname->ShowModal(); - delete frameCENickname; - frameCENickname = NULL; + + // Bring up window to add nickname. + + frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); + frameCENickname->SetEditorMode(FALSE, CE_HOME); + frameCENickname->SetupPointers(&ContactEditorData.HomeNicknamesList, + &ContactEditorData.HomeNicknamesListAltID, + &ContactEditorData.HomeNicknamesListPID, + &ContactEditorData.HomeNicknamesListType, + &ContactEditorData.HomeNicknamesListLanguage, + &ContactEditorData.HomeNicknamesListTokens, + &ContactEditorData.HomeNicknamesListPref, + lboHomeNicknames, + (intValueSeek)); + frameCENickname->ShowModal(); + delete frameCENickname; + frameCENickname = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeNickname( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeNicknames, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); - frameCENickname->SetupPointers(&HomeNicknamesList, - &HomeNicknamesListAltID, - &HomeNicknamesListPID, - &HomeNicknamesListType, - &HomeNicknamesListLanguage, - &HomeNicknamesListTokens, - &HomeNicknamesListPref, - lboHomeNicknames, - intSelectedData); - frameCENickname->SetEditorMode(TRUE, CE_HOME); - frameCENickname->ShowModal(); - delete frameCENickname; - frameCENickname = NULL; + + // Bring up window to modify nickname. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeNicknames->GetItemCount() == 0 || !GetSelectedItem(lboHomeNicknames, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); + frameCENickname->SetupPointers(&ContactEditorData.HomeNicknamesList, + &ContactEditorData.HomeNicknamesListAltID, + &ContactEditorData.HomeNicknamesListPID, + &ContactEditorData.HomeNicknamesListType, + &ContactEditorData.HomeNicknamesListLanguage, + &ContactEditorData.HomeNicknamesListTokens, + &ContactEditorData.HomeNicknamesListPref, + lboHomeNicknames, + intSelectedData); + frameCENickname->SetEditorMode(TRUE, CE_HOME); + frameCENickname->ShowModal(); + delete frameCENickname; + frameCENickname = NULL; + } void frmContactEditor::DeleteHomeNickname( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeNicknames, - &longSelected, - &intSelectedData)){ - return; - } - - lboHomeNicknames->DeleteItem(longSelected); - - DeleteMapData(intSelectedData, - &HomeNicknamesList, - &HomeNicknamesListLanguage, - &HomeNicknamesListAltID, - &HomeNicknamesListPID, - &HomeNicknamesListTokens, - &HomeNicknamesListType, - &HomeNicknamesListPref); - + // Bring up window to delete nickname. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeNicknames->GetItemCount() == 0 || !GetSelectedItem(lboHomeNicknames, + &longSelected, + &intSelectedData)){ + return; + } + + lboHomeNicknames->DeleteItem(longSelected); + + DeleteMapData(intSelectedData, + &ContactEditorData.HomeNicknamesList, + &ContactEditorData.HomeNicknamesListLanguage, + &ContactEditorData.HomeNicknamesListAltID, + &ContactEditorData.HomeNicknamesListPID, + &ContactEditorData.HomeNicknamesListTokens, + &ContactEditorData.HomeNicknamesListType, + &ContactEditorData.HomeNicknamesListPref); + } void frmContactEditor::AddHomeAddress( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); - frameCEAddress->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeAddressList); - frameCEAddress->SetupPointers(&HomeAddressList, - &HomeAddressListTown, - &HomeAddressListCounty, - &HomeAddressListPostCode, - &HomeAddressListCountry, - &HomeAddressListLabel, - &HomeAddressListLang, - &HomeAddressListAltID, - &HomeAddressListPID, - &HomeAddressListTokens, - &HomeAddressListGeo, - &HomeAddressListTimezone, - &HomeAddressListType, - &HomeAddressListMediatype, - &HomeAddressListPref, - lboHomeAddresses, - (intValueSeek)); - frameCEAddress->ShowModal(); - delete frameCEAddress; - frameCEAddress = NULL; + + // Bring up window to add address. + + frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); + frameCEAddress->SetEditorMode(FALSE, CE_HOME); + frameCEAddress->SetupPointers(&ContactEditorData.HomeAddressList, + &ContactEditorData.HomeAddressListTown, + &ContactEditorData.HomeAddressListCounty, + &ContactEditorData.HomeAddressListPostCode, + &ContactEditorData.HomeAddressListCountry, + &ContactEditorData.HomeAddressListLabel, + &ContactEditorData.HomeAddressListLang, + &ContactEditorData.HomeAddressListAltID, + &ContactEditorData.HomeAddressListPID, + &ContactEditorData.HomeAddressListTokens, + &ContactEditorData.HomeAddressListGeo, + &ContactEditorData.HomeAddressListTimezone, + &ContactEditorData.HomeAddressListType, + &ContactEditorData.HomeAddressListMediatype, + &ContactEditorData.HomeAddressListPref, + lboHomeAddresses, + (intValueSeek)); + frameCEAddress->ShowModal(); + delete frameCEAddress; + frameCEAddress = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeAddress( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeAddresses, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); - frameCEAddress->SetupPointers(&HomeAddressList, - &HomeAddressListTown, - &HomeAddressListCounty, - &HomeAddressListPostCode, - &HomeAddressListCountry, - &HomeAddressListLabel, - &HomeAddressListLang, - &HomeAddressListAltID, - &HomeAddressListPID, - &HomeAddressListTokens, - &HomeAddressListGeo, - &HomeAddressListTimezone, - &HomeAddressListType, - &HomeAddressListMediatype, - &HomeAddressListPref, - lboHomeAddresses, - intSelectedData); - frameCEAddress->SetEditorMode(TRUE, CE_HOME); - frameCEAddress->ShowModal(); - delete frameCEAddress; - frameCEAddress = NULL; + + // Bring up window to modify address. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeAddresses->GetItemCount() == 0 || !GetSelectedItem(lboHomeAddresses, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); + frameCEAddress->SetupPointers(&ContactEditorData.HomeAddressList, + &ContactEditorData.HomeAddressListTown, + &ContactEditorData.HomeAddressListCounty, + &ContactEditorData.HomeAddressListPostCode, + &ContactEditorData.HomeAddressListCountry, + &ContactEditorData.HomeAddressListLabel, + &ContactEditorData.HomeAddressListLang, + &ContactEditorData.HomeAddressListAltID, + &ContactEditorData.HomeAddressListPID, + &ContactEditorData.HomeAddressListTokens, + &ContactEditorData.HomeAddressListGeo, + &ContactEditorData.HomeAddressListTimezone, + &ContactEditorData.HomeAddressListType, + &ContactEditorData.HomeAddressListMediatype, + &ContactEditorData.HomeAddressListPref, + lboHomeAddresses, + intSelectedData); + frameCEAddress->SetEditorMode(TRUE, CE_HOME); + frameCEAddress->ShowModal(); + delete frameCEAddress; + frameCEAddress = NULL; + } void frmContactEditor::DeleteHomeAddress( wxCommandEvent& event ) { - - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeAddresses, - &longSelected, - &intSelectedData)){ - return; - } - - lboHomeAddresses->DeleteItem(longSelected); - - DeleteMapData(intSelectedData, &HomeAddressList, - &HomeAddressListTown, &HomeAddressListCounty, - &HomeAddressListPostCode, &HomeAddressListCountry, - &HomeAddressList, &HomeAddressListLabel, - &HomeAddressListLang, &HomeAddressListAltID, - &HomeAddressListPID, &HomeAddressListTokens, - &HomeAddressListGeo, &HomeAddressListTimezone, - &HomeAddressListType, &HomeAddressListMediatype, - &HomeAddressListPref); + + // Bring up window to delete address. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeAddresses->GetItemCount() == 0 || !GetSelectedItem(lboHomeAddresses, + &longSelected, + &intSelectedData)){ + return; + } + + lboHomeAddresses->DeleteItem(longSelected); + + DeleteMapData(intSelectedData, &ContactEditorData.HomeAddressList, + &ContactEditorData.HomeAddressListTown, &ContactEditorData.HomeAddressListCounty, + &ContactEditorData.HomeAddressListPostCode, &ContactEditorData.HomeAddressListCountry, + &ContactEditorData.HomeAddressList, &ContactEditorData.HomeAddressListLabel, + &ContactEditorData.HomeAddressListLang, &ContactEditorData.HomeAddressListAltID, + &ContactEditorData.HomeAddressListPID, &ContactEditorData.HomeAddressListTokens, + &ContactEditorData.HomeAddressListGeo, &ContactEditorData.HomeAddressListTimezone, + &ContactEditorData.HomeAddressListType, &ContactEditorData.HomeAddressListMediatype, + &ContactEditorData.HomeAddressListPref); } void frmContactEditor::AddHomeEmail( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); - frameCEEmail->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeAddressList); - frameCEEmail->SetupPointers(&HomeEmailList, - &HomeEmailListAltID, - &HomeEmailListPID, - &HomeEmailListType, - &HomeEmailListTokens, - &HomeEmailListPref, - lboHomeEmails, - (intValueSeek)); - frameCEEmail->ShowModal(); - delete frameCEEmail; - frameCEEmail = NULL; + + // Bring up window to add email. + + frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); + frameCEEmail->SetEditorMode(FALSE, CE_HOME); + frameCEEmail->SetupPointers(&ContactEditorData.HomeEmailList, + &ContactEditorData.HomeEmailListAltID, + &ContactEditorData.HomeEmailListPID, + &ContactEditorData.HomeEmailListType, + &ContactEditorData.HomeEmailListTokens, + &ContactEditorData.HomeEmailListPref, + lboHomeEmails, + (intValueSeek)); + frameCEEmail->ShowModal(); + delete frameCEEmail; + frameCEEmail = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeEmail( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeEmails, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); - frameCEEmail->SetupPointers(&HomeEmailList, - &HomeEmailListAltID, - &HomeEmailListPID, - &HomeEmailListType, - &HomeEmailListTokens, - &HomeEmailListPref, - lboHomeEmails, - intSelectedData); - frameCEEmail->SetEditorMode(TRUE, CE_HOME); - frameCEEmail->ShowModal(); - delete frameCEEmail; - frameCEEmail = NULL; + + // Bring up window to modify email. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeEmails->GetItemCount() == 0 || !GetSelectedItem(lboHomeEmails, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); + frameCEEmail->SetupPointers(&ContactEditorData.HomeEmailList, + &ContactEditorData.HomeEmailListAltID, + &ContactEditorData.HomeEmailListPID, + &ContactEditorData.HomeEmailListType, + &ContactEditorData.HomeEmailListTokens, + &ContactEditorData.HomeEmailListPref, + lboHomeEmails, + intSelectedData); + frameCEEmail->SetEditorMode(TRUE, CE_HOME); + frameCEEmail->ShowModal(); + delete frameCEEmail; + frameCEEmail = NULL; + } void frmContactEditor::DeleteHomeEmail( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeEmails, - &longSelected, - &intSelectedData)){ - return; - } - - lboHomeEmails->DeleteItem(longSelected); - - DeleteMapData(intSelectedData, &HomeEmailList, - &HomeEmailListAltID, &HomeEmailListPID, - &HomeEmailListType, &HomeEmailListTokens, - &HomeEmailListPref); + + // Bring up window to delete email. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeEmails->GetItemCount() == 0 || !GetSelectedItem(lboHomeEmails, + &longSelected, + &intSelectedData)){ + return; + } + + lboHomeEmails->DeleteItem(longSelected); + + DeleteMapData(intSelectedData, &ContactEditorData.HomeEmailList, + &ContactEditorData.HomeEmailListAltID, &ContactEditorData.HomeEmailListPID, + &ContactEditorData.HomeEmailListType, &ContactEditorData.HomeEmailListTokens, + &ContactEditorData.HomeEmailListPref); + } void frmContactEditor::AddHomeIM( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); - frameCEIM->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeIMList); - frameCEIM->SetupPointers(&HomeIMList, - &HomeIMListAltID, - &HomeIMListPID, - &HomeIMListType, - &HomeIMListTokens, - &HomeIMListMediatype, - &HomeIMListPref, - lboHomeIM, - (intValueSeek)); - frameCEIM->ShowModal(); - delete frameCEIM; - frameCEIM = NULL; + + // Bring up window to add IM. + + frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); + frameCEIM->SetEditorMode(FALSE, CE_HOME); + frameCEIM->SetupPointers(&ContactEditorData.HomeIMList, + &ContactEditorData.HomeIMListAltID, + &ContactEditorData.HomeIMListPID, + &ContactEditorData.HomeIMListType, + &ContactEditorData.HomeIMListTypeInfo, + &ContactEditorData.HomeIMListTokens, + &ContactEditorData.HomeIMListMediatype, + &ContactEditorData.HomeIMListPref, + lboHomeIM, + (intValueSeek)); + frameCEIM->ShowModal(); + delete frameCEIM; + frameCEIM = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeIM( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeIM, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); - frameCEIM->SetupPointers(&HomeIMList, - &HomeIMListAltID, - &HomeIMListPID, - &HomeIMListType, - &HomeIMListTokens, - &HomeIMListMediatype, - &HomeIMListPref, - lboHomeIM, - intSelectedData); - frameCEIM->SetEditorMode(TRUE, CE_HOME); - frameCEIM->ShowModal(); - delete frameCEIM; - frameCEIM = NULL; + + // Bring up window to modify IM. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeIM->GetItemCount() == 0 || !GetSelectedItem(lboHomeIM, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); + frameCEIM->SetupPointers(&ContactEditorData.HomeIMList, + &ContactEditorData.HomeIMListAltID, + &ContactEditorData.HomeIMListPID, + &ContactEditorData.HomeIMListType, + &ContactEditorData.HomeIMListTypeInfo, + &ContactEditorData.HomeIMListTokens, + &ContactEditorData.HomeIMListMediatype, + &ContactEditorData.HomeIMListPref, + lboHomeIM, + intSelectedData); + frameCEIM->SetEditorMode(TRUE, CE_HOME); + frameCEIM->ShowModal(); + delete frameCEIM; + frameCEIM = NULL; + } void frmContactEditor::DeleteHomeIM( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete IM. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeIM, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeIM->GetItemCount() == 0 || !GetSelectedItem(lboHomeIM, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeIM->DeleteItem(longSelected); + lboHomeIM->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeIMList, - &HomeIMListAltID, &HomeIMListPID, - &HomeIMListType, &HomeIMListTokens, - &HomeIMListMediatype, &HomeIMListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeIMList, + &ContactEditorData.HomeIMListAltID, &ContactEditorData.HomeIMListPID, + &ContactEditorData.HomeIMListType, &ContactEditorData.HomeIMListTypeInfo, + &ContactEditorData.HomeIMListTokens, &ContactEditorData.HomeIMListMediatype, + &ContactEditorData.HomeIMListPref); } void frmContactEditor::AddHomeTelephone( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); - frameCETel->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeTelephoneList); - frameCETel->SetupPointers(&HomeTelephoneList, - &HomeTelephoneListAltID, - &HomeTelephoneListPID, - &HomeTelephoneListType, - &HomeTelephoneListTokens, - &HomeTelephoneListPref, - lboHomeTelephone, - (intValueSeek)); - frameCETel->ShowModal(); - delete frameCETel; - frameCETel = NULL; + + // Bring up window to add telephone. + + frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); + frameCETel->SetEditorMode(FALSE, CE_HOME); + frameCETel->SetupPointers(&ContactEditorData.HomeTelephoneList, + &ContactEditorData.HomeTelephoneListAltID, + &ContactEditorData.HomeTelephoneListPID, + &ContactEditorData.HomeTelephoneListType, + &ContactEditorData.HomeTelephoneListTypeInfo, + &ContactEditorData.HomeTelephoneListTokens, + &ContactEditorData.HomeTelephoneListPref, + lboHomeTelephone, + (intValueSeek)); + frameCETel->ShowModal(); + delete frameCETel; + frameCETel = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeTelephone( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeTelephone, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); - frameCETel->SetupPointers(&HomeTelephoneList, - &HomeTelephoneListAltID, - &HomeTelephoneListPID, - &HomeTelephoneListType, - &HomeTelephoneListTokens, - &HomeTelephoneListPref, - lboHomeTelephone, - intSelectedData); - frameCETel->SetEditorMode(TRUE, CE_HOME); - frameCETel->ShowModal(); - delete frameCETel; - frameCETel = NULL; -} + + // Bring up window to modify telephone. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeTelephone->GetItemCount() == 0 || !GetSelectedItem(lboHomeTelephone, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); + frameCETel->SetupPointers(&ContactEditorData.HomeTelephoneList, + &ContactEditorData.HomeTelephoneListAltID, + &ContactEditorData.HomeTelephoneListPID, + &ContactEditorData.HomeTelephoneListType, + &ContactEditorData.HomeTelephoneListTypeInfo, + &ContactEditorData.HomeTelephoneListTokens, + &ContactEditorData.HomeTelephoneListPref, + lboHomeTelephone, + intSelectedData); + frameCETel->SetEditorMode(TRUE, CE_HOME); + frameCETel->ShowModal(); + delete frameCETel; + frameCETel = NULL; + +} void frmContactEditor::DeleteHomeTelephone( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete telephone. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeTelephone, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeTelephone->GetItemCount() == 0 || !GetSelectedItem(lboHomeTelephone, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeTelephone->DeleteItem(longSelected); + lboHomeTelephone->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeTelephoneList, - &HomeTelephoneListAltID, &HomeTelephoneListPID, - &HomeTelephoneListType, &HomeTelephoneListTokens, - &HomeTelephoneListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeTelephoneList, + &ContactEditorData.HomeTelephoneListAltID, &ContactEditorData.HomeTelephoneListPID, + &ContactEditorData.HomeTelephoneListType, &ContactEditorData.HomeTelephoneListTypeInfo, + &ContactEditorData.HomeTelephoneListTokens, &ContactEditorData.HomeTelephoneListPref); } void frmContactEditor::AddHomeLanguage( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); - frameCELang->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeLanguageList); - frameCELang->SetupPointers(&HomeLanguageList, - &HomeLanguageListAltID, - &HomeLanguageListPID, - &HomeLanguageListType, - &HomeLanguageListTokens, - &HomeLanguageListPref, - lboHomeLanguages, - (intValueSeek)); - frameCELang->ShowModal(); - delete frameCELang; - frameCELang = NULL; + + // Bring up window to add language. + + frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); + frameCELang->SetEditorMode(FALSE, CE_HOME); + frameCELang->SetupPointers(&ContactEditorData.HomeLanguageList, + &ContactEditorData.HomeLanguageListAltID, + &ContactEditorData.HomeLanguageListPID, + &ContactEditorData.HomeLanguageListType, + &ContactEditorData.HomeLanguageListTokens, + &ContactEditorData.HomeLanguageListPref, + lboHomeLanguages, + (intValueSeek)); + frameCELang->ShowModal(); + delete frameCELang; + frameCELang = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeLanguage( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeLanguages, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); - frameCELang->SetupPointers(&HomeLanguageList, - &HomeLanguageListAltID, - &HomeLanguageListPID, - &HomeLanguageListType, - &HomeLanguageListTokens, - &HomeLanguageListPref, - lboHomeLanguages, - intSelectedData); - frameCELang->SetEditorMode(TRUE, CE_HOME); - frameCELang->ShowModal(); - delete frameCELang; - frameCELang = NULL; + + // Bring up window to modify language. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeLanguages->GetItemCount() == 0 || !GetSelectedItem(lboHomeLanguages, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); + frameCELang->SetupPointers(&ContactEditorData.HomeLanguageList, + &ContactEditorData.HomeLanguageListAltID, + &ContactEditorData.HomeLanguageListPID, + &ContactEditorData.HomeLanguageListType, + &ContactEditorData.HomeLanguageListTokens, + &ContactEditorData.HomeLanguageListPref, + lboHomeLanguages, + intSelectedData); + frameCELang->SetEditorMode(TRUE, CE_HOME); + frameCELang->ShowModal(); + delete frameCELang; + frameCELang = NULL; + } void frmContactEditor::DeleteHomeLanguage( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete language. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeLanguages, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeLanguages->GetItemCount() == 0 || !GetSelectedItem(lboHomeLanguages, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeLanguages->DeleteItem(longSelected); + lboHomeLanguages->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeLanguageList, - &HomeLanguageListAltID, &HomeLanguageListPID, - &HomeLanguageListType, &HomeLanguageListTokens, - &HomeLanguageListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeLanguageList, + &ContactEditorData.HomeLanguageListAltID, &ContactEditorData.HomeLanguageListPID, + &ContactEditorData.HomeLanguageListType, &ContactEditorData.HomeLanguageListTokens, + &ContactEditorData.HomeLanguageListPref); } void frmContactEditor::AddHomeTimezone( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); - frameCETZ->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeTZList); - frameCETZ->SetupPointers(&HomeTZList, - &HomeTZListAltID, - &HomeTZListPID, - &HomeTZListType, - &HomeTZListTokens, - &HomeTZListMediatype, - &HomeTZListPref, - lboHomeTimezones, - (intValueSeek)); - frameCETZ->ShowModal(); - delete frameCETZ; - frameCETZ = NULL; + + // Bring up window to add timezone. + + frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); + frameCETZ->SetEditorMode(FALSE, CE_HOME); + frameCETZ->SetupPointers(&ContactEditorData.HomeTZList, + &ContactEditorData.HomeTZListAltID, + &ContactEditorData.HomeTZListPID, + &ContactEditorData.HomeTZListType, + &ContactEditorData.HomeTZListTokens, + &ContactEditorData.HomeTZListMediatype, + &ContactEditorData.HomeTZListPref, + lboHomeTimezones, + (intValueSeek)); + frameCETZ->ShowModal(); + delete frameCETZ; + frameCETZ = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeTimezone( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeTimezones, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); - frameCETZ->SetupPointers(&HomeTZList, - &HomeTZListAltID, - &HomeTZListPID, - &HomeTZListType, - &HomeTZListTokens, - &HomeTZListMediatype, - &HomeTZListPref, - lboHomeTimezones, - intSelectedData); - frameCETZ->SetEditorMode(TRUE, CE_HOME); - frameCETZ->ShowModal(); - delete frameCETZ; - frameCETZ = NULL; + + // Bring up window to modify timezone. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeTimezones->GetItemCount() == 0 || !GetSelectedItem(lboHomeTimezones, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); + frameCETZ->SetupPointers(&ContactEditorData.HomeTZList, + &ContactEditorData.HomeTZListAltID, + &ContactEditorData.HomeTZListPID, + &ContactEditorData.HomeTZListType, + &ContactEditorData.HomeTZListTokens, + &ContactEditorData.HomeTZListMediatype, + &ContactEditorData.HomeTZListPref, + lboHomeTimezones, + intSelectedData); + frameCETZ->SetEditorMode(TRUE, CE_HOME); + frameCETZ->ShowModal(); + delete frameCETZ; + frameCETZ = NULL; + } void frmContactEditor::DeleteHomeTimezone( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete timezone. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeTimezones, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeTimezones->GetItemCount() == 0 || !GetSelectedItem(lboHomeTimezones, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeTimezones->DeleteItem(longSelected); + lboHomeTimezones->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeTZList, - &HomeTZListAltID, &HomeTZListPID, - &HomeTZListType, &HomeTZListTokens, - &HomeTZListMediatype, &HomeTZListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeTZList, + &ContactEditorData.HomeTZListAltID, &ContactEditorData.HomeTZListPID, + &ContactEditorData.HomeTZListType, &ContactEditorData.HomeTZListTokens, + &ContactEditorData.HomeTZListMediatype, &ContactEditorData.HomeTZListPref); } void frmContactEditor::AddHomeGeoposition( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); - frameCEGeo->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeGeographyList); - frameCEGeo->SetupPointers(&HomeGeographyList, - &HomeGeographyListAltID, - &HomeGeographyListPID, - &HomeGeographyListType, - &HomeGeographyListTokens, - &HomeGeographyListMediatype, - &HomeGeographyListPref, - lboHomeGeoposition, - (intValueSeek)); - frameCEGeo->ShowModal(); - delete frameCEGeo; - frameCEGeo = NULL; + + // Bring up window to add geoposition. + + frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); + frameCEGeo->SetEditorMode(FALSE, CE_HOME); + frameCEGeo->SetupPointers(&ContactEditorData.HomeGeographyList, + &ContactEditorData.HomeGeographyListAltID, + &ContactEditorData.HomeGeographyListPID, + &ContactEditorData.HomeGeographyListType, + &ContactEditorData.HomeGeographyListDataType, + &ContactEditorData.HomeGeographyListTokens, + &ContactEditorData.HomeGeographyListMediatype, + &ContactEditorData.HomeGeographyListPref, + lboHomeGeoposition, + (intValueSeek)); + frameCEGeo->ShowModal(); + delete frameCEGeo; + frameCEGeo = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeGeoposition( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeGeoposition, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); - frameCEGeo->SetupPointers(&HomeGeographyList, - &HomeGeographyListAltID, - &HomeGeographyListPID, - &HomeGeographyListType, - &HomeGeographyListTokens, - &HomeGeographyListMediatype, - &HomeGeographyListPref, - lboHomeGeoposition, - intSelectedData); - frameCEGeo->SetEditorMode(TRUE, CE_HOME); - frameCEGeo->ShowModal(); - delete frameCEGeo; - frameCEGeo = NULL; + + // Bring up window to modify geoposition. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboHomeGeoposition, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); + frameCEGeo->SetupPointers(&ContactEditorData.HomeGeographyList, + &ContactEditorData.HomeGeographyListAltID, + &ContactEditorData.HomeGeographyListPID, + &ContactEditorData.HomeGeographyListType, + &ContactEditorData.HomeGeographyListDataType, + &ContactEditorData.HomeGeographyListTokens, + &ContactEditorData.HomeGeographyListMediatype, + &ContactEditorData.HomeGeographyListPref, + lboHomeGeoposition, + intSelectedData); + frameCEGeo->SetEditorMode(TRUE, CE_HOME); + frameCEGeo->ShowModal(); + delete frameCEGeo; + frameCEGeo = NULL; + } void frmContactEditor::DeleteHomeGeoposition( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeGeoposition, - &longSelected, - &intSelectedData)){ - return; - } - - lboHomeGeoposition->DeleteItem(longSelected); - - DeleteMapData(intSelectedData, &HomeGeographyList, - &HomeGeographyListAltID, &HomeGeographyListPID, - &HomeGeographyListType, &HomeGeographyListTokens, - &HomeGeographyListMediatype, &HomeGeographyListPref); + + // Bring up window to delete geoposition. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboHomeGeoposition, + &longSelected, + &intSelectedData)){ + return; + } + + lboHomeGeoposition->DeleteItem(longSelected); + + DeleteMapData(intSelectedData, &ContactEditorData.HomeGeographyList, + &ContactEditorData.HomeGeographyListAltID, &ContactEditorData.HomeGeographyListPID, + &ContactEditorData.HomeGeographyListType, &ContactEditorData.HomeGeographyListTokens, + &ContactEditorData.HomeGeographyListDataType, &ContactEditorData.HomeGeographyListMediatype, + &ContactEditorData.HomeGeographyListPref); } void frmContactEditor::AddHomeWebsite( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); - frameCEWeb->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeWebsiteList); - frameCEWeb->SetupPointers(&HomeWebsiteList, - &HomeWebsiteListAltID, - &HomeWebsiteListPID, - &HomeWebsiteListType, - &HomeWebsiteListTokens, - &HomeWebsiteListMediatype, - &HomeWebsiteListPref, - lboHomeWebsites, - (intValueSeek)); - frameCEWeb->ShowModal(); - delete frameCEWeb; - frameCEWeb = NULL; + + // Bring up window to add website. + + frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); + frameCEWeb->SetEditorMode(FALSE, CE_HOME); + frameCEWeb->SetupPointers(&ContactEditorData.HomeWebsiteList, + &ContactEditorData.HomeWebsiteListAltID, + &ContactEditorData.HomeWebsiteListPID, + &ContactEditorData.HomeWebsiteListType, + &ContactEditorData.HomeWebsiteListTokens, + &ContactEditorData.HomeWebsiteListMediatype, + &ContactEditorData.HomeWebsiteListPref, + lboHomeWebsites, + (intValueSeek)); + frameCEWeb->ShowModal(); + delete frameCEWeb; + frameCEWeb = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeWebsite( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeWebsites, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); - frameCEWeb->SetupPointers(&HomeWebsiteList, - &HomeWebsiteListAltID, - &HomeWebsiteListPID, - &HomeWebsiteListType, - &HomeWebsiteListTokens, - &HomeWebsiteListMediatype, - &HomeWebsiteListPref, - lboHomeWebsites, - intSelectedData); - frameCEWeb->SetEditorMode(TRUE, CE_HOME); - frameCEWeb->ShowModal(); - delete frameCEWeb; - frameCEWeb = NULL; + + // Bring up window to modify website. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeWebsites->GetItemCount() == 0 || !GetSelectedItem(lboHomeWebsites, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); + frameCEWeb->SetupPointers(&ContactEditorData.HomeWebsiteList, + &ContactEditorData.HomeWebsiteListAltID, + &ContactEditorData.HomeWebsiteListPID, + &ContactEditorData.HomeWebsiteListType, + &ContactEditorData.HomeWebsiteListTokens, + &ContactEditorData.HomeWebsiteListMediatype, + &ContactEditorData.HomeWebsiteListPref, + lboHomeWebsites, + intSelectedData); + frameCEWeb->SetEditorMode(TRUE, CE_HOME); + frameCEWeb->ShowModal(); + delete frameCEWeb; + frameCEWeb = NULL; + } void frmContactEditor::DeleteHomeWebsite( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete website. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeWebsites, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeWebsites->GetItemCount() == 0 || !GetSelectedItem(lboHomeWebsites, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeWebsites->DeleteItem(longSelected); + lboHomeWebsites->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeWebsiteList, - &HomeWebsiteListAltID, &HomeWebsiteListPID, - &HomeWebsiteListType, &HomeWebsiteListTokens, - &HomeWebsiteListMediatype, &HomeWebsiteListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeWebsiteList, + &ContactEditorData.HomeWebsiteListAltID, &ContactEditorData.HomeWebsiteListPID, + &ContactEditorData.HomeWebsiteListType, &ContactEditorData.HomeWebsiteListTokens, + &ContactEditorData.HomeWebsiteListMediatype, &ContactEditorData.HomeWebsiteListPref); } void frmContactEditor::AddHomeTitle( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); - frameCETitle->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeTitleList); - frameCETitle->SetupPointers(&HomeTitleList, - &HomeTitleListLanguage, - &HomeTitleListAltID, - &HomeTitleListPID, - &HomeTitleListType, - &HomeTitleListTokens, - &HomeTitleListPref, - lboHomeTitles, - (intValueSeek)); - frameCETitle->ShowModal(); - delete frameCETitle; - frameCETitle = NULL; + + // Bring up window to add title. + + frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); + frameCETitle->SetEditorMode(FALSE, CE_HOME); + frameCETitle->SetupPointers(&ContactEditorData.HomeTitleList, + &ContactEditorData.HomeTitleListLanguage, + &ContactEditorData.HomeTitleListAltID, + &ContactEditorData.HomeTitleListPID, + &ContactEditorData.HomeTitleListType, + &ContactEditorData.HomeTitleListTokens, + &ContactEditorData.HomeTitleListPref, + lboHomeTitles, + (intValueSeek)); + frameCETitle->ShowModal(); + delete frameCETitle; + frameCETitle = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeTitle( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeTitles, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); - frameCETitle->SetupPointers(&HomeTitleList, - &HomeTitleListLanguage, - &HomeTitleListAltID, - &HomeTitleListPID, - &HomeTitleListType, - &HomeTitleListTokens, - &HomeTitleListPref, - lboHomeTitles, - intSelectedData); - frameCETitle->SetEditorMode(TRUE, CE_HOME); - frameCETitle->ShowModal(); - delete frameCETitle; - frameCETitle = NULL; + + // Bring up window to modify title. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeTitles->GetItemCount() == 0 || !GetSelectedItem(lboHomeTitles, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); + frameCETitle->SetupPointers(&ContactEditorData.HomeTitleList, + &ContactEditorData.HomeTitleListLanguage, + &ContactEditorData.HomeTitleListAltID, + &ContactEditorData.HomeTitleListPID, + &ContactEditorData.HomeTitleListType, + &ContactEditorData.HomeTitleListTokens, + &ContactEditorData.HomeTitleListPref, + lboHomeTitles, + intSelectedData); + frameCETitle->SetEditorMode(TRUE, CE_HOME); + frameCETitle->ShowModal(); + delete frameCETitle; + frameCETitle = NULL; + } void frmContactEditor::DeleteHomeTitle( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete title. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeTitles, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeTitles->GetItemCount() == 0 || !GetSelectedItem(lboHomeTitles, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeTitles->DeleteItem(longSelected); + lboHomeTitles->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeTitleList, - &HomeTitleListLanguage, &HomeTitleListAltID, - &HomeTitleListPID, &HomeTitleListType, - &HomeTitleListTokens, &HomeTitleListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeTitleList, + &ContactEditorData.HomeTitleListLanguage, &ContactEditorData.HomeTitleListAltID, + &ContactEditorData.HomeTitleListPID, &ContactEditorData.HomeTitleListType, + &ContactEditorData.HomeTitleListTokens, &ContactEditorData.HomeTitleListPref); } void frmContactEditor::AddHomeRole( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); - frameCERole->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeRoleList); - frameCERole->SetupPointers(&HomeRoleList, - &HomeRoleListLanguage, - &HomeRoleListAltID, - &HomeRoleListPID, - &HomeRoleListType, - &HomeRoleListTokens, - &HomeRoleListPref, - lboHomeRoles, - (intValueSeek)); - frameCERole->ShowModal(); - delete frameCERole; - frameCERole = NULL; + + // Bring up window to add role. + + frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); + frameCERole->SetEditorMode(FALSE, CE_HOME); + frameCERole->SetupPointers(&ContactEditorData.HomeRoleList, + &ContactEditorData.HomeRoleListLanguage, + &ContactEditorData.HomeRoleListAltID, + &ContactEditorData.HomeRoleListPID, + &ContactEditorData.HomeRoleListType, + &ContactEditorData.HomeRoleListTokens, + &ContactEditorData.HomeRoleListPref, + lboHomeRoles, + (intValueSeek)); + frameCERole->ShowModal(); + delete frameCERole; + frameCERole = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeRole( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeRoles, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); - frameCERole->SetupPointers(&HomeRoleList, - &HomeRoleListLanguage, - &HomeRoleListAltID, - &HomeRoleListPID, - &HomeRoleListType, - &HomeRoleListTokens, - &HomeRoleListPref, - lboHomeRoles, - intSelectedData); - frameCERole->SetEditorMode(TRUE, CE_HOME); - frameCERole->ShowModal(); - delete frameCERole; - frameCERole = NULL; + + // Bring up window to modify role. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeRoles->GetItemCount() == 0 || !GetSelectedItem(lboHomeRoles, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); + frameCERole->SetupPointers(&ContactEditorData.HomeRoleList, + &ContactEditorData.HomeRoleListLanguage, + &ContactEditorData.HomeRoleListAltID, + &ContactEditorData.HomeRoleListPID, + &ContactEditorData.HomeRoleListType, + &ContactEditorData.HomeRoleListTokens, + &ContactEditorData.HomeRoleListPref, + lboHomeRoles, + intSelectedData); + frameCERole->SetEditorMode(TRUE, CE_HOME); + frameCERole->ShowModal(); + delete frameCERole; + frameCERole = NULL; + } void frmContactEditor::DeleteHomeRole( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; + + // Bring up window to delete role. + + long longSelected = -1; + int intSelectedData = 0; - if (!GetSelectedItem(lboHomeRoles, - &longSelected, - &intSelectedData)){ - return; - } + if (lboHomeRoles->GetItemCount() == 0 || !GetSelectedItem(lboHomeRoles, + &longSelected, + &intSelectedData)){ + return; + } - lboHomeRoles->DeleteItem(longSelected); + lboHomeRoles->DeleteItem(longSelected); - DeleteMapData(intSelectedData, &HomeRoleList, - &HomeRoleListLanguage, &HomeRoleListAltID, - &HomeRoleListPID, &HomeRoleListType, - &HomeRoleListTokens, &HomeRoleListPref); + DeleteMapData(intSelectedData, &ContactEditorData.HomeRoleList, + &ContactEditorData.HomeRoleListLanguage, &ContactEditorData.HomeRoleListAltID, + &ContactEditorData.HomeRoleListPID, &ContactEditorData.HomeRoleListType, + &ContactEditorData.HomeRoleListTokens, &ContactEditorData.HomeRoleListPref); } void frmContactEditor::AddHomeOrganisation( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); - frameCEOrg->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeOrganisationsList); - frameCEOrg->SetupPointers(&HomeOrganisationsList, - &HomeOrganisationsListLanguage, - &HomeOrganisationsListSortAs, - &HomeOrganisationsListAltID, - &HomeOrganisationsListPID, - &HomeOrganisationsListType, - &HomeOrganisationsListTokens, - &HomeOrganisationsListPref, - lboHomeOrganisations, - (intValueSeek)); - frameCEOrg->ShowModal(); - delete frameCEOrg; - frameCEOrg = NULL; + + // Bring up window to add organisation. + + frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); + frameCEOrg->SetEditorMode(FALSE, CE_HOME); + frameCEOrg->SetupPointers(&ContactEditorData.HomeOrganisationsList, + &ContactEditorData.HomeOrganisationsListLanguage, + &ContactEditorData.HomeOrganisationsListSortAs, + &ContactEditorData.HomeOrganisationsListAltID, + &ContactEditorData.HomeOrganisationsListPID, + &ContactEditorData.HomeOrganisationsListType, + &ContactEditorData.HomeOrganisationsListTokens, + &ContactEditorData.HomeOrganisationsListPref, + lboHomeOrganisations, + (intValueSeek)); + frameCEOrg->ShowModal(); + delete frameCEOrg; + frameCEOrg = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeOrganisation( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeOrganisations, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); - frameCEOrg->SetupPointers(&HomeOrganisationsList, - &HomeOrganisationsListLanguage, - &HomeOrganisationsListSortAs, - &HomeOrganisationsListAltID, - &HomeOrganisationsListPID, - &HomeOrganisationsListType, - &HomeOrganisationsListTokens, - &HomeOrganisationsListPref, - lboHomeOrganisations, - intSelectedData); - frameCEOrg->SetEditorMode(TRUE, CE_HOME); - frameCEOrg->ShowModal(); - delete frameCEOrg; - frameCEOrg = NULL; + + // Bring up window to modify organisation. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboHomeOrganisations, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); + frameCEOrg->SetupPointers(&ContactEditorData.HomeOrganisationsList, + &ContactEditorData.HomeOrganisationsListLanguage, + &ContactEditorData.HomeOrganisationsListSortAs, + &ContactEditorData.HomeOrganisationsListAltID, + &ContactEditorData.HomeOrganisationsListPID, + &ContactEditorData.HomeOrganisationsListType, + &ContactEditorData.HomeOrganisationsListTokens, + &ContactEditorData.HomeOrganisationsListPref, + lboHomeOrganisations, + intSelectedData); + frameCEOrg->SetEditorMode(TRUE, CE_HOME); + frameCEOrg->ShowModal(); + delete frameCEOrg; + frameCEOrg = NULL; + } void frmContactEditor::DeleteHomeOrganisation( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeOrganisations, - &longSelected, - &intSelectedData)){ - return; - } - - lboHomeOrganisations->DeleteItem(longSelected); - - DeleteMapData(intSelectedData, &HomeOrganisationsList, - &HomeOrganisationsListLanguage, &HomeOrganisationsListSortAs, - &HomeOrganisationsListAltID, &HomeOrganisationsListPID, - &HomeOrganisationsListType, &HomeOrganisationsListTokens, - &HomeOrganisationsListPref); + + // Bring up window to delete organisation. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeOrganisations->GetItemCount() == 0 ||!GetSelectedItem(lboHomeOrganisations, + &longSelected, + &intSelectedData)){ + return; + } + + lboHomeOrganisations->DeleteItem(longSelected); + + DeleteMapData(intSelectedData, &ContactEditorData.HomeOrganisationsList, + &ContactEditorData.HomeOrganisationsListLanguage, &ContactEditorData.HomeOrganisationsListSortAs, + &ContactEditorData.HomeOrganisationsListAltID, &ContactEditorData.HomeOrganisationsListPID, + &ContactEditorData.HomeOrganisationsListType, &ContactEditorData.HomeOrganisationsListTokens, + &ContactEditorData.HomeOrganisationsListPref); } void frmContactEditor::AddHomeNote( wxCommandEvent& event ) { - int intResult = 0; - - frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); - frameCENote->SetEditorMode(FALSE, CE_HOME); - intResult = GetLastInt(&HomeNoteList); - frameCENote->SetupPointers(&HomeNoteList, - &HomeNoteListLanguage, - &HomeNoteListAltID, - &HomeNoteListPID, - &HomeNoteListType, - &HomeNoteListTokens, - &HomeNoteListPref, - lboHomeNotes, - (intValueSeek)); - frameCENote->ShowModal(); - delete frameCENote; - frameCENote = NULL; + + // Bring up window to add note. + + frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); + frameCENote->SetEditorMode(FALSE, CE_HOME); + frameCENote->SetupPointers(&ContactEditorData.HomeNoteList, + &ContactEditorData.HomeNoteListLanguage, + &ContactEditorData.HomeNoteListAltID, + &ContactEditorData.HomeNoteListPID, + &ContactEditorData.HomeNoteListType, + &ContactEditorData.HomeNoteListTokens, + &ContactEditorData.HomeNoteListPref, + lboHomeNotes, + (intValueSeek)); + frameCENote->ShowModal(); + delete frameCENote; + frameCENote = NULL; + intValueSeek++; + } void frmContactEditor::ModifyHomeNote( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeNotes, - &longSelected, - &intSelectedData)){ - return; - } - - frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); - frameCENote->SetupPointers(&HomeNoteList, - &HomeNoteListLanguage, - &HomeNoteListAltID, - &HomeNoteListPID, - &HomeNoteListType, - &HomeNoteListTokens, - &HomeNoteListPref, - lboHomeNotes, - intSelectedData); - frameCENote->SetEditorMode(TRUE, CE_HOME); - frameCENote->ShowModal(); - delete frameCENote; - frameCENote = NULL; + + // Bring up window to modify note. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeNotes->GetItemCount() == 0 || !GetSelectedItem(lboHomeNotes, + &longSelected, + &intSelectedData)){ + return; + } + + frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); + frameCENote->SetupPointers(&ContactEditorData.HomeNoteList, + &ContactEditorData.HomeNoteListLanguage, + &ContactEditorData.HomeNoteListAltID, + &ContactEditorData.HomeNoteListPID, + &ContactEditorData.HomeNoteListType, + &ContactEditorData.HomeNoteListTokens, + &ContactEditorData.HomeNoteListPref, + lboHomeNotes, + intSelectedData); + frameCENote->SetEditorMode(TRUE, CE_HOME); + frameCENote->ShowModal(); + delete frameCENote; + frameCENote = NULL; + } void frmContactEditor::DeleteHomeNote( wxCommandEvent& event ) { - long longSelected = -1; - int intSelectedData = 0; - - if (!GetSelectedItem(lboHomeNotes, - &longSelected, - &intSelectedData)){ - return; - } - - lboNotes->DeleteItem(longSelected); - - DeleteMapData(intSelectedData, &HomeNoteList, - &HomeNoteListLanguage, &HomeNoteListAltID, - &HomeNoteListPID, &HomeNoteListType, - &HomeNoteListTokens, &HomeNoteListPref); + + // Bring up window to delete note. + + long longSelected = -1; + int intSelectedData = 0; + + if (lboHomeNotes->GetItemCount() == 0 || !GetSelectedItem(lboHomeNotes, + &longSelected, + &intSelectedData)){ + return; + } + + lboHomeNotes->DeleteItem(longSelected); + + DeleteMapData(intSelectedData, &ContactEditorData.HomeNoteList, + &ContactEditorData.HomeNoteListLanguage, &ContactEditorData.HomeNoteListAltID, + &ContactEditorData.HomeNoteListPID, &ContactEditorData.HomeNoteListType, + &ContactEditorData.HomeNoteListTokens, &ContactEditorData.HomeNoteListPref); }