KissCount/view/AccountPanel.h

70 lines
1.8 KiB
C++

#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>
#include "CalendarEditor.h"
#include "wxGridCellBitmapRenderer.h"
#define OWN_CYAN wxColour(0x99, 0xCC, 0xFF)
#define OWN_YELLOW wxColour(0xFF, 0xFF, 0x99)
#define OWN_GREEN wxColour(0x3D, 0xEB, 0x3D)
#define DEFAULT_FONT_NAME _("Liberation Sans")
#define DEFAULT_FONT_SIZE 12
#define DEFAULT_FONT(font_name) wxFont font_name(DEFAULT_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, DEFAULT_FONT_NAME);
#define DELETE_ICON "ressources/process-stop.png"
#include <controller/KissCount.h>
#include "wxUI.h"
#include <model/model.h>
#include "GridAccount.h"
#include <wx/category/categorysimpledataset.h>
class wxUI;
class KissCount;
class AccountPanel: public wxPanel
{
public:
AccountPanel(KissCount* kiss, wxUI *parent);
~AccountPanel();
void ChangeUser();
void LoadYear(int year, bool showMonth=true);
void ShowMonth(int year, int month);
void OnOperationModified(wxGridEvent& event);
void OnAccountModified(wxGridEvent& event);
void OnTreeRightClick(wxTreeEvent& event);
void OnTreeChange(wxTreeEvent& event);
private:
KissCount* _kiss;
wxUI* _wxUI;
wxTreeCtrl _tree;
GridAccount* _grid;
wxGrid *_statsGrid, *_accountsGrid;
PiePlot* _pie;
double *_categoriesValues;
std::map<wxString, int> _categoriesIndexes;
std::vector<operation>* _curOperations;
int _curMonth, _curYear;
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);
DECLARE_EVENT_TABLE();
};
#endif