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.
43 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
44 frameCENickname->SetEditorMode(FALSE, CE_GENERAL);
45 intResult = GetLastInt(&ContactEditorData.GeneralNicknamesList);
46 frameCENickname->SetupPointers(&ContactEditorData.GeneralNicknamesList,
47 &ContactEditorData.GeneralNicknamesListAltID,
48 &ContactEditorData.GeneralNicknamesListPID,
49 &ContactEditorData.GeneralNicknamesListType,
50 &ContactEditorData.GeneralNicknamesListLanguage,
51 &ContactEditorData.GeneralNicknamesListTokens,
52 &ContactEditorData.GeneralNicknamesListPref,
55 frameCENickname->ShowModal();
56 delete frameCENickname;
57 frameCENickname = NULL;
61 void frmContactEditor::ModifyGeneralNickname( wxCommandEvent& event )
64 // Bring up the window for modifying a nickname.
66 long longSelected = -1;
67 int intSelectedData = 0;
69 if (!GetSelectedItem(lboNicknames,
75 frmContactEditorNickname *frameCENickname = new frmContactEditorNickname ( this );
76 frameCENickname->SetupPointers(&ContactEditorData.GeneralNicknamesList,
77 &ContactEditorData.GeneralNicknamesListAltID,
78 &ContactEditorData.GeneralNicknamesListPID,
79 &ContactEditorData.GeneralNicknamesListType,
80 &ContactEditorData.GeneralNicknamesListLanguage,
81 &ContactEditorData.GeneralNicknamesListTokens,
82 &ContactEditorData.GeneralNicknamesListPref,
85 frameCENickname->SetEditorMode(TRUE, CE_GENERAL);
86 frameCENickname->ShowModal();
87 delete frameCENickname;
88 frameCENickname = NULL;
92 void frmContactEditor::DeleteGeneralNickname( wxCommandEvent& event )
95 // Bring up the window for deleting a nickname.
97 long longSelected = -1;
98 int intSelectedData = 0;
100 if (!GetSelectedItem(lboNicknames,
106 lboNicknames->DeleteItem(longSelected);
108 DeleteMapData(intSelectedData,
109 &ContactEditorData.GeneralNicknamesList,
110 &ContactEditorData.GeneralNicknamesListLanguage,
111 &ContactEditorData.GeneralNicknamesListAltID,
112 &ContactEditorData.GeneralNicknamesListPID,
113 &ContactEditorData.GeneralNicknamesListTokens,
114 &ContactEditorData.GeneralNicknamesListType,
115 &ContactEditorData.GeneralNicknamesListPref);
119 void frmContactEditor::AddGeneralAddress( wxCommandEvent& event )
122 // Bring up the window for adding an address.
126 frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
127 frameCEAddress->SetEditorMode(FALSE, CE_GENERAL);
128 intResult = GetLastInt(&ContactEditorData.GeneralAddressList);
129 frameCEAddress->SetupPointers(&ContactEditorData.GeneralAddressList,
130 &ContactEditorData.GeneralAddressListTown,
131 &ContactEditorData.GeneralAddressListCounty,
132 &ContactEditorData.GeneralAddressListPostCode,
133 &ContactEditorData.GeneralAddressListCountry,
134 &ContactEditorData.GeneralAddressListLabel,
135 &ContactEditorData.GeneralAddressListLang,
136 &ContactEditorData.GeneralAddressListAltID,
137 &ContactEditorData.GeneralAddressListPID,
138 &ContactEditorData.GeneralAddressListTokens,
139 &ContactEditorData.GeneralAddressListGeo,
140 &ContactEditorData.GeneralAddressListTimezone,
141 &ContactEditorData.GeneralAddressListType,
142 &ContactEditorData.GeneralAddressListMediatype,
143 &ContactEditorData.GeneralAddressListPref,
146 frameCEAddress->ShowModal();
147 delete frameCEAddress;
148 frameCEAddress = NULL;
152 void frmContactEditor::ModifyGeneralAddress( wxCommandEvent& event )
155 // Bring up the window for editing an address.
157 long longSelected = -1;
158 int intSelectedData = 0;
160 if (!GetSelectedItem(lboAddresses,
168 if (longSelected == -1){
174 frmContactEditorAddress *frameCEAddress = new frmContactEditorAddress ( this );
175 frameCEAddress->SetupPointers(&ContactEditorData.GeneralAddressList,
176 &ContactEditorData.GeneralAddressListTown,
177 &ContactEditorData.GeneralAddressListCounty,
178 &ContactEditorData.GeneralAddressListPostCode,
179 &ContactEditorData.GeneralAddressListCountry,
180 &ContactEditorData.GeneralAddressListLabel,
181 &ContactEditorData.GeneralAddressListLang,
182 &ContactEditorData.GeneralAddressListAltID,
183 &ContactEditorData.GeneralAddressListPID,
184 &ContactEditorData.GeneralAddressListTokens,
185 &ContactEditorData.GeneralAddressListGeo,
186 &ContactEditorData.GeneralAddressListTimezone,
187 &ContactEditorData.GeneralAddressListType,
188 &ContactEditorData.GeneralAddressListMediatype,
189 &ContactEditorData.GeneralAddressListPref,
192 frameCEAddress->SetEditorMode(TRUE, CE_GENERAL);
193 frameCEAddress->ShowModal();
194 delete frameCEAddress;
195 frameCEAddress = NULL;
199 void frmContactEditor::DeleteGeneralAddress( wxCommandEvent& event )
202 // Bring up the window for deleting a nickname.
204 long longSelected = -1;
205 int intSelectedData = 0;
207 if (!GetSelectedItem(lboAddresses,
215 lboAddresses->DeleteItem(longSelected);
217 DeleteMapData(intSelectedData, &ContactEditorData.GeneralAddressList,
218 &ContactEditorData.GeneralAddressListTown, &ContactEditorData.GeneralAddressListCounty,
219 &ContactEditorData.GeneralAddressListPostCode, &ContactEditorData.GeneralAddressListCountry,
220 &ContactEditorData.GeneralAddressList, &ContactEditorData.GeneralAddressListLabel,
221 &ContactEditorData.GeneralAddressListLang, &ContactEditorData.GeneralAddressListAltID,
222 &ContactEditorData.GeneralAddressListPID, &ContactEditorData.GeneralAddressListTokens,
223 &ContactEditorData.GeneralAddressListGeo, &ContactEditorData.GeneralAddressListTimezone,
224 &ContactEditorData.GeneralAddressListType, &ContactEditorData.GeneralAddressListMediatype,
225 &ContactEditorData.GeneralAddressListPref);
229 void frmContactEditor::AddGeneralEmail( wxCommandEvent& event )
232 // Bring up the window for adding an email.
236 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
237 frameCEEmail->SetEditorMode(FALSE, CE_GENERAL);
238 intResult = GetLastInt(&ContactEditorData.GeneralAddressList);
239 frameCEEmail->SetupPointers(&ContactEditorData.GeneralEmailList,
240 &ContactEditorData.GeneralEmailListAltID,
241 &ContactEditorData.GeneralEmailListPID,
242 &ContactEditorData.GeneralEmailListType,
243 &ContactEditorData.GeneralEmailListTokens,
244 &ContactEditorData.GeneralEmailListPref,
247 frameCEEmail->ShowModal();
253 void frmContactEditor::ModifyGeneralEmail( wxCommandEvent& event )
256 // Bring up the window for modifying an email.
258 long longSelected = -1;
259 int intSelectedData = 0;
261 if (!GetSelectedItem(lboEmails,
269 frmContactEditorEmail *frameCEEmail = new frmContactEditorEmail ( this );
270 frameCEEmail->SetupPointers(&ContactEditorData.GeneralEmailList,
271 &ContactEditorData.GeneralEmailListAltID,
272 &ContactEditorData.GeneralEmailListPID,
273 &ContactEditorData.GeneralEmailListType,
274 &ContactEditorData.GeneralEmailListTokens,
275 &ContactEditorData.GeneralEmailListPref,
278 frameCEEmail->SetEditorMode(TRUE, CE_GENERAL);
279 frameCEEmail->ShowModal();
285 void frmContactEditor::DeleteGeneralEmail( wxCommandEvent& event )
288 // Bring up the window for deleting an email.
290 long longSelected = -1;
291 int intSelectedData = 0;
293 if (!GetSelectedItem(lboEmails,
301 lboEmails->DeleteItem(longSelected);
303 DeleteMapData(intSelectedData, &ContactEditorData.GeneralEmailList,
304 &ContactEditorData.GeneralEmailListAltID, &ContactEditorData.GeneralEmailListPID,
305 &ContactEditorData.GeneralEmailListType, &ContactEditorData.GeneralEmailListTokens,
306 &ContactEditorData.GeneralEmailListPref);
310 void frmContactEditor::AddGeneralIM( wxCommandEvent& event )
313 // Bring up the window for adding a IM address.
317 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
318 frameCEIM->SetEditorMode(FALSE, CE_GENERAL);
319 intResult = GetLastInt(&ContactEditorData.GeneralIMList);
320 frameCEIM->SetupPointers(&ContactEditorData.GeneralIMList,
321 &ContactEditorData.GeneralIMListAltID,
322 &ContactEditorData.GeneralIMListPID,
323 &ContactEditorData.GeneralIMListType,
324 &ContactEditorData.GeneralIMListTypeInfo,
325 &ContactEditorData.GeneralIMListTokens,
326 &ContactEditorData.GeneralIMListMediatype,
327 &ContactEditorData.GeneralIMListPref,
330 frameCEIM->ShowModal();
336 void frmContactEditor::ModifyGeneralIM( wxCommandEvent& event )
339 // Bring up the window for editing a IM address.
341 long longSelected = -1;
342 int intSelectedData = 0;
344 if (!GetSelectedItem(lboIM,
352 frmContactEditorIM *frameCEIM = new frmContactEditorIM ( this );
353 frameCEIM->SetupPointers(&ContactEditorData.GeneralIMList,
354 &ContactEditorData.GeneralIMListAltID,
355 &ContactEditorData.GeneralIMListPID,
356 &ContactEditorData.GeneralIMListType,
357 &ContactEditorData.GeneralIMListTypeInfo,
358 &ContactEditorData.GeneralIMListTokens,
359 &ContactEditorData.GeneralIMListMediatype,
360 &ContactEditorData.GeneralIMListPref,
363 frameCEIM->SetEditorMode(TRUE, CE_GENERAL);
364 frameCEIM->ShowModal();
370 void frmContactEditor::DeleteGeneralIM( wxCommandEvent& event )
373 // Bring up the window for deleting an IM address.
375 long longSelected = -1;
376 int intSelectedData = 0;
378 if (!GetSelectedItem(lboIM,
385 lboIM->DeleteItem(longSelected);
387 DeleteMapData(intSelectedData, &ContactEditorData.GeneralIMList,
388 &ContactEditorData.GeneralIMListAltID, &ContactEditorData.GeneralIMListPID,
389 &ContactEditorData.GeneralIMListType, &ContactEditorData.GeneralIMListTypeInfo,
390 &ContactEditorData.GeneralIMListTokens, &ContactEditorData.GeneralIMListMediatype,
391 &ContactEditorData.GeneralIMListPref);
395 void frmContactEditor::AddGeneralTelephone( wxCommandEvent& event )
398 // Bring up the window for adding a telephone.
402 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
403 frameCETel->SetEditorMode(FALSE, CE_GENERAL);
404 intResult = GetLastInt(&ContactEditorData.GeneralTelephoneList);
405 frameCETel->SetupPointers(&ContactEditorData.GeneralTelephoneList,
406 &ContactEditorData.GeneralTelephoneListAltID,
407 &ContactEditorData.GeneralTelephoneListPID,
408 &ContactEditorData.GeneralTelephoneListType,
409 &ContactEditorData.GeneralTelephoneListTypeInfo,
410 &ContactEditorData.GeneralTelephoneListTokens,
411 &ContactEditorData.GeneralTelephoneListPref,
414 frameCETel->ShowModal();
420 void frmContactEditor::ModifyGeneralTelephone( wxCommandEvent& event )
423 // Bring up the window for editing a telephone.
425 long longSelected = -1;
426 int intSelectedData = 0;
428 if (!GetSelectedItem(lboTelephone,
436 frmContactEditorTelephone *frameCETel = new frmContactEditorTelephone ( this );
437 frameCETel->SetupPointers(&ContactEditorData.GeneralTelephoneList,
438 &ContactEditorData.GeneralTelephoneListAltID,
439 &ContactEditorData.GeneralTelephoneListPID,
440 &ContactEditorData.GeneralTelephoneListType,
441 &ContactEditorData.GeneralTelephoneListTypeInfo,
442 &ContactEditorData.GeneralTelephoneListTokens,
443 &ContactEditorData.GeneralTelephoneListPref,
446 frameCETel->SetEditorMode(TRUE, CE_GENERAL);
447 frameCETel->ShowModal();
453 void frmContactEditor::DeleteGeneralTelephone( wxCommandEvent& event )
456 // Bring up the window for deleting a telephone.
458 long longSelected = -1;
459 int intSelectedData = 0;
461 if (!GetSelectedItem(lboTelephone,
469 lboTelephone->DeleteItem(longSelected);
471 DeleteMapData(intSelectedData, &ContactEditorData.GeneralTelephoneList,
472 &ContactEditorData.GeneralTelephoneListAltID, &ContactEditorData.GeneralTelephoneListPID,
473 &ContactEditorData.GeneralTelephoneListType, &ContactEditorData.GeneralTelephoneListTypeInfo,
474 &ContactEditorData.GeneralTelephoneListTokens, &ContactEditorData.GeneralTelephoneListPref);
478 void frmContactEditor::AddGeneralLanguages( wxCommandEvent& event )
481 // Bring up the window for adding a language.
485 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
486 frameCELang->SetEditorMode(FALSE, CE_GENERAL);
487 intResult = GetLastInt(&ContactEditorData.GeneralLanguageList);
488 frameCELang->SetupPointers(&ContactEditorData.GeneralLanguageList,
489 &ContactEditorData.GeneralLanguageListAltID,
490 &ContactEditorData.GeneralLanguageListPID,
491 &ContactEditorData.GeneralLanguageListType,
492 &ContactEditorData.GeneralLanguageListTokens,
493 &ContactEditorData.GeneralLanguageListPref,
496 frameCELang->ShowModal();
502 void frmContactEditor::ModifyGeneralLanguages( wxCommandEvent& event )
505 // Bring up the window for modifying a language.
507 long longSelected = -1;
508 int intSelectedData = 0;
510 if (!GetSelectedItem(lboLanguages,
518 frmContactEditorLanguages *frameCELang = new frmContactEditorLanguages ( this );
519 frameCELang->SetupPointers(&ContactEditorData.GeneralLanguageList,
520 &ContactEditorData.GeneralLanguageListAltID,
521 &ContactEditorData.GeneralLanguageListPID,
522 &ContactEditorData.GeneralLanguageListType,
523 &ContactEditorData.GeneralLanguageListTokens,
524 &ContactEditorData.GeneralLanguageListPref,
527 frameCELang->SetEditorMode(TRUE, CE_GENERAL);
528 frameCELang->ShowModal();
534 void frmContactEditor::DeleteGeneralLanguage( wxCommandEvent& event )
537 // Bring up the window for deleting a language.
539 long longSelected = -1;
540 int intSelectedData = 0;
542 if (!GetSelectedItem(lboLanguages,
549 lboLanguages->DeleteItem(longSelected);
551 DeleteMapData(intSelectedData, &ContactEditorData.GeneralLanguageList,
552 &ContactEditorData.GeneralLanguageListAltID, &ContactEditorData.GeneralLanguageListPID,
553 &ContactEditorData.GeneralLanguageListType, &ContactEditorData.GeneralLanguageListTokens,
554 &ContactEditorData.GeneralLanguageListPref);
558 void frmContactEditor::AddGeneralTimezone( wxCommandEvent& event )
561 // Bring up the window for adding a timezone.
565 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
566 frameCETZ->SetEditorMode(FALSE, CE_GENERAL);
567 intResult = GetLastInt(&ContactEditorData.GeneralTZList);
568 frameCETZ->SetupPointers(&ContactEditorData.GeneralTZList,
569 &ContactEditorData.GeneralTZListAltID,
570 &ContactEditorData.GeneralTZListPID,
571 &ContactEditorData.GeneralTZListType,
572 &ContactEditorData.GeneralTZListTokens,
573 &ContactEditorData.GeneralTZListMediatype,
574 &ContactEditorData.GeneralTZListPref,
577 frameCETZ->ShowModal();
583 void frmContactEditor::ModifyGeneralTimezone( wxCommandEvent& event )
586 // Bring up a window for editing a timezone.
588 long longSelected = -1;
589 int intSelectedData = 0;
591 if (!GetSelectedItem(lboTimezones,
598 frmContactEditorTimezones *frameCETZ = new frmContactEditorTimezones ( this );
599 frameCETZ->SetupPointers(&ContactEditorData.GeneralTZList,
600 &ContactEditorData.GeneralTZListAltID,
601 &ContactEditorData.GeneralTZListPID,
602 &ContactEditorData.GeneralTZListType,
603 &ContactEditorData.GeneralTZListTokens,
604 &ContactEditorData.GeneralTZListMediatype,
605 &ContactEditorData.GeneralTZListPref,
608 frameCETZ->SetEditorMode(TRUE, CE_GENERAL);
609 frameCETZ->ShowModal();
615 void frmContactEditor::DeleteGeneralTimezone( wxCommandEvent& event )
618 // Bring up the window for deleting a timezone.
620 long longSelected = -1;
621 int intSelectedData = 0;
623 if (!GetSelectedItem(lboTimezones,
631 lboTimezones->DeleteItem(longSelected);
633 DeleteMapData(intSelectedData, &ContactEditorData.GeneralTZList,
634 &ContactEditorData.GeneralTZListAltID, &ContactEditorData.GeneralTZListPID,
635 &ContactEditorData.GeneralTZListType, &ContactEditorData.GeneralTZListTokens,
636 &ContactEditorData.GeneralTZListMediatype, &ContactEditorData.GeneralTZListPref);
640 void frmContactEditor::AddGeneralGeoposition( wxCommandEvent& event )
643 // Bring up the window for adding a geoposition location.
647 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
648 frameCEGeo->SetEditorMode(FALSE, CE_GENERAL);
649 intResult = GetLastInt(&ContactEditorData.GeneralGeographyList);
650 frameCEGeo->SetupPointers(&ContactEditorData.GeneralGeographyList,
651 &ContactEditorData.GeneralGeographyListAltID,
652 &ContactEditorData.GeneralGeographyListPID,
653 &ContactEditorData.GeneralGeographyListType,
654 &ContactEditorData.GeneralGeographyListDataType,
655 &ContactEditorData.GeneralGeographyListTokens,
656 &ContactEditorData.GeneralGeographyListMediatype,
657 &ContactEditorData.GeneralGeographyListPref,
660 frameCEGeo->ShowModal();
666 void frmContactEditor::ModifyGeneralGeoposition( wxCommandEvent& event )
669 // Bring up the window for editing a geoposition location.
671 long longSelected = -1;
672 int intSelectedData = 0;
674 if (!GetSelectedItem(lboGeoposition,
682 frmContactEditorGeoposition *frameCEGeo = new frmContactEditorGeoposition ( this );
683 frameCEGeo->SetupPointers(&ContactEditorData.GeneralGeographyList,
684 &ContactEditorData.GeneralGeographyListAltID,
685 &ContactEditorData.GeneralGeographyListPID,
686 &ContactEditorData.GeneralGeographyListType,
687 &ContactEditorData.GeneralGeographyListDataType,
688 &ContactEditorData.GeneralGeographyListTokens,
689 &ContactEditorData.GeneralGeographyListMediatype,
690 &ContactEditorData.GeneralGeographyListPref,
694 frameCEGeo->SetEditorMode(TRUE, CE_GENERAL);
695 frameCEGeo->ShowModal();
701 void frmContactEditor::DeleteGeneralGeoposition( wxCommandEvent& event )
704 // Bring up the window for deleting a geoposition location.
706 long longSelected = -1;
707 int intSelectedData = 0;
709 if (!GetSelectedItem(lboGeoposition,
717 lboGeoposition->DeleteItem(longSelected);
719 DeleteMapData(intSelectedData, &ContactEditorData.GeneralGeographyList,
720 &ContactEditorData.GeneralGeographyListAltID, &ContactEditorData.GeneralGeographyListPID,
721 &ContactEditorData.GeneralGeographyListType, &ContactEditorData.GeneralGeographyListDataType,
722 &ContactEditorData.GeneralGeographyListTokens, &ContactEditorData.GeneralGeographyListMediatype,
723 &ContactEditorData.GeneralGeographyListPref);
727 void frmContactEditor::AddGeneralRelated( wxCommandEvent& event )
730 // Bring up the window for adding a relation.
734 frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
735 frameCERel->SetEditorMode(FALSE, CE_GENERAL);
736 intResult = GetLastInt(&ContactEditorData.GeneralRelatedList);
737 frameCERel->SetupPointers(&ContactEditorData.GeneralRelatedList,
738 &ContactEditorData.GeneralRelatedListRelType,
739 &ContactEditorData.GeneralRelatedListAltID,
740 &ContactEditorData.GeneralRelatedListPID,
741 &ContactEditorData.GeneralRelatedListType,
742 &ContactEditorData.GeneralRelatedListTokens,
743 &ContactEditorData.GeneralRelatedListPref,
746 frameCERel->ShowModal();
752 void frmContactEditor::ModifyGeneralRelated( wxCommandEvent& event )
755 // Bring up the window for editing a relation.
757 long longSelected = -1;
758 int intSelectedData = 0;
760 if (!GetSelectedItem(lboRelated,
768 frmContactEditorRelated *frameCERel = new frmContactEditorRelated ( this );
769 frameCERel->SetupPointers(&ContactEditorData.GeneralRelatedList,
770 &ContactEditorData.GeneralRelatedListRelType,
771 &ContactEditorData.GeneralRelatedListAltID,
772 &ContactEditorData.GeneralRelatedListPID,
773 &ContactEditorData.GeneralRelatedListType,
774 &ContactEditorData.GeneralRelatedListTokens,
775 &ContactEditorData.GeneralRelatedListPref,
778 frameCERel->SetEditorMode(TRUE, CE_GENERAL);
779 frameCERel->ShowModal();
785 void frmContactEditor::DeleteGeneralRelated( wxCommandEvent& event )
788 // Bring up a window for deleting a relation.
790 long longSelected = -1;
791 int intSelectedData = 0;
793 if (!GetSelectedItem(lboRelated,
801 lboRelated->DeleteItem(longSelected);
803 DeleteMapData(intSelectedData, &ContactEditorData.GeneralRelatedList,
804 &ContactEditorData.GeneralRelatedListRelType, &ContactEditorData.GeneralRelatedListAltID,
805 &ContactEditorData.GeneralRelatedListPID, &ContactEditorData.GeneralRelatedListType,
806 &ContactEditorData.GeneralRelatedListTokens, &ContactEditorData.GeneralRelatedListPref);
810 void frmContactEditor::AddGeneralWebsite( wxCommandEvent& event )
813 // Bring up a window for adding a website.
817 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
818 frameCEWeb->SetEditorMode(FALSE, CE_GENERAL);
819 intResult = GetLastInt(&ContactEditorData.GeneralWebsiteList);
820 frameCEWeb->SetupPointers(&ContactEditorData.GeneralWebsiteList,
821 &ContactEditorData.GeneralWebsiteListAltID,
822 &ContactEditorData.GeneralWebsiteListPID,
823 &ContactEditorData.GeneralWebsiteListType,
824 &ContactEditorData.GeneralWebsiteListTokens,
825 &ContactEditorData.GeneralWebsiteListMediatype,
826 &ContactEditorData.GeneralWebsiteListPref,
829 frameCEWeb->ShowModal();
835 void frmContactEditor::ModifyGeneralWebsite( wxCommandEvent& event )
838 // Bring up a window for editing a website.
840 long longSelected = -1;
841 int intSelectedData = 0;
843 if (!GetSelectedItem(lboWebsites,
851 frmContactEditorWebsites *frameCEWeb = new frmContactEditorWebsites ( this );
852 frameCEWeb->SetupPointers(&ContactEditorData.GeneralWebsiteList,
853 &ContactEditorData.GeneralWebsiteListAltID,
854 &ContactEditorData.GeneralWebsiteListPID,
855 &ContactEditorData.GeneralWebsiteListType,
856 &ContactEditorData.GeneralWebsiteListTokens,
857 &ContactEditorData.GeneralWebsiteListMediatype,
858 &ContactEditorData.GeneralWebsiteListPref,
861 frameCEWeb->SetEditorMode(TRUE, CE_GENERAL);
862 frameCEWeb->ShowModal();
868 void frmContactEditor::DeleteGeneralWebsite( wxCommandEvent& event )
871 // Bring up a window for deleting a website.
873 long longSelected = -1;
874 int intSelectedData = 0;
876 if (!GetSelectedItem(lboWebsites,
884 lboWebsites->DeleteItem(longSelected);
886 DeleteMapData(intSelectedData, &ContactEditorData.GeneralWebsiteList,
887 &ContactEditorData.GeneralWebsiteListAltID, &ContactEditorData.GeneralWebsiteListPID,
888 &ContactEditorData.GeneralWebsiteListType, &ContactEditorData.GeneralWebsiteListTokens,
889 &ContactEditorData.GeneralWebsiteListMediatype, &ContactEditorData.GeneralWebsiteListPref);
893 void frmContactEditor::AddGeneralTitle( wxCommandEvent& event )
896 // Bring up the window for adding a title.
900 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
901 frameCETitle->SetEditorMode(FALSE, CE_GENERAL);
902 intResult = GetLastInt(&ContactEditorData.GeneralTitleList);
903 frameCETitle->SetupPointers(&ContactEditorData.GeneralTitleList,
904 &ContactEditorData.GeneralTitleListLanguage,
905 &ContactEditorData.GeneralTitleListAltID,
906 &ContactEditorData.GeneralTitleListPID,
907 &ContactEditorData.GeneralTitleListType,
908 &ContactEditorData.GeneralTitleListTokens,
909 &ContactEditorData.GeneralTitleListPref,
912 frameCETitle->ShowModal();
918 void frmContactEditor::ModifyGeneralTitle( wxCommandEvent& event )
921 // Bring up the window for editing a title.
923 long longSelected = -1;
924 int intSelectedData = 0;
926 if (!GetSelectedItem(lboTitles,
934 frmContactEditorTitles *frameCETitle = new frmContactEditorTitles ( this );
935 frameCETitle->SetupPointers(&ContactEditorData.GeneralTitleList,
936 &ContactEditorData.GeneralTitleListLanguage,
937 &ContactEditorData.GeneralTitleListAltID,
938 &ContactEditorData.GeneralTitleListPID,
939 &ContactEditorData.GeneralTitleListType,
940 &ContactEditorData.GeneralTitleListTokens,
941 &ContactEditorData.GeneralTitleListPref,
944 frameCETitle->SetEditorMode(TRUE, CE_GENERAL);
945 frameCETitle->ShowModal();
951 void frmContactEditor::DeleteGeneralTitle( wxCommandEvent& event )
954 // Bring up the window for deleting a title.
956 long longSelected = -1;
957 int intSelectedData = 0;
959 if (!GetSelectedItem(lboTitles,
967 lboTitles->DeleteItem(longSelected);
969 DeleteMapData(intSelectedData, &ContactEditorData.GeneralTitleList,
970 &ContactEditorData.GeneralTitleListLanguage, &ContactEditorData.GeneralTitleListAltID,
971 &ContactEditorData.GeneralTitleListPID, &ContactEditorData.GeneralTitleListType,
972 &ContactEditorData.GeneralTitleListTokens, &ContactEditorData.GeneralTitleListPref);
976 void frmContactEditor::AddGeneralRole( wxCommandEvent& event )
979 // Bring up the window for adding a role.
983 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
984 frameCERole->SetEditorMode(FALSE, CE_GENERAL);
985 intResult = GetLastInt(&ContactEditorData.GeneralRoleList);
986 frameCERole->SetupPointers(&ContactEditorData.GeneralRoleList,
987 &ContactEditorData.GeneralRoleListLanguage,
988 &ContactEditorData.GeneralRoleListAltID,
989 &ContactEditorData.GeneralRoleListPID,
990 &ContactEditorData.GeneralRoleListType,
991 &ContactEditorData.GeneralRoleListTokens,
992 &ContactEditorData.GeneralRoleListPref,
995 frameCERole->ShowModal();
1001 void frmContactEditor::ModifyGeneralRole( wxCommandEvent& event )
1004 // Bring up the window for editing a role.
1006 long longSelected = -1;
1007 int intSelectedData = 0;
1009 if (!GetSelectedItem(lboRoles,
1017 frmContactEditorRoles *frameCERole = new frmContactEditorRoles ( this );
1018 frameCERole->SetupPointers(&ContactEditorData.GeneralRoleList,
1019 &ContactEditorData.GeneralRoleListLanguage,
1020 &ContactEditorData.GeneralRoleListAltID,
1021 &ContactEditorData.GeneralRoleListPID,
1022 &ContactEditorData.GeneralRoleListType,
1023 &ContactEditorData.GeneralRoleListTokens,
1024 &ContactEditorData.GeneralRoleListPref,
1027 frameCERole->SetEditorMode(TRUE, CE_GENERAL);
1028 frameCERole->ShowModal();
1034 void frmContactEditor::DeleteGeneralRole( wxCommandEvent& event )
1037 // Bring up the window for deleting a role.
1039 long longSelected = -1;
1040 int intSelectedData = 0;
1042 if (!GetSelectedItem(lboRoles,
1050 lboRoles->DeleteItem(longSelected);
1052 DeleteMapData(intSelectedData, &ContactEditorData.GeneralRoleList,
1053 &ContactEditorData.GeneralRoleListLanguage, &ContactEditorData.GeneralRoleListAltID,
1054 &ContactEditorData.GeneralRoleListPID, &ContactEditorData.GeneralRoleListType,
1055 &ContactEditorData.GeneralRoleListTokens, &ContactEditorData.GeneralRoleListPref);
1059 void frmContactEditor::AddGeneralOrganisation( wxCommandEvent& event )
1062 // Bring up the window for adding an organisation.
1066 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1067 frameCEOrg->SetEditorMode(FALSE, CE_GENERAL);
1068 intResult = GetLastInt(&ContactEditorData.GeneralOrganisationsList);
1069 frameCEOrg->SetupPointers(&ContactEditorData.GeneralOrganisationsList,
1070 &ContactEditorData.GeneralOrganisationsListLanguage,
1071 &ContactEditorData.GeneralOrganisationsListSortAs,
1072 &ContactEditorData.GeneralOrganisationsListAltID,
1073 &ContactEditorData.GeneralOrganisationsListPID,
1074 &ContactEditorData.GeneralOrganisationsListType,
1075 &ContactEditorData.GeneralOrganisationsListTokens,
1076 &ContactEditorData.GeneralOrganisationsListPref,
1079 frameCEOrg->ShowModal();
1085 void frmContactEditor::ModifyGeneralOrganisation( wxCommandEvent& event )
1088 // Bring up the window for editing an organisation.
1090 long longSelected = -1;
1091 int intSelectedData = 0;
1093 if (!GetSelectedItem(lboOrganisations,
1101 frmContactEditorOrganisations *frameCEOrg = new frmContactEditorOrganisations ( this );
1102 frameCEOrg->SetupPointers(&ContactEditorData.GeneralOrganisationsList,
1103 &ContactEditorData.GeneralOrganisationsListLanguage,
1104 &ContactEditorData.GeneralOrganisationsListSortAs,
1105 &ContactEditorData.GeneralOrganisationsListAltID,
1106 &ContactEditorData.GeneralOrganisationsListPID,
1107 &ContactEditorData.GeneralOrganisationsListType,
1108 &ContactEditorData.GeneralOrganisationsListTokens,
1109 &ContactEditorData.GeneralOrganisationsListPref,
1112 frameCEOrg->SetEditorMode(TRUE, CE_GENERAL);
1113 frameCEOrg->ShowModal();
1119 void frmContactEditor::DeleteGeneralOrganisation( wxCommandEvent& event )
1122 // Bring up the window for deleting an organisation.
1124 long longSelected = -1;
1125 int intSelectedData = 0;
1127 if (!GetSelectedItem(lboOrganisations,
1135 lboOrganisations->DeleteItem(longSelected);
1137 DeleteMapData(intSelectedData, &ContactEditorData.GeneralOrganisationsList,
1138 &ContactEditorData.GeneralOrganisationsListLanguage, &ContactEditorData.GeneralOrganisationsListSortAs,
1139 &ContactEditorData.GeneralOrganisationsListAltID, &ContactEditorData.GeneralOrganisationsListPID,
1140 &ContactEditorData.GeneralOrganisationsListType, &ContactEditorData.GeneralOrganisationsListTokens,
1141 &ContactEditorData.GeneralOrganisationsListPref);
1145 void frmContactEditor::AddGeneralNote( wxCommandEvent& event )
1148 // Bring up the window for adding a note.
1152 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1153 frameCENote->SetEditorMode(FALSE, CE_GENERAL);
1154 intResult = GetLastInt(&ContactEditorData.GeneralNoteList);
1155 frameCENote->SetupPointers(&ContactEditorData.GeneralNoteList,
1156 &ContactEditorData.GeneralNoteListLanguage,
1157 &ContactEditorData.GeneralNoteListAltID,
1158 &ContactEditorData.GeneralNoteListPID,
1159 &ContactEditorData.GeneralNoteListType,
1160 &ContactEditorData.GeneralNoteListTokens,
1161 &ContactEditorData.GeneralNoteListPref,
1164 frameCENote->ShowModal();
1170 void frmContactEditor::ModifyGeneralNote( wxCommandEvent& event )
1173 // Bring up the window for editing a note.
1175 long longSelected = -1;
1176 int intSelectedData = 0;
1178 if (!GetSelectedItem(lboNotes,
1186 frmContactEditorNotes *frameCENote = new frmContactEditorNotes ( this );
1187 frameCENote->SetupPointers(&ContactEditorData.GeneralNoteList,
1188 &ContactEditorData.GeneralNoteListLanguage,
1189 &ContactEditorData.GeneralNoteListAltID,
1190 &ContactEditorData.GeneralNoteListPID,
1191 &ContactEditorData.GeneralNoteListType,
1192 &ContactEditorData.GeneralNoteListTokens,
1193 &ContactEditorData.GeneralNoteListPref,
1196 frameCENote->SetEditorMode(TRUE, CE_GENERAL);
1197 frameCENote->ShowModal();
1203 void frmContactEditor::DeleteGeneralNote( wxCommandEvent& event )
1206 // Bring up a window for deleting a note.
1208 long longSelected = -1;
1209 int intSelectedData = 0;
1211 if (!GetSelectedItem(lboNotes,
1218 lboNotes->DeleteItem(longSelected);
1220 DeleteMapData(intSelectedData, &ContactEditorData.GeneralNoteList,
1221 &ContactEditorData.GeneralNoteListLanguage, &ContactEditorData.GeneralNoteListAltID,
1222 &ContactEditorData.GeneralNoteListPID, &ContactEditorData.GeneralNoteListType,
1223 &ContactEditorData.GeneralNoteListTokens, &ContactEditorData.GeneralNoteListPref);