Bumped copyright dates for 2013
[barry.git] / desktop / src / CalendarEditDlg.h
blob9025cf8159d40fb017afa7c97e80945dc82d4a9d
1 ///
2 /// \file CalendarEditDlg.h
3 /// Dialog class to handle the editing of the Calendar record
4 ///
6 /*
7 Copyright (C) 2012-2013, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRYDESKTOP_CALENDAR_EDIT_DLG_H__
23 #define __BARRYDESKTOP_CALENDAR_EDIT_DLG_H__
25 //#define wxUSE_DATEPICKCTRL 1
27 #include "StringSync.h"
28 #include "guitimet.h"
29 #include <wx/wx.h>
30 #include <wx/image.h>
31 #include <barry/barry.h>
32 // begin wxGlade: ::dependencies
33 #include <wx/spinctrl.h>
34 #include <wx/statline.h>
35 #include <wx/datectrl.h>
36 // end wxGlade
37 #include <wx/dateevt.h>
41 // begin wxGlade: ::extracode
42 // end wxGlade
45 class CalendarEditDlg: public wxDialog
47 public:
48 // begin wxGlade: CalendarEditDlg::ids
49 // end wxGlade
51 private:
52 // begin wxGlade: CalendarEditDlg::methods
53 void set_properties();
54 void do_layout();
55 // end wxGlade
57 protected:
58 Barry::TimeZones m_static_zones;
59 const Barry::TimeZones *m_zones;
60 Barry::Calendar &m_rec;
61 StringSync m_strings;
62 GUITimeT m_StartDateObj;
63 GUITimeT m_EndDateObj;
64 GUITimeT m_RecurEndDateObj;
65 int m_duration_hours, m_duration_minutes;
66 int m_reminder_hours, m_reminder_minutes;
67 int m_interval;
68 int m_recur_choice;
69 bool m_weekdays[7];
70 bool m_relative_date;
71 std::string m_organizer, m_invited, m_accepted_by;
73 // begin wxGlade: CalendarEditDlg::attributes
74 wxStaticText* label_1;
75 wxTextCtrl* m_Subject;
76 wxStaticText* label_2;
77 wxTextCtrl* m_Location;
78 wxStaticLine* static_line_1;
79 wxStaticText* label_4;
80 wxCheckBox* m_AllDayCheck;
81 wxStaticText* label_5;
82 wxDatePickerCtrl* m_StartDateCtrl;
83 wxSpinCtrl* m_StartHoursSpinner;
84 wxStaticText* label_11;
85 wxSpinCtrl* m_StartMinutesSpinner;
86 wxStaticText* label_6;
87 wxDatePickerCtrl* m_EndDateCtrl;
88 wxSpinCtrl* m_EndHoursSpinner;
89 wxStaticText* label_12;
90 wxSpinCtrl* m_EndMinutesSpinner;
91 wxStaticText* label_7;
92 wxSpinCtrl* m_DurationHoursSpinner;
93 wxStaticText* label_13;
94 wxSpinCtrl* m_DurationMinutesSpinner;
95 wxStaticText* label_17;
96 wxStaticText* label_8;
97 wxChoice* m_TimezoneChoice;
98 wxStaticText* label_9;
99 wxChoice* m_ShowAsChoice;
100 wxStaticText* label_10;
101 wxSpinCtrl* m_ReminderHoursSpinner;
102 wxStaticText* label_13_copy;
103 wxSpinCtrl* m_ReminderMinutesSpinner;
104 wxStaticText* label_17_copy;
105 wxStaticLine* static_line_2;
106 wxStaticText* label_18;
107 wxChoice* m_RecurrenceChoice;
108 wxStaticText* RecurIntervalLabel;
109 wxStaticText* RecurIntervalLabelB;
110 wxSpinCtrl* m_IntervalSpinner;
111 wxStaticText* m_IntervalUnitLabel;
112 wxStaticText* RecurDaysLabel;
113 wxCheckBox* m_SunCheck;
114 wxCheckBox* m_MonCheck;
115 wxCheckBox* m_TueCheck;
116 wxCheckBox* m_WedCheck;
117 wxCheckBox* m_ThuCheck;
118 wxCheckBox* m_FriCheck;
119 wxCheckBox* m_SatCheck;
120 wxStaticText* RecurRelativeDateLabel;
121 wxCheckBox* m_RelativeDateCheck;
122 wxStaticText* RecurEndDateLabel;
123 wxCheckBox* m_NeverEndsCheck;
124 wxDatePickerCtrl* m_RecurEndDateCtrl;
125 wxStaticLine* static_line_3;
126 wxStaticText* label_14;
127 wxTextCtrl* m_OrganizerText;
128 wxStaticText* label_15;
129 wxTextCtrl* m_InvitedText;
130 wxStaticText* label_16;
131 wxTextCtrl* m_AcceptedByText;
132 wxStaticLine* static_line_4;
133 wxRadioBox* m_ClassRadioBox;
134 wxStaticLine* static_line_5;
135 wxStaticText* label_3;
136 wxTextCtrl* m_NotesText;
137 // end wxGlade
139 wxSizer *bottom_buttons;
140 wxSizer *m_top_sizer;
142 DECLARE_EVENT_TABLE(); // sets to protected:
144 protected:
145 // helper functions
146 void UpdateDuration();
147 void UpdateEndDate();
148 void RedoLayout();
149 void EnableAllDayMode(bool all_day = true);
150 void EnableRecurMode(bool recur = true);
152 public:
153 CalendarEditDlg(wxWindow* parent, Barry::Calendar &rec, bool editable,
154 const Barry::TimeZones *device_zones);
156 virtual bool TransferDataToWindow();
157 virtual bool TransferDataFromWindow();
159 public:
160 virtual void OnAllDayEvent(wxCommandEvent &event); // wxGlade: <event_handler>
161 virtual void OnStartDateChanged(wxDateEvent &event); // wxGlade: <event_handler>
162 virtual void OnStartHoursSpin(wxSpinEvent &event); // wxGlade: <event_handler>
163 virtual void OnStartMinutesSpin(wxSpinEvent &event); // wxGlade: <event_handler>
164 virtual void OnEndDateChanged(wxDateEvent &event); // wxGlade: <event_handler>
165 virtual void OnEndHoursSpin(wxSpinEvent &event); // wxGlade: <event_handler>
166 virtual void OnEndMinutesSpin(wxSpinEvent &event); // wxGlade: <event_handler>
167 virtual void OnDurationHoursSpin(wxSpinEvent &event); // wxGlade: <event_handler>
168 virtual void OnDurationMinutesSpin(wxSpinEvent &event); // wxGlade: <event_handler>
169 virtual void OnRecurrenceChoice(wxCommandEvent &event); // wxGlade: <event_handler>
170 virtual void OnEndDateCheckbox(wxCommandEvent &event); // wxGlade: <event_handler>
171 }; // wxGlade: end class
174 #endif