// frmContactEditorBusiness.cpp - frmContactEditor Business 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::AddBusinessNickname( wxCommandEvent& event ) { // Bring up the window for adding a nickname. frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); frameCENickname->SetEditorMode(FALSE, CE_WORK); frameCENickname->SetupPointers(&ContactEditorData.BusinessNicknamesList, &ContactEditorData.BusinessNicknamesListAltID, &ContactEditorData.BusinessNicknamesListPID, &ContactEditorData.BusinessNicknamesListType, &ContactEditorData.BusinessNicknamesListLanguage, &ContactEditorData.BusinessNicknamesListTokens, &ContactEditorData.BusinessNicknamesListPref, lboBusinessNicknames, (intValueSeek)); frameCENickname->ShowModal(); delete frameCENickname; frameCENickname = NULL; } void frmContactEditor::ModifyBusinessNickname( wxCommandEvent& event ) { // Bring up the window for modifying a nickname. long longSelected = -1; int intSelectedData = 0; if (lboBusinessNicknames->GetItemCount() == 0 || !GetSelectedItem(lboBusinessNicknames, &longSelected, &intSelectedData)){ return; } frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this ); frameCENickname->SetupPointers(&ContactEditorData.BusinessNicknamesList, &ContactEditorData.BusinessNicknamesListAltID, &ContactEditorData.BusinessNicknamesListPID, &ContactEditorData.BusinessNicknamesListType, &ContactEditorData.BusinessNicknamesListLanguage, &ContactEditorData.BusinessNicknamesListTokens, &ContactEditorData.BusinessNicknamesListPref, lboBusinessNicknames, intSelectedData); frameCENickname->SetEditorMode(TRUE, CE_WORK); frameCENickname->ShowModal(); delete frameCENickname; frameCENickname = NULL; } void frmContactEditor::DeleteBusinessNickname( wxCommandEvent& event ) { // Bring up the window to delete the nickname. long longSelected = -1; int intSelectedData = 0; if (lboBusinessNicknames->GetItemCount() == 0 || !GetSelectedItem(lboBusinessNicknames, &longSelected, &intSelectedData)){ return; } lboBusinessNicknames->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessNicknamesList, &ContactEditorData.BusinessNicknamesListLanguage, &ContactEditorData.BusinessNicknamesListAltID, &ContactEditorData.BusinessNicknamesListPID, &ContactEditorData.BusinessNicknamesListTokens, &ContactEditorData.BusinessNicknamesListType, &ContactEditorData.BusinessNicknamesListPref); } void frmContactEditor::AddBusinessAddress( wxCommandEvent& event ) { // Bring up the window for adding an address. frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); frameCEAddress->SetEditorMode(FALSE, CE_WORK); frameCEAddress->SetupPointers(&ContactEditorData.BusinessAddressList, &ContactEditorData.BusinessAddressListTown, &ContactEditorData.BusinessAddressListCounty, &ContactEditorData.BusinessAddressListPostCode, &ContactEditorData.BusinessAddressListCountry, &ContactEditorData.BusinessAddressListLabel, &ContactEditorData.BusinessAddressListLang, &ContactEditorData.BusinessAddressListAltID, &ContactEditorData.BusinessAddressListPID, &ContactEditorData.BusinessAddressListTokens, &ContactEditorData.BusinessAddressListGeo, &ContactEditorData.BusinessAddressListTimezone, &ContactEditorData.BusinessAddressListType, &ContactEditorData.BusinessAddressListMediatype, &ContactEditorData.BusinessAddressListPref, lboBusinessAddresses, (intValueSeek)); frameCEAddress->ShowModal(); delete frameCEAddress; frameCEAddress = NULL; } void frmContactEditor::ModifyBusinessAddress( wxCommandEvent& event ) { // Bring up a window for editing an address. long longSelected = -1; int intSelectedData = 0; if (lboBusinessAddresses->GetItemCount() == 0 || !GetSelectedItem(lboBusinessAddresses, &longSelected, &intSelectedData)){ return; } frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this ); frameCEAddress->SetupPointers(&ContactEditorData.BusinessAddressList, &ContactEditorData.BusinessAddressListTown, &ContactEditorData.BusinessAddressListCounty, &ContactEditorData.BusinessAddressListPostCode, &ContactEditorData.BusinessAddressListCountry, &ContactEditorData.BusinessAddressListLabel, &ContactEditorData.BusinessAddressListLang, &ContactEditorData.BusinessAddressListAltID, &ContactEditorData.BusinessAddressListPID, &ContactEditorData.BusinessAddressListTokens, &ContactEditorData.BusinessAddressListGeo, &ContactEditorData.BusinessAddressListTimezone, &ContactEditorData.BusinessAddressListType, &ContactEditorData.BusinessAddressListMediatype, &ContactEditorData.BusinessAddressListPref, lboBusinessAddresses, intSelectedData); frameCEAddress->SetEditorMode(TRUE, CE_WORK); frameCEAddress->ShowModal(); delete frameCEAddress; frameCEAddress = NULL; } void frmContactEditor::DeleteBusinessAddress( wxCommandEvent& event ) { // Bring up the window for deleting the address. long longSelected = -1; int intSelectedData = 0; if (lboBusinessAddresses->GetItemCount() == 0 || !GetSelectedItem(lboBusinessAddresses, &longSelected, &intSelectedData)){ return; } lboBusinessAddresses->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessAddressList, &ContactEditorData.BusinessAddressListTown, &ContactEditorData.BusinessAddressListCounty, &ContactEditorData.BusinessAddressListPostCode, &ContactEditorData.BusinessAddressListCountry, &ContactEditorData.BusinessAddressList, &ContactEditorData.BusinessAddressListLabel, &ContactEditorData.BusinessAddressListLang, &ContactEditorData.BusinessAddressListAltID, &ContactEditorData.BusinessAddressListPID, &ContactEditorData.BusinessAddressListTokens, &ContactEditorData.BusinessAddressListGeo, &ContactEditorData.BusinessAddressListTimezone, &ContactEditorData.BusinessAddressListType, &ContactEditorData.BusinessAddressListMediatype, &ContactEditorData.BusinessAddressListPref); } void frmContactEditor::AddBusinessEmail( wxCommandEvent& event ) { // Bring up the window for adding an email address. frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); frameCEEmail->SetEditorMode(FALSE, CE_WORK); frameCEEmail->SetupPointers(&ContactEditorData.BusinessEmailList, &ContactEditorData.BusinessEmailListAltID, &ContactEditorData.BusinessEmailListPID, &ContactEditorData.BusinessEmailListType, &ContactEditorData.BusinessEmailListTokens, &ContactEditorData.BusinessEmailListPref, lboBusinessEmail, (intValueSeek)); frameCEEmail->ShowModal(); delete frameCEEmail; frameCEEmail = NULL; } void frmContactEditor::ModifyBusinessEmail( wxCommandEvent& event ) { // Bring up the window for modifying the email address. long longSelected = -1; int intSelectedData = 0; if (lboBusinessEmail->GetItemCount() == 0 || !GetSelectedItem(lboBusinessEmail, &longSelected, &intSelectedData)){ return; } frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this ); frameCEEmail->SetupPointers(&ContactEditorData.BusinessEmailList, &ContactEditorData.BusinessEmailListAltID, &ContactEditorData.BusinessEmailListPID, &ContactEditorData.BusinessEmailListType, &ContactEditorData.BusinessEmailListTokens, &ContactEditorData.BusinessEmailListPref, lboBusinessEmail, intSelectedData); frameCEEmail->SetEditorMode(TRUE, CE_WORK); frameCEEmail->ShowModal(); delete frameCEEmail; frameCEEmail = NULL; } void frmContactEditor::DeleteBusinessEmail( wxCommandEvent& event ) { // Bring up the window to delete the email address. long longSelected = -1; int intSelectedData = 0; if (lboBusinessEmail->GetItemCount() == 0 || !GetSelectedItem(lboBusinessEmail, &longSelected, &intSelectedData)){ return; } lboBusinessEmail->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessEmailList, &ContactEditorData.BusinessEmailListAltID, &ContactEditorData.BusinessEmailListPID, &ContactEditorData.BusinessEmailListType, &ContactEditorData.BusinessEmailListTokens, &ContactEditorData.BusinessEmailListPref); } void frmContactEditor::AddBusinessIM( wxCommandEvent& event ) { // Bring up the window for adding an IM address. frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); frameCEIM->SetEditorMode(FALSE, CE_WORK); frameCEIM->SetupPointers(&ContactEditorData.BusinessIMList, &ContactEditorData.BusinessIMListAltID, &ContactEditorData.BusinessIMListPID, &ContactEditorData.BusinessIMListType, &ContactEditorData.BusinessIMListTypeInfo, &ContactEditorData.BusinessIMListTokens, &ContactEditorData.BusinessIMListMediatype, &ContactEditorData.BusinessIMListPref, lboBusinessIM, (intValueSeek)); frameCEIM->ShowModal(); delete frameCEIM; frameCEIM = NULL; } void frmContactEditor::ModifyBusinessIM( wxCommandEvent& event ) { // Bring up the window for editing an IM address. long longSelected = -1; int intSelectedData = 0; if (lboBusinessIM->GetItemCount() == 0 || !GetSelectedItem(lboBusinessIM, &longSelected, &intSelectedData)){ return; } frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this ); frameCEIM->SetupPointers(&ContactEditorData.BusinessIMList, &ContactEditorData.BusinessIMListAltID, &ContactEditorData.BusinessIMListPID, &ContactEditorData.BusinessIMListType, &ContactEditorData.BusinessIMListTypeInfo, &ContactEditorData.BusinessIMListTokens, &ContactEditorData.BusinessIMListMediatype, &ContactEditorData.BusinessIMListPref, lboBusinessIM, intSelectedData); frameCEIM->SetEditorMode(TRUE, CE_WORK); frameCEIM->ShowModal(); delete frameCEIM; frameCEIM = NULL; } void frmContactEditor::DeleteBusinessIM( wxCommandEvent& event ) { // Bring up the window for deleting an IM address. long longSelected = -1; int intSelectedData = 0; if (lboBusinessIM->GetItemCount() == 0 || !GetSelectedItem(lboBusinessIM, &longSelected, &intSelectedData)){ return; } lboBusinessIM->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessIMList, &ContactEditorData.BusinessIMListAltID, &ContactEditorData.BusinessIMListPID, &ContactEditorData.BusinessIMListType, &ContactEditorData.BusinessIMListTypeInfo, &ContactEditorData.BusinessIMListTokens, &ContactEditorData.BusinessIMListMediatype, &ContactEditorData.BusinessIMListPref); } void frmContactEditor::AddBusinessTelephone( wxCommandEvent& event ) { // Bring up the window for adding a telephone number. frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); frameCETel->SetEditorMode(FALSE, CE_WORK); frameCETel->SetupPointers(&ContactEditorData.BusinessTelephoneList, &ContactEditorData.BusinessTelephoneListAltID, &ContactEditorData.BusinessTelephoneListPID, &ContactEditorData.BusinessTelephoneListType, &ContactEditorData.BusinessTelephoneListTypeInfo, &ContactEditorData.BusinessTelephoneListTokens, &ContactEditorData.BusinessTelephoneListPref, lboBusinessTelephone, (intValueSeek)); frameCETel->ShowModal(); delete frameCETel; frameCETel = NULL; } void frmContactEditor::ModifyBusinessTelephone( wxCommandEvent& event ) { // Bring up the address for editing a telephone number. long longSelected = -1; int intSelectedData = 0; if (lboBusinessTelephone->GetItemCount() == 0 || !GetSelectedItem(lboBusinessTelephone, &longSelected, &intSelectedData)){ return; } frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this ); frameCETel->SetupPointers(&ContactEditorData.BusinessTelephoneList, &ContactEditorData.BusinessTelephoneListAltID, &ContactEditorData.BusinessTelephoneListPID, &ContactEditorData.BusinessTelephoneListType, &ContactEditorData.BusinessTelephoneListTypeInfo, &ContactEditorData.BusinessTelephoneListTokens, &ContactEditorData.BusinessTelephoneListPref, lboBusinessTelephone, intSelectedData); frameCETel->SetEditorMode(TRUE, CE_WORK); frameCETel->ShowModal(); delete frameCETel; frameCETel = NULL; } void frmContactEditor::DeleteBusinessTelephone( wxCommandEvent& event ) { // Bring up the window for deleting a telephone number. long longSelected = -1; int intSelectedData = 0; if (lboBusinessTelephone->GetItemCount() == 0 || !GetSelectedItem(lboBusinessTelephone, &longSelected, &intSelectedData)){ return; } lboBusinessTelephone->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessTelephoneList, &ContactEditorData.BusinessTelephoneListAltID, &ContactEditorData.BusinessTelephoneListPID, &ContactEditorData.BusinessTelephoneListType, &ContactEditorData.BusinessTelephoneListTypeInfo, &ContactEditorData.BusinessTelephoneListTokens, &ContactEditorData.BusinessTelephoneListPref); } void frmContactEditor::AddBusinessLanguage( wxCommandEvent& event ) { // Bring up the window for adding a language. frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); frameCELang->SetEditorMode(FALSE, CE_WORK); frameCELang->SetupPointers(&ContactEditorData.BusinessLanguageList, &ContactEditorData.BusinessLanguageListAltID, &ContactEditorData.BusinessLanguageListPID, &ContactEditorData.BusinessLanguageListType, &ContactEditorData.BusinessLanguageListTokens, &ContactEditorData.BusinessLanguageListPref, lboBusinessLanguages, (intValueSeek)); frameCELang->ShowModal(); delete frameCELang; frameCELang = NULL; } void frmContactEditor::ModifyBusinessLanguage( wxCommandEvent& event ) { // Bring up the window for editing a language. long longSelected = -1; int intSelectedData = 0; if (lboBusinessLanguages->GetItemCount() == 0 || !GetSelectedItem(lboBusinessLanguages, &longSelected, &intSelectedData)){ return; } frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this ); frameCELang->SetupPointers(&ContactEditorData.BusinessLanguageList, &ContactEditorData.BusinessLanguageListAltID, &ContactEditorData.BusinessLanguageListPID, &ContactEditorData.BusinessLanguageListType, &ContactEditorData.BusinessLanguageListTokens, &ContactEditorData.BusinessLanguageListPref, lboBusinessLanguages, intSelectedData); frameCELang->SetEditorMode(TRUE, CE_WORK); frameCELang->ShowModal(); delete frameCELang; frameCELang = NULL; } void frmContactEditor::DeleteBusinessLanguage( wxCommandEvent& event ) { // Bring up the window for deleting a language. long longSelected = -1; int intSelectedData = 0; if (lboBusinessLanguages->GetItemCount() == 0 || !GetSelectedItem(lboBusinessLanguages, &longSelected, &intSelectedData)){ return; } lboBusinessLanguages->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessLanguageList, &ContactEditorData.BusinessLanguageListAltID, &ContactEditorData.BusinessLanguageListPID, &ContactEditorData.BusinessLanguageListType, &ContactEditorData.BusinessLanguageListTokens, &ContactEditorData.BusinessLanguageListPref); } void frmContactEditor::AddBusinessTimezone( wxCommandEvent& event ) { // Bring up the window for adding a timezone. frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); frameCETZ->SetEditorMode(FALSE, CE_WORK); frameCETZ->SetupPointers(&ContactEditorData.BusinessTZList, &ContactEditorData.BusinessTZListAltID, &ContactEditorData.BusinessTZListPID, &ContactEditorData.BusinessTZListType, &ContactEditorData.BusinessTZListTokens, &ContactEditorData.BusinessTZListMediatype, &ContactEditorData.BusinessTZListPref, lboBusinessTimezones, (intValueSeek)); frameCETZ->ShowModal(); delete frameCETZ; frameCETZ = NULL; } void frmContactEditor::ModifyBusinessTimezone( wxCommandEvent& event ) { // Bring up the window for modifying a timezone. long longSelected = -1; int intSelectedData = 0; if (lboBusinessTimezones->GetItemCount() == 0 || !GetSelectedItem(lboBusinessTimezones, &longSelected, &intSelectedData)){ return; } frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this ); frameCETZ->SetupPointers(&ContactEditorData.BusinessTZList, &ContactEditorData.BusinessTZListAltID, &ContactEditorData.BusinessTZListPID, &ContactEditorData.BusinessTZListType, &ContactEditorData.BusinessTZListTokens, &ContactEditorData.BusinessTZListMediatype, &ContactEditorData.BusinessTZListPref, lboBusinessTimezones, intSelectedData); frameCETZ->SetEditorMode(TRUE, CE_WORK); frameCETZ->ShowModal(); delete frameCETZ; frameCETZ = NULL; } void frmContactEditor::DeleteBusinessTimezone( wxCommandEvent& event ) { // Bring up the window for deleting a timezone. long longSelected = -1; int intSelectedData = 0; if (lboBusinessTimezones->GetItemCount() == 0 || !GetSelectedItem(lboBusinessTimezones, &longSelected, &intSelectedData)){ return; } lboBusinessTimezones->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessTZList, &ContactEditorData.BusinessTZListAltID, &ContactEditorData.BusinessTZListPID, &ContactEditorData.BusinessTZListType, &ContactEditorData.BusinessTZListTokens, &ContactEditorData.BusinessTZListMediatype, &ContactEditorData.BusinessTZListPref); } void frmContactEditor::AddBusinessGeoposition( wxCommandEvent& event ) { // Bring up the window for adding a geoposition location. frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); frameCEGeo->SetEditorMode(FALSE, CE_WORK); frameCEGeo->SetupPointers(&ContactEditorData.BusinessGeographyList, &ContactEditorData.BusinessGeographyListAltID, &ContactEditorData.BusinessGeographyListPID, &ContactEditorData.BusinessGeographyListType, &ContactEditorData.BusinessGeographyListDataType, &ContactEditorData.BusinessGeographyListTokens, &ContactEditorData.BusinessGeographyListMediatype, &ContactEditorData.BusinessGeographyListPref, lboBusinessGeoposition, (intValueSeek)); frameCEGeo->ShowModal(); delete frameCEGeo; frameCEGeo = NULL; } void frmContactEditor::ModifyBusinessGeoposition( wxCommandEvent& event ) { // Bring up the window for editing a geoposition location. long longSelected = -1; int intSelectedData = 0; if (lboBusinessGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboBusinessGeoposition, &longSelected, &intSelectedData)){ return; } frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this ); frameCEGeo->SetupPointers(&ContactEditorData.BusinessGeographyList, &ContactEditorData.BusinessGeographyListAltID, &ContactEditorData.BusinessGeographyListPID, &ContactEditorData.BusinessGeographyListType, &ContactEditorData.BusinessGeographyListDataType, &ContactEditorData.BusinessGeographyListTokens, &ContactEditorData.BusinessGeographyListMediatype, &ContactEditorData.BusinessGeographyListPref, lboBusinessGeoposition, intSelectedData); frameCEGeo->SetEditorMode(TRUE, CE_WORK); frameCEGeo->ShowModal(); delete frameCEGeo; frameCEGeo = NULL; } void frmContactEditor::DeleteBusinessGeoposition( wxCommandEvent& event ) { // Bring up the window for deleting a geoposition location. long longSelected = -1; int intSelectedData = 0; if (lboBusinessGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboBusinessGeoposition, &longSelected, &intSelectedData)){ return; } lboBusinessGeoposition->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessGeographyList, &ContactEditorData.BusinessGeographyListAltID, &ContactEditorData.BusinessGeographyListPID, &ContactEditorData.BusinessGeographyListType, &ContactEditorData.BusinessGeographyListDataType, &ContactEditorData.BusinessGeographyListTokens, &ContactEditorData.BusinessGeographyListMediatype, &ContactEditorData.BusinessGeographyListPref); } void frmContactEditor::AddBusinessWebsite( wxCommandEvent& event ) { // Bring up the window for adding a website. frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); frameCEWeb->SetEditorMode(FALSE, CE_WORK); frameCEWeb->SetupPointers(&ContactEditorData.BusinessWebsiteList, &ContactEditorData.BusinessWebsiteListAltID, &ContactEditorData.BusinessWebsiteListPID, &ContactEditorData.BusinessWebsiteListType, &ContactEditorData.BusinessWebsiteListTokens, &ContactEditorData.BusinessWebsiteListMediatype, &ContactEditorData.BusinessWebsiteListPref, lboBusinessWebsites, (intValueSeek)); frameCEWeb->ShowModal(); delete frameCEWeb; frameCEWeb = NULL; } void frmContactEditor::ModifyBusinessWebsite( wxCommandEvent& event ) { // Bring up a window for editing a website. long longSelected = -1; int intSelectedData = 0; if (lboBusinessWebsites->GetItemCount() == 0 || !GetSelectedItem(lboBusinessWebsites, &longSelected, &intSelectedData)){ return; } frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this ); frameCEWeb->SetupPointers(&ContactEditorData.BusinessWebsiteList, &ContactEditorData.BusinessWebsiteListAltID, &ContactEditorData.BusinessWebsiteListPID, &ContactEditorData.BusinessWebsiteListType, &ContactEditorData.BusinessWebsiteListTokens, &ContactEditorData.BusinessWebsiteListMediatype, &ContactEditorData.BusinessWebsiteListPref, lboBusinessWebsites, intSelectedData); frameCEWeb->SetEditorMode(TRUE, CE_WORK); frameCEWeb->ShowModal(); delete frameCEWeb; frameCEWeb = NULL; } void frmContactEditor::DeleteBusinessWebsite( wxCommandEvent& event ) { // Bring up the window for deleting a website. long longSelected = -1; int intSelectedData = 0; if (lboBusinessWebsites->GetItemCount() == 0 || !GetSelectedItem(lboBusinessWebsites, &longSelected, &intSelectedData)){ return; } lboBusinessWebsites->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessWebsiteList, &ContactEditorData.BusinessWebsiteListAltID, &ContactEditorData.BusinessWebsiteListPID, &ContactEditorData.BusinessWebsiteListType, &ContactEditorData.BusinessWebsiteListTokens, &ContactEditorData.BusinessWebsiteListMediatype, &ContactEditorData.BusinessWebsiteListPref); } void frmContactEditor::AddBusinessTitle( wxCommandEvent& event ) { // Bring up the window for adding a title. frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); frameCETitle->SetEditorMode(FALSE, CE_WORK); frameCETitle->SetupPointers(&ContactEditorData.BusinessTitleList, &ContactEditorData.BusinessTitleListLanguage, &ContactEditorData.BusinessTitleListAltID, &ContactEditorData.BusinessTitleListPID, &ContactEditorData.BusinessTitleListType, &ContactEditorData.BusinessTitleListTokens, &ContactEditorData.BusinessTitleListPref, lboBusinessTitles, (intValueSeek)); frameCETitle->ShowModal(); delete frameCETitle; frameCETitle = NULL; } void frmContactEditor::ModifyBusinessTitle( wxCommandEvent& event ) { // Bring up the window for editing a title. long longSelected = -1; int intSelectedData = 0; if (lboBusinessTitles->GetItemCount() == 0 || !GetSelectedItem(lboBusinessTitles, &longSelected, &intSelectedData)){ return; } frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this ); frameCETitle->SetupPointers(&ContactEditorData.BusinessTitleList, &ContactEditorData.BusinessTitleListLanguage, &ContactEditorData.BusinessTitleListAltID, &ContactEditorData.BusinessTitleListPID, &ContactEditorData.BusinessTitleListType, &ContactEditorData.BusinessTitleListTokens, &ContactEditorData.BusinessTitleListPref, lboBusinessTitles, intSelectedData); frameCETitle->SetEditorMode(TRUE, CE_WORK); frameCETitle->ShowModal(); delete frameCETitle; frameCETitle = NULL; } void frmContactEditor::DeleteBusinessTitle( wxCommandEvent& event ) { // Bring up the window to delete the title. long longSelected = -1; int intSelectedData = 0; if (lboBusinessTitles->GetItemCount() == 0 || !GetSelectedItem(lboBusinessTitles, &longSelected, &intSelectedData)){ return; } lboBusinessTitles->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessTitleList, &ContactEditorData.BusinessTitleListLanguage, &ContactEditorData.BusinessTitleListAltID, &ContactEditorData.BusinessTitleListPID, &ContactEditorData.BusinessTitleListType, &ContactEditorData.BusinessTitleListTokens, &ContactEditorData.BusinessTitleListPref); } void frmContactEditor::AddBusinessRole( wxCommandEvent& event ) { // Bring up the window to add a role. frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); frameCERole->SetEditorMode(FALSE, CE_WORK); frameCERole->SetupPointers(&ContactEditorData.BusinessRoleList, &ContactEditorData.BusinessRoleListLanguage, &ContactEditorData.BusinessRoleListAltID, &ContactEditorData.BusinessRoleListPID, &ContactEditorData.BusinessRoleListType, &ContactEditorData.BusinessRoleListTokens, &ContactEditorData.BusinessRoleListPref, lboBusinessRoles, (intValueSeek)); frameCERole->ShowModal(); delete frameCERole; frameCERole = NULL; } void frmContactEditor::ModifyBusinessRole( wxCommandEvent& event ) { // Bring up the window for editing a role. long longSelected = -1; int intSelectedData = 0; if (lboBusinessRoles->GetItemCount() == 0 || !GetSelectedItem(lboBusinessRoles, &longSelected, &intSelectedData)){ return; } frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this ); frameCERole->SetupPointers(&ContactEditorData.BusinessRoleList, &ContactEditorData.BusinessRoleListLanguage, &ContactEditorData.BusinessRoleListAltID, &ContactEditorData.BusinessRoleListPID, &ContactEditorData.BusinessRoleListType, &ContactEditorData.BusinessRoleListTokens, &ContactEditorData.BusinessRoleListPref, lboBusinessRoles, intSelectedData); frameCERole->SetEditorMode(TRUE, CE_WORK); frameCERole->ShowModal(); delete frameCERole; frameCERole = NULL; } void frmContactEditor::DeleteBusinessRole( wxCommandEvent& event ) { // Bring up the window to delete a role. long longSelected = -1; int intSelectedData = 0; if (lboBusinessRoles->GetItemCount() == 0 || !GetSelectedItem(lboBusinessRoles, &longSelected, &intSelectedData)){ return; } lboBusinessRoles->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessRoleList, &ContactEditorData.BusinessRoleListLanguage, &ContactEditorData.BusinessRoleListAltID, &ContactEditorData.BusinessRoleListPID, &ContactEditorData.BusinessRoleListType, &ContactEditorData.BusinessRoleListTokens, &ContactEditorData.BusinessRoleListPref); } void frmContactEditor::AddBusinessOrganisation( wxCommandEvent& event ) { // Bring up the window to add an organisation. frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); frameCEOrg->SetEditorMode(FALSE, CE_WORK); frameCEOrg->SetupPointers(&ContactEditorData.BusinessOrganisationsList, &ContactEditorData.BusinessOrganisationsListLanguage, &ContactEditorData.BusinessOrganisationsListSortAs, &ContactEditorData.BusinessOrganisationsListAltID, &ContactEditorData.BusinessOrganisationsListPID, &ContactEditorData.BusinessOrganisationsListType, &ContactEditorData.BusinessOrganisationsListTokens, &ContactEditorData.BusinessOrganisationsListPref, lboBusinessOrganisations, (intValueSeek)); frameCEOrg->ShowModal(); delete frameCEOrg; frameCEOrg = NULL; } void frmContactEditor::ModifyBusinessOrganisation( wxCommandEvent& event ) { // Bring up the window to edit an organisation. long longSelected = -1; int intSelectedData = 0; if (lboBusinessOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboBusinessOrganisations, &longSelected, &intSelectedData)){ return; } frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this ); frameCEOrg->SetupPointers(&ContactEditorData.BusinessOrganisationsList, &ContactEditorData.BusinessOrganisationsListLanguage, &ContactEditorData.BusinessOrganisationsListSortAs, &ContactEditorData.BusinessOrganisationsListAltID, &ContactEditorData.BusinessOrganisationsListPID, &ContactEditorData.BusinessOrganisationsListType, &ContactEditorData.BusinessOrganisationsListTokens, &ContactEditorData.BusinessOrganisationsListPref, lboBusinessOrganisations, intSelectedData); frameCEOrg->SetEditorMode(TRUE, CE_WORK); frameCEOrg->ShowModal(); delete frameCEOrg; frameCEOrg = NULL; } void frmContactEditor::DeleteBusinessOrganisation( wxCommandEvent& event ) { // Bring up the window to delete a organisation. long longSelected = -1; int intSelectedData = 0; if (lboBusinessOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboBusinessOrganisations, &longSelected, &intSelectedData)){ return; } lboBusinessOrganisations->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessOrganisationsList, &ContactEditorData.BusinessOrganisationsListLanguage, &ContactEditorData.BusinessOrganisationsListSortAs, &ContactEditorData.BusinessOrganisationsListAltID, &ContactEditorData.BusinessOrganisationsListPID, &ContactEditorData.BusinessOrganisationsListType, &ContactEditorData.BusinessOrganisationsListTokens, &ContactEditorData.BusinessOrganisationsListPref); } void frmContactEditor::AddBusinessNote( wxCommandEvent& event ) { // Bring up the window to add a note. frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); frameCENote->SetEditorMode(FALSE, CE_WORK); frameCENote->SetupPointers(&ContactEditorData.BusinessNoteList, &ContactEditorData.BusinessNoteListLanguage, &ContactEditorData.BusinessNoteListAltID, &ContactEditorData.BusinessNoteListPID, &ContactEditorData.BusinessNoteListType, &ContactEditorData.BusinessNoteListTokens, &ContactEditorData.BusinessNoteListPref, lboBusinessNotes, (intValueSeek)); frameCENote->ShowModal(); delete frameCENote; frameCENote = NULL; } void frmContactEditor::ModifyBusinessNote( wxCommandEvent& event ) { // Bring up the window to edit a note. long longSelected = -1; int intSelectedData = 0; if (lboBusinessNotes->GetItemCount() == 0 || !GetSelectedItem(lboBusinessNotes, &longSelected, &intSelectedData)){ return; } frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this ); frameCENote->SetupPointers(&ContactEditorData.BusinessNoteList, &ContactEditorData.BusinessNoteListLanguage, &ContactEditorData.BusinessNoteListAltID, &ContactEditorData.BusinessNoteListPID, &ContactEditorData.BusinessNoteListType, &ContactEditorData.BusinessNoteListTokens, &ContactEditorData.BusinessNoteListPref, lboBusinessNotes, intSelectedData); frameCENote->SetEditorMode(TRUE, CE_WORK); frameCENote->ShowModal(); delete frameCENote; frameCENote = NULL; } void frmContactEditor::DeleteBusinessNote( wxCommandEvent& event ) { // Bring up the window to delete a note. long longSelected = -1; int intSelectedData = 0; if (lboBusinessNotes->GetItemCount() == 0 || !GetSelectedItem(lboBusinessNotes, &longSelected, &intSelectedData)){ return; } lboBusinessNotes->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.BusinessNoteList, &ContactEditorData.BusinessNoteListLanguage, &ContactEditorData.BusinessNoteListAltID, &ContactEditorData.BusinessNoteListPID, &ContactEditorData.BusinessNoteListType, &ContactEditorData.BusinessNoteListTokens, &ContactEditorData.BusinessNoteListPref); }