1 // frmContactEditor-Init.cpp - frmContactEditor Initalisation 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::SetupHeaders()
24 // Setup the list control headers.
26 /* Items for the General Tab */
28 SetupColumn(CE_NICKNAME, lboNicknames);
29 SetupColumn(CE_ADDRESS, lboAddresses);
30 SetupColumn(CE_EMAIL, lboEmails);
31 SetupColumn(CE_IM, lboIM);
32 SetupColumn(CE_TELEPHONE, lboTelephone);
33 SetupColumn(CE_LANG, lboLanguages);
34 SetupColumn(CE_TZ, lboTimezones);
35 SetupColumn(CE_GEOPOSITION, lboGeoposition);
36 SetupColumn(CE_RELATED, lboRelated);
37 SetupColumn(CE_WEBSITE, lboWebsites);
38 SetupColumn(CE_TITLE, lboTitles);
39 SetupColumn(CE_ROLE, lboRoles);
40 SetupColumn(CE_ORG, lboOrganisations);
41 SetupColumn(CE_NOTE, lboNotes);
43 /* Items for the Home Tab */
45 SetupColumn(CE_NICKNAME, lboHomeNicknames);
46 SetupColumn(CE_ADDRESS, lboHomeAddresses);
47 SetupColumn(CE_EMAIL, lboHomeEmails);
48 SetupColumn(CE_IM, lboHomeIM);
49 SetupColumn(CE_TELEPHONE, lboHomeTelephone);
50 SetupColumn(CE_LANG, lboHomeLanguages);
51 SetupColumn(CE_TZ, lboHomeTimezones);
52 SetupColumn(CE_GEOPOSITION, lboHomeGeoposition);
53 SetupColumn(CE_WEBSITE, lboHomeWebsites);
54 SetupColumn(CE_TITLE, lboHomeTitles);
55 SetupColumn(CE_ROLE, lboHomeRoles);
56 SetupColumn(CE_ORG, lboHomeOrganisations);
57 SetupColumn(CE_NOTE, lboHomeNotes);
59 /* Items for the Business Tab */
61 SetupColumn(CE_NICKNAME, lboBusinessNicknames);
62 SetupColumn(CE_ADDRESS, lboBusinessAddresses);
63 SetupColumn(CE_EMAIL, lboBusinessEmail);
64 SetupColumn(CE_IM, lboBusinessIM);
65 SetupColumn(CE_TELEPHONE, lboBusinessTelephone);
66 SetupColumn(CE_LANG, lboBusinessLanguages);
67 SetupColumn(CE_TZ, lboBusinessTimezones);
68 SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition);
69 SetupColumn(CE_WEBSITE, lboBusinessWebsites);
70 SetupColumn(CE_TITLE, lboBusinessTitles);
71 SetupColumn(CE_ROLE, lboBusinessRoles);
72 SetupColumn(CE_ORG, lboBusinessOrganisations);
73 SetupColumn(CE_NOTE, lboBusinessNotes);
75 /* Items for the Categories Tab */
77 SetupColumn(CE_CATEGORIES, lboCategories);
79 /* Items for the Groups Tab */
81 SetupColumn(CE_GROUPS, lboGroups);
83 /* Items for the Pictures and Logos Tab */
85 SetupColumn(CE_PICTURES, lboPictures);
86 SetupColumn(CE_PICTURES, lboLogos);
88 /* Items for the Sounds Tab */
90 SetupColumn(CE_SOUNDS, lboSounds);
92 /* Items for the Calendaring Tab */
94 SetupColumn(CE_CALENDAR, lboCalendarAddresses);
95 SetupColumn(CE_CALENDAR, lboCalendarRequestAddress);
96 SetupColumn(CE_CALENDAR, lboFreeBusyAddresses);
98 /* Items for the Security Tab */
100 SetupColumn(CE_KEY, lboKeys);
102 /* Items for the Other Tab */
104 SetupColumn(CE_TOKEN, lboVendorNamespace);
105 SetupColumn(CE_TOKEN, lboXToken);
109 void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl)
112 // Setup the columns.
116 if (ColumnType == CE_NICKNAME){
119 coldata.SetText(_("Nickname"));
120 coldata.SetWidth(128);
121 ListCtrl->InsertColumn(0, coldata);
124 coldata.SetText(_("Pri."));
125 coldata.SetWidth(32);
126 ListCtrl->InsertColumn(1, coldata);
128 } else if (ColumnType == CE_ADDRESS){
131 coldata.SetText(_("Address"));
132 coldata.SetWidth(128);
133 ListCtrl->InsertColumn(0, coldata);
136 coldata.SetText(_("Town"));
137 coldata.SetWidth(64);
138 ListCtrl->InsertColumn(1, coldata);
141 coldata.SetText(_("County"));
142 coldata.SetWidth(64);
143 ListCtrl->InsertColumn(2, coldata);
146 coldata.SetText(_("Post code"));
147 coldata.SetWidth(48);
148 ListCtrl->InsertColumn(3, coldata);
151 coldata.SetText(_("Pri."));
152 coldata.SetWidth(32);
153 ListCtrl->InsertColumn(4, coldata);
155 } else if (ColumnType == CE_EMAIL){
158 coldata.SetText(_("Email address"));
159 coldata.SetWidth(304);
160 ListCtrl->InsertColumn(0, coldata);
163 coldata.SetText(_("Pri."));
164 coldata.SetWidth(32);
165 ListCtrl->InsertColumn(1, coldata);
167 } else if (ColumnType == CE_IM){
170 coldata.SetText(_("Type"));
171 coldata.SetWidth(64);
172 ListCtrl->InsertColumn(0, coldata);
175 coldata.SetText(_("Address"));
176 coldata.SetWidth(240);
177 ListCtrl->InsertColumn(1, coldata);
180 coldata.SetText(_("Pri."));
181 coldata.SetWidth(32);
182 ListCtrl->InsertColumn(2, coldata);
184 } else if (ColumnType == CE_TELEPHONE){
187 coldata.SetText(_("Telephone number"));
188 coldata.SetWidth(128);
189 ListCtrl->InsertColumn(0, coldata);
192 coldata.SetText(_("Type"));
193 coldata.SetWidth(64);
194 ListCtrl->InsertColumn(1, coldata);
197 coldata.SetText(_("Pri."));
198 coldata.SetWidth(32);
199 ListCtrl->InsertColumn(2, coldata);
201 } else if (ColumnType == CE_LANG){
204 coldata.SetText(_("Language"));
205 coldata.SetWidth(128);
206 ListCtrl->InsertColumn(0, coldata);
209 coldata.SetText(_("Pri."));
210 coldata.SetWidth(32);
211 ListCtrl->InsertColumn(1, coldata);
213 } else if (ColumnType == CE_TZ){
216 coldata.SetText(_("Timezone"));
217 coldata.SetWidth(192);
218 ListCtrl->InsertColumn(0, coldata);
221 coldata.SetText(_("Pri."));
222 coldata.SetWidth(32);
223 ListCtrl->InsertColumn(1, coldata);
225 } else if (ColumnType == CE_RELATED){
228 coldata.SetText(_("Type"));
229 coldata.SetWidth(64);
230 ListCtrl->InsertColumn(0, coldata);
233 coldata.SetText(_("Name/Description"));
234 coldata.SetWidth(192);
235 ListCtrl->InsertColumn(1, coldata);
238 coldata.SetText(_("Pri."));
239 coldata.SetWidth(32);
240 ListCtrl->InsertColumn(2, coldata);
242 } else if (ColumnType == CE_WEBSITE){
245 coldata.SetText(_("Website"));
246 coldata.SetWidth(288);
247 ListCtrl->InsertColumn(0, coldata);
250 coldata.SetText(_("Pri."));
251 coldata.SetWidth(32);
252 ListCtrl->InsertColumn(1, coldata);
254 } else if (ColumnType == CE_TITLE){
257 coldata.SetText(_("Title"));
258 coldata.SetWidth(288);
259 ListCtrl->InsertColumn(0, coldata);
262 coldata.SetText(_("Pri."));
263 coldata.SetWidth(32);
264 ListCtrl->InsertColumn(1, coldata);
266 } else if (ColumnType == CE_ROLE){
269 coldata.SetText(_("Role"));
270 coldata.SetWidth(288);
271 ListCtrl->InsertColumn(0, coldata);
274 coldata.SetText(_("Pri."));
275 coldata.SetWidth(32);
276 ListCtrl->InsertColumn(1, coldata);
278 } else if (ColumnType == CE_ORG){
281 coldata.SetText(_("Organisation"));
282 coldata.SetWidth(288);
283 ListCtrl->InsertColumn(0, coldata);
286 coldata.SetText(_("Pri."));
287 coldata.SetWidth(32);
288 ListCtrl->InsertColumn(1, coldata);
290 } else if (ColumnType == CE_NOTE){
293 coldata.SetText(_("Notes"));
294 coldata.SetWidth(288);
295 ListCtrl->InsertColumn(0, coldata);
298 coldata.SetText(_("Pri."));
299 coldata.SetWidth(32);
300 ListCtrl->InsertColumn(1, coldata);
302 } else if (ColumnType == CE_CATEGORIES){
305 coldata.SetText(_("Category"));
306 coldata.SetWidth(320);
307 ListCtrl->InsertColumn(0, coldata);
310 coldata.SetText(_("Pri."));
311 coldata.SetWidth(32);
312 ListCtrl->InsertColumn(1, coldata);
314 } else if (ColumnType == CE_GROUPS){
317 coldata.SetText(_("Member"));
318 coldata.SetWidth(320);
319 ListCtrl->InsertColumn(0, coldata);
321 } else if (ColumnType == CE_GEOPOSITION){
324 coldata.SetText(_("Geoposition"));
325 coldata.SetWidth(320);
326 ListCtrl->InsertColumn(0, coldata);
329 coldata.SetText(_("Pri."));
330 coldata.SetWidth(32);
331 ListCtrl->InsertColumn(1, coldata);
333 } else if (ColumnType == CE_PICTURES){
336 coldata.SetText(_("Pictures"));
337 coldata.SetWidth(128);
338 ListCtrl->InsertColumn(0, coldata);
341 coldata.SetText(_("Type"));
342 coldata.SetWidth(64);
343 ListCtrl->InsertColumn(1, coldata);
346 coldata.SetText(_("Pri."));
347 coldata.SetWidth(32);
348 ListCtrl->InsertColumn(2, coldata);
350 } else if (ColumnType == CE_SOUNDS){
353 coldata.SetText(_("Sounds"));
354 coldata.SetWidth(128);
355 ListCtrl->InsertColumn(0, coldata);
358 coldata.SetText(_("Type"));
359 coldata.SetWidth(64);
360 ListCtrl->InsertColumn(1, coldata);
363 coldata.SetText(_("Pri."));
364 coldata.SetWidth(32);
365 ListCtrl->InsertColumn(2, coldata);
367 } else if (ColumnType == CE_CALENDAR){
370 coldata.SetText(_("Calendar Address"));
371 coldata.SetWidth(224);
372 ListCtrl->InsertColumn(0, coldata);
375 coldata.SetText(_("Type"));
376 coldata.SetWidth(64);
377 ListCtrl->InsertColumn(1, coldata);
380 coldata.SetText(_("Pri."));
381 coldata.SetWidth(32);
382 ListCtrl->InsertColumn(2, coldata);
384 } else if (ColumnType == CE_KEY){
387 coldata.SetText(_("Key information"));
388 coldata.SetWidth(224);
389 ListCtrl->InsertColumn(0, coldata);
392 coldata.SetText(_("Type"));
393 coldata.SetWidth(64);
394 ListCtrl->InsertColumn(1, coldata);
397 coldata.SetText(_("Pri."));
398 coldata.SetWidth(32);
399 ListCtrl->InsertColumn(2, coldata);
401 } else if (ColumnType == CE_TOKEN){
404 coldata.SetText(_("Token"));
405 coldata.SetWidth(320);
406 ListCtrl->InsertColumn(0, coldata);