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-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-05-16 20:09:18 +02:00
|
|
|
#define OWN_CYAN wxColour(0x99, 0xCC, 0xFF)
|
|
|
|
#define OWN_YELLOW wxColour(0xFF, 0xFF, 0x99)
|
|
|
|
#define OWN_GREEN wxColour(0x3D, 0xEB, 0x3D)
|
|
|
|
|
2010-05-27 22:32:35 +02:00
|
|
|
#define DEFAULT_FONT_NAME _("Liberation Sans")
|
2010-05-16 20:09:18 +02:00
|
|
|
#define DEFAULT_FONT_SIZE 12
|
2010-05-27 22:32:35 +02:00
|
|
|
#define DEFAULT_FONT(font_name) wxFont font_name(DEFAULT_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, DEFAULT_FONT_NAME);
|
2010-05-16 20:09:18 +02:00
|
|
|
|
2010-06-16 19:15:49 +02:00
|
|
|
enum {DESCRIPTION, DATE, DEBIT, CREDIT, CATEGORY, ACCOUNT, DELETE, CHECKED, NUMBER_COLS_OPS};
|
2010-06-02 22:14:11 +02:00
|
|
|
enum {ACCOUNT_NUMBER, ACCOUNT_NAME, ACCOUNT_INIT, ACCOUNT_CUR, ACCOUNT_FINAL, NUMBER_COLS_ACCOUNTS};
|
2010-05-27 22:32:35 +02:00
|
|
|
enum {CUR_CREDIT, CUR_DEBIT, TOTAL_CREDIT, TOTAL_DEBIT, REMAINS, STATS_ROW, CATS_STATS};
|
2010-05-16 20:09:18 +02:00
|
|
|
|
2010-06-02 22:14:11 +02:00
|
|
|
enum {CALENDAR_TREE_ID=10, OPS_GRID_ID, ACCOUNTS_GRID_ID};
|
2010-06-16 17:29:07 +02:00
|
|
|
|
|
|
|
#define DELETE_ICON "ressources/process-stop.png"
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
class AccountPanel: public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AccountPanel(KissCount* kiss, wxUI *parent);
|
2010-05-27 21:09:02 +02:00
|
|
|
~AccountPanel();
|
2010-05-16 10:35:34 +02:00
|
|
|
void ChangeUser();
|
|
|
|
void LoadYear(int year);
|
|
|
|
void ShowMonth(int year, int month);
|
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-02 22:14:11 +02:00
|
|
|
|
2010-05-14 15:04:01 +02:00
|
|
|
private:
|
|
|
|
KissCount* _kiss;
|
|
|
|
wxUI* _wxUI;
|
|
|
|
wxTreeCtrl _tree;
|
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-02 22:14:11 +02:00
|
|
|
std::map<wxString, int> _categoriesIndexes, _accountsIndexes;
|
2010-06-03 18:28:38 +02:00
|
|
|
std::vector<operation>* _curOperations;
|
2010-05-27 21:09:02 +02:00
|
|
|
int _curMonth, _curYear;
|
|
|
|
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-06-10 19:15:25 +02:00
|
|
|
void InsertOperation(User* user, operation* op, int line, bool fix);
|
2010-06-02 22:14:11 +02:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE();
|
2010-05-14 15:04:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|