Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added comments to describe functions in contacteditor/frmContactEditor-Category.cpp
[xestiaab/.git] / source / contacteditor / frmContactEditor-Category.cpp
1 // frmContactEditor-Category.cpp - frmContactEditor Category 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 "frmContactEditorCategory.h"
22 void frmContactEditor::AddCategory( wxCommandEvent& event )
23 {
25         // Bring up the window to add a category.
27         int intResult = 0;
28     
29         frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
30         frameCECategory->SetEditorMode(FALSE);
31         intResult = GetLastInt(&ContactEditorData.CategoriesList);
32         frameCECategory->SetupPointers(&ContactEditorData.CategoriesList,
33                 &ContactEditorData.CategoriesListAltID,
34                 &ContactEditorData.CategoriesListPID,
35                 &ContactEditorData.CategoriesListType,
36                 &ContactEditorData.CategoriesListTokens,
37                 &ContactEditorData.CategoriesListPref,
38                 lboCategories,
39                 (intValueSeek));
40         frameCECategory->ShowModal();
41         delete frameCECategory;
42         frameCECategory = NULL;
43         
44 }
46 void frmContactEditor::ModifyCategory( wxCommandEvent& event )
47 {
49         // Bring up the window to edit a category.
51         long longSelected = -1;
52         int intSelectedData = 0;
53     
54         if (!GetSelectedItem(lboCategories,
55                 &longSelected,
56                 &intSelectedData)){
57                 
58                 return;
59                 
60         }
61     
62         frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
63         frameCECategory->SetupPointers(&ContactEditorData.CategoriesList,
64                 &ContactEditorData.CategoriesListAltID,
65                 &ContactEditorData.CategoriesListPID,
66                 &ContactEditorData.CategoriesListType,
67                 &ContactEditorData.CategoriesListTokens,
68                 &ContactEditorData.CategoriesListPref,
69                 lboCategories,
70                 intSelectedData);
71         frameCECategory->SetEditorMode(TRUE);
72         frameCECategory->ShowModal();
73         delete frameCECategory;
74         frameCECategory = NULL;
75         
76 }
78 void frmContactEditor::DeleteCategory( wxCommandEvent& event )
79 {
81         // Bring up the window to delete the category.
83         long longSelected = -1;
84         int intSelectedData = 0;
85     
86         if (!GetSelectedItem(lboCategories,
87                 &longSelected,
88                 &intSelectedData)){
89                 
90                 return;
91                 
92         }
93     
94         lboCategories->DeleteItem(longSelected);
95     
96         DeleteMapData(intSelectedData, &ContactEditorData.CategoriesList,
97                 &ContactEditorData.CategoriesListAltID, &ContactEditorData.CategoriesListPID,
98                 &ContactEditorData.CategoriesListType, &ContactEditorData.CategoriesListTokens,
99                 &ContactEditorData.CategoriesListPref);
100  
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