KissCount/view/AccountPanel.h

79 lines
2.2 KiB
C
Raw Normal View History

#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 <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-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-07-03 11:19:02 +02:00
#define DEFAULT_FONT_NAME wxT("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 17:29:07 +02:00
#define DELETE_ICON "ressources/process-stop.png"
#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>
class wxUI;
class KissCount;
class AccountPanel: public wxScrolledWindow
{
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();
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-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
private:
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;
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-06-03 18:28:38 +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-06-10 19:15:25 +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();
};
#endif