1 // frmContactEditor-General.cpp - frmContactEditor General tab subroutines.
3 // (c) 2012-2016 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "frmContactEditor.h"
20 #include "frmContactEditorNickname.h"
21 #include "frmContactEditorAddress.h"
22 #include "frmContactEditorEmail.h"
23 #include "frmContactEditorIM.h"
24 #include "frmContactEditorTelephone.h"
25 #include "frmContactEditorLanguages.h"
26 #include "frmContactEditorTimezones.h"
27 #include "frmContactEditorRelated.h"
28 #include "frmContactEditorWebsites.h"
29 #include "frmContactEditorTitles.h"
30 #include "frmContactEditorRoles.h"
31 #include "frmContactEditorGeoposition.h"
32 #include "frmContactEditorGroups.h"
33 #include "frmContactEditorOrganisations.h"
34 #include "frmContactEditorNotes.h"
36 void frmContactEditor::AddGeneralNickname( wxCommandEvent& event )
39 // Bring up the window for adding a nickname.
41 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
42 frameCENickname->SetEditorMode(FALSE, CE_GENERAL);
43 frameCENickname->SetupPointers(&ContactEditorData.GeneralNicknamesList,
44 &ContactEditorData.GeneralNicknamesListAltID,
45 &ContactEditorData.GeneralNicknamesListPID,
46 &ContactEditorData.GeneralNicknamesListType,
47 &ContactEditorData.GeneralNicknamesListLanguage,
48 &ContactEditorData.GeneralNicknamesListTokens,
49 &ContactEditorData.GeneralNicknamesListPref,
52 frameCENickname->ShowModal();
53 delete frameCENickname;
54 frameCENickname = NULL;
59 void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event )
62 // Bring up the window for modifying a nickname.
64 long longSelected = -1;
65 int intSelectedData = 0;
67 if (lboNicknames->GetItemCount() == 0 || !GetSelectedItem(lboNicknames,
73 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
74 frameCENickname->SetupPointers(&ContactEditorData.GeneralNicknamesList,
75 &ContactEditorData.GeneralNicknamesListAltID,
76 &ContactEditorData.GeneralNicknamesListPID,
77 &ContactEditorData.GeneralNicknamesListType,
78 &ContactEditorData.GeneralNicknamesListLanguage,
79 &ContactEditorData.GeneralNicknamesListTokens,
80 &ContactEditorData.GeneralNicknamesListPref,
83 frameCENickname->SetEditorMode(TRUE, CE_GENERAL);
84 frameCENickname->ShowModal();
85 delete frameCENickname;
86 frameCENickname = NULL;
90 void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event )
93 // Bring up the window for deleting a nickname.
95 long longSelected = -1;
96 int intSelectedData = 0;
98 if (lboNicknames->GetItemCount() == 0 || !GetSelectedItem(lboNicknames,
104 lboNicknames->DeleteItem(longSelected);
106 DeleteMapData(intSelectedData,
107 &ContactEditorData.GeneralNicknamesList,
108 &ContactEditorData.GeneralNicknamesListLanguage,
109 &ContactEditorData.GeneralNicknamesListAltID,
110 &ContactEditorData.GeneralNicknamesListPID,
111 &ContactEditorData.GeneralNicknamesListTokens,
112 &ContactEditorData.GeneralNicknamesListType,
113 &ContactEditorData.GeneralNicknamesListPref);
117 void frmContactEditor::AddGeneralAddress( wxCommandEvent& event )
120 // Bring up the window for adding an address.
122 frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
123 frameCEAddress->SetEditorMode(FALSE, CE_GENERAL);
124 frameCEAddress->SetupPointers(&ContactEditorData.GeneralAddressList,
125 &ContactEditorData.GeneralAddressListTown,
126 &ContactEditorData.GeneralAddressListCounty,
127 &ContactEditorData.GeneralAddressListPostCode,
128 &ContactEditorData.GeneralAddressListCountry,
129 &ContactEditorData.GeneralAddressListLabel,
130 &ContactEditorData.GeneralAddressListLang,
131 &ContactEditorData.GeneralAddressListAltID,
132 &ContactEditorData.GeneralAddressListPID,
133 &ContactEditorData.GeneralAddressListTokens,
134 &ContactEditorData.GeneralAddressListGeo,
135 &ContactEditorData.GeneralAddressListTimezone,
136 &ContactEditorData.GeneralAddressListType,
137 &ContactEditorData.GeneralAddressListMediatype,
138 &ContactEditorData.GeneralAddressListPref,
141 frameCEAddress->ShowModal();
142 delete frameCEAddress;
143 frameCEAddress = NULL;
148 void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event )
151 // Bring up the window for editing an address.
153 long longSelected = -1;
154 int intSelectedData = 0;
156 if (lboAddresses->GetItemCount() == 0 || !GetSelectedItem(lboAddresses,
164 if (longSelected == -1){
170 frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
171 frameCEAddress->SetupPointers(&ContactEditorData.GeneralAddressList,
172 &ContactEditorData.GeneralAddressListTown,
173 &ContactEditorData.GeneralAddressListCounty,
174 &ContactEditorData.GeneralAddressListPostCode,
175 &ContactEditorData.GeneralAddressListCountry,
176 &ContactEditorData.GeneralAddressListLabel,
177 &ContactEditorData.GeneralAddressListLang,
178 &ContactEditorData.GeneralAddressListAltID,
179 &ContactEditorData.GeneralAddressListPID,
180 &ContactEditorData.GeneralAddressListTokens,
181 &ContactEditorData.GeneralAddressListGeo,
182 &ContactEditorData.GeneralAddressListTimezone,
183 &ContactEditorData.GeneralAddressListType,
184 &ContactEditorData.GeneralAddressListMediatype,
185 &ContactEditorData.GeneralAddressListPref,
188 frameCEAddress->SetEditorMode(TRUE, CE_GENERAL);
189 frameCEAddress->ShowModal();
190 delete frameCEAddress;
191 frameCEAddress = NULL;
195 void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event )
198 // Bring up the window for deleting a nickname.
200 long longSelected = -1;
201 int intSelectedData = 0;
203 if (lboAddresses->GetItemCount() == 0 || !GetSelectedItem(lboAddresses,
211 lboAddresses->DeleteItem(longSelected);
213 DeleteMapData(intSelectedData, &ContactEditorData.GeneralAddressList,
214 &ContactEditorData.GeneralAddressListTown, &ContactEditorData.GeneralAddressListCounty,
215 &ContactEditorData.GeneralAddressListPostCode, &ContactEditorData.GeneralAddressListCountry,
216 &ContactEditorData.GeneralAddressList, &ContactEditorData.GeneralAddressListLabel,
217 &ContactEditorData.GeneralAddressListLang, &ContactEditorData.GeneralAddressListAltID,
218 &ContactEditorData.GeneralAddressListPID, &ContactEditorData.GeneralAddressListTokens,
219 &ContactEditorData.GeneralAddressListGeo, &ContactEditorData.GeneralAddressListTimezone,
220 &ContactEditorData.GeneralAddressListType, &ContactEditorData.GeneralAddressListMediatype,
221 &ContactEditorData.GeneralAddressListPref);
225 void frmContactEditor::AddGeneralEmail( wxCommandEvent& event )
228 // Bring up the window for adding an email.
230 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
231 frameCEEmail->SetEditorMode(FALSE, CE_GENERAL);
232 frameCEEmail->SetupPointers(&ContactEditorData.GeneralEmailList,
233 &ContactEditorData.GeneralEmailListAltID,
234 &ContactEditorData.GeneralEmailListPID,
235 &ContactEditorData.GeneralEmailListType,
236 &ContactEditorData.GeneralEmailListTokens,
237 &ContactEditorData.GeneralEmailListPref,
240 frameCEEmail->ShowModal();
247 void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event )
250 // Bring up the window for modifying an email.
252 long longSelected = -1;
253 int intSelectedData = 0;
255 if (lboEmails->GetItemCount() == 0 || !GetSelectedItem(lboEmails,
263 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
264 frameCEEmail->SetupPointers(&ContactEditorData.GeneralEmailList,
265 &ContactEditorData.GeneralEmailListAltID,
266 &ContactEditorData.GeneralEmailListPID,
267 &ContactEditorData.GeneralEmailListType,
268 &ContactEditorData.GeneralEmailListTokens,
269 &ContactEditorData.GeneralEmailListPref,
272 frameCEEmail->SetEditorMode(TRUE, CE_GENERAL);
273 frameCEEmail->ShowModal();
279 void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event )
282 // Bring up the window for deleting an email.
284 long longSelected = -1;
285 int intSelectedData = 0;
287 if (lboEmails->GetItemCount() == 0 || !GetSelectedItem(lboEmails,
295 lboEmails->DeleteItem(longSelected);
297 DeleteMapData(intSelectedData, &ContactEditorData.GeneralEmailList,
298 &ContactEditorData.GeneralEmailListAltID, &ContactEditorData.GeneralEmailListPID,
299 &ContactEditorData.GeneralEmailListType, &ContactEditorData.GeneralEmailListTokens,
300 &ContactEditorData.GeneralEmailListPref);
304 void frmContactEditor::AddGeneralIM( wxCommandEvent& event )
307 // Bring up the window for adding a IM address.
309 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
310 frameCEIM->SetEditorMode(FALSE, CE_GENERAL);
311 frameCEIM->SetupPointers(&ContactEditorData.GeneralIMList,
312 &ContactEditorData.GeneralIMListAltID,
313 &ContactEditorData.GeneralIMListPID,
314 &ContactEditorData.GeneralIMListType,
315 &ContactEditorData.GeneralIMListTypeInfo,
316 &ContactEditorData.GeneralIMListTokens,
317 &ContactEditorData.GeneralIMListMediatype,
318 &ContactEditorData.GeneralIMListPref,
321 frameCEIM->ShowModal();
328 void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event )
331 // Bring up the window for editing a IM address.
333 long longSelected = -1;
334 int intSelectedData = 0;
336 if (lboIM->GetItemCount() == 0 || !GetSelectedItem(lboIM,
344 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
345 frameCEIM->SetupPointers(&ContactEditorData.GeneralIMList,
346 &ContactEditorData.GeneralIMListAltID,
347 &ContactEditorData.GeneralIMListPID,
348 &ContactEditorData.GeneralIMListType,
349 &ContactEditorData.GeneralIMListTypeInfo,
350 &ContactEditorData.GeneralIMListTokens,
351 &ContactEditorData.GeneralIMListMediatype,
352 &ContactEditorData.GeneralIMListPref,
355 frameCEIM->SetEditorMode(TRUE, CE_GENERAL);
356 frameCEIM->ShowModal();
362 void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event )
365 // Bring up the window for deleting an IM address.
367 long longSelected = -1;
368 int intSelectedData = 0;
370 if (lboIM->GetItemCount() == 0 || !GetSelectedItem(lboIM,
377 lboIM->DeleteItem(longSelected);
379 DeleteMapData(intSelectedData, &ContactEditorData.GeneralIMList,
380 &ContactEditorData.GeneralIMListAltID, &ContactEditorData.GeneralIMListPID,
381 &ContactEditorData.GeneralIMListType, &ContactEditorData.GeneralIMListTypeInfo,
382 &ContactEditorData.GeneralIMListTokens, &ContactEditorData.GeneralIMListMediatype,
383 &ContactEditorData.GeneralIMListPref);
387 void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event )
390 // Bring up the window for adding a telephone.
392 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
393 frameCETel->SetEditorMode(FALSE, CE_GENERAL);
394 frameCETel->SetupPointers(&ContactEditorData.GeneralTelephoneList,
395 &ContactEditorData.GeneralTelephoneListAltID,
396 &ContactEditorData.GeneralTelephoneListPID,
397 &ContactEditorData.GeneralTelephoneListType,
398 &ContactEditorData.GeneralTelephoneListTypeInfo,
399 &ContactEditorData.GeneralTelephoneListTokens,
400 &ContactEditorData.GeneralTelephoneListPref,
403 frameCETel->ShowModal();
410 void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event )
413 // Bring up the window for editing a telephone.
415 long longSelected = -1;
416 int intSelectedData = 0;
418 if (lboTelephone->GetItemCount() == 0 || !GetSelectedItem(lboTelephone,
426 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
427 frameCETel->SetupPointers(&ContactEditorData.GeneralTelephoneList,
428 &ContactEditorData.GeneralTelephoneListAltID,
429 &ContactEditorData.GeneralTelephoneListPID,
430 &ContactEditorData.GeneralTelephoneListType,
431 &ContactEditorData.GeneralTelephoneListTypeInfo,
432 &ContactEditorData.GeneralTelephoneListTokens,
433 &ContactEditorData.GeneralTelephoneListPref,
436 frameCETel->SetEditorMode(TRUE, CE_GENERAL);
437 frameCETel->ShowModal();
443 void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event )
446 // Bring up the window for deleting a telephone.
448 long longSelected = -1;
449 int intSelectedData = 0;
451 if (lboTelephone->GetItemCount() == 0 || !GetSelectedItem(lboTelephone,
459 lboTelephone->DeleteItem(longSelected);
461 DeleteMapData(intSelectedData, &ContactEditorData.GeneralTelephoneList,
462 &ContactEditorData.GeneralTelephoneListAltID, &ContactEditorData.GeneralTelephoneListPID,
463 &ContactEditorData.GeneralTelephoneListType, &ContactEditorData.GeneralTelephoneListTypeInfo,
464 &ContactEditorData.GeneralTelephoneListTokens, &ContactEditorData.GeneralTelephoneListPref);
468 void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event )
471 // Bring up the window for adding a language.
473 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
474 frameCELang->SetEditorMode(FALSE, CE_GENERAL);
475 frameCELang->SetupPointers(&ContactEditorData.GeneralLanguageList,
476 &ContactEditorData.GeneralLanguageListAltID,
477 &ContactEditorData.GeneralLanguageListPID,
478 &ContactEditorData.GeneralLanguageListType,
479 &ContactEditorData.GeneralLanguageListTokens,
480 &ContactEditorData.GeneralLanguageListPref,
483 frameCELang->ShowModal();
490 void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event )
493 // Bring up the window for modifying a language.
495 long longSelected = -1;
496 int intSelectedData = 0;
498 if (lboLanguages->GetItemCount() == 0 || !GetSelectedItem(lboLanguages,
506 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
507 frameCELang->SetupPointers(&ContactEditorData.GeneralLanguageList,
508 &ContactEditorData.GeneralLanguageListAltID,
509 &ContactEditorData.GeneralLanguageListPID,
510 &ContactEditorData.GeneralLanguageListType,
511 &ContactEditorData.GeneralLanguageListTokens,
512 &ContactEditorData.GeneralLanguageListPref,
515 frameCELang->SetEditorMode(TRUE, CE_GENERAL);
516 frameCELang->ShowModal();
522 void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event )
525 // Bring up the window for deleting a language.
527 long longSelected = -1;
528 int intSelectedData = 0;
530 if (lboLanguages->GetItemCount() == 0 || !GetSelectedItem(lboLanguages,
537 lboLanguages->DeleteItem(longSelected);
539 DeleteMapData(intSelectedData, &ContactEditorData.GeneralLanguageList,
540 &ContactEditorData.GeneralLanguageListAltID, &ContactEditorData.GeneralLanguageListPID,
541 &ContactEditorData.GeneralLanguageListType, &ContactEditorData.GeneralLanguageListTokens,
542 &ContactEditorData.GeneralLanguageListPref);
546 void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event )
549 // Bring up the window for adding a timezone.
551 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
552 frameCETZ->SetEditorMode(FALSE, CE_GENERAL);
553 frameCETZ->SetupPointers(&ContactEditorData.GeneralTZList,
554 &ContactEditorData.GeneralTZListAltID,
555 &ContactEditorData.GeneralTZListPID,
556 &ContactEditorData.GeneralTZListType,
557 &ContactEditorData.GeneralTZListTokens,
558 &ContactEditorData.GeneralTZListMediatype,
559 &ContactEditorData.GeneralTZListPref,
562 frameCETZ->ShowModal();
569 void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event )
572 // Bring up a window for editing a timezone.
574 long longSelected = -1;
575 int intSelectedData = 0;
577 if (lboTimezones->GetItemCount() == 0 || !GetSelectedItem(lboTimezones,
584 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
585 frameCETZ->SetupPointers(&ContactEditorData.GeneralTZList,
586 &ContactEditorData.GeneralTZListAltID,
587 &ContactEditorData.GeneralTZListPID,
588 &ContactEditorData.GeneralTZListType,
589 &ContactEditorData.GeneralTZListTokens,
590 &ContactEditorData.GeneralTZListMediatype,
591 &ContactEditorData.GeneralTZListPref,
594 frameCETZ->SetEditorMode(TRUE, CE_GENERAL);
595 frameCETZ->ShowModal();
601 void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event )
604 // Bring up the window for deleting a timezone.
606 long longSelected = -1;
607 int intSelectedData = 0;
609 if (lboTimezones->GetItemCount() == 0 || !GetSelectedItem(lboTimezones,
617 lboTimezones->DeleteItem(longSelected);
619 DeleteMapData(intSelectedData, &ContactEditorData.GeneralTZList,
620 &ContactEditorData.GeneralTZListAltID, &ContactEditorData.GeneralTZListPID,
621 &ContactEditorData.GeneralTZListType, &ContactEditorData.GeneralTZListTokens,
622 &ContactEditorData.GeneralTZListMediatype, &ContactEditorData.GeneralTZListPref);
626 void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event )
629 // Bring up the window for adding a geoposition location.
631 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
632 frameCEGeo->SetEditorMode(FALSE, CE_GENERAL);
633 frameCEGeo->SetupPointers(&ContactEditorData.GeneralGeographyList,
634 &ContactEditorData.GeneralGeographyListAltID,
635 &ContactEditorData.GeneralGeographyListPID,
636 &ContactEditorData.GeneralGeographyListType,
637 &ContactEditorData.GeneralGeographyListDataType,
638 &ContactEditorData.GeneralGeographyListTokens,
639 &ContactEditorData.GeneralGeographyListMediatype,
640 &ContactEditorData.GeneralGeographyListPref,
643 frameCEGeo->ShowModal();
650 void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event )
653 // Bring up the window for editing a geoposition location.
655 long longSelected = -1;
656 int intSelectedData = 0;
658 if (lboGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboGeoposition,
666 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
667 frameCEGeo->SetupPointers(&ContactEditorData.GeneralGeographyList,
668 &ContactEditorData.GeneralGeographyListAltID,
669 &ContactEditorData.GeneralGeographyListPID,
670 &ContactEditorData.GeneralGeographyListType,
671 &ContactEditorData.GeneralGeographyListDataType,
672 &ContactEditorData.GeneralGeographyListTokens,
673 &ContactEditorData.GeneralGeographyListMediatype,
674 &ContactEditorData.GeneralGeographyListPref,
678 frameCEGeo->SetEditorMode(TRUE, CE_GENERAL);
679 frameCEGeo->ShowModal();
685 void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event )
688 // Bring up the window for deleting a geoposition location.
690 long longSelected = -1;
691 int intSelectedData = 0;
693 if (lboGeoposition->GetItemCount() == 0 || !GetSelectedItem(lboGeoposition,
701 lboGeoposition->DeleteItem(longSelected);
703 DeleteMapData(intSelectedData, &ContactEditorData.GeneralGeographyList,
704 &ContactEditorData.GeneralGeographyListAltID, &ContactEditorData.GeneralGeographyListPID,
705 &ContactEditorData.GeneralGeographyListType, &ContactEditorData.GeneralGeographyListDataType,
706 &ContactEditorData.GeneralGeographyListTokens, &ContactEditorData.GeneralGeographyListMediatype,
707 &ContactEditorData.GeneralGeographyListPref);
711 void frmContactEditor::AddGeneralRelated( wxCommandEvent& event )
714 // Bring up the window for adding a relation.
716 frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
717 frameCERel->SetEditorMode(FALSE, CE_GENERAL);
718 frameCERel->SetupPointers(&ContactEditorData.GeneralRelatedList,
719 &ContactEditorData.GeneralRelatedListRelType,
720 &ContactEditorData.GeneralRelatedListAltID,
721 &ContactEditorData.GeneralRelatedListPID,
722 &ContactEditorData.GeneralRelatedListType,
723 &ContactEditorData.GeneralRelatedListTokens,
724 &ContactEditorData.GeneralRelatedListPref,
727 frameCERel->ShowModal();
734 void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event )
737 // Bring up the window for editing a relation.
739 long longSelected = -1;
740 int intSelectedData = 0;
742 if (lboRelated->GetItemCount() == 0 || !GetSelectedItem(lboRelated,
750 frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
751 frameCERel->SetupPointers(&ContactEditorData.GeneralRelatedList,
752 &ContactEditorData.GeneralRelatedListRelType,
753 &ContactEditorData.GeneralRelatedListAltID,
754 &ContactEditorData.GeneralRelatedListPID,
755 &ContactEditorData.GeneralRelatedListType,
756 &ContactEditorData.GeneralRelatedListTokens,
757 &ContactEditorData.GeneralRelatedListPref,
760 frameCERel->SetEditorMode(TRUE, CE_GENERAL);
761 frameCERel->ShowModal();
767 void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event )
770 // Bring up a window for deleting a relation.
772 long longSelected = -1;
773 int intSelectedData = 0;
775 if (lboRelated->GetItemCount() == 0 || !GetSelectedItem(lboRelated,
783 lboRelated->DeleteItem(longSelected);
785 DeleteMapData(intSelectedData, &ContactEditorData.GeneralRelatedList,
786 &ContactEditorData.GeneralRelatedListRelType, &ContactEditorData.GeneralRelatedListAltID,
787 &ContactEditorData.GeneralRelatedListPID, &ContactEditorData.GeneralRelatedListType,
788 &ContactEditorData.GeneralRelatedListTokens, &ContactEditorData.GeneralRelatedListPref);
792 void frmContactEditor::AddGeneralWebsite( wxCommandEvent& event )
795 // Bring up a window for adding a website.
797 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
798 frameCEWeb->SetEditorMode(FALSE, CE_GENERAL);
799 frameCEWeb->SetupPointers(&ContactEditorData.GeneralWebsiteList,
800 &ContactEditorData.GeneralWebsiteListAltID,
801 &ContactEditorData.GeneralWebsiteListPID,
802 &ContactEditorData.GeneralWebsiteListType,
803 &ContactEditorData.GeneralWebsiteListTokens,
804 &ContactEditorData.GeneralWebsiteListMediatype,
805 &ContactEditorData.GeneralWebsiteListPref,
808 frameCEWeb->ShowModal();
815 void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event )
818 // Bring up a window for editing a website.
820 long longSelected = -1;
821 int intSelectedData = 0;
823 if (lboWebsites->GetItemCount() == 0 || !GetSelectedItem(lboWebsites,
831 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
832 frameCEWeb->SetupPointers(&ContactEditorData.GeneralWebsiteList,
833 &ContactEditorData.GeneralWebsiteListAltID,
834 &ContactEditorData.GeneralWebsiteListPID,
835 &ContactEditorData.GeneralWebsiteListType,
836 &ContactEditorData.GeneralWebsiteListTokens,
837 &ContactEditorData.GeneralWebsiteListMediatype,
838 &ContactEditorData.GeneralWebsiteListPref,
841 frameCEWeb->SetEditorMode(TRUE, CE_GENERAL);
842 frameCEWeb->ShowModal();
848 void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event )
851 // Bring up a window for deleting a website.
853 long longSelected = -1;
854 int intSelectedData = 0;
856 if (lboWebsites->GetItemCount() == 0 || !GetSelectedItem(lboWebsites,
864 lboWebsites->DeleteItem(longSelected);
866 DeleteMapData(intSelectedData, &ContactEditorData.GeneralWebsiteList,
867 &ContactEditorData.GeneralWebsiteListAltID, &ContactEditorData.GeneralWebsiteListPID,
868 &ContactEditorData.GeneralWebsiteListType, &ContactEditorData.GeneralWebsiteListTokens,
869 &ContactEditorData.GeneralWebsiteListMediatype, &ContactEditorData.GeneralWebsiteListPref);
873 void frmContactEditor::AddGeneralTitle( wxCommandEvent& event )
876 // Bring up the window for adding a title.
878 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
879 frameCETitle->SetEditorMode(FALSE, CE_GENERAL);
880 frameCETitle->SetupPointers(&ContactEditorData.GeneralTitleList,
881 &ContactEditorData.GeneralTitleListLanguage,
882 &ContactEditorData.GeneralTitleListAltID,
883 &ContactEditorData.GeneralTitleListPID,
884 &ContactEditorData.GeneralTitleListType,
885 &ContactEditorData.GeneralTitleListTokens,
886 &ContactEditorData.GeneralTitleListPref,
889 frameCETitle->ShowModal();
896 void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event )
899 // Bring up the window for editing a title.
901 long longSelected = -1;
902 int intSelectedData = 0;
904 if (lboTitles->GetItemCount() == 0 || !GetSelectedItem(lboTitles,
912 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
913 frameCETitle->SetupPointers(&ContactEditorData.GeneralTitleList,
914 &ContactEditorData.GeneralTitleListLanguage,
915 &ContactEditorData.GeneralTitleListAltID,
916 &ContactEditorData.GeneralTitleListPID,
917 &ContactEditorData.GeneralTitleListType,
918 &ContactEditorData.GeneralTitleListTokens,
919 &ContactEditorData.GeneralTitleListPref,
922 frameCETitle->SetEditorMode(TRUE, CE_GENERAL);
923 frameCETitle->ShowModal();
929 void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event )
932 // Bring up the window for deleting a title.
934 long longSelected = -1;
935 int intSelectedData = 0;
937 if (lboTitles->GetItemCount() == 0 || !GetSelectedItem(lboTitles,
945 lboTitles->DeleteItem(longSelected);
947 DeleteMapData(intSelectedData, &ContactEditorData.GeneralTitleList,
948 &ContactEditorData.GeneralTitleListLanguage, &ContactEditorData.GeneralTitleListAltID,
949 &ContactEditorData.GeneralTitleListPID, &ContactEditorData.GeneralTitleListType,
950 &ContactEditorData.GeneralTitleListTokens, &ContactEditorData.GeneralTitleListPref);
954 void frmContactEditor::AddGeneralRole( wxCommandEvent& event )
957 // Bring up the window for adding a role.
959 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
960 frameCERole->SetEditorMode(FALSE, CE_GENERAL);
961 frameCERole->SetupPointers(&ContactEditorData.GeneralRoleList,
962 &ContactEditorData.GeneralRoleListLanguage,
963 &ContactEditorData.GeneralRoleListAltID,
964 &ContactEditorData.GeneralRoleListPID,
965 &ContactEditorData.GeneralRoleListType,
966 &ContactEditorData.GeneralRoleListTokens,
967 &ContactEditorData.GeneralRoleListPref,
970 frameCERole->ShowModal();
977 void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event )
980 // Bring up the window for editing a role.
982 long longSelected = -1;
983 int intSelectedData = 0;
985 if (lboRoles->GetItemCount() == 0 || !GetSelectedItem(lboRoles,
993 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
994 frameCERole->SetupPointers(&ContactEditorData.GeneralRoleList,
995 &ContactEditorData.GeneralRoleListLanguage,
996 &ContactEditorData.GeneralRoleListAltID,
997 &ContactEditorData.GeneralRoleListPID,
998 &ContactEditorData.GeneralRoleListType,
999 &ContactEditorData.GeneralRoleListTokens,
1000 &ContactEditorData.GeneralRoleListPref,
1003 frameCERole->SetEditorMode(TRUE, CE_GENERAL);
1004 frameCERole->ShowModal();
1010 void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event )
1013 // Bring up the window for deleting a role.
1015 long longSelected = -1;
1016 int intSelectedData = 0;
1018 if (lboRoles->GetItemCount() == 0 || !GetSelectedItem(lboRoles,
1026 lboRoles->DeleteItem(longSelected);
1028 DeleteMapData(intSelectedData, &ContactEditorData.GeneralRoleList,
1029 &ContactEditorData.GeneralRoleListLanguage, &ContactEditorData.GeneralRoleListAltID,
1030 &ContactEditorData.GeneralRoleListPID, &ContactEditorData.GeneralRoleListType,
1031 &ContactEditorData.GeneralRoleListTokens, &ContactEditorData.GeneralRoleListPref);
1035 void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event )
1038 // Bring up the window for adding an organisation.
1040 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1041 frameCEOrg->SetEditorMode(FALSE, CE_GENERAL);
1042 frameCEOrg->SetupPointers(&ContactEditorData.GeneralOrganisationsList,
1043 &ContactEditorData.GeneralOrganisationsListLanguage,
1044 &ContactEditorData.GeneralOrganisationsListSortAs,
1045 &ContactEditorData.GeneralOrganisationsListAltID,
1046 &ContactEditorData.GeneralOrganisationsListPID,
1047 &ContactEditorData.GeneralOrganisationsListType,
1048 &ContactEditorData.GeneralOrganisationsListTokens,
1049 &ContactEditorData.GeneralOrganisationsListPref,
1052 frameCEOrg->ShowModal();
1059 void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event )
1062 // Bring up the window for editing an organisation.
1064 long longSelected = -1;
1065 int intSelectedData = 0;
1067 if (lboOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboOrganisations,
1075 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1076 frameCEOrg->SetupPointers(&ContactEditorData.GeneralOrganisationsList,
1077 &ContactEditorData.GeneralOrganisationsListLanguage,
1078 &ContactEditorData.GeneralOrganisationsListSortAs,
1079 &ContactEditorData.GeneralOrganisationsListAltID,
1080 &ContactEditorData.GeneralOrganisationsListPID,
1081 &ContactEditorData.GeneralOrganisationsListType,
1082 &ContactEditorData.GeneralOrganisationsListTokens,
1083 &ContactEditorData.GeneralOrganisationsListPref,
1086 frameCEOrg->SetEditorMode(TRUE, CE_GENERAL);
1087 frameCEOrg->ShowModal();
1093 void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event )
1096 // Bring up the window for deleting an organisation.
1098 long longSelected = -1;
1099 int intSelectedData = 0;
1101 if (lboOrganisations->GetItemCount() == 0 || !GetSelectedItem(lboOrganisations,
1109 lboOrganisations->DeleteItem(longSelected);
1111 DeleteMapData(intSelectedData, &ContactEditorData.GeneralOrganisationsList,
1112 &ContactEditorData.GeneralOrganisationsListLanguage, &ContactEditorData.GeneralOrganisationsListSortAs,
1113 &ContactEditorData.GeneralOrganisationsListAltID, &ContactEditorData.GeneralOrganisationsListPID,
1114 &ContactEditorData.GeneralOrganisationsListType, &ContactEditorData.GeneralOrganisationsListTokens,
1115 &ContactEditorData.GeneralOrganisationsListPref);
1119 void frmContactEditor::AddGeneralNote( wxCommandEvent& event )
1122 // Bring up the window for adding a note.
1124 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1125 frameCENote->SetEditorMode(FALSE, CE_GENERAL);
1126 frameCENote->SetupPointers(&ContactEditorData.GeneralNoteList,
1127 &ContactEditorData.GeneralNoteListLanguage,
1128 &ContactEditorData.GeneralNoteListAltID,
1129 &ContactEditorData.GeneralNoteListPID,
1130 &ContactEditorData.GeneralNoteListType,
1131 &ContactEditorData.GeneralNoteListTokens,
1132 &ContactEditorData.GeneralNoteListPref,
1135 frameCENote->ShowModal();
1142 void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event )
1145 // Bring up the window for editing a note.
1147 long longSelected = -1;
1148 int intSelectedData = 0;
1150 if (lboNotes->GetItemCount() == 0 || !GetSelectedItem(lboNotes,
1158 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1159 frameCENote->SetupPointers(&ContactEditorData.GeneralNoteList,
1160 &ContactEditorData.GeneralNoteListLanguage,
1161 &ContactEditorData.GeneralNoteListAltID,
1162 &ContactEditorData.GeneralNoteListPID,
1163 &ContactEditorData.GeneralNoteListType,
1164 &ContactEditorData.GeneralNoteListTokens,
1165 &ContactEditorData.GeneralNoteListPref,
1168 frameCENote->SetEditorMode(TRUE, CE_GENERAL);
1169 frameCENote->ShowModal();
1175 void frmContactEditor::DeleteGeneralNote( wxCommandEvent& event )
1178 // Bring up a window for deleting a note.
1180 long longSelected = -1;
1181 int intSelectedData = 0;
1183 if (lboBusinessNotes->GetItemCount() == 0 || !GetSelectedItem(lboNotes,
1190 lboNotes->DeleteItem(longSelected);
1192 DeleteMapData(intSelectedData, &ContactEditorData.GeneralNoteList,
1193 &ContactEditorData.GeneralNoteListLanguage, &ContactEditorData.GeneralNoteListAltID,
1194 &ContactEditorData.GeneralNoteListPID, &ContactEditorData.GeneralNoteListType,
1195 &ContactEditorData.GeneralNoteListTokens, &ContactEditorData.GeneralNoteListPref);