Money Manager EX
An easy to use, money management application built with wxWidgets
mmreportspanel.h
Go to the documentation of this file.
1 /*******************************************************
2  Copyright (C) 2006 Madhan Kanagavel
3  Copyright (C) 2022 Mark Whalley (mark@ipx.co.uk)
4  Copyright (C) 2025 Klaus Wich
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program 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
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  ********************************************************/
20 
21 #ifndef MM_EX_REPORTSPANEL_H_
22 #define MM_EX_REPORTSPANEL_H_
23 
24 #include "mmpanelbase.h"
25 #include "mmSimpleDialogs.h"
26 #include "mmcheckingpanel.h"
27 #include "reports/reportbase.h"
28 #include <wx/spinctrl.h>
29 #include <wx/timectrl.h>
30 
31 class mmGUIFrame;
32 class mmDateRange;
34 {
35  wxDECLARE_EVENT_TABLE();
36 
37 public:
39  bool cleanupReport,
40  wxWindow *parent,
41  mmGUIFrame *frame,
42  wxWindowID winid = wxID_ANY,
43  const wxPoint& pos = wxDefaultPosition,
44  const wxSize& size = wxDefaultSize,
45  long style = wxTAB_TRAVERSAL | wxNO_BORDER,
46  const wxString& name = "mmReportsPanel");
48 
49  bool Create(wxWindow *parent, wxWindowID winid,
50  const wxPoint& pos = wxDefaultPosition,
51  const wxSize& size = wxDefaultSize,
52  long style = wxTAB_TRAVERSAL | wxNO_BORDER,
53  const wxString& name = "mmReportsPanel");
54 
55  void CreateControls();
56  void loadFilterSettings();
57  void saveFilterSettings();
58  void sortList() {}
59 
60  bool saveReportText(bool initial = true);
62  void PrintPage();
63 
64  mmGUIFrame *m_frame = nullptr;
65 
66  enum RepPanel
67  {
68  ID_CHOICE_DATE_RANGE = wxID_HIGHEST + 555,
82  };
83 
84 private:
85  void OnNewWindow(wxWebViewEvent& evt);
86  std::vector<wxSharedPtr<mmDateRange>> m_all_date_ranges;
87  std::vector<DateRange2::Spec> m_date_range_a = {};
88  wxChoice* m_date_ranges = nullptr;
89  mmDatePickerCtrl *m_single_date = nullptr, *m_start_date = nullptr, *m_end_date = nullptr;
90  wxTimePickerCtrl *m_time = nullptr;
91  wxWebView * browser_ = nullptr;
92  mmPrintableBase* rb_ = nullptr;
93  wxChoice* m_accounts = nullptr;
94  wxChoice* m_chart = nullptr;
95  wxSpinCtrl *m_forwardMonths = nullptr;
96 
97  wxButton* m_bitmapDataPeriodFilterBtn = nullptr;
98  DateRange2 m_current_date_range = DateRange2();
99  mmCheckingPanel::FILTER_ID m_filter_id;
100 
101 private:
102  void OnYearChanged(wxCommandEvent& event);
103  void OnBudgetChanged(wxCommandEvent & event);
104  void OnStartEndDateChanged(wxDateEvent& event);
105  void OnSingleDateChanged(wxDateEvent& event);
106  void OnAccountChanged(wxCommandEvent& event);
107  void OnChartChanged(wxCommandEvent& event);
108  void OnForwardMonthsChangedSpin(wxSpinEvent& event);
109  void OnForwardMonthsChangedText(wxCommandEvent& event);
110  void OnShiftPressed(wxCommandEvent& event);
111  void OnPeriodSelectPopup(wxCommandEvent& event);
112  void onFilterDateMenu(wxCommandEvent& event);
113  void onEditDateRanges(wxCommandEvent& event);
114 
115  void updateFilter();
116 
117  bool cleanup_;
118  bool cleanupmem_ = false;
119  int m_shift = 0;
120 
121  // New filtering
122  bool m_use_account_specific_filter;
123  int m_date_range_m = -1;
124  wxString htmlreport_;
125 
126 };
127 
129 #endif
Definition: mmreportspanel.h:72
bool saveReportText(bool initial=true)
Definition: mmreportspanel.cpp:120
Definition: mmframe.h:56
bool Create(wxWindow *parent, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name="mmReportsPanel")
Definition: mmreportspanel.cpp:88
Definition: mmreportspanel.h:76
FILTER_ID
Definition: mmcheckingpanel.h:53
Definition: mmDateRange.h:26
Definition: mmreportspanel.h:77
mmPrintableBase * getPrintableBase()
Definition: mmreportspanel.h:128
mmReportsPanel(mmPrintableBase *rb, bool cleanupReport, wxWindow *parent, mmGUIFrame *frame, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name="mmReportsPanel")
Definition: mmreportspanel.h:68
Definition: mmreportspanel.h:75
RepPanel
Definition: mmreportspanel.h:66
void CreateControls()
Definition: mmreportspanel.cpp:264
Definition: mmreportspanel.h:33
void PrintPage()
Definition: mmreportspanel.cpp:477
Definition: daterange2.h:29
mmGUIFrame * m_frame
Definition: mmreportspanel.h:64
Definition: mmreportspanel.h:80
Definition: reportbase.h:33
Definition: mmreportspanel.h:71
Definition: mmreportspanel.h:74
void sortList()
Definition: mmreportspanel.h:58
Definition: mmSimpleDialogs.h:250
Definition: mmreportspanel.h:70
Definition: mmpanelbase.h:293
Definition: mmreportspanel.h:69
void loadFilterSettings()
Definition: mmreportspanel.cpp:187
Definition: mmreportspanel.h:78
void saveFilterSettings()
Definition: mmreportspanel.cpp:249
~mmReportsPanel()
Definition: mmreportspanel.cpp:78
Definition: mmreportspanel.h:79
Definition: mmreportspanel.h:73
Definition: mmreportspanel.h:81