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-09-28 21:38:14 +02:00
|
|
|
#include "grid/CalendarEditor.h"
|
2010-09-04 11:54:49 +02:00
|
|
|
#include "grid/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>
|
2010-05-16 10:35:34 +02:00
|
|
|
#include <model/model.h>
|
2010-09-04 11:54:49 +02:00
|
|
|
#include "grid/GridAccount.h"
|
2010-05-24 20:14:15 +02:00
|
|
|
#include <wx/category/categorysimpledataset.h>
|
2010-05-14 15:04:01 +02:00
|
|
|
|
2010-12-15 19:13:16 +01:00
|
|
|
class AccountPanel: public KissPanel
|
2010-05-14 15:04:01 +02:00
|
|
|
{
|
2010-08-26 21:28:15 +02:00
|
|
|
public:
|
|
|
|
AccountPanel(KissCount* kiss, wxUI *parent);
|
|
|
|
~AccountPanel();
|
2010-12-15 19:13:16 +01:00
|
|
|
|
|
|
|
KissPanel* CreatePanel();
|
|
|
|
wxBitmapButton* GetButton(int id);
|
|
|
|
wxString GetToolTip();
|
|
|
|
void OnShow(wxShowEvent& event);
|
|
|
|
|
2010-08-26 21:28:15 +02:00
|
|
|
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 OnCalendarChange(wxCalendarEvent& event);
|
2010-09-22 21:02:29 +02:00
|
|
|
void OnCheckMode(wxCommandEvent& event);
|
|
|
|
void OnGroup(wxCommandEvent& event);
|
|
|
|
void OnUnGroup(wxCommandEvent& event);
|
2010-08-26 21:28:15 +02:00
|
|
|
|
|
|
|
int _curMonth, _curYear;
|
|
|
|
|
|
|
|
private:
|
|
|
|
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);
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE();
|
2010-05-14 15:04:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|