// frmContactEditor-Init.cpp - frmContactEditor Initalisation subroutines. // // (c) 2012-2015 Xestia Software Development. // // This file is part of Xestia Address Book. // // Xestia Address Book is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // // Xestia Address Book is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with Xestia Address Book. If not, see #include "frmContactEditor.h" void frmContactEditor::SetupHeaders() { // Setup the list control headers. /* Items for the General Tab */ SetupColumn(CE_NICKNAME, lboNicknames); SetupColumn(CE_ADDRESS, lboAddresses); SetupColumn(CE_EMAIL, lboEmails); SetupColumn(CE_IM, lboIM); SetupColumn(CE_TELEPHONE, lboTelephone); SetupColumn(CE_LANG, lboLanguages); SetupColumn(CE_TZ, lboTimezones); SetupColumn(CE_GEOPOSITION, lboGeoposition); SetupColumn(CE_RELATED, lboRelated); SetupColumn(CE_WEBSITE, lboWebsites); SetupColumn(CE_TITLE, lboTitles); SetupColumn(CE_ROLE, lboRoles); SetupColumn(CE_ORG, lboOrganisations); SetupColumn(CE_NOTE, lboNotes); /* Items for the Home Tab */ SetupColumn(CE_NICKNAME, lboHomeNicknames); SetupColumn(CE_ADDRESS, lboHomeAddresses); SetupColumn(CE_EMAIL, lboHomeEmails); SetupColumn(CE_IM, lboHomeIM); SetupColumn(CE_TELEPHONE, lboHomeTelephone); SetupColumn(CE_LANG, lboHomeLanguages); SetupColumn(CE_TZ, lboHomeTimezones); SetupColumn(CE_GEOPOSITION, lboHomeGeoposition); SetupColumn(CE_WEBSITE, lboHomeWebsites); SetupColumn(CE_TITLE, lboHomeTitles); SetupColumn(CE_ROLE, lboHomeRoles); SetupColumn(CE_ORG, lboHomeOrganisations); SetupColumn(CE_NOTE, lboHomeNotes); /* Items for the Business Tab */ SetupColumn(CE_NICKNAME, lboBusinessNicknames); SetupColumn(CE_ADDRESS, lboBusinessAddresses); SetupColumn(CE_EMAIL, lboBusinessEmail); SetupColumn(CE_IM, lboBusinessIM); SetupColumn(CE_TELEPHONE, lboBusinessTelephone); SetupColumn(CE_LANG, lboBusinessLanguages); SetupColumn(CE_TZ, lboBusinessTimezones); SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition); SetupColumn(CE_WEBSITE, lboBusinessWebsites); SetupColumn(CE_TITLE, lboBusinessTitles); SetupColumn(CE_ROLE, lboBusinessRoles); SetupColumn(CE_ORG, lboBusinessOrganisations); SetupColumn(CE_NOTE, lboBusinessNotes); /* Items for the Categories Tab */ SetupColumn(CE_CATEGORIES, lboCategories); /* Items for the Groups Tab */ SetupColumn(CE_GROUPS, lboGroups); /* Items for the Pictures and Logos Tab */ SetupColumn(CE_PICTURES, lboPictures); SetupColumn(CE_PICTURES, lboLogos); /* Items for the Sounds Tab */ SetupColumn(CE_SOUNDS, lboSounds); /* Items for the Calendaring Tab */ SetupColumn(CE_CALENDAR, lboCalendarAddresses); SetupColumn(CE_CALENDAR, lboCalendarRequestAddress); SetupColumn(CE_CALENDAR, lboFreeBusyAddresses); /* Items for the Security Tab */ SetupColumn(CE_KEY, lboKeys); /* Items for the Other Tab */ SetupColumn(CE_TOKEN, lboVendorNamespace); SetupColumn(CE_TOKEN, lboXToken); } void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl) { // Setup the columns. wxListItem coldata; if (ColumnType == CE_NICKNAME){ coldata.SetId(0); coldata.SetText(_("Nickname")); coldata.SetWidth(128); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_ADDRESS){ coldata.SetId(0); coldata.SetText(_("Address")); coldata.SetWidth(128); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Town")); coldata.SetWidth(64); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("County")); coldata.SetWidth(64); ListCtrl->InsertColumn(2, coldata); coldata.SetId(3); coldata.SetText(_("Post code")); coldata.SetWidth(48); ListCtrl->InsertColumn(3, coldata); coldata.SetId(4); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(4, coldata); } else if (ColumnType == CE_EMAIL){ coldata.SetId(0); coldata.SetText(_("Email address")); coldata.SetWidth(304); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_IM){ coldata.SetId(0); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Address")); coldata.SetWidth(240); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_TELEPHONE){ coldata.SetId(0); coldata.SetText(_("Telephone number")); coldata.SetWidth(128); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_LANG){ coldata.SetId(0); coldata.SetText(_("Language")); coldata.SetWidth(128); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_TZ){ coldata.SetId(0); coldata.SetText(_("Timezone")); coldata.SetWidth(192); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_RELATED){ coldata.SetId(0); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Name/Description")); coldata.SetWidth(192); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_WEBSITE){ coldata.SetId(0); coldata.SetText(_("Website")); coldata.SetWidth(288); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_TITLE){ coldata.SetId(0); coldata.SetText(_("Title")); coldata.SetWidth(288); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_ROLE){ coldata.SetId(0); coldata.SetText(_("Role")); coldata.SetWidth(288); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_ORG){ coldata.SetId(0); coldata.SetText(_("Organisation")); coldata.SetWidth(288); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_NOTE){ coldata.SetId(0); coldata.SetText(_("Notes")); coldata.SetWidth(288); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_CATEGORIES){ coldata.SetId(0); coldata.SetText(_("Category")); coldata.SetWidth(320); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_GROUPS){ coldata.SetId(0); coldata.SetText(_("Member")); coldata.SetWidth(320); ListCtrl->InsertColumn(0, coldata); } else if (ColumnType == CE_GEOPOSITION){ coldata.SetId(0); coldata.SetText(_("Geoposition")); coldata.SetWidth(320); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(1, coldata); } else if (ColumnType == CE_PICTURES){ coldata.SetId(0); coldata.SetText(_("Pictures")); coldata.SetWidth(128); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_SOUNDS){ coldata.SetId(0); coldata.SetText(_("Sounds")); coldata.SetWidth(128); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_CALENDAR){ coldata.SetId(0); coldata.SetText(_("Calendar Address")); coldata.SetWidth(224); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_KEY){ coldata.SetId(0); coldata.SetText(_("Key information")); coldata.SetWidth(224); ListCtrl->InsertColumn(0, coldata); coldata.SetId(1); coldata.SetText(_("Type")); coldata.SetWidth(64); ListCtrl->InsertColumn(1, coldata); coldata.SetId(2); coldata.SetText(_("Pri.")); coldata.SetWidth(32); ListCtrl->InsertColumn(2, coldata); } else if (ColumnType == CE_TOKEN){ coldata.SetId(0); coldata.SetText(_("Token")); coldata.SetWidth(320); ListCtrl->InsertColumn(0, coldata); } }