// frmContactEditor-Home.cpp - frmContactEditor Home tab subroutines. // // (c) 2012-2016 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" #include "frmContactEditorNickname.h" #include "frmContactEditorAddress.h" #include "frmContactEditorEmail.h" #include "frmContactEditorIM.h" #include "frmContactEditorTelephone.h" #include "frmContactEditorLanguages.h" #include "frmContactEditorTimezones.h" #include "frmContactEditorRelated.h" #include "frmContactEditorWebsites.h" #include "frmContactEditorTitles.h" #include "frmContactEditorRoles.h" #include "frmContactEditorGeoposition.h" #include "frmContactEditorGroups.h" #include "frmContactEditorOrganisations.h" #include "frmContactEditorNotes.h" void frmContactEditor::AddHomeNickname( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeNickname( wxCommandEvent& event ) { // 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 ) { // 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 ) { // 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; } void frmContactEditor::ModifyHomeAddress( wxCommandEvent& event ) { // 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 ) { // 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 ) { // 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; } void frmContactEditor::ModifyHomeEmail( wxCommandEvent& event ) { // 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 ) { // 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 ) { // 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; } void frmContactEditor::ModifyHomeIM( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete IM. long longSelected = -1; int intSelectedData = 0; if (lboHomeIM->GetItemCount() == 0 || !GetSelectedItem(lboHomeIM, &longSelected, &intSelectedData)){ return; } lboHomeIM->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeIMList, &ContactEditorData.HomeIMListAltID, &ContactEditorData.HomeIMListPID, &ContactEditorData.HomeIMListType, &ContactEditorData.HomeIMListTypeInfo, &ContactEditorData.HomeIMListTokens, &ContactEditorData.HomeIMListMediatype, &ContactEditorData.HomeIMListPref); } void frmContactEditor::AddHomeTelephone( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeTelephone( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete telephone. long longSelected = -1; int intSelectedData = 0; if (lboHomeTelephone->GetItemCount() == 0 || !GetSelectedItem(lboHomeTelephone, &longSelected, &intSelectedData)){ return; } lboHomeTelephone->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeTelephoneList, &ContactEditorData.HomeTelephoneListAltID, &ContactEditorData.HomeTelephoneListPID, &ContactEditorData.HomeTelephoneListType, &ContactEditorData.HomeTelephoneListTypeInfo, &ContactEditorData.HomeTelephoneListTokens, &ContactEditorData.HomeTelephoneListPref); } void frmContactEditor::AddHomeLanguage( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeLanguage( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete language. long longSelected = -1; int intSelectedData = 0; if (lboHomeLanguages->GetItemCount() == 0 || !GetSelectedItem(lboHomeLanguages, &longSelected, &intSelectedData)){ return; } lboHomeLanguages->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeLanguageList, &ContactEditorData.HomeLanguageListAltID, &ContactEditorData.HomeLanguageListPID, &ContactEditorData.HomeLanguageListType, &ContactEditorData.HomeLanguageListTokens, &ContactEditorData.HomeLanguageListPref); } void frmContactEditor::AddHomeTimezone( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeTimezone( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete timezone. long longSelected = -1; int intSelectedData = 0; if (lboHomeTimezones->GetItemCount() == 0 || !GetSelectedItem(lboHomeTimezones, &longSelected, &intSelectedData)){ return; } lboHomeTimezones->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeTZList, &ContactEditorData.HomeTZListAltID, &ContactEditorData.HomeTZListPID, &ContactEditorData.HomeTZListType, &ContactEditorData.HomeTZListTokens, &ContactEditorData.HomeTZListMediatype, &ContactEditorData.HomeTZListPref); } void frmContactEditor::AddHomeGeoposition( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeGeoposition( wxCommandEvent& event ) { // 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 ) { // 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 ) { // 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; } void frmContactEditor::ModifyHomeWebsite( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete website. long longSelected = -1; int intSelectedData = 0; if (lboHomeWebsites->GetItemCount() == 0 || !GetSelectedItem(lboHomeWebsites, &longSelected, &intSelectedData)){ return; } lboHomeWebsites->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeWebsiteList, &ContactEditorData.HomeWebsiteListAltID, &ContactEditorData.HomeWebsiteListPID, &ContactEditorData.HomeWebsiteListType, &ContactEditorData.HomeWebsiteListTokens, &ContactEditorData.HomeWebsiteListMediatype, &ContactEditorData.HomeWebsiteListPref); } void frmContactEditor::AddHomeTitle( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeTitle( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete title. long longSelected = -1; int intSelectedData = 0; if (lboHomeTitles->GetItemCount() == 0 || !GetSelectedItem(lboHomeTitles, &longSelected, &intSelectedData)){ return; } lboHomeTitles->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeTitleList, &ContactEditorData.HomeTitleListLanguage, &ContactEditorData.HomeTitleListAltID, &ContactEditorData.HomeTitleListPID, &ContactEditorData.HomeTitleListType, &ContactEditorData.HomeTitleListTokens, &ContactEditorData.HomeTitleListPref); } void frmContactEditor::AddHomeRole( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeRole( wxCommandEvent& event ) { // 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 ) { // Bring up window to delete role. long longSelected = -1; int intSelectedData = 0; if (lboHomeRoles->GetItemCount() == 0 || !GetSelectedItem(lboHomeRoles, &longSelected, &intSelectedData)){ return; } lboHomeRoles->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.HomeRoleList, &ContactEditorData.HomeRoleListLanguage, &ContactEditorData.HomeRoleListAltID, &ContactEditorData.HomeRoleListPID, &ContactEditorData.HomeRoleListType, &ContactEditorData.HomeRoleListTokens, &ContactEditorData.HomeRoleListPref); } void frmContactEditor::AddHomeOrganisation( wxCommandEvent& event ) { // 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; } void frmContactEditor::ModifyHomeOrganisation( wxCommandEvent& event ) { // 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 ) { // 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 ) { // 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; } void frmContactEditor::ModifyHomeNote( wxCommandEvent& event ) { // 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 ) { // 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); }