YATiSh
Yet Another TIme SHeet
yatishFrame.h
Go to the documentation of this file.
1 /********************************************************************
2  * Name: yatishFrame.h
3  * Purpose: Declares the main Frame
4  * Author: Nicolas PĂ©renne (nicolas.perenne@eif-services.eu)
5  * Created: 2020-02-11
6  * Copyright: EIF-services (https://www.eif-services.eu/yatish)
7  * License: GPLv3
8  ********************************************************************/
9 
10 #ifndef YATISHMAIN_H
11 #define YATISHMAIN_H
12 
13 //(*Headers(yatishFrame)
14 #include <wx/button.h>
15 #include <wx/choice.h>
16 #include <wx/datectrl.h>
17 #include <wx/dateevt.h>
18 #include <wx/frame.h>
19 #include <wx/listctrl.h>
20 #include <wx/menu.h>
21 #include <wx/notebook.h>
22 #include <wx/panel.h>
23 #include <wx/sizer.h>
24 #include <wx/statusbr.h>
25 #include <wx/textctrl.h>
26 #include <wx/timer.h>
27 //*)
28 
29 #include "yatishDBmysql.h"
30 #include "yatishDBsqlite.h"
31 #include "yatishDlgActivity.h"
32 #include "yatishDlgFilter.h"
33 #include "yatishDlgName.h"
34 #include "yatishDlgProject.h"
35 #include "yatishDlgTimeslot.h"
36 #include "yatishPDF.h"
37 #include "yatishPlot.h"
38 #include "yatishSettings.h"
39 
43  mysql_err
44 };
45 
46 // Need to send a wxSizeEvent with wxCharts...
47 #define UNFORTUNATE_TRICK if (currentChartLib == wxCharts) SetSize ( GetSize() + wxSize (0, 1) );
48 
55 class yatishFrame: public wxFrame {
56  public:
57  yatishFrame (wxWindow *, wxWindowID = -1);
58  private:
60  wxLog * defaultLog;
61  wxHtmlHelpController help;
62  wxDateTime clockStart;
69  void UpdateClock ();
71  void ResetChoices ();
72  void UpdateColumns ();
73  void UpdateRows (tableID);
74  void ResetPickersT ();
75  void ResetPickersG ();
76  void NewPlot ();
77  void ToggleConnect ();
78  void ToggleLog ();
79  void Recording ();
80  //(*Handlers(yatishFrame)
81  void OnQuit(wxCommandEvent& event);
82  void OnAbout(wxCommandEvent& event);
83  void OnTimerTrigger(wxTimerEvent& event);
84  void OnButtonStartClick(wxCommandEvent& event);
85  void OnButtonStopClick(wxCommandEvent& event);
86  void OnClose(wxCloseEvent& event);
87  void OnChoiceTableSelect(wxCommandEvent& event);
88  void OnNotebookPageChanged(wxNotebookEvent& event);
89  void OnDatePicker1Changed(wxDateEvent& event);
90  void OnDatePicker2Changed(wxDateEvent& event);
91  void OnListColumnClick(wxListEvent& event);
92  void OnListKeyDown(wxListEvent& event);
93  void OnMenuitemEditTableSelected(wxCommandEvent& event);
94  void OnMenuitemFileConnectSelected(wxCommandEvent& event);
95  void OnMenuitemFileUpdateSelected(wxCommandEvent& event);
96  void OnMenuitemEditNewSelected(wxCommandEvent& event);
97  void OnMenuitemEditResetSelected(wxCommandEvent& event);
98  void OnMenuitemFileUploadSelected(wxCommandEvent& event);
99  void OnMenuitemFileDownloadSelected(wxCommandEvent& event);
100  void OnMenuitemEditSettingsSelected(wxCommandEvent& event);
101  void OnHelp(wxCommandEvent& event);
102  void OnMenuitemEditActivitySelected(wxCommandEvent& event);
103  void OnMenuitemEditChartSelected(wxCommandEvent& event);
104  void OnButtonPDFClick(wxCommandEvent& event);
105  void OnChoiceChartSelect(wxCommandEvent& event);
106  void OnChoiceAggregateSelect(wxCommandEvent& event);
107  void OnChoiceClusterSelect(wxCommandEvent& event);
108  void OnDatePicker3Changed(wxDateEvent& event);
109  void OnDatePicker4Changed(wxDateEvent& event);
110  void OnListItemRightClick(wxListEvent& event);
111  void OnMenuitemTimeTodaySelected(wxCommandEvent& event);
112  void OnMenuitemTimeThisweekSelected(wxCommandEvent& event);
113  void OnmenuitemTimeThismonthSelected(wxCommandEvent& event);
114  void OnMenuitemTimeThisyearSelected(wxCommandEvent& event);
115  void OnMenuitemTimeYesterdaySelected(wxCommandEvent& event);
116  void OnMenuitemTimeLastweekSelected(wxCommandEvent& event);
117  void OnMenuitemTimeLastmonthSelected(wxCommandEvent& event);
118  void OnMenuitemTimeLastyearSelected(wxCommandEvent& event);
119  void OnMenuitemTimeThismonthSelected(wxCommandEvent& event);
120  //*)
121  void OnListActivityRecord (wxCommandEvent& event);
122  void OnListActivityListTimeslot (wxCommandEvent& event);
123  void OnMenuitemEditActivityUpdate (wxUpdateUIEvent&);
124  void OnMenuitemEditTableUpdate (wxUpdateUIEvent&);
125  void OnMenuitemEditChartUpdate (wxUpdateUIEvent&);
126  void OnMenuitemEditNewUpdate (wxUpdateUIEvent&);
127  void OnMenuitemEditResetUpdate (wxUpdateUIEvent&);
128  void OnMenuitemTimeTodayUpdate (wxUpdateUIEvent&);
129  void OnChoiceAggregateUpdate (wxUpdateUIEvent&);
130  void OnChoiceClusterUpdate (wxUpdateUIEvent&);
131  void OnContextMenu1 (wxContextMenuEvent&);
132  void OnContextMenu2 (wxContextMenuEvent&);
133  void OnContextMenu3 (wxContextMenuEvent&);
134  void OnContextMenu4 (wxContextMenuEvent&);
135  //(*Identifiers(yatishFrame)
136  static const long idChoiceProject;
137  static const long idChoiceTask;
138  static const long idChoiceTool;
139  static const long idButtonStart;
140  static const long idButtonStop;
141  static const long idPanelCurrent;
142  static const long idChoiceTable;
143  static const long idDatePicker1;
144  static const long idDatePicker2;
145  static const long idButtonPDF;
146  static const long idListCtrl;
147  static const long idPanelList;
148  static const long idChoiceChart;
149  static const long idChoiceAggregate;
150  static const long idChoiceCluster;
151  static const long idDatePicker3;
152  static const long idDatePicker4;
153  static const long idPanelChart;
154  static const long idNotebook;
155  static const long idTextCtrl;
156  static const long idFileConnect;
157  static const long idFileUpdate;
158  static const long idFileUpload;
159  static const long idFileDownload;
160  static const long idFileQuit;
161  static const long idEditActivity;
162  static const long idEditTable;
163  static const long idEditChart;
164  static const long idEditNew;
165  static const long idEditReset;
166  static const long idEditSettings;
167  static const long idTimeToday;
168  static const long idTimeThisweek;
169  static const long idTimeThismonth;
170  static const long idTimeThisyear;
171  static const long idTimeYesterday;
172  static const long idTimeLastweek;
173  static const long idTimeLastmonth;
174  static const long idTimeLastyear;
175  static const long idHelpUser;
176  static const long idHelpAbout;
177  static const long idStatusBar;
178  static const long idTimer;
179  //*)
180  static const long idListActivityRecord;
181  static const long idListActivityListTimeslot;
182  //(*Declarations(yatishFrame)
183  wxBoxSizer* boxSizer1;
184  wxBoxSizer* boxSizer6;
185  wxButton* buttonPDF;
186  wxButton* buttonStart;
187  wxButton* buttonStop;
188  wxChoice* choiceAggregate;
189  wxChoice* choiceChart;
190  wxChoice* choiceCluster;
191  wxChoice* choiceProject;
192  wxChoice* choiceTable;
193  wxChoice* choiceTask;
194  wxChoice* choiceTool;
195  wxDatePickerCtrl* datePicker1;
196  wxDatePickerCtrl* datePicker2;
197  wxDatePickerCtrl* datePicker3;
198  wxDatePickerCtrl* datePicker4;
199  wxListCtrl* listCtrl;
200  wxMenuItem* menuitemFileConnect;
201  wxMenuItem* menuitemFileDownload;
202  wxMenuItem* menuitemFileUpdate;
203  wxMenuItem* menuitemFileUpload;
204  wxNotebook* notebook;
205  wxPanel* panelChart;
206  wxStatusBar* statusBar;
207  wxTextCtrl* textCtrl;
208  wxTimer timer;
209  //*)
210  DECLARE_EVENT_TABLE()
211 };
212 
213 #endif // YATISHMAIN_H
Interacts with yatish tables in a MySQL/MariaDB database.
Definition: yatishDBmysql.h:18
Interacts with yatish tables in a SQLite database.
Main Yatish frame; apart from menus, status bar, etc. this (large!) class:
Definition: yatishFrame.h:55
yatishFrame(wxWindow *, wxWindowID=-1)
Definition: yatishFrame.cpp:87
void OnMenuitemTimeLastweekSelected(wxCommandEvent &event)
long selectedActivityID
Definition: yatishFrame.h:68
static const long idTimer
Definition: yatishFrame.h:178
void OnHelp(wxCommandEvent &event)
static const long idHelpUser
Definition: yatishFrame.h:175
void OnMenuitemFileUpdateSelected(wxCommandEvent &event)
void OnContextMenu1(wxContextMenuEvent &)
void NewPlot()
void OnButtonPDFClick(wxCommandEvent &event)
static const long idTimeLastmonth
Definition: yatishFrame.h:173
static const long idHelpAbout
Definition: yatishFrame.h:176
wxDatePickerCtrl * datePicker3
Definition: yatishFrame.h:197
void ToggleLog()
wxChoice * choiceTool
Definition: yatishFrame.h:194
static const long idFileUpload
Definition: yatishFrame.h:158
static const long idNotebook
Definition: yatishFrame.h:154
static const long idListActivityRecord
Definition: yatishFrame.h:180
wxChoice * choiceProject
Definition: yatishFrame.h:191
void OnDatePicker4Changed(wxDateEvent &event)
void OnChoiceTableSelect(wxCommandEvent &event)
void OnMenuitemTimeThisyearSelected(wxCommandEvent &event)
void OnChoiceAggregateUpdate(wxUpdateUIEvent &)
void OnListColumnClick(wxListEvent &event)
void OnChoiceClusterSelect(wxCommandEvent &event)
static const long idTextCtrl
Definition: yatishFrame.h:155
void OnListKeyDown(wxListEvent &event)
wxMenuItem * menuitemFileUpload
Definition: yatishFrame.h:203
void OnmenuitemTimeThismonthSelected(wxCommandEvent &event)
wxMenuItem * menuitemFileUpdate
Definition: yatishFrame.h:202
static const long idChoiceAggregate
Definition: yatishFrame.h:149
void OnMenuitemEditActivitySelected(wxCommandEvent &event)
void OnQuit(wxCommandEvent &event)
yatishDBsqlite masterDB
Definition: yatishFrame.h:63
static const long idFileDownload
Definition: yatishFrame.h:159
static const long idFileConnect
Definition: yatishFrame.h:156
void OnMenuitemTimeYesterdaySelected(wxCommandEvent &event)
static const long idStatusBar
Definition: yatishFrame.h:177
wxMenuItem * menuitemFileConnect
Definition: yatishFrame.h:200
static const long idTimeThisweek
Definition: yatishFrame.h:168
wxChoice * choiceAggregate
Definition: yatishFrame.h:188
wxDateTime clockStart
Definition: yatishFrame.h:62
void OnMenuitemEditChartSelected(wxCommandEvent &event)
void OnAbout(wxCommandEvent &event)
void OnNotebookPageChanged(wxNotebookEvent &event)
static const long idButtonStop
Definition: yatishFrame.h:140
ChartLib currentChartLib
Definition: yatishFrame.h:66
void OnChoiceAggregateSelect(wxCommandEvent &event)
static const long idEditTable
Definition: yatishFrame.h:162
void OnClose(wxCloseEvent &event)
void Recording()
static const long idChoiceTask
Definition: yatishFrame.h:137
void UpdateColumns()
wxBoxSizer * boxSizer1
Definition: yatishFrame.h:183
void OnListItemRightClick(wxListEvent &event)
static const long idChoiceProject
Definition: yatishFrame.h:136
void OnMenuitemEditTableUpdate(wxUpdateUIEvent &)
void ResetPickersT()
void OnDatePicker3Changed(wxDateEvent &event)
wxChoice * choiceTask
Definition: yatishFrame.h:193
static const long idPanelChart
Definition: yatishFrame.h:153
void OnMenuitemEditResetUpdate(wxUpdateUIEvent &)
wxBoxSizer * boxSizer6
Definition: yatishFrame.h:184
wxMenuItem * menuitemFileDownload
Definition: yatishFrame.h:201
static const long idPanelCurrent
Definition: yatishFrame.h:141
void OnDatePicker1Changed(wxDateEvent &event)
void OnMenuitemFileDownloadSelected(wxCommandEvent &event)
void OnMenuitemTimeTodaySelected(wxCommandEvent &event)
wxChoice * choiceChart
Definition: yatishFrame.h:189
void OnMenuitemEditTableSelected(wxCommandEvent &event)
static const long idTimeToday
Definition: yatishFrame.h:167
void OnMenuitemFileUploadSelected(wxCommandEvent &event)
static const long idDatePicker1
Definition: yatishFrame.h:143
void OnMenuitemTimeLastmonthSelected(wxCommandEvent &event)
void OnMenuitemTimeThismonthSelected(wxCommandEvent &event)
static const long idDatePicker2
Definition: yatishFrame.h:144
static const long idTimeLastweek
Definition: yatishFrame.h:172
wxHtmlHelpController help
Definition: yatishFrame.h:61
Settings settings
Definition: yatishFrame.h:59
wxDatePickerCtrl * datePicker2
Definition: yatishFrame.h:196
static const long idListActivityListTimeslot
Definition: yatishFrame.h:181
void ResetChoices()
wxPanel * panelChart
Definition: yatishFrame.h:205
static const long idDatePicker3
Definition: yatishFrame.h:151
void OnTimerTrigger(wxTimerEvent &event)
void OnMenuitemEditSettingsSelected(wxCommandEvent &event)
void OnMenuitemEditActivityUpdate(wxUpdateUIEvent &)
wxButton * buttonStart
Definition: yatishFrame.h:186
wxTextCtrl * textCtrl
Definition: yatishFrame.h:207
void OnMenuitemFileConnectSelected(wxCommandEvent &event)
static const long idFileUpdate
Definition: yatishFrame.h:157
wxButton * buttonStop
Definition: yatishFrame.h:187
void UpdateClock()
void OnDatePicker2Changed(wxDateEvent &event)
static const long idEditSettings
Definition: yatishFrame.h:166
wxListCtrl * listCtrl
Definition: yatishFrame.h:199
void OnListActivityListTimeslot(wxCommandEvent &event)
static const long idChoiceTool
Definition: yatishFrame.h:138
wxChoice * choiceTable
Definition: yatishFrame.h:192
static const long idEditActivity
Definition: yatishFrame.h:161
wxDatePickerCtrl * datePicker4
Definition: yatishFrame.h:198
void OnButtonStartClick(wxCommandEvent &event)
void OnMenuitemTimeLastyearSelected(wxCommandEvent &event)
static const long idEditReset
Definition: yatishFrame.h:165
static const long idButtonPDF
Definition: yatishFrame.h:145
void ResetPickersG()
static const long idFileQuit
Definition: yatishFrame.h:160
void OnMenuitemTimeTodayUpdate(wxUpdateUIEvent &)
wxTimer timer
Definition: yatishFrame.h:208
void OnMenuitemEditNewSelected(wxCommandEvent &event)
void OnMenuitemEditChartUpdate(wxUpdateUIEvent &)
static const long idTimeYesterday
Definition: yatishFrame.h:171
void OnContextMenu4(wxContextMenuEvent &)
void OnContextMenu2(wxContextMenuEvent &)
wxDatePickerCtrl * datePicker1
Definition: yatishFrame.h:195
static const long idListCtrl
Definition: yatishFrame.h:146
wxStatusBar * statusBar
Definition: yatishFrame.h:206
wxChoice * choiceCluster
Definition: yatishFrame.h:190
static const long idEditChart
Definition: yatishFrame.h:163
wxLog * defaultLog
Definition: yatishFrame.h:60
wxNotebook * notebook
Definition: yatishFrame.h:204
static const long idButtonStart
Definition: yatishFrame.h:139
void OnChoiceClusterUpdate(wxUpdateUIEvent &)
PlotType currentPlotType
Definition: yatishFrame.h:67
void ToggleConnect()
static const long idChoiceTable
Definition: yatishFrame.h:142
static const long idTimeThismonth
Definition: yatishFrame.h:169
static const long idDatePicker4
Definition: yatishFrame.h:152
wxButton * buttonPDF
Definition: yatishFrame.h:185
static const long idTimeLastyear
Definition: yatishFrame.h:174
yatishDBmysql * slaveDB
Definition: yatishFrame.h:64
static const long idChoiceChart
Definition: yatishFrame.h:148
static const long idTimeThisyear
Definition: yatishFrame.h:170
void OnChoiceChartSelect(wxCommandEvent &event)
void OnMenuitemEditNewUpdate(wxUpdateUIEvent &)
static const long idEditNew
Definition: yatishFrame.h:164
void UpdateStatus(mysqlStatus)
void OnListActivityRecord(wxCommandEvent &event)
void OnButtonStopClick(wxCommandEvent &event)
static const long idPanelList
Definition: yatishFrame.h:147
void OnContextMenu3(wxContextMenuEvent &)
static const long idChoiceCluster
Definition: yatishFrame.h:150
void OnMenuitemTimeThisweekSelected(wxCommandEvent &event)
void UpdateRows(tableID)
void OnMenuitemEditResetSelected(wxCommandEvent &event)
yatishPlot * plot
Definition: yatishFrame.h:65
Abstract Base class for the plots of panel #3.
Definition: yatishPlot.h:34
As its names implies: the class holding YATiSh settings.
tableID
Definition: yatishDB.h:13
mysqlStatus
Definition: yatishFrame.h:40
@ mysql_off
Definition: yatishFrame.h:41
@ mysql_on
Definition: yatishFrame.h:42
@ mysql_err
Definition: yatishFrame.h:43
ChartLib
Same order as yatishSettings::choiceLib.
PlotType
Same order as yatishFrame::choiceChart.
Definition: yatishTypes.h:41