1 // frmContactEditor-Calendar.cpp - frmContactEditor Calendar tab 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"
20 #include "frmContactEditorCalAdr.h"
22 void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
26 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
27 frameCECalAdr->SetEditorMode(FALSE);
28 intResult = GetLastInt(&CalendarList);
29 frameCECalAdr->SetupPointers(&CalendarList,
37 frameCECalAdr->ShowModal();
42 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
44 long longSelected = -1;
45 int intSelectedData = 0;
47 if (!GetSelectedItem(lboCalendarAddresses,
53 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
54 frameCECalAdr->SetupPointers(&CalendarList,
62 frameCECalAdr->SetEditorMode(TRUE);
63 frameCECalAdr->ShowModal();
68 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
70 long longSelected = -1;
71 int intSelectedData = 0;
73 if (!GetSelectedItem(lboCalendarAddresses,
79 lboCalendarAddresses->DeleteItem(longSelected);
81 DeleteMapData(intSelectedData, &CalendarList, &CalendarListAltID,
82 &CalendarListPID, &CalendarListType, &CalendarListTokens,
87 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
91 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
92 frameCECalAdr->SetEditorMode(FALSE);
93 intResult = GetLastInt(&CalendarRequestList);
94 frameCECalAdr->SetupPointers(&CalendarRequestList,
95 &CalendarRequestListAltID,
96 &CalendarRequestListPID,
97 &CalendarRequestListType,
98 &CalendarRequestListTokens,
99 &CalendarRequestListPref,
100 lboCalendarRequestAddress,
102 frameCECalAdr->ShowModal();
103 delete frameCECalAdr;
104 frameCECalAdr = NULL;
107 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
109 long longSelected = -1;
110 int intSelectedData = 0;
112 if (!GetSelectedItem(lboCalendarRequestAddress,
118 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
119 frameCECalAdr->SetupPointers(&CalendarList,
120 &CalendarRequestListAltID,
121 &CalendarRequestListPID,
122 &CalendarRequestListType,
123 &CalendarRequestListTokens,
124 &CalendarRequestListPref,
125 lboCalendarRequestAddress,
127 frameCECalAdr->SetEditorMode(TRUE);
128 frameCECalAdr->ShowModal();
129 delete frameCECalAdr;
130 frameCECalAdr = NULL;
133 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
135 long longSelected = -1;
136 int intSelectedData = 0;
138 if (!GetSelectedItem(lboCalendarRequestAddress,
144 lboCalendarRequestAddress->DeleteItem(longSelected);
146 DeleteMapData(intSelectedData, &CalendarRequestList,
147 &CalendarRequestListAltID, &CalendarRequestListPID,
148 &CalendarRequestListType, &CalendarRequestListTokens,
149 &CalendarRequestListPref);
152 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
156 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
157 frameCECalAdr->SetEditorMode(FALSE);
158 intResult = GetLastInt(&FreeBusyList);
159 frameCECalAdr->SetupPointers(&FreeBusyList,
165 lboFreeBusyAddresses,
167 frameCECalAdr->ShowModal();
168 delete frameCECalAdr;
169 frameCECalAdr = NULL;
172 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
174 long longSelected = -1;
175 int intSelectedData = 0;
177 if (!GetSelectedItem(lboFreeBusyAddresses,
183 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
184 frameCECalAdr->SetupPointers(&FreeBusyList,
190 lboFreeBusyAddresses,
192 frameCECalAdr->SetEditorMode(TRUE);
193 frameCECalAdr->ShowModal();
194 delete frameCECalAdr;
195 frameCECalAdr = NULL;
198 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
200 long longSelected = -1;
201 int intSelectedData = 0;
203 if (!GetSelectedItem(lboFreeBusyAddresses,
209 lboFreeBusyAddresses->DeleteItem(longSelected);
211 DeleteMapData(intSelectedData, &FreeBusyList, &FreeBusyListAltID,
212 &FreeBusyListPID, &FreeBusyListType, &FreeBusyListTokens,