2010-07-10 16:34:30 +02:00
|
|
|
/*
|
2010-08-26 21:28:15 +02:00
|
|
|
Copyright 2010 Grégory Soutadé
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
This file is part of KissCount.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
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.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
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.
|
2010-07-10 16:34:30 +02:00
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
2010-07-10 16:34:30 +02:00
|
|
|
*/
|
|
|
|
|
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-08-26 21:28:15 +02:00
|
|
|
public:
|
|
|
|
AccountPanel(KissCount* kiss, wxUI *parent);
|
|
|
|
~AccountPanel();
|
|
|
|
void ChangeUser();
|
|
|
|
void LoadYear(int year, bool showMonth=true);
|
|
|
|
void ShowMonth(int month, int year);
|
|
|
|
void GenerateMonth(int month, int year);
|
|
|
|
|
|
|
|
void OnOperationModified(wxGridEvent& event);
|
|
|
|
void OnAccountModified(wxGridEvent& event);
|
|
|
|
void OnTreeRightClick(wxTreeEvent& event);
|
|
|
|
void OnTreeChange(wxTreeEvent& event);
|
|
|
|
void OnMenuGenerate(wxCommandEvent& event);
|
|
|
|
void OnMenuDelete(wxCommandEvent& event);
|
|
|
|
void OnShow(wxShowEvent& event);
|
|
|
|
void OnCalendarChange(wxCalendarEvent& event);
|
|
|
|
|
|
|
|
int _curMonth, _curYear;
|
|
|
|
|
|
|
|
private:
|
|
|
|
KissCount* _kiss;
|
|
|
|
wxUI* _wxUI;
|
|
|
|
wxTreeCtrl _tree;
|
|
|
|
wxCalendarCtrl* _calendar;
|
|
|
|
GridAccount* _grid;
|
|
|
|
wxGrid *_statsGrid, *_accountsGrid;
|
|
|
|
PiePlot* _pie;
|
|
|
|
double *_categoriesValues;
|
|
|
|
wxCheckBox *_checkCheckMode;
|
|
|
|
std::map<wxString, int> _categoriesIndexes;
|
|
|
|
std::vector<Operation>* _curOperations;
|
|
|
|
wxString* _categories, *_accounts;
|
|
|
|
std::map<wxString, double> _accountsInitValues;
|
|
|
|
CategorySimpleDataset* _dataset;
|
|
|
|
int _fixCosts;
|
|
|
|
|
|
|
|
void InitStatsGrid(User* user);
|
|
|
|
void InitAccountsGrid(User* user, int month, int year);
|
|
|
|
void UpdateStats();
|
|
|
|
void InsertOperation(User* user, Operation* op, int line, bool fix);
|
|
|
|
void GetTreeSelection(int* month, int* year);
|
|
|
|
void OnCheckMode(wxCommandEvent& event);
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE();
|
2010-05-14 15:04:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|