GridAccount code moved

This commit is contained in:
2010-07-14 14:36:21 +02:00
parent 6ca15e23b0
commit 2c1c8b7b76
2 changed files with 19 additions and 115 deletions

View File

@@ -24,38 +24,29 @@ along with KissCount. If not, see <http://www.gnu.org/licenses/>.
#include <wx/grid.h>
#include <list>
#include "AccountPanel.h"
#include <model/model.h>
#include <controller/KissCount.h>
class KissCount;
enum {DESCRIPTION, DATE, DEBIT, CREDIT, CATEGORY, ACCOUNT, DELETE, CHECKED, NUMBER_COLS_OPS};
class GridAccount : public wxGrid
{
public:
GridAccount(wxWindow *parent, wxWindowID id) : wxGrid(parent, id),
_fixCosts(0), _week1(0), _week2(0), _week3(0), _week4(0)
{}
GridAccount(KissCount* kiss, wxWindow *parent, wxWindowID id);
~GridAccount();
wxPen GetColGridLinePen (int col) {return wxPen(*wxBLACK, 1, wxSOLID);}
wxPen GetRowGridLinePen (int row) {
if (row == 0 || row == _fixCosts ||
row == _week1 ||
row == _week2 ||
row == _week3 ||
row == _week4)
return wxPen(*wxBLACK, 1, wxSOLID);
return GetCellBackgroundColour(row, 0);
}
wxPen GetColGridLinePen (int col);
wxPen GetRowGridLinePen (int row);
void SetWeek(int week, int line);
void InsertOperation(User* user, Operation* op, int line, bool fix, int curMonth, int curYear);
void SetWeek(int week, int line) {
switch (week) {
case 1: _week1 = line; break;
case 2: _week2 = line; break;
case 3: _week3 = line; break;
case 4: _week4 = line; break;
}
}
int _fixCosts;
int _week1, _week2, _week3, _week4;
private:
std::list<int> _col;
KissCount* _kiss;
wxString* _categories, *_accounts;
};
#endif