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 )
25 // Bring up the window for adding a key.
29 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
30 frameCEKey->SetEditorMode(FALSE);
31 intResult = GetLastInt(&ContactEditorData.KeyList);
32 frameCEKey->SetupPointers(&ContactEditorData.KeyList,
33 &ContactEditorData.KeyListAltID,
34 &ContactEditorData.KeyListPID,
35 &ContactEditorData.KeyListKeyType,
36 &ContactEditorData.KeyListDataType,
37 &ContactEditorData.KeyListType,
38 &ContactEditorData.KeyListTokens,
39 &ContactEditorData.KeyListPref,
42 frameCEKey->ShowModal();
48 void frmContactEditor::ModifyKey( wxCommandEvent& event )
51 // Bring up the window for modifying a key.
53 long longSelected = -1;
54 int intSelectedData = 0;
56 if (!GetSelectedItem(lboKeys,
62 frmContactEditorKey *frameCEKey = new frmContactEditorKey ( this );
63 frameCEKey->SetupPointers(&ContactEditorData.KeyList,
64 &ContactEditorData.KeyListAltID,
65 &ContactEditorData.KeyListPID,
66 &ContactEditorData.KeyListKeyType,
67 &ContactEditorData.KeyListDataType,
68 &ContactEditorData.KeyListType,
69 &ContactEditorData.KeyListTokens,
70 &ContactEditorData.KeyListPref,
73 frameCEKey->SetEditorMode(TRUE);
74 frameCEKey->ShowModal();
80 void frmContactEditor::DeleteKey( wxCommandEvent& event )
85 long longSelected = -1;
86 int intSelectedData = 0;
88 if (!GetSelectedItem(lboKeys,
94 lboKeys->DeleteItem(longSelected);
96 DeleteMapData(intSelectedData, &ContactEditorData.KeyList, &ContactEditorData.KeyListAltID,
97 &ContactEditorData.KeyListPID, &ContactEditorData.KeyListKeyType, &ContactEditorData.KeyListDataType, &ContactEditorData.KeyListType,
98 &ContactEditorData.KeyListTokens, &ContactEditorData.KeyListPref);