Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added new widgets
[xestiacalendar/.git] / source / widgets / XCCalendarList.cpp
1 // XCCalendarList.cpp - Xestia Calendar XCCalendarList widget class.
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
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 Calendar. If not, see <http://www.gnu.org/licenses/> 
19 #include "XCCalendarList.h" 
21 XCCalendarList::XCCalendarList(wxWindow *parent)
22         : wxPopupTransientWindow (parent){
23                 
24         // Setup the controls.
25                 
26         szrMain = new wxBoxSizer( wxVERTICAL );
27         this->SetSizer(szrMain);
28         this->SetSize(wxSize(350, 500));
30         //scwMain = new wxScrolledWindow();
31         
32         //szrScrolled = new wxBoxSizer( wxHORIZONTAL );
33         //scwMain->SetSizer(szrScrolled);
34                 
35         //szrMain->Add(scwMain, 0, wxEXPAND, 5);
36         //szrMain->Layout();
37         
38                 
39 }
41 XCCalendarList::~XCCalendarList(){
42         
43 }
45 void XCCalendarList::UpdateCalendarList(CalendarDataStorage *dataStorage){
46         
47         // TODO: Verify if the generated code has changed.
48         
49         // Get the list of accounts and create them one by one.
50         
51         CDSAccountList accountListData = dataStorage->GetAccountList();
52         
53         for (int AccountSeek = 0; AccountSeek < accountListData.accountList.size(); AccountSeek++){
54                 
55                 // Create the control and add it to the list.
56                 
57                 XCCalendarListAccountCtrl *newAccountCtrl = new XCCalendarListAccountCtrl(this, accountListData.accountList[AccountSeek].accountName);
58                 
59                 szrMain->Add(newAccountCtrl, 0, wxEXPAND, 5);
60                 
61                 accountControlList.push_back(newAccountCtrl);
62                 
63                 // Get the list of calendars and create controls.
64                 
65                 CDSCalendarList accountCalendarList = dataStorage->GetCalendarList(accountListData.accountList[AccountSeek].accountID);
66                 
67                 for (int calendarSeek = 0; calendarSeek < accountCalendarList.calendarList.size(); calendarSeek++){
68                         
69                         CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar(accountListData.accountList[AccountSeek].accountName, accountCalendarList.calendarListTextID[calendarSeek]);
70                         
71                         XCCalendarListCalendarCtrl *newCalendarCtrl = new XCCalendarListCalendarCtrl(this, calendarInfo.calendarName, calendarInfo.calendarColour);
72                         
73                         newAccountCtrl->AddCalendar(newCalendarCtrl);
75                         szrMain->Add(newCalendarCtrl, 0, wxEXPAND, 5);
76                         
77                 }
78                 
79         }
80         
81 }
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