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.
28 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
29 frameCEVen->SetEditorMode(FALSE);
30 frameCEVen->SetupPointers(&ContactEditorData.VendorList,
31 &ContactEditorData.VendorListPEN,
32 &ContactEditorData.VendorListElement,
35 frameCEVen->ShowModal();
42 void frmContactEditor::ModifyVendorNamespace( wxCommandEvent& event )
45 // Bring up the window for modifying vendor namespace data.
47 long longSelected = -1;
48 int intSelectedData = 0;
50 if (lboVendorNamespace->GetItemCount() == 0 || !GetSelectedItem(lboVendorNamespace,
56 frmContactEditorVendor *frameCEVen = new frmContactEditorVendor ( this );
57 frameCEVen->SetupPointers(&ContactEditorData.VendorList,
58 &ContactEditorData.VendorListPEN,
59 &ContactEditorData.VendorListElement,
62 frameCEVen->SetEditorMode(TRUE);
63 frameCEVen->ShowModal();
69 void frmContactEditor::DeleteVendorNamespace( wxCommandEvent& event )
72 // Bring up the window for deleting vendor namespace data.
74 long longSelected = -1;
75 int intSelectedData = 0;
77 if (lboVendorNamespace->GetItemCount() == 0 || !GetSelectedItem(lboVendorNamespace,
83 lboVendorNamespace->DeleteItem(longSelected);
85 DeleteMapData(intSelectedData, &ContactEditorData.VendorList, &ContactEditorData.VendorListPEN,
86 &ContactEditorData.VendorListElement);
90 void frmContactEditor::AddXToken( wxCommandEvent& event )
93 // Bring up the window for adding extended data.
95 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
96 frameCEXT->SetEditorMode(FALSE);
97 frameCEXT->SetupPointers(&ContactEditorData.XTokenList,
98 &ContactEditorData.XTokenListTokens,
101 frameCEXT->ShowModal();
108 void frmContactEditor::ModifyXToken( wxCommandEvent& event )
111 // Bring up the window for modifying extended data.
113 long longSelected = -1;
114 int intSelectedData = 0;
116 if (lboXToken->GetItemCount() == 0 || !GetSelectedItem(lboXToken,
124 frmContactEditorXToken *frameCEXT = new frmContactEditorXToken ( this );
125 frameCEXT->SetupPointers(&ContactEditorData.XTokenList,
126 &ContactEditorData.XTokenListTokens,
129 frameCEXT->SetEditorMode(TRUE);
130 frameCEXT->ShowModal();
136 void frmContactEditor::DeleteXToken( wxCommandEvent& event )
139 // Bring up the window for deleting extended data.
141 long longSelected = -1;
142 int intSelectedData = 0;
144 if (lboXToken->GetItemCount() == 0 || !GetSelectedItem(lboXToken,
150 lboXToken->DeleteItem(longSelected);
152 DeleteMapData(intSelectedData, &ContactEditorData.XTokenList, &ContactEditorData.XTokenListTokens);