Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added comments to describe functions in contacteditor/frmContactEditor-Key.cpp
[xestiaab/.git] / source / contacteditor / frmContactEditor-Key.cpp
1 // frmContactEditor-Key.cpp - frmContactEditor Key tab subroutines.
2 //
3 // (c) 2012-2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
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.
10 //
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.
15 //
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 )
23 {
24         
25         // Bring up the window for adding a key.
26         
27         int intResult = 0;
28     
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,
40                 lboKeys,
41                 (intValueSeek));
42         frameCEKey->ShowModal();
43         delete frameCEKey;
44         frameCEKey = NULL;
45         
46 }
48 void frmContactEditor::ModifyKey( wxCommandEvent& event )
49 {
50         
51         // Bring up the window for modifying a key.
52         
53         long longSelected = -1;
54         int intSelectedData = 0;
55     
56         if (!GetSelectedItem(lboKeys,
57                 &longSelected,
58                 &intSelectedData)){
59                 return;
60         }
61     
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,
71                 lboKeys,
72                 intSelectedData);
73         frameCEKey->SetEditorMode(TRUE);
74         frameCEKey->ShowModal();
75         delete frameCEKey;
76         frameCEKey = NULL;
77         
78 }
80 void frmContactEditor::DeleteKey( wxCommandEvent& event )
81 {
82         
83         // Delete a key.
84         
85         long longSelected = -1;
86         int intSelectedData = 0;
87     
88         if (!GetSelectedItem(lboKeys,
89                 &longSelected,
90                 &intSelectedData)){
91                 return;
92         }
93     
94         lboKeys->DeleteItem(longSelected);
95     
96         DeleteMapData(intSelectedData, &ContactEditorData.KeyList, &ContactEditorData.KeyListAltID,
97                 &ContactEditorData.KeyListPID, &ContactEditorData.KeyListKeyType, &ContactEditorData.KeyListDataType, &ContactEditorData.KeyListType,
98                 &ContactEditorData.KeyListTokens, &ContactEditorData.KeyListPref);
99     
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy