From aaa93eca7361f552d5e16f75a4f4e0f25cb14426 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 26 Feb 2009 07:51:33 +0000 Subject: [PATCH] Patch level : 10.0 250 Files correlati : Ricompilazione Demo : [ ] Commento : modificata colorazione riighe git-svn-id: svn://10.65.10.50/trunk@18359 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/msksheet.cpp | 80 ++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 32 deletions(-) diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 30305a89e..dd4cc7a96 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -62,10 +62,8 @@ void TRow_property::set(int col, COLOR back, COLOR fore) { if (col < 0) { - if (back != COLOR_INVALID) - _back = back; - if (fore != COLOR_INVALID) - _fore = fore; + _back = back; + _fore = fore; if (_cell_prop != NULL) { delete _cell_prop; @@ -79,13 +77,20 @@ void TRow_property::set(int col, COLOR back, COLOR fore) TCell_property * p = (TCell_property *) _cell_prop->objptr(col); - if (p == NULL) - { - p = new TCell_property; - _cell_prop->add(p, col); - } - - p->set(back, fore); + if (back == COLOR_INVALID && fore == COLOR_INVALID) + { + if (p != NULL) + _cell_prop->destroy(col); + } + else + { + if (p == NULL) + { + p = new TCell_property; + _cell_prop->add(p, col); + } + p->set(back, fore); + } } } @@ -1157,10 +1162,21 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) } else { - get_back_and_fore_color(xiev->v.cell_request.back_color, - xiev->v.cell_request.color, rec, col); - if (xiev->v.cell_request.back_color == 0 && f->required()) - xiev->v.cell_request.back_color = REQUIRED_BACK_COLOR; +// XI_OBJ * obj = xi_get_focus(itf); + +// if (obj->type != XIT_CELL || obj->v.cell.column != num || +// obj->v.cell.row != xiev->v.cell_request.rec) +// { + COLOR back, fore; + get_back_and_fore_color(back, fore, rec, col); + + if (back != COLOR_INVALID && back != NORMAL_BACK_COLOR) + xiev->v.cell_request.back_color = back; + if (fore != COLOR_INVALID && fore != NORMAL_COLOR) + xiev->v.cell_request.color = fore; + if (xiev->v.cell_request.back_color == 0 && f->required()) + xiev->v.cell_request.back_color = REQUIRED_BACK_COLOR; +// } if (e->has_query_button()) // Metto il bottone sulle celle attive { @@ -2066,25 +2082,25 @@ void TSpreadsheet::set_back_and_fore_color(COLOR back, COLOR fore, int row, int if (col >= FIRST_FIELD) col = cid2index(col); - if (back != COLOR_INVALID || fore != COLOR_INVALID) +// if (back != COLOR_INVALID || fore != COLOR_INVALID) +// { + int first, last; + if (row < 0) { - int first, last; - if (row < 0) - { - first = 0; - last = items()-1; - } - else - first = last = row; - - const bool crea = back != NORMAL_BACK_COLOR || fore != NORMAL_COLOR; - for (int r = first; r <= last; r++) - { - TRow_property* prop = get_property(r, crea); - if (prop) - prop->set(col, back, fore); - } + first = 0; + last = items()-1; + } + else + first = last = row; + + const bool crea = back != NORMAL_BACK_COLOR || fore != NORMAL_COLOR; + for (int r = first; r <= last; r++) + { + TRow_property* prop = get_property(r, crea); + if (prop) + prop->set(col, back, fore); } +// } } void TSpreadsheet::get_back_and_fore_color(COLOR& back, COLOR& fore, int row, int col)