1 // frmContactEditor-Home.cpp - frmContactEditor Home 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::AddHomeNickname( wxCommandEvent& event )
39 // Bring up window to add nickname.
43 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
44 frameCENickname->SetEditorMode(FALSE, CE_HOME);
45 intResult = GetLastInt(&ContactEditorData.HomeNicknamesList);
46 frameCENickname->SetupPointers(&ContactEditorData.HomeNicknamesList,
47 &ContactEditorData.HomeNicknamesListAltID,
48 &ContactEditorData.HomeNicknamesListPID,
49 &ContactEditorData.HomeNicknamesListType,
50 &ContactEditorData.HomeNicknamesListLanguage,
51 &ContactEditorData.HomeNicknamesListTokens,
52 &ContactEditorData.HomeNicknamesListPref,
55 frameCENickname->ShowModal();
56 delete frameCENickname;
57 frameCENickname = NULL;
61 void frmContactEditor::ModifyHomeNickname( wxCommandEvent& event )
64 // Bring up window to modify nickname.
66 long longSelected = -1;
67 int intSelectedData = 0;
69 if (!GetSelectedItem(lboHomeNicknames,
75 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
76 frameCENickname->SetupPointers(&ContactEditorData.HomeNicknamesList,
77 &ContactEditorData.HomeNicknamesListAltID,
78 &ContactEditorData.HomeNicknamesListPID,
79 &ContactEditorData.HomeNicknamesListType,
80 &ContactEditorData.HomeNicknamesListLanguage,
81 &ContactEditorData.HomeNicknamesListTokens,
82 &ContactEditorData.HomeNicknamesListPref,
85 frameCENickname->SetEditorMode(TRUE, CE_HOME);
86 frameCENickname->ShowModal();
87 delete frameCENickname;
88 frameCENickname = NULL;
92 void frmContactEditor::DeleteHomeNickname( wxCommandEvent& event )
95 // Bring up window to delete nickname.
97 long longSelected = -1;
98 int intSelectedData = 0;
100 if (!GetSelectedItem(lboHomeNicknames,
106 lboHomeNicknames->DeleteItem(longSelected);
108 DeleteMapData(intSelectedData,
109 &ContactEditorData.HomeNicknamesList,
110 &ContactEditorData.HomeNicknamesListLanguage,
111 &ContactEditorData.HomeNicknamesListAltID,
112 &ContactEditorData.HomeNicknamesListPID,
113 &ContactEditorData.HomeNicknamesListTokens,
114 &ContactEditorData.HomeNicknamesListType,
115 &ContactEditorData.HomeNicknamesListPref);
119 void frmContactEditor::AddHomeAddress( wxCommandEvent& event )
122 // Bring up window to add address.
126 frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
127 frameCEAddress->SetEditorMode(FALSE, CE_HOME);
128 intResult = GetLastInt(&ContactEditorData.HomeAddressList);
129 frameCEAddress->SetupPointers(&ContactEditorData.HomeAddressList,
130 &ContactEditorData.HomeAddressListTown,
131 &ContactEditorData.HomeAddressListCounty,
132 &ContactEditorData.HomeAddressListPostCode,
133 &ContactEditorData.HomeAddressListCountry,
134 &ContactEditorData.HomeAddressListLabel,
135 &ContactEditorData.HomeAddressListLang,
136 &ContactEditorData.HomeAddressListAltID,
137 &ContactEditorData.HomeAddressListPID,
138 &ContactEditorData.HomeAddressListTokens,
139 &ContactEditorData.HomeAddressListGeo,
140 &ContactEditorData.HomeAddressListTimezone,
141 &ContactEditorData.HomeAddressListType,
142 &ContactEditorData.HomeAddressListMediatype,
143 &ContactEditorData.HomeAddressListPref,
146 frameCEAddress->ShowModal();
147 delete frameCEAddress;
148 frameCEAddress = NULL;
152 void frmContactEditor::ModifyHomeAddress( wxCommandEvent& event )
155 // Bring up window to modify address.
157 long longSelected = -1;
158 int intSelectedData = 0;
160 if (!GetSelectedItem(lboHomeAddresses,
166 frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
167 frameCEAddress->SetupPointers(&ContactEditorData.HomeAddressList,
168 &ContactEditorData.HomeAddressListTown,
169 &ContactEditorData.HomeAddressListCounty,
170 &ContactEditorData.HomeAddressListPostCode,
171 &ContactEditorData.HomeAddressListCountry,
172 &ContactEditorData.HomeAddressListLabel,
173 &ContactEditorData.HomeAddressListLang,
174 &ContactEditorData.HomeAddressListAltID,
175 &ContactEditorData.HomeAddressListPID,
176 &ContactEditorData.HomeAddressListTokens,
177 &ContactEditorData.HomeAddressListGeo,
178 &ContactEditorData.HomeAddressListTimezone,
179 &ContactEditorData.HomeAddressListType,
180 &ContactEditorData.HomeAddressListMediatype,
181 &ContactEditorData.HomeAddressListPref,
184 frameCEAddress->SetEditorMode(TRUE, CE_HOME);
185 frameCEAddress->ShowModal();
186 delete frameCEAddress;
187 frameCEAddress = NULL;
191 void frmContactEditor::DeleteHomeAddress( wxCommandEvent& event )
194 // Bring up window to delete address.
196 long longSelected = -1;
197 int intSelectedData = 0;
199 if (!GetSelectedItem(lboHomeAddresses,
205 lboHomeAddresses->DeleteItem(longSelected);
207 DeleteMapData(intSelectedData, &ContactEditorData.HomeAddressList,
208 &ContactEditorData.HomeAddressListTown, &ContactEditorData.HomeAddressListCounty,
209 &ContactEditorData.HomeAddressListPostCode, &ContactEditorData.HomeAddressListCountry,
210 &ContactEditorData.HomeAddressList, &ContactEditorData.HomeAddressListLabel,
211 &ContactEditorData.HomeAddressListLang, &ContactEditorData.HomeAddressListAltID,
212 &ContactEditorData.HomeAddressListPID, &ContactEditorData.HomeAddressListTokens,
213 &ContactEditorData.HomeAddressListGeo, &ContactEditorData.HomeAddressListTimezone,
214 &ContactEditorData.HomeAddressListType, &ContactEditorData.HomeAddressListMediatype,
215 &ContactEditorData.HomeAddressListPref);
219 void frmContactEditor::AddHomeEmail( wxCommandEvent& event )
222 // Bring up window to add email.
226 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
227 frameCEEmail->SetEditorMode(FALSE, CE_HOME);
228 intResult = GetLastInt(&ContactEditorData.HomeAddressList);
229 frameCEEmail->SetupPointers(&ContactEditorData.HomeEmailList,
230 &ContactEditorData.HomeEmailListAltID,
231 &ContactEditorData.HomeEmailListPID,
232 &ContactEditorData.HomeEmailListType,
233 &ContactEditorData.HomeEmailListTokens,
234 &ContactEditorData.HomeEmailListPref,
237 frameCEEmail->ShowModal();
243 void frmContactEditor::ModifyHomeEmail( wxCommandEvent& event )
246 // Bring up window to modify email.
248 long longSelected = -1;
249 int intSelectedData = 0;
251 if (!GetSelectedItem(lboHomeEmails,
257 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
258 frameCEEmail->SetupPointers(&ContactEditorData.HomeEmailList,
259 &ContactEditorData.HomeEmailListAltID,
260 &ContactEditorData.HomeEmailListPID,
261 &ContactEditorData.HomeEmailListType,
262 &ContactEditorData.HomeEmailListTokens,
263 &ContactEditorData.HomeEmailListPref,
266 frameCEEmail->SetEditorMode(TRUE, CE_HOME);
267 frameCEEmail->ShowModal();
274 void frmContactEditor::DeleteHomeEmail( wxCommandEvent& event )
277 // Bring up window to delete email.
279 long longSelected = -1;
280 int intSelectedData = 0;
282 if (!GetSelectedItem(lboHomeEmails,
288 lboHomeEmails->DeleteItem(longSelected);
290 DeleteMapData(intSelectedData, &ContactEditorData.HomeEmailList,
291 &ContactEditorData.HomeEmailListAltID, &ContactEditorData.HomeEmailListPID,
292 &ContactEditorData.HomeEmailListType, &ContactEditorData.HomeEmailListTokens,
293 &ContactEditorData.HomeEmailListPref);
298 void frmContactEditor::AddHomeIM( wxCommandEvent& event )
301 // Bring up window to add IM.
305 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
306 frameCEIM->SetEditorMode(FALSE, CE_HOME);
307 intResult = GetLastInt(&ContactEditorData.HomeIMList);
308 frameCEIM->SetupPointers(&ContactEditorData.HomeIMList,
309 &ContactEditorData.HomeIMListAltID,
310 &ContactEditorData.HomeIMListPID,
311 &ContactEditorData.HomeIMListType,
312 &ContactEditorData.HomeIMListTypeInfo,
313 &ContactEditorData.HomeIMListTokens,
314 &ContactEditorData.HomeIMListMediatype,
315 &ContactEditorData.HomeIMListPref,
318 frameCEIM->ShowModal();
324 void frmContactEditor::ModifyHomeIM( wxCommandEvent& event )
327 // Bring up window to modify IM.
329 long longSelected = -1;
330 int intSelectedData = 0;
332 if (!GetSelectedItem(lboHomeIM,
338 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
339 frameCEIM->SetupPointers(&ContactEditorData.HomeIMList,
340 &ContactEditorData.HomeIMListAltID,
341 &ContactEditorData.HomeIMListPID,
342 &ContactEditorData.HomeIMListType,
343 &ContactEditorData.HomeIMListTypeInfo,
344 &ContactEditorData.HomeIMListTokens,
345 &ContactEditorData.HomeIMListMediatype,
346 &ContactEditorData.HomeIMListPref,
349 frameCEIM->SetEditorMode(TRUE, CE_HOME);
350 frameCEIM->ShowModal();
356 void frmContactEditor::DeleteHomeIM( wxCommandEvent& event )
359 // Bring up window to delete IM.
361 long longSelected = -1;
362 int intSelectedData = 0;
364 if (!GetSelectedItem(lboHomeIM,
370 lboHomeIM->DeleteItem(longSelected);
372 DeleteMapData(intSelectedData, &ContactEditorData.HomeIMList,
373 &ContactEditorData.HomeIMListAltID, &ContactEditorData.HomeIMListPID,
374 &ContactEditorData.HomeIMListType, &ContactEditorData.HomeIMListTypeInfo,
375 &ContactEditorData.HomeIMListTokens, &ContactEditorData.HomeIMListMediatype,
376 &ContactEditorData.HomeIMListPref);
380 void frmContactEditor::AddHomeTelephone( wxCommandEvent& event )
383 // Bring up window to add telephone.
387 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
388 frameCETel->SetEditorMode(FALSE, CE_HOME);
389 intResult = GetLastInt(&ContactEditorData.HomeTelephoneList);
390 frameCETel->SetupPointers(&ContactEditorData.HomeTelephoneList,
391 &ContactEditorData.HomeTelephoneListAltID,
392 &ContactEditorData.HomeTelephoneListPID,
393 &ContactEditorData.HomeTelephoneListType,
394 &ContactEditorData.HomeTelephoneListTypeInfo,
395 &ContactEditorData.HomeTelephoneListTokens,
396 &ContactEditorData.HomeTelephoneListPref,
399 frameCETel->ShowModal();
405 void frmContactEditor::ModifyHomeTelephone( wxCommandEvent& event )
408 // Bring up window to modify telephone.
410 long longSelected = -1;
411 int intSelectedData = 0;
413 if (!GetSelectedItem(lboHomeTelephone,
419 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
420 frameCETel->SetupPointers(&ContactEditorData.HomeTelephoneList,
421 &ContactEditorData.HomeTelephoneListAltID,
422 &ContactEditorData.HomeTelephoneListPID,
423 &ContactEditorData.HomeTelephoneListType,
424 &ContactEditorData.HomeTelephoneListTypeInfo,
425 &ContactEditorData.HomeTelephoneListTokens,
426 &ContactEditorData.HomeTelephoneListPref,
429 frameCETel->SetEditorMode(TRUE, CE_HOME);
430 frameCETel->ShowModal();
436 void frmContactEditor::DeleteHomeTelephone( wxCommandEvent& event )
439 // Bring up window to delete telephone.
441 long longSelected = -1;
442 int intSelectedData = 0;
444 if (!GetSelectedItem(lboHomeTelephone,
450 lboHomeTelephone->DeleteItem(longSelected);
452 DeleteMapData(intSelectedData, &ContactEditorData.HomeTelephoneList,
453 &ContactEditorData.HomeTelephoneListAltID, &ContactEditorData.HomeTelephoneListPID,
454 &ContactEditorData.HomeTelephoneListType, &ContactEditorData.HomeTelephoneListTypeInfo,
455 &ContactEditorData.HomeTelephoneListTokens, &ContactEditorData.HomeTelephoneListPref);
459 void frmContactEditor::AddHomeLanguage( wxCommandEvent& event )
462 // Bring up window to add language.
466 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
467 frameCELang->SetEditorMode(FALSE, CE_HOME);
468 intResult = GetLastInt(&ContactEditorData.HomeLanguageList);
470 frameCELang->SetupPointers(&ContactEditorData.HomeLanguageList,
471 &ContactEditorData.HomeLanguageListAltID,
472 &ContactEditorData.HomeLanguageListPID,
473 &ContactEditorData.HomeLanguageListType,
474 &ContactEditorData.HomeLanguageListTokens,
475 &ContactEditorData.HomeLanguageListPref,
478 frameCELang->ShowModal();
484 void frmContactEditor::ModifyHomeLanguage( wxCommandEvent& event )
487 // Bring up window to modify language.
489 long longSelected = -1;
490 int intSelectedData = 0;
492 if (!GetSelectedItem(lboHomeLanguages,
498 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
499 frameCELang->SetupPointers(&ContactEditorData.HomeLanguageList,
500 &ContactEditorData.HomeLanguageListAltID,
501 &ContactEditorData.HomeLanguageListPID,
502 &ContactEditorData.HomeLanguageListType,
503 &ContactEditorData.HomeLanguageListTokens,
504 &ContactEditorData.HomeLanguageListPref,
507 frameCELang->SetEditorMode(TRUE, CE_HOME);
508 frameCELang->ShowModal();
514 void frmContactEditor::DeleteHomeLanguage( wxCommandEvent& event )
517 // Bring up window to delete language.
519 long longSelected = -1;
520 int intSelectedData = 0;
522 if (!GetSelectedItem(lboHomeLanguages,
528 lboHomeLanguages->DeleteItem(longSelected);
530 DeleteMapData(intSelectedData, &ContactEditorData.HomeLanguageList,
531 &ContactEditorData.HomeLanguageListAltID, &ContactEditorData.HomeLanguageListPID,
532 &ContactEditorData.HomeLanguageListType, &ContactEditorData.HomeLanguageListTokens,
533 &ContactEditorData.HomeLanguageListPref);
537 void frmContactEditor::AddHomeTimezone( wxCommandEvent& event )
540 // Bring up window to add timezone.
544 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
545 frameCETZ->SetEditorMode(FALSE, CE_HOME);
546 intResult = GetLastInt(&ContactEditorData.HomeTZList);
547 frameCETZ->SetupPointers(&ContactEditorData.HomeTZList,
548 &ContactEditorData.HomeTZListAltID,
549 &ContactEditorData.HomeTZListPID,
550 &ContactEditorData.HomeTZListType,
551 &ContactEditorData.HomeTZListTokens,
552 &ContactEditorData.HomeTZListMediatype,
553 &ContactEditorData.HomeTZListPref,
556 frameCETZ->ShowModal();
562 void frmContactEditor::ModifyHomeTimezone( wxCommandEvent& event )
565 // Bring up window to modify timezone.
567 long longSelected = -1;
568 int intSelectedData = 0;
570 if (!GetSelectedItem(lboHomeTimezones,
576 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
577 frameCETZ->SetupPointers(&ContactEditorData.HomeTZList,
578 &ContactEditorData.HomeTZListAltID,
579 &ContactEditorData.HomeTZListPID,
580 &ContactEditorData.HomeTZListType,
581 &ContactEditorData.HomeTZListTokens,
582 &ContactEditorData.HomeTZListMediatype,
583 &ContactEditorData.HomeTZListPref,
586 frameCETZ->SetEditorMode(TRUE, CE_HOME);
587 frameCETZ->ShowModal();
593 void frmContactEditor::DeleteHomeTimezone( wxCommandEvent& event )
596 // Bring up window to delete timezone.
598 long longSelected = -1;
599 int intSelectedData = 0;
601 if (!GetSelectedItem(lboHomeTimezones,
607 lboHomeTimezones->DeleteItem(longSelected);
609 DeleteMapData(intSelectedData, &ContactEditorData.HomeTZList,
610 &ContactEditorData.HomeTZListAltID, &ContactEditorData.HomeTZListPID,
611 &ContactEditorData.HomeTZListType, &ContactEditorData.HomeTZListTokens,
612 &ContactEditorData.HomeTZListMediatype, &ContactEditorData.HomeTZListPref);
616 void frmContactEditor::AddHomeGeoposition( wxCommandEvent& event )
619 // Bring up window to add geoposition.
623 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
624 frameCEGeo->SetEditorMode(FALSE, CE_HOME);
625 intResult = GetLastInt(&ContactEditorData.HomeGeographyList);
626 frameCEGeo->SetupPointers(&ContactEditorData.HomeGeographyList,
627 &ContactEditorData.HomeGeographyListAltID,
628 &ContactEditorData.HomeGeographyListPID,
629 &ContactEditorData.HomeGeographyListType,
630 &ContactEditorData.HomeGeographyListDataType,
631 &ContactEditorData.HomeGeographyListTokens,
632 &ContactEditorData.HomeGeographyListMediatype,
633 &ContactEditorData.HomeGeographyListPref,
636 frameCEGeo->ShowModal();
642 void frmContactEditor::ModifyHomeGeoposition( wxCommandEvent& event )
645 // Bring up window to modify geoposition.
647 long longSelected = -1;
648 int intSelectedData = 0;
650 if (!GetSelectedItem(lboHomeGeoposition,
656 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
657 frameCEGeo->SetupPointers(&ContactEditorData.HomeGeographyList,
658 &ContactEditorData.HomeGeographyListAltID,
659 &ContactEditorData.HomeGeographyListPID,
660 &ContactEditorData.HomeGeographyListType,
661 &ContactEditorData.HomeGeographyListDataType,
662 &ContactEditorData.HomeGeographyListTokens,
663 &ContactEditorData.HomeGeographyListMediatype,
664 &ContactEditorData.HomeGeographyListPref,
667 frameCEGeo->SetEditorMode(TRUE, CE_HOME);
668 frameCEGeo->ShowModal();
674 void frmContactEditor::DeleteHomeGeoposition( wxCommandEvent& event )
677 // Bring up window to delete geoposition.
679 long longSelected = -1;
680 int intSelectedData = 0;
682 if (!GetSelectedItem(lboHomeGeoposition,
688 lboHomeGeoposition->DeleteItem(longSelected);
690 DeleteMapData(intSelectedData, &ContactEditorData.HomeGeographyList,
691 &ContactEditorData.HomeGeographyListAltID, &ContactEditorData.HomeGeographyListPID,
692 &ContactEditorData.HomeGeographyListType, &ContactEditorData.HomeGeographyListTokens,
693 &ContactEditorData.HomeGeographyListDataType, &ContactEditorData.HomeGeographyListMediatype,
694 &ContactEditorData.HomeGeographyListPref);
698 void frmContactEditor::AddHomeWebsite( wxCommandEvent& event )
701 // Bring up window to add website.
705 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
706 frameCEWeb->SetEditorMode(FALSE, CE_HOME);
707 intResult = GetLastInt(&ContactEditorData.HomeWebsiteList);
708 frameCEWeb->SetupPointers(&ContactEditorData.HomeWebsiteList,
709 &ContactEditorData.HomeWebsiteListAltID,
710 &ContactEditorData.HomeWebsiteListPID,
711 &ContactEditorData.HomeWebsiteListType,
712 &ContactEditorData.HomeWebsiteListTokens,
713 &ContactEditorData.HomeWebsiteListMediatype,
714 &ContactEditorData.HomeWebsiteListPref,
717 frameCEWeb->ShowModal();
723 void frmContactEditor::ModifyHomeWebsite( wxCommandEvent& event )
726 // Bring up window to modify website.
728 long longSelected = -1;
729 int intSelectedData = 0;
731 if (!GetSelectedItem(lboHomeWebsites,
737 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
738 frameCEWeb->SetupPointers(&ContactEditorData.HomeWebsiteList,
739 &ContactEditorData.HomeWebsiteListAltID,
740 &ContactEditorData.HomeWebsiteListPID,
741 &ContactEditorData.HomeWebsiteListType,
742 &ContactEditorData.HomeWebsiteListTokens,
743 &ContactEditorData.HomeWebsiteListMediatype,
744 &ContactEditorData.HomeWebsiteListPref,
747 frameCEWeb->SetEditorMode(TRUE, CE_HOME);
748 frameCEWeb->ShowModal();
754 void frmContactEditor::DeleteHomeWebsite( wxCommandEvent& event )
757 // Bring up window to delete website.
759 long longSelected = -1;
760 int intSelectedData = 0;
762 if (!GetSelectedItem(lboHomeWebsites,
768 lboHomeWebsites->DeleteItem(longSelected);
770 DeleteMapData(intSelectedData, &ContactEditorData.HomeWebsiteList,
771 &ContactEditorData.HomeWebsiteListAltID, &ContactEditorData.HomeWebsiteListPID,
772 &ContactEditorData.HomeWebsiteListType, &ContactEditorData.HomeWebsiteListTokens,
773 &ContactEditorData.HomeWebsiteListMediatype, &ContactEditorData.HomeWebsiteListPref);
777 void frmContactEditor::AddHomeTitle( wxCommandEvent& event )
780 // Bring up window to add title.
784 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
785 frameCETitle->SetEditorMode(FALSE, CE_HOME);
786 intResult = GetLastInt(&ContactEditorData.HomeTitleList);
787 frameCETitle->SetupPointers(&ContactEditorData.HomeTitleList,
788 &ContactEditorData.HomeTitleListLanguage,
789 &ContactEditorData.HomeTitleListAltID,
790 &ContactEditorData.HomeTitleListPID,
791 &ContactEditorData.HomeTitleListType,
792 &ContactEditorData.HomeTitleListTokens,
793 &ContactEditorData.HomeTitleListPref,
796 frameCETitle->ShowModal();
802 void frmContactEditor::ModifyHomeTitle( wxCommandEvent& event )
805 // Bring up window to modify title.
807 long longSelected = -1;
808 int intSelectedData = 0;
810 if (!GetSelectedItem(lboHomeTitles,
816 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
817 frameCETitle->SetupPointers(&ContactEditorData.HomeTitleList,
818 &ContactEditorData.HomeTitleListLanguage,
819 &ContactEditorData.HomeTitleListAltID,
820 &ContactEditorData.HomeTitleListPID,
821 &ContactEditorData.HomeTitleListType,
822 &ContactEditorData.HomeTitleListTokens,
823 &ContactEditorData.HomeTitleListPref,
826 frameCETitle->SetEditorMode(TRUE, CE_HOME);
827 frameCETitle->ShowModal();
833 void frmContactEditor::DeleteHomeTitle( wxCommandEvent& event )
836 // Bring up window to delete title.
838 long longSelected = -1;
839 int intSelectedData = 0;
841 if (!GetSelectedItem(lboHomeTitles,
847 lboHomeTitles->DeleteItem(longSelected);
849 DeleteMapData(intSelectedData, &ContactEditorData.HomeTitleList,
850 &ContactEditorData.HomeTitleListLanguage, &ContactEditorData.HomeTitleListAltID,
851 &ContactEditorData.HomeTitleListPID, &ContactEditorData.HomeTitleListType,
852 &ContactEditorData.HomeTitleListTokens, &ContactEditorData.HomeTitleListPref);
856 void frmContactEditor::AddHomeRole( wxCommandEvent& event )
859 // Bring up window to add role.
863 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
864 frameCERole->SetEditorMode(FALSE, CE_HOME);
865 intResult = GetLastInt(&ContactEditorData.HomeRoleList);
866 frameCERole->SetupPointers(&ContactEditorData.HomeRoleList,
867 &ContactEditorData.HomeRoleListLanguage,
868 &ContactEditorData.HomeRoleListAltID,
869 &ContactEditorData.HomeRoleListPID,
870 &ContactEditorData.HomeRoleListType,
871 &ContactEditorData.HomeRoleListTokens,
872 &ContactEditorData.HomeRoleListPref,
875 frameCERole->ShowModal();
881 void frmContactEditor::ModifyHomeRole( wxCommandEvent& event )
884 // Bring up window to modify role.
886 long longSelected = -1;
887 int intSelectedData = 0;
889 if (!GetSelectedItem(lboHomeRoles,
895 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
896 frameCERole->SetupPointers(&ContactEditorData.HomeRoleList,
897 &ContactEditorData.HomeRoleListLanguage,
898 &ContactEditorData.HomeRoleListAltID,
899 &ContactEditorData.HomeRoleListPID,
900 &ContactEditorData.HomeRoleListType,
901 &ContactEditorData.HomeRoleListTokens,
902 &ContactEditorData.HomeRoleListPref,
905 frameCERole->SetEditorMode(TRUE, CE_HOME);
906 frameCERole->ShowModal();
912 void frmContactEditor::DeleteHomeRole( wxCommandEvent& event )
915 // Bring up window to delete role.
917 long longSelected = -1;
918 int intSelectedData = 0;
920 if (!GetSelectedItem(lboHomeRoles,
926 lboHomeRoles->DeleteItem(longSelected);
928 DeleteMapData(intSelectedData, &ContactEditorData.HomeRoleList,
929 &ContactEditorData.HomeRoleListLanguage, &ContactEditorData.HomeRoleListAltID,
930 &ContactEditorData.HomeRoleListPID, &ContactEditorData.HomeRoleListType,
931 &ContactEditorData.HomeRoleListTokens, &ContactEditorData.HomeRoleListPref);
935 void frmContactEditor::AddHomeOrganisation( wxCommandEvent& event )
938 // Bring up window to add organisation.
942 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
943 frameCEOrg->SetEditorMode(FALSE, CE_HOME);
944 intResult = GetLastInt(&ContactEditorData.HomeOrganisationsList);
945 frameCEOrg->SetupPointers(&ContactEditorData.HomeOrganisationsList,
946 &ContactEditorData.HomeOrganisationsListLanguage,
947 &ContactEditorData.HomeOrganisationsListSortAs,
948 &ContactEditorData.HomeOrganisationsListAltID,
949 &ContactEditorData.HomeOrganisationsListPID,
950 &ContactEditorData.HomeOrganisationsListType,
951 &ContactEditorData.HomeOrganisationsListTokens,
952 &ContactEditorData.HomeOrganisationsListPref,
953 lboHomeOrganisations,
955 frameCEOrg->ShowModal();
961 void frmContactEditor::ModifyHomeOrganisation( wxCommandEvent& event )
964 // Bring up window to modify organisation.
966 long longSelected = -1;
967 int intSelectedData = 0;
969 if (!GetSelectedItem(lboHomeOrganisations,
975 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
976 frameCEOrg->SetupPointers(&ContactEditorData.HomeOrganisationsList,
977 &ContactEditorData.HomeOrganisationsListLanguage,
978 &ContactEditorData.HomeOrganisationsListSortAs,
979 &ContactEditorData.HomeOrganisationsListAltID,
980 &ContactEditorData.HomeOrganisationsListPID,
981 &ContactEditorData.HomeOrganisationsListType,
982 &ContactEditorData.HomeOrganisationsListTokens,
983 &ContactEditorData.HomeOrganisationsListPref,
984 lboHomeOrganisations,
986 frameCEOrg->SetEditorMode(TRUE, CE_HOME);
987 frameCEOrg->ShowModal();
993 void frmContactEditor::DeleteHomeOrganisation( wxCommandEvent& event )
996 // Bring up window to delete organisation.
998 long longSelected = -1;
999 int intSelectedData = 0;
1001 if (!GetSelectedItem(lboHomeOrganisations,
1007 lboHomeOrganisations->DeleteItem(longSelected);
1009 DeleteMapData(intSelectedData, &ContactEditorData.HomeOrganisationsList,
1010 &ContactEditorData.HomeOrganisationsListLanguage, &ContactEditorData.HomeOrganisationsListSortAs,
1011 &ContactEditorData.HomeOrganisationsListAltID, &ContactEditorData.HomeOrganisationsListPID,
1012 &ContactEditorData.HomeOrganisationsListType, &ContactEditorData.HomeOrganisationsListTokens,
1013 &ContactEditorData.HomeOrganisationsListPref);
1017 void frmContactEditor::AddHomeNote( wxCommandEvent& event )
1020 // Bring up window to add note.
1024 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1025 frameCENote->SetEditorMode(FALSE, CE_HOME);
1026 intResult = GetLastInt(&ContactEditorData.HomeNoteList);
1027 frameCENote->SetupPointers(&ContactEditorData.HomeNoteList,
1028 &ContactEditorData.HomeNoteListLanguage,
1029 &ContactEditorData.HomeNoteListAltID,
1030 &ContactEditorData.HomeNoteListPID,
1031 &ContactEditorData.HomeNoteListType,
1032 &ContactEditorData.HomeNoteListTokens,
1033 &ContactEditorData.HomeNoteListPref,
1036 frameCENote->ShowModal();
1042 void frmContactEditor::ModifyHomeNote( wxCommandEvent& event )
1045 // Bring up window to modify note.
1047 long longSelected = -1;
1048 int intSelectedData = 0;
1050 if (!GetSelectedItem(lboHomeNotes,
1056 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1057 frameCENote->SetupPointers(&ContactEditorData.HomeNoteList,
1058 &ContactEditorData.HomeNoteListLanguage,
1059 &ContactEditorData.HomeNoteListAltID,
1060 &ContactEditorData.HomeNoteListPID,
1061 &ContactEditorData.HomeNoteListType,
1062 &ContactEditorData.HomeNoteListTokens,
1063 &ContactEditorData.HomeNoteListPref,
1066 frameCENote->SetEditorMode(TRUE, CE_HOME);
1067 frameCENote->ShowModal();
1073 void frmContactEditor::DeleteHomeNote( wxCommandEvent& event )
1076 // Bring up window to delete note.
1078 long longSelected = -1;
1079 int intSelectedData = 0;
1081 if (!GetSelectedItem(lboHomeNotes,
1087 lboNotes->DeleteItem(longSelected);
1089 DeleteMapData(intSelectedData, &ContactEditorData.HomeNoteList,
1090 &ContactEditorData.HomeNoteListLanguage, &ContactEditorData.HomeNoteListAltID,
1091 &ContactEditorData.HomeNoteListPID, &ContactEditorData.HomeNoteListType,
1092 &ContactEditorData.HomeNoteListTokens, &ContactEditorData.HomeNoteListPref);