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 /* Items for the General Tab */
26 SetupColumn(CE_NICKNAME, lboNicknames);
27 SetupColumn(CE_ADDRESS, lboAddresses);
28 SetupColumn(CE_EMAIL, lboEmails);
29 SetupColumn(CE_IM, lboIM);
30 SetupColumn(CE_TELEPHONE, lboTelephone);
31 SetupColumn(CE_LANG, lboLanguages);
32 SetupColumn(CE_TZ, lboTimezones);
33 SetupColumn(CE_GEOPOSITION, lboGeoposition);
34 SetupColumn(CE_RELATED, lboRelated);
35 SetupColumn(CE_WEBSITE, lboWebsites);
36 SetupColumn(CE_TITLE, lboTitles);
37 SetupColumn(CE_ROLE, lboRoles);
38 SetupColumn(CE_ORG, lboOrganisations);
39 SetupColumn(CE_NOTE, lboNotes);
41 /* Items for the Home Tab */
43 SetupColumn(CE_NICKNAME, lboHomeNicknames);
44 SetupColumn(CE_ADDRESS, lboHomeAddresses);
45 SetupColumn(CE_EMAIL, lboHomeEmails);
46 SetupColumn(CE_IM, lboHomeIM);
47 SetupColumn(CE_TELEPHONE, lboHomeTelephone);
48 SetupColumn(CE_LANG, lboHomeLanguages);
49 SetupColumn(CE_TZ, lboHomeTimezones);
50 SetupColumn(CE_GEOPOSITION, lboHomeGeoposition);
51 SetupColumn(CE_WEBSITE, lboHomeWebsites);
52 SetupColumn(CE_TITLE, lboHomeTitles);
53 SetupColumn(CE_ROLE, lboHomeRoles);
54 SetupColumn(CE_ORG, lboHomeOrganisations);
55 SetupColumn(CE_NOTE, lboHomeNotes);
57 /* Items for the Business Tab */
59 SetupColumn(CE_NICKNAME, lboBusinessNicknames);
60 SetupColumn(CE_ADDRESS, lboBusinessAddresses);
61 SetupColumn(CE_EMAIL, lboBusinessEmail);
62 SetupColumn(CE_IM, lboBusinessIM);
63 SetupColumn(CE_TELEPHONE, lboBusinessTelephone);
64 SetupColumn(CE_LANG, lboBusinessLanguages);
65 SetupColumn(CE_TZ, lboBusinessTimezones);
66 SetupColumn(CE_GEOPOSITION, lboBusinessGeoposition);
67 SetupColumn(CE_WEBSITE, lboBusinessWebsites);
68 SetupColumn(CE_TITLE, lboBusinessTitles);
69 SetupColumn(CE_ROLE, lboBusinessRoles);
70 SetupColumn(CE_ORG, lboBusinessOrganisations);
71 SetupColumn(CE_NOTE, lboBusinessNotes);
73 /* Items for the Categories Tab */
75 SetupColumn(CE_CATEGORIES, lboCategories);
77 /* Items for the Groups Tab */
79 SetupColumn(CE_GROUPS, lboGroups);
81 /* Items for the Pictures and Logos Tab */
83 SetupColumn(CE_PICTURES, lboPictures);
84 SetupColumn(CE_PICTURES, lboLogos);
86 /* Items for the Sounds Tab */
88 SetupColumn(CE_SOUNDS, lboSounds);
90 /* Items for the Calendaring Tab */
92 SetupColumn(CE_CALENDAR, lboCalendarAddresses);
93 SetupColumn(CE_CALENDAR, lboCalendarRequestAddress);
94 SetupColumn(CE_CALENDAR, lboFreeBusyAddresses);
96 /* Items for the Security Tab */
98 SetupColumn(CE_KEY, lboKeys);
100 /* Items for the Other Tab */
102 SetupColumn(CE_TOKEN, lboVendorNamespace);
103 SetupColumn(CE_TOKEN, lboXToken);
107 void frmContactEditor::SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl)
112 if (ColumnType == CE_NICKNAME){
115 coldata.SetText(_("Nickname"));
116 coldata.SetWidth(128);
117 ListCtrl->InsertColumn(0, coldata);
120 coldata.SetText(_("Pri."));
121 coldata.SetWidth(32);
122 ListCtrl->InsertColumn(1, coldata);
124 } else if (ColumnType == CE_ADDRESS){
127 coldata.SetText(_("Address"));
128 coldata.SetWidth(128);
129 ListCtrl->InsertColumn(0, coldata);
132 coldata.SetText(_("Town"));
133 coldata.SetWidth(64);
134 ListCtrl->InsertColumn(1, coldata);
137 coldata.SetText(_("County"));
138 coldata.SetWidth(64);
139 ListCtrl->InsertColumn(2, coldata);
142 coldata.SetText(_("Post code"));
143 coldata.SetWidth(48);
144 ListCtrl->InsertColumn(3, coldata);
147 coldata.SetText(_("Pri."));
148 coldata.SetWidth(32);
149 ListCtrl->InsertColumn(4, coldata);
151 } else if (ColumnType == CE_EMAIL){
154 coldata.SetText(_("Email address"));
155 coldata.SetWidth(304);
156 ListCtrl->InsertColumn(0, coldata);
159 coldata.SetText(_("Pri."));
160 coldata.SetWidth(32);
161 ListCtrl->InsertColumn(1, coldata);
163 } else if (ColumnType == CE_IM){
166 coldata.SetText(_("Type"));
167 coldata.SetWidth(64);
168 ListCtrl->InsertColumn(0, coldata);
171 coldata.SetText(_("Address"));
172 coldata.SetWidth(240);
173 ListCtrl->InsertColumn(1, coldata);
176 coldata.SetText(_("Pri."));
177 coldata.SetWidth(32);
178 ListCtrl->InsertColumn(2, coldata);
180 } else if (ColumnType == CE_TELEPHONE){
183 coldata.SetText(_("Telephone number"));
184 coldata.SetWidth(128);
185 ListCtrl->InsertColumn(0, coldata);
188 coldata.SetText(_("Type"));
189 coldata.SetWidth(64);
190 ListCtrl->InsertColumn(1, coldata);
193 coldata.SetText(_("Pri."));
194 coldata.SetWidth(32);
195 ListCtrl->InsertColumn(2, coldata);
197 } else if (ColumnType == CE_LANG){
200 coldata.SetText(_("Language"));
201 coldata.SetWidth(128);
202 ListCtrl->InsertColumn(0, coldata);
205 coldata.SetText(_("Pri."));
206 coldata.SetWidth(32);
207 ListCtrl->InsertColumn(1, coldata);
209 } else if (ColumnType == CE_TZ){
212 coldata.SetText(_("Timezone"));
213 coldata.SetWidth(192);
214 ListCtrl->InsertColumn(0, coldata);
217 coldata.SetText(_("Pri."));
218 coldata.SetWidth(32);
219 ListCtrl->InsertColumn(1, coldata);
221 } else if (ColumnType == CE_RELATED){
224 coldata.SetText(_("Type"));
225 coldata.SetWidth(64);
226 ListCtrl->InsertColumn(0, coldata);
229 coldata.SetText(_("Name/Description"));
230 coldata.SetWidth(192);
231 ListCtrl->InsertColumn(1, coldata);
234 coldata.SetText(_("Pri."));
235 coldata.SetWidth(32);
236 ListCtrl->InsertColumn(2, coldata);
238 } else if (ColumnType == CE_WEBSITE){
241 coldata.SetText(_("Website"));
242 coldata.SetWidth(288);
243 ListCtrl->InsertColumn(0, coldata);
246 coldata.SetText(_("Pri."));
247 coldata.SetWidth(32);
248 ListCtrl->InsertColumn(1, coldata);
250 } else if (ColumnType == CE_TITLE){
253 coldata.SetText(_("Title"));
254 coldata.SetWidth(288);
255 ListCtrl->InsertColumn(0, coldata);
258 coldata.SetText(_("Pri."));
259 coldata.SetWidth(32);
260 ListCtrl->InsertColumn(1, coldata);
262 } else if (ColumnType == CE_ROLE){
265 coldata.SetText(_("Role"));
266 coldata.SetWidth(288);
267 ListCtrl->InsertColumn(0, coldata);
270 coldata.SetText(_("Pri."));
271 coldata.SetWidth(32);
272 ListCtrl->InsertColumn(1, coldata);
274 } else if (ColumnType == CE_ORG){
277 coldata.SetText(_("Organisation"));
278 coldata.SetWidth(288);
279 ListCtrl->InsertColumn(0, coldata);
282 coldata.SetText(_("Pri."));
283 coldata.SetWidth(32);
284 ListCtrl->InsertColumn(1, coldata);
286 } else if (ColumnType == CE_NOTE){
289 coldata.SetText(_("Notes"));
290 coldata.SetWidth(288);
291 ListCtrl->InsertColumn(0, coldata);
294 coldata.SetText(_("Pri."));
295 coldata.SetWidth(32);
296 ListCtrl->InsertColumn(1, coldata);
298 } else if (ColumnType == CE_CATEGORIES){
301 coldata.SetText(_("Category"));
302 coldata.SetWidth(320);
303 ListCtrl->InsertColumn(0, coldata);
306 coldata.SetText(_("Pri."));
307 coldata.SetWidth(32);
308 ListCtrl->InsertColumn(1, coldata);
310 } else if (ColumnType == CE_GROUPS){
313 coldata.SetText(_("Member"));
314 coldata.SetWidth(320);
315 ListCtrl->InsertColumn(0, coldata);
317 } else if (ColumnType == CE_GEOPOSITION){
320 coldata.SetText(_("Geoposition"));
321 coldata.SetWidth(320);
322 ListCtrl->InsertColumn(0, coldata);
325 coldata.SetText(_("Pri."));
326 coldata.SetWidth(32);
327 ListCtrl->InsertColumn(1, coldata);
329 } else if (ColumnType == CE_PICTURES){
332 coldata.SetText(_("Pictures"));
333 coldata.SetWidth(128);
334 ListCtrl->InsertColumn(0, coldata);
337 coldata.SetText(_("Type"));
338 coldata.SetWidth(64);
339 ListCtrl->InsertColumn(1, coldata);
342 coldata.SetText(_("Pri."));
343 coldata.SetWidth(32);
344 ListCtrl->InsertColumn(2, coldata);
346 } else if (ColumnType == CE_SOUNDS){
349 coldata.SetText(_("Sounds"));
350 coldata.SetWidth(128);
351 ListCtrl->InsertColumn(0, coldata);
354 coldata.SetText(_("Type"));
355 coldata.SetWidth(64);
356 ListCtrl->InsertColumn(1, coldata);
359 coldata.SetText(_("Pri."));
360 coldata.SetWidth(32);
361 ListCtrl->InsertColumn(2, coldata);
363 } else if (ColumnType == CE_CALENDAR){
366 coldata.SetText(_("Calendar Address"));
367 coldata.SetWidth(224);
368 ListCtrl->InsertColumn(0, coldata);
371 coldata.SetText(_("Type"));
372 coldata.SetWidth(64);
373 ListCtrl->InsertColumn(1, coldata);
376 coldata.SetText(_("Pri."));
377 coldata.SetWidth(32);
378 ListCtrl->InsertColumn(2, coldata);
380 } else if (ColumnType == CE_KEY){
383 coldata.SetText(_("Key information"));
384 coldata.SetWidth(224);
385 ListCtrl->InsertColumn(0, coldata);
388 coldata.SetText(_("Type"));
389 coldata.SetWidth(64);
390 ListCtrl->InsertColumn(1, coldata);
393 coldata.SetText(_("Pri."));
394 coldata.SetWidth(32);
395 ListCtrl->InsertColumn(2, coldata);
397 } else if (ColumnType == CE_TOKEN){
400 coldata.SetText(_("Token"));
401 coldata.SetWidth(320);
402 ListCtrl->InsertColumn(0, coldata);