* Goup/Ungroup initial work

* Add INSTALL file
* Adapt KissCount to new resolution
This commit is contained in:
2010-09-22 21:02:29 +02:00
parent e7a2b0c988
commit 3eea053d54
15 changed files with 203 additions and 17 deletions

View File

@@ -88,6 +88,13 @@ GridAccount::GridAccount(KissCount* kiss, wxWindow *parent, wxWindowID id) : wxG
}
Connect(id, wxEVT_GRID_CELL_CHANGE, wxGridEventHandler(GridAccount::OnOperationModified), NULL, this);
AutoSizeColumn(TREE, false);
AutoSizeColumn(CATEGORY, false);
AutoSizeColumn(DATE, false);
AutoSizeColumn(ACCOUNT, false);
AutoSizeColumn(DELETE, false);
AutoSizeColumn(CHECKED, false);
}
GridAccount::~GridAccount()
@@ -141,19 +148,27 @@ void GridAccount::LoadOperations(std::vector<Operation>* operations, bool canAdd
it = _operations->begin();
for (;it != _operations->end() && it->fix_cost; it++)
{
if (it->parent.Length()) continue;
if (setWeek)
InsertOperationWithWeek(user, &(*it), ++curLine, true, it->month, it->year);
else
InsertOperation(user, &(*it), ++curLine, true, it->month, it->year);
}
if (canAddOperation)
InsertOperation(user, NULL, ++curLine, true, month, year);
for (; it != _operations->end(); it++)
{
if (it->parent.Length()) continue;
if (setWeek)
InsertOperationWithWeek(user, &(*it), ++curLine, false, it->month, it->year);
else
InsertOperation(user, &(*it), ++curLine, false, it->month, it->year);
}
if (canAddOperation)
InsertOperation(user, NULL, ++curLine, false, month, year);
@@ -224,8 +239,20 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
InsertRows(line, 1);
SetCellRenderer(line, TREE, new wxGridCellTreeButtonRenderer());
SetCellEditor(line, TREE, new wxGridCellTreeButtonEditor());
if (op && op->meta)
{
SetCellRenderer(line, TREE, new wxGridCellTreeButtonRenderer());
SetCellEditor(line, TREE, new wxGridCellTreeButtonEditor());
SetReadOnly(line, DATE, true);
SetReadOnly(line, CREDIT, true);
SetReadOnly(line, DEBIT, true);
SetReadOnly(line, CATEGORY, true);
SetReadOnly(line, ACCOUNT, true);
}
else
SetReadOnly(line, TREE, true);
SetCellEditor(line, DEBIT, new wxGridCellFloatEditor(wxID_ANY, 2));
SetCellEditor(line, CREDIT, new wxGridCellFloatEditor(wxID_ANY, 2));
wxGridCellChoiceEditor* accountEditor = new wxGridCellChoiceEditor(user->GetAccountsNumber(), _accounts, false);
@@ -304,6 +331,7 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
SetReadOnly(line, DELETE, true);
}
SetCellAlignment(line, DATE, wxALIGN_CENTRE, wxALIGN_CENTRE);
SetCellAlignment(line, DEBIT, wxALIGN_RIGHT, wxALIGN_CENTRE);
SetCellAlignment(line, CREDIT, wxALIGN_RIGHT, wxALIGN_CENTRE);
SetCellAlignment(line, DELETE, wxALIGN_CENTRE, wxALIGN_CENTRE);
@@ -626,3 +654,13 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
inModification = false ;
event.Skip();
}
void GridAccount::Group()
{
}
void GridAccount::UnGroup()
{
}

View File

@@ -47,6 +47,9 @@ public:
void InsertOperationWithWeek(User* user, Operation* op, int line, bool fix, int month, int year) ;
void InsertOperation(User* user, Operation* op, int line, bool fix, int month, int year) ;
void Group();
void UnGroup();
void OnCellLeftClick(wxGridEvent& evt);
void OnOperationModified(wxGridEvent& event);