Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmMain: Implemented UTF8 support in DeleteCalendar function
[xestiacalendar/.git] / source / widgets / XCCalendarMonthSelect.cpp
1 // XCCalendarMonthSelect.cpp - Xestia Calendar XCCalendarMonthSelect 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 "XCCalendarMonthSelect.h" 
21 XCCalendarMonthSelect::XCCalendarMonthSelect(wxWindow *parent)
22         : wxPopupTransientWindow (parent){
23         
24         // Setup the main sizer.
25                 
26         szrMain = new wxBoxSizer( wxHORIZONTAL );
27         this->SetSizer(szrMain);
28         this->SetSize(wxSize(255, 40));
29                 
30         // Setup the month selection control.
31         
32         cmbMonth = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
33                 
34         cmbMonth->Append(_("January"));
35         cmbMonth->Append(_("February"));
36         cmbMonth->Append(_("March"));
37         cmbMonth->Append(_("April"));
38         cmbMonth->Append(_("May"));
39         cmbMonth->Append(_("June"));
40         cmbMonth->Append(_("July"));
41         cmbMonth->Append(_("August"));
42         cmbMonth->Append(_("September"));
43         cmbMonth->Append(_("October"));
44         cmbMonth->Append(_("November"));
45         cmbMonth->Append(_("December"));
47         szrMain->Add(cmbMonth, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
49         // Setup the year selection control.
50         
51         spcYear = new wxSpinCtrl(this, wxID_ANY, _(""), wxDefaultPosition, wxSize(50,-1), wxSP_ARROW_KEYS, 0, 9999, 2016);
52         szrMain->Add(spcYear, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
54         // Setup the Change button.
55         
56         btnChange = new wxButton(this, wxID_ANY, _("Change"), wxDefaultPosition, wxDefaultSize);
57         szrMain->Add(btnChange, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
58         
59         // Setup the events.
60         
61         btnChange->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(XCCalendarMonthSelect::UpdateMonthView), NULL, this);
63         this->Layout();
64 }
66 XCCalendarMonthSelect::~XCCalendarMonthSelect(){
67         
68         
69         
70 }
72 void XCCalendarMonthSelect::UpdateDate(int Month, int Year){
73         
74         cmbMonth->SetSelection((Month - 1));
75         spcYear->SetValue(Year);
76         
77 }
79 void XCCalendarMonthSelect::UpdateMonthView(wxCommandEvent &event){
80         
81         // Post an event back to the parent updating the calendar
82         // with the new month.
83         
84         this->Dismiss();
85         wxCommandEvent UpdateGrid(XCCALENDARMANIPULATOR_CHANGEGRID);
86         UpdateGrid.SetId(ID_CHANGEGRID);
87         wxPostEvent(this->GetParent(), UpdateGrid);
88         
89 }
91 int XCCalendarMonthSelect::GetMonth(){
92         
93         return (cmbMonth->GetSelection() + 1);
94         
95 }
97 int XCCalendarMonthSelect::GetYear(){
98         
99         return spcYear->GetValue();
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