1 // frmContactEditor-Key.cpp - frmContactEditor Key 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 "frmContactEditorKey.h"
22 void frmContactEditor::AddKey( wxCommandEvent& event )
27 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
28 frameCEKey->SetEditorMode(FALSE);
29 intResult = GetLastInt(&ContactEditorData.KeyList);
30 frameCEKey->SetupPointers(&ContactEditorData.KeyList,
31 &ContactEditorData.KeyListAltID,
32 &ContactEditorData.KeyListPID,
33 &ContactEditorData.KeyListKeyType,
34 &ContactEditorData.KeyListDataType,
35 &ContactEditorData.KeyListType,
36 &ContactEditorData.KeyListTokens,
37 &ContactEditorData.KeyListPref,
40 frameCEKey->ShowModal();
46 void frmContactEditor::ModifyKey( wxCommandEvent& event )
49 long longSelected = -1;
50 int intSelectedData = 0;
52 if (!GetSelectedItem(lboKeys,
58 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
59 frameCEKey->SetupPointers(&ContactEditorData.KeyList,
60 &ContactEditorData.KeyListAltID,
61 &ContactEditorData.KeyListPID,
62 &ContactEditorData.KeyListKeyType,
63 &ContactEditorData.KeyListDataType,
64 &ContactEditorData.KeyListType,
65 &ContactEditorData.KeyListTokens,
66 &ContactEditorData.KeyListPref,
69 frameCEKey->SetEditorMode(TRUE);
70 frameCEKey->ShowModal();
76 void frmContactEditor::DeleteKey( wxCommandEvent& event )
79 long longSelected = -1;
80 int intSelectedData = 0;
82 if (!GetSelectedItem(lboKeys,
88 lboKeys->DeleteItem(longSelected);
90 DeleteMapData(intSelectedData, &ContactEditorData.KeyList, &ContactEditorData.KeyListAltID,
91 &ContactEditorData.KeyListPID, &ContactEditorData.KeyListKeyType, &ContactEditorData.KeyListDataType, &ContactEditorData.KeyListType,
92 &ContactEditorData.KeyListTokens, &ContactEditorData.KeyListPref);