1 // frmContactEditor-Reset.cpp - frmContactEditor form reset subroutines.
3 // (c) 2012-2015 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"
21 void frmContactEditor::ClearContact(){
23 // Clear out the GUI and values.
30 txtOtherNames->Clear();
32 cmbDisplayAs->Clear();
33 cmbDisplayAs->SetValue(wxT(""));
36 dapAnniversary->SetValue(EmptyDate);
37 dapBirthday->SetValue(EmptyDate);
39 txtAnniversary->Clear();
41 txtGenderDescription->Clear();
43 lboNicknames->DeleteAllItems();
44 lboHomeNicknames->DeleteAllItems();
45 lboBusinessNicknames->DeleteAllItems();
47 lboAddresses->DeleteAllItems();
48 lboHomeAddresses->DeleteAllItems();
49 lboBusinessAddresses->DeleteAllItems();
51 lboEmails->DeleteAllItems();
52 lboHomeEmails->DeleteAllItems();
53 lboBusinessEmail->DeleteAllItems();
55 lboIM->DeleteAllItems();
56 lboHomeIM->DeleteAllItems();
57 lboBusinessIM->DeleteAllItems();
59 lboTelephone->DeleteAllItems();
60 lboHomeTelephone->DeleteAllItems();
61 lboBusinessTelephone->DeleteAllItems();
63 lboLanguages->DeleteAllItems();
64 lboHomeLanguages->DeleteAllItems();
65 lboBusinessLanguages->DeleteAllItems();
67 lboTimezones->DeleteAllItems();
68 lboHomeTimezones->DeleteAllItems();
69 lboBusinessTimezones->DeleteAllItems();
71 lboGeoposition->DeleteAllItems();
72 lboHomeGeoposition->DeleteAllItems();
73 lboBusinessGeoposition->DeleteAllItems();
75 lboRelated->DeleteAllItems();
77 lboWebsites->DeleteAllItems();
78 lboHomeWebsites->DeleteAllItems();
79 lboBusinessWebsites->DeleteAllItems();
81 lboTitles->DeleteAllItems();
82 lboHomeTitles->DeleteAllItems();
83 lboBusinessTitles->DeleteAllItems();
85 lboRoles->DeleteAllItems();
86 lboHomeRoles->DeleteAllItems();
87 lboBusinessRoles->DeleteAllItems();
89 lboOrganisations->DeleteAllItems();
90 lboHomeOrganisations->DeleteAllItems();
91 lboBusinessOrganisations->DeleteAllItems();
93 lboNotes->DeleteAllItems();
94 lboHomeNotes->DeleteAllItems();
95 lboBusinessNotes->DeleteAllItems();
97 lboCategories->DeleteAllItems();
99 lboGroups->DeleteAllItems();
102 lboPictures->DeleteAllItems();
103 imgPicture->SetBitmap(EmptyBitmap);
106 lboLogos->DeleteAllItems();
107 imgLogo->SetBitmap(EmptyBitmap);
109 lboSounds->DeleteAllItems();
111 lboCalendarAddresses->DeleteAllItems();
112 lboCalendarRequestAddress->DeleteAllItems();
113 lboFreeBusyAddresses->DeleteAllItems();
115 lboKeys->DeleteAllItems();
117 lboVendorNamespace->DeleteAllItems();
118 lboXToken->DeleteAllItems();
123 wxString NameForename;
124 wxString NameSurname;
125 wxString NameOtherNames;
127 wxString NameNickname;
128 wxString NameDisplayAs;
129 wxString NameLanguage;
134 wxString BirthdayAltID;
135 wxString BirthdayCalScale;
136 wxString BirthdayTokens;
137 wxString Anniversary;
138 wxString AnniversaryAltID;
139 wxString AnniversaryCalScale;
140 wxString AnniversaryTokens;
143 wxString GenderDetails;
144 wxString GenderTokens;
148 /* We don't use these at the moment but we want to keep
149 them for compatability reasons */
151 /*std::map<int, wxString> ExtraFullNames;*/
152 /*std::map<int, wxString> ExtraNicknames;*/
154 FullNamesList.clear();
155 FullNamesListType.clear();
156 FullNamesListLanguage.clear();
157 FullNamesListAltID.clear();
158 FullNamesListPID.clear();
159 FullNamesListTokens.clear();
160 FullNamesListPref.clear();
162 GeneralNicknamesList.clear();
163 GeneralNicknamesListType.clear();
164 GeneralNicknamesListLanguage.clear();
165 GeneralNicknamesListAltID.clear();
166 GeneralNicknamesListPID.clear();
167 GeneralNicknamesListTokens.clear();
168 GeneralNicknamesListPref.clear();
170 GeneralAddressList.clear();
171 GeneralAddressListTown.clear();
172 GeneralAddressListCounty.clear();
173 GeneralAddressListPostCode.clear();
174 GeneralAddressListCountry.clear();
175 GeneralAddressListLabel.clear();
176 GeneralAddressListLang.clear();
177 GeneralAddressListAltID.clear();
178 GeneralAddressListPID.clear();
179 GeneralAddressListTokens.clear();
180 GeneralAddressListGeo.clear();
181 GeneralAddressListTimezone.clear();
182 GeneralAddressListType.clear();
183 GeneralAddressListMediatype.clear();
184 GeneralAddressListPref.clear();
186 GeneralEmailList.clear();
187 GeneralEmailListAltID.clear();
188 GeneralEmailListPID.clear();
189 GeneralEmailListType.clear();
190 GeneralEmailListTokens.clear();
191 GeneralEmailListPref.clear();
193 GeneralIMList.clear();
194 GeneralIMListAltID.clear();
195 GeneralIMListPID.clear();
196 GeneralIMListType.clear();
197 GeneralIMListTokens.clear();
198 GeneralIMListMediatype.clear();
199 GeneralIMListPref.clear();
201 GeneralTelephoneList.clear();
202 GeneralTelephoneListAltID.clear();
203 GeneralTelephoneListPID.clear();
204 GeneralTelephoneListType.clear();
205 GeneralTelephoneListTokens.clear();
206 GeneralTelephoneListPref.clear();
208 GeneralLanguageList.clear();
209 GeneralLanguageListAltID.clear();
210 GeneralLanguageListPID.clear();
211 GeneralLanguageListType.clear();
212 GeneralLanguageListTokens.clear();
213 GeneralLanguageListPref.clear();
215 GeneralTZList.clear();
216 GeneralTZListAltID.clear();
217 GeneralTZListPID.clear();
218 GeneralTZListType.clear();
219 GeneralTZListTokens.clear();
220 GeneralTZListMediatype.clear();
221 GeneralTZListPref.clear();
223 GeneralGeographyList.clear();
224 GeneralGeographyListAltID.clear();
225 GeneralGeographyListPID.clear();
226 GeneralGeographyListType.clear();
227 GeneralGeographyListTokens.clear();
228 GeneralGeographyListMediatype.clear();
229 GeneralGeographyListPref.clear();
231 GeneralRelatedList.clear();
232 GeneralRelatedListRelType.clear();
233 GeneralRelatedListLanguage.clear();
234 GeneralRelatedListAltID.clear();
235 GeneralRelatedListPID.clear();
236 GeneralRelatedListType.clear();
237 GeneralRelatedListTokens.clear();
238 GeneralRelatedListPref.clear();
240 GeneralWebsiteList.clear();
241 GeneralWebsiteListAltID.clear();
242 GeneralWebsiteListPID.clear();
243 GeneralWebsiteListType.clear();
244 GeneralWebsiteListTokens.clear();
245 GeneralWebsiteListMediatype.clear();
246 GeneralWebsiteListPref.clear();
248 GeneralTitleList.clear();
249 GeneralTitleListLanguage.clear();
250 GeneralTitleListAltID.clear();
251 GeneralTitleListPID.clear();
252 GeneralTitleListType.clear();
253 GeneralTitleListTokens.clear();
254 GeneralTitleListPref.clear();
256 GeneralRoleList.clear();
257 GeneralRoleListLanguage.clear();
258 GeneralRoleListAltID.clear();
259 GeneralRoleListPID.clear();
260 GeneralRoleListType.clear();
261 GeneralRoleListTokens.clear();
262 GeneralRoleListPref.clear();
264 GeneralOrganisationsList.clear();
265 GeneralOrganisationsListLanguage.clear();
266 GeneralOrganisationsListAltID.clear();
267 GeneralOrganisationsListPID.clear();
268 GeneralOrganisationsListType.clear();
269 GeneralOrganisationsListTokens.clear();
270 GeneralOrganisationsListSortAs.clear();
271 GeneralOrganisationsListPref.clear();
273 GeneralNoteList.clear();
274 GeneralNoteListLanguage.clear();
275 GeneralNoteListAltID.clear();
276 GeneralNoteListPID.clear();
277 GeneralNoteListType.clear();
278 GeneralNoteListTokens.clear();
279 GeneralNoteListPref.clear();
281 /* Items on Home Tab */
283 HomeNicknamesList.clear();
284 HomeNicknamesListType.clear();
285 HomeNicknamesListLanguage.clear();
286 HomeNicknamesListAltID.clear();
287 HomeNicknamesListPID.clear();
288 HomeNicknamesListTokens.clear();
289 HomeNicknamesListPref.clear();
291 HomeAddressList.clear();
292 HomeAddressListTown.clear();
293 HomeAddressListCounty.clear();
294 HomeAddressListPostCode.clear();
295 HomeAddressListCountry.clear();
296 HomeAddressListLabel.clear();
297 HomeAddressListLang.clear();
298 HomeAddressListAltID.clear();
299 HomeAddressListPID.clear();
300 HomeAddressListTokens.clear();
301 HomeAddressListGeo.clear();
302 HomeAddressListTimezone.clear();
303 HomeAddressListType.clear();
304 HomeAddressListMediatype.clear();
305 HomeAddressListPref.clear();
307 HomeEmailList.clear();
308 HomeEmailListAltID.clear();
309 HomeEmailListPID.clear();
310 HomeEmailListType.clear();
311 HomeEmailListTokens.clear();
312 HomeEmailListPref.clear();
315 HomeIMListAltID.clear();
316 HomeIMListPID.clear();
317 HomeIMListType.clear();
318 HomeIMListTokens.clear();
319 HomeIMListMediatype.clear();
320 HomeIMListPref.clear();
322 HomeTelephoneList.clear();
323 HomeTelephoneListAltID.clear();
324 HomeTelephoneListPID.clear();
325 HomeTelephoneListType.clear();
326 HomeTelephoneListTokens.clear();
327 HomeTelephoneListPref.clear();
329 HomeLanguageList.clear();
330 HomeLanguageListAltID.clear();
331 HomeLanguageListPID.clear();
332 HomeLanguageListType.clear();
333 HomeLanguageListTokens.clear();
334 HomeLanguageListPref.clear();
337 HomeTZListAltID.clear();
338 HomeTZListPID.clear();
339 HomeTZListType.clear();
340 HomeTZListTokens.clear();
341 HomeTZListMediatype.clear();
342 HomeTZListPref.clear();
344 HomeGeographyList.clear();
345 HomeGeographyListAltID.clear();
346 HomeGeographyListPID.clear();
347 HomeGeographyListType.clear();
348 HomeGeographyListTokens.clear();
349 HomeGeographyListMediatype.clear();
350 HomeGeographyListPref.clear();
352 HomeRelatedList.clear();
353 HomeRelatedListRelType.clear();
354 HomeRelatedListLanguage.clear();
355 HomeRelatedListAltID.clear();
356 HomeRelatedListPID.clear();
357 HomeRelatedListType.clear();
358 HomeRelatedListTokens.clear();
359 HomeRelatedListPref.clear();
361 HomeWebsiteList.clear();
362 HomeWebsiteListAltID.clear();
363 HomeWebsiteListPID.clear();
364 HomeWebsiteListType.clear();
365 HomeWebsiteListTokens.clear();
366 HomeWebsiteListMediatype.clear();
367 HomeWebsiteListPref.clear();
369 HomeTitleList.clear();
370 HomeTitleListLanguage.clear();
371 HomeTitleListAltID.clear();
372 HomeTitleListPID.clear();
373 HomeTitleListType.clear();
374 HomeTitleListTokens.clear();
375 HomeTitleListPref.clear();
377 HomeRoleList.clear();
378 HomeRoleListLanguage.clear();
379 HomeRoleListAltID.clear();
380 HomeRoleListPID.clear();
381 HomeRoleListType.clear();
382 HomeRoleListTokens.clear();
383 HomeRoleListPref.clear();
385 HomeOrganisationsList.clear();
386 HomeOrganisationsListLanguage.clear();
387 HomeOrganisationsListAltID.clear();
388 HomeOrganisationsListPID.clear();
389 HomeOrganisationsListType.clear();
390 HomeOrganisationsListTokens.clear();
391 HomeOrganisationsListSortAs.clear();
392 HomeOrganisationsListPref.clear();
394 HomeNoteList.clear();
395 HomeNoteListLanguage.clear();
396 HomeNoteListAltID.clear();
397 HomeNoteListPID.clear();
398 HomeNoteListType.clear();
399 HomeNoteListTokens.clear();
400 HomeNoteListPref.clear();
402 /* Items on the Business tab */
404 BusinessNicknamesList.clear();
405 BusinessNicknamesListType.clear();
406 BusinessNicknamesListLanguage.clear();
407 BusinessNicknamesListAltID.clear();
408 BusinessNicknamesListPID.clear();
409 BusinessNicknamesListTokens.clear();
410 BusinessNicknamesListPref.clear();
412 BusinessAddressList.clear();
413 BusinessAddressListTown.clear();
414 BusinessAddressListCounty.clear();
415 BusinessAddressListPostCode.clear();
416 BusinessAddressListCountry.clear();
417 BusinessAddressListLabel.clear();
418 BusinessAddressListLang.clear();
419 BusinessAddressListAltID.clear();
420 BusinessAddressListPID.clear();
421 BusinessAddressListTokens.clear();
422 BusinessAddressListGeo.clear();
423 BusinessAddressListTimezone.clear();
424 BusinessAddressListType.clear();
425 BusinessAddressListMediatype.clear();
426 BusinessAddressListPref.clear();
428 BusinessEmailList.clear();
429 BusinessEmailListAltID.clear();
430 BusinessEmailListPID.clear();
431 BusinessEmailListType.clear();
432 BusinessEmailListTokens.clear();
433 BusinessEmailListPref.clear();
435 BusinessIMList.clear();
436 BusinessIMListAltID.clear();
437 BusinessIMListPID.clear();
438 BusinessIMListType.clear();
439 BusinessIMListTokens.clear();
440 BusinessIMListMediatype.clear();
441 BusinessIMListPref.clear();
443 BusinessTelephoneList.clear();
444 BusinessTelephoneListAltID.clear();
445 BusinessTelephoneListPID.clear();
446 BusinessTelephoneListType.clear();
447 BusinessTelephoneListTokens.clear();
448 BusinessTelephoneListPref.clear();
450 BusinessLanguageList.clear();
451 BusinessLanguageListAltID.clear();
452 BusinessLanguageListPID.clear();
453 BusinessLanguageListType.clear();
454 BusinessLanguageListTokens.clear();
455 BusinessLanguageListPref.clear();
457 BusinessTZList.clear();
458 BusinessTZListAltID.clear();
459 BusinessTZListPID.clear();
460 BusinessTZListType.clear();
461 BusinessTZListTokens.clear();
462 BusinessTZListMediatype.clear();
463 BusinessTZListPref.clear();
465 BusinessGeographyList.clear();
466 BusinessGeographyListAltID.clear();
467 BusinessGeographyListPID.clear();
468 BusinessGeographyListType.clear();
469 BusinessGeographyListTokens.clear();
470 BusinessGeographyListMediatype.clear();
471 BusinessGeographyListPref.clear();
473 BusinessRelatedList.clear();
474 BusinessRelatedListRelType.clear();
475 BusinessRelatedListLanguage.clear();
476 BusinessRelatedListAltID.clear();
477 BusinessRelatedListPID.clear();
478 BusinessRelatedListType.clear();
479 BusinessRelatedListTokens.clear();
480 BusinessRelatedListPref.clear();
482 BusinessWebsiteList.clear();
483 BusinessWebsiteListAltID.clear();
484 BusinessWebsiteListPID.clear();
485 BusinessWebsiteListType.clear();
486 BusinessWebsiteListTokens.clear();
487 BusinessWebsiteListMediatype.clear();
488 BusinessWebsiteListPref.clear();
490 BusinessTitleList.clear();
491 BusinessTitleListLanguage.clear();
492 BusinessTitleListAltID.clear();
493 BusinessTitleListPID.clear();
494 BusinessTitleListType.clear();
495 BusinessTitleListTokens.clear();
496 BusinessTitleListPref.clear();
498 BusinessRoleList.clear();
499 BusinessRoleListLanguage.clear();
500 BusinessRoleListAltID.clear();
501 BusinessRoleListPID.clear();
502 BusinessRoleListType.clear();
503 BusinessRoleListTokens.clear();
504 BusinessRoleListPref.clear();
506 BusinessOrganisationsList.clear();
507 BusinessOrganisationsListLanguage.clear();
508 BusinessOrganisationsListAltID.clear();
509 BusinessOrganisationsListPID.clear();
510 BusinessOrganisationsListType.clear();
511 BusinessOrganisationsListTokens.clear();
512 BusinessOrganisationsListSortAs.clear();
513 BusinessOrganisationsListPref.clear();
515 BusinessNoteList.clear();
516 BusinessNoteListLanguage.clear();
517 BusinessNoteListAltID.clear();
518 BusinessNoteListPID.clear();
519 BusinessNoteListType.clear();
520 BusinessNoteListTokens.clear();
521 BusinessNoteListPref.clear();
523 /* Items on the Categories tab */
525 CategoriesList.clear();
526 CategoriesListAltID.clear();
527 CategoriesListPID.clear();
528 CategoriesListType.clear();
529 CategoriesListTokens.clear();
530 CategoriesListPref.clear();
532 /* Items on the Groups tab */
535 GroupsListAltID.clear();
536 GroupsListPID.clear();
537 GroupsListType.clear();
538 GroupsListTokens.clear();
539 GroupsListPref.clear();
541 /* Items on the Pictures tab */
543 PicturesList.clear();
544 PicturesListAltID.clear();
545 PicturesListPID.clear();
546 PicturesListType.clear();
547 PicturesListPicEncType.clear();
548 PicturesListPictureType.clear();
549 PicturesListTokens.clear();
550 PicturesListMediatype.clear();
551 PicturesListPref.clear();
553 /* Items on the Logos tab */
556 LogosListAltID.clear();
557 LogosListPID.clear();
558 LogosListType.clear();
559 LogosListPicEncType.clear();
560 LogosListPictureType.clear();
561 LogosListTokens.clear();
562 LogosListMediatype.clear();
563 LogosListPref.clear();
565 /* Items on the Sounds tab */
568 SoundsListAltID.clear();
569 SoundsListPID.clear();
570 SoundsListType.clear();
571 SoundsListAudioEncType.clear();
572 SoundsListAudioType.clear();
573 SoundsListTokens.clear();
574 SoundsListMediatype.clear();
575 SoundsListPref.clear();
577 /* Items on the Calendaring tab */
579 CalendarList.clear();
580 CalendarListAltID.clear();
581 CalendarListPID.clear();
582 CalendarListType.clear();
583 CalendarListTokens.clear();
584 CalendarListMediatype.clear();
585 CalendarListPref.clear();
587 CalendarRequestList.clear();
588 CalendarRequestListAltID.clear();
589 CalendarRequestListPID.clear();
590 CalendarRequestListType.clear();
591 CalendarRequestListTokens.clear();
592 CalendarRequestListMediatype.clear();
593 CalendarRequestListPref.clear();
595 FreeBusyList.clear();
596 FreeBusyListAltID.clear();
597 FreeBusyListPID.clear();
598 FreeBusyListType.clear();
599 FreeBusyListTokens.clear();
600 FreeBusyListMediatype.clear();
601 FreeBusyListPref.clear();
603 /* Items on the Security tab */
606 KeyListAltID.clear();
608 KeyListKeyType.clear();
609 KeyListDataType.clear();
610 KeyListDataEncType.clear();
612 KeyListTokens.clear();
615 /* Items on the Other tab */
618 VendorListPEN.clear();
619 VendorListElement.clear();
622 XTokenListTokens.clear();
624 wxSContactFilename.Clear();
625 boolContactModified = FALSE;
626 intSeekSelectedData = 0;
628 /* Section for saving/loading data */
631 ETagOriginal.Clear();
642 BinaryDataProc = FALSE;
646 PictureImage = wxNullBitmap;
647 LogoImage = wxNullBitmap;