2010-07-10 16:34:30 +02:00
|
|
|
/*
|
|
|
|
Copyright 2010 Grégory Soutadé
|
|
|
|
|
|
|
|
This file is part of KissCount.
|
|
|
|
|
|
|
|
KissCount is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
KissCount is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-05-14 15:04:01 +02:00
|
|
|
#ifndef ACCOUNTPANEL_H
|
|
|
|
#define ACCOUNTPANEL_H
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <wx/grid.h>
|
|
|
|
#include <wx/treectrl.h>
|
|
|
|
#include <wx/pie/pieplot.h>
|
|
|
|
#include <wx/chartpanel.h>
|
2010-07-01 20:28:43 +02:00
|
|
|
#include <wx/scrolwin.h>
|
2010-06-02 22:14:11 +02:00
|
|
|
#include "CalendarEditor.h"
|
2010-06-16 17:29:07 +02:00
|
|
|
#include "wxGridCellBitmapRenderer.h"
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2010-07-14 11:15:48 +02:00
|
|
|
#include "view.h"
|
2010-06-16 17:29:07 +02:00
|
|
|
|
2010-05-14 15:04:01 +02:00
|
|
|
#include <controller/KissCount.h>
|
|
|
|
#include "wxUI.h"
|
2010-05-16 10:35:34 +02:00
|
|
|
#include <model/model.h>
|
|
|
|
#include "GridAccount.h"
|
2010-05-24 20:14:15 +02:00
|
|
|
#include <wx/category/categorysimpledataset.h>
|
2010-05-14 15:04:01 +02:00
|
|
|
|
|
|
|
class wxUI;
|
|
|
|
class KissCount;
|
|
|
|
|
2010-07-01 20:28:43 +02:00
|
|
|
class AccountPanel: public wxScrolledWindow
|
2010-05-14 15:04:01 +02:00
|
|
|
{
|
2010-07-04 16:33:25 +02:00
|
|
|
public:
|
2010-05-14 15:04:01 +02:00
|
|
|
AccountPanel(KissCount* kiss, wxUI *parent);
|
2010-05-27 21:09:02 +02:00
|
|
|
~AccountPanel();
|
2010-05-16 10:35:34 +02:00
|
|
|
void ChangeUser();
|
2010-06-22 20:46:30 +02:00
|
|
|
void LoadYear(int year, bool showMonth=true);
|
2010-06-23 19:32:42 +02:00
|
|
|
void ShowMonth(int month, int year);
|
|
|
|
void GenerateMonth(int month, int year);
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2010-06-02 22:14:11 +02:00
|
|
|
void OnOperationModified(wxGridEvent& event);
|
2010-06-12 15:59:27 +02:00
|
|
|
void OnAccountModified(wxGridEvent& event);
|
2010-06-22 15:51:51 +02:00
|
|
|
void OnTreeRightClick(wxTreeEvent& event);
|
|
|
|
void OnTreeChange(wxTreeEvent& event);
|
2010-06-23 14:25:00 +02:00
|
|
|
void OnMenuGenerate(wxCommandEvent& event);
|
|
|
|
void OnMenuDelete(wxCommandEvent& event);
|
2010-06-27 21:39:49 +02:00
|
|
|
void OnShow(wxShowEvent& event);
|
2010-06-29 21:43:29 +02:00
|
|
|
void OnCalendarChange(wxCalendarEvent& event);
|
2010-06-27 21:39:49 +02:00
|
|
|
|
|
|
|
int _curMonth, _curYear;
|
2010-06-02 22:14:11 +02:00
|
|
|
|
2010-07-04 16:33:25 +02:00
|
|
|
private:
|
2010-05-14 15:04:01 +02:00
|
|
|
KissCount* _kiss;
|
|
|
|
wxUI* _wxUI;
|
2010-06-27 21:44:24 +02:00
|
|
|
wxTreeCtrl _tree;
|
2010-06-29 21:43:29 +02:00
|
|
|
wxCalendarCtrl* _calendar;
|
2010-05-16 20:09:18 +02:00
|
|
|
GridAccount* _grid;
|
2010-06-02 22:14:11 +02:00
|
|
|
wxGrid *_statsGrid, *_accountsGrid;
|
2010-05-14 15:04:01 +02:00
|
|
|
PiePlot* _pie;
|
2010-05-27 21:09:02 +02:00
|
|
|
double *_categoriesValues;
|
2010-06-21 13:02:02 +02:00
|
|
|
std::map<wxString, int> _categoriesIndexes;
|
2010-07-03 11:48:53 +02:00
|
|
|
std::vector<Operation>* _curOperations;
|
2010-05-27 21:09:02 +02:00
|
|
|
wxString* _categories, *_accounts;
|
2010-06-02 22:14:11 +02:00
|
|
|
std::map<wxString, double> _accountsInitValues;
|
2010-05-27 21:09:02 +02:00
|
|
|
CategorySimpleDataset* _dataset;
|
2010-06-02 22:14:11 +02:00
|
|
|
int _fixCosts;
|
2010-05-27 21:09:02 +02:00
|
|
|
|
2010-06-02 22:14:11 +02:00
|
|
|
void InitStatsGrid(User* user);
|
|
|
|
void InitAccountsGrid(User* user, int month, int year);
|
2010-05-27 22:32:35 +02:00
|
|
|
void UpdateStats();
|
2010-07-03 11:48:53 +02:00
|
|
|
void InsertOperation(User* user, Operation* op, int line, bool fix);
|
2010-06-24 21:02:42 +02:00
|
|
|
void GetTreeSelection(int* month, int* year);
|
2010-06-02 22:14:11 +02:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE();
|
2010-05-14 15:04:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|