1 // frmContactEditor-Other.cpp - frmContactEditor Other tab subroutines.
3 // (c) 2012-2016 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 "frmContactEditorVendor.h"
21 #include "frmContactEditorXToken.h"
23 void frmContactEditor::AddVendorNamespace( wxCommandEvent& event )
26 // Bring up the window for adding vendor namespace data.
30 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
31 frameCEVen->SetEditorMode(FALSE);
32 intResult = GetLastInt(&ContactEditorData.VendorList);
33 frameCEVen->SetupPointers(&ContactEditorData.VendorList,
34 &ContactEditorData.VendorListPEN,
35 &ContactEditorData.VendorListElement,
38 frameCEVen->ShowModal();
44 void frmContactEditor::ModifyVendorNamespace( wxCommandEvent& event )
47 // Bring up the window for modifying vendor namespace data.
49 long longSelected = -1;
50 int intSelectedData = 0;
52 if (!GetSelectedItem(lboVendorNamespace,
58 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
59 frameCEVen->SetupPointers(&ContactEditorData.VendorList,
60 &ContactEditorData.VendorListPEN,
61 &ContactEditorData.VendorListElement,
64 frameCEVen->SetEditorMode(TRUE);
65 frameCEVen->ShowModal();
71 void frmContactEditor::DeleteVendorNamespace( wxCommandEvent& event )
74 // Bring up the window for deleting vendor namespace data.
76 long longSelected = -1;
77 int intSelectedData = 0;
79 if (!GetSelectedItem(lboVendorNamespace,
85 lboVendorNamespace->DeleteItem(longSelected);
87 DeleteMapData(intSelectedData, &ContactEditorData.VendorList, &ContactEditorData.VendorListPEN,
88 &ContactEditorData.VendorListElement);
92 void frmContactEditor::AddXToken( wxCommandEvent& event )
95 // Bring up the window for adding extended data.
99 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
100 frameCEXT->SetEditorMode(FALSE);
101 intResult = GetLastInt(&ContactEditorData.XTokenList);
102 frameCEXT->SetupPointers(&ContactEditorData.XTokenList,
103 &ContactEditorData.XTokenListTokens,
106 frameCEXT->ShowModal();
112 void frmContactEditor::ModifyXToken( wxCommandEvent& event )
115 // Bring up the window for modifying extended data.
117 long longSelected = -1;
118 int intSelectedData = 0;
120 if (!GetSelectedItem(lboXToken,
128 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
129 frameCEXT->SetupPointers(&ContactEditorData.XTokenList,
130 &ContactEditorData.XTokenListTokens,
133 frameCEXT->SetEditorMode(TRUE);
134 frameCEXT->ShowModal();
140 void frmContactEditor::DeleteXToken( wxCommandEvent& event )
143 // Bring up the window for deleting extended data.
145 long longSelected = -1;
146 int intSelectedData = 0;
148 if (!GetSelectedItem(lboXToken,
154 lboXToken->DeleteItem(longSelected);
156 DeleteMapData(intSelectedData, &ContactEditorData.XTokenList, &ContactEditorData.XTokenListTokens);