Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed crash in frmContactEditorOrganisations in Edit mode.
[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 {
24     int intResult = 0;
25     
26     frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
27     frameCECategory->SetEditorMode(FALSE);
28     intResult = GetLastInt(&ContactEditorData.CategoriesList);
29     frameCECategory->SetupPointers(&ContactEditorData.CategoriesList,
30                                    &ContactEditorData.CategoriesListAltID,
31                                    &ContactEditorData.CategoriesListPID,
32                                    &ContactEditorData.CategoriesListType,
33                                    &ContactEditorData.CategoriesListTokens,
34                                    &ContactEditorData.CategoriesListPref,
35                                    lboCategories,
36                                    (intValueSeek));
37     frameCECategory->ShowModal();
38     delete frameCECategory;
39     frameCECategory = NULL;
40 }
42 void frmContactEditor::ModifyCategory( wxCommandEvent& event )
43 {
44     long longSelected = -1;
45     int intSelectedData = 0;
46     
47     if (!GetSelectedItem(lboCategories,
48                          &longSelected,
49                          &intSelectedData)){
50         return;
51     }
52     
53     frmContactEditorCategory *frameCECategory = new frmContactEditorCategory ( this );
54     frameCECategory->SetupPointers(&ContactEditorData.CategoriesList,
55                                    &ContactEditorData.CategoriesListAltID,
56                                    &ContactEditorData.CategoriesListPID,
57                                    &ContactEditorData.CategoriesListType,
58                                    &ContactEditorData.CategoriesListTokens,
59                                    &ContactEditorData.CategoriesListPref,
60                                    lboCategories,
61                                    intSelectedData);
62     frameCECategory->SetEditorMode(TRUE);
63     frameCECategory->ShowModal();
64     delete frameCECategory;
65     frameCECategory = NULL;
66 }
68 void frmContactEditor::DeleteCategory( wxCommandEvent& event )
69 {
70     long longSelected = -1;
71     int intSelectedData = 0;
72     
73     if (!GetSelectedItem(lboCategories,
74                          &longSelected,
75                          &intSelectedData)){
76         return;
77     }
78     
79     lboCategories->DeleteItem(longSelected);
80     
81     DeleteMapData(intSelectedData, &ContactEditorData.CategoriesList,
82                   &ContactEditorData.CategoriesListAltID, &ContactEditorData.CategoriesListPID,
83                   &ContactEditorData.CategoriesListType, &ContactEditorData.CategoriesListTokens,
84                   &ContactEditorData.CategoriesListPref);
85     
86 }
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