* Add category font/color (web is missing)

*  Fix a bug in category modification (PreferencesPanel), inModification = false ; missing
This commit is contained in:
2010-09-09 20:54:00 +02:00
parent 7edd4854f4
commit 2c7a1ca252
12 changed files with 198 additions and 174 deletions

View File

@@ -19,9 +19,10 @@
#include "GridAccount.h"
#define SET_ROW_COLOR(row, color) for(int i=0; i<NUMBER_COLS_OPS; i++) \
#define SET_ROW_COLOR(row, backcolor, forecolor) for(int i=0; i<NUMBER_COLS_OPS; i++) \
{ \
SetCellBackgroundColour(row, i, color); \
SetCellBackgroundColour(row, i, backcolor); \
SetCellTextColour(row, i, forecolor); \
}
#define SET_ROW_FONT(row, font) for(int i=0; i<NUMBER_COLS_OPS; i++) \
@@ -165,7 +166,7 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
SetCellRenderer(line, CHECKED, new wxGridCellBoolRenderer ());
SetCellEditor(line, CHECKED, new wxGridCellFastBoolEditor ());
color = cat.color;
color = cat.backcolor;
if (op->checked)
{
@@ -176,7 +177,7 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
SetCellValue(line, CHECKED, wxT("1"));
}
SET_ROW_COLOR(line, color);
SET_ROW_COLOR(line, color, cat.forecolor);
if (cat.font.Length())
{
font = user->GetCategoryFont(cat.id);
@@ -198,11 +199,11 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
if (fix)
{
SET_ROW_COLOR(line, OWN_YELLOW);
SET_ROW_COLOR(line, OWN_YELLOW, *wxBLACK);
}
else
{
SET_ROW_COLOR(line, OWN_GREEN);
SET_ROW_COLOR(line, OWN_GREEN, *wxBLACK);
}
SetReadOnly(line, CHECKED, true);