/*
Copyright 2010 Grégory Soutadé
This file is part of KissCount.
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.
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.
You should have received a copy of the GNU General Public License
along with KissCount. If not, see .
*/
#ifndef ACCOUNTPANEL_H
#define ACCOUNTPANEL_H
#include
#include
#include
#include
#include
#include
#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 wxT("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/icons/process-stop.png"
#define CHECKED_ICON "ressources/icons/tick-icon.png"
#include
#include "wxUI.h"
#include
#include "GridAccount.h"
#include
class wxUI;
class KissCount;
class AccountPanel: public wxScrolledWindow
{
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;
std::map _categoriesIndexes;
std::vector* _curOperations;
wxString* _categories, *_accounts;
std::map _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();
};
#endif