Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl and background color of a row
GridCtrl and background color of a row [message #41918] |
Wed, 05 February 2014 19:09 |
|
forlano
Messages: 1186 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
I am fighting with the GridCtrl. This code:
class RowColor : public GridDisplay
{ public:
virtual void Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style,
Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe);
};
void RowColor::Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style, Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe)
{ if (AsString(val)=="0") {
//parent->GetRow().Bg(LtRed);
GridDisplay::Paint(w, x, y, cx, cy, val, style, fg, LtRed(), fnt, found, fs, fe);
}
if (AsString(val)=="") {
//parent->GetRow().Bg(Yellow);
GridDisplay::Paint(w, x, y, cx, cy, val, style, fg, Yellow(), fnt, found, fs, fe);
}
}
and
grid.AddColumn("Status", t_("Status"), 4).Ctrls(Avail3bis).Default(true).SetDisplay(Single<RowColor >());
permit me to change the background color of a column depending a three status button and it works:
I would like to extend the red/yellow color to the WHOLE row. Unfortunately I can't get the row correspondent to the right column.
Any idea?
Thanks,
Luigi
|
|
|
Goto Forum:
Current Time: Thu May 23 17:16:50 CEST 2024
Total time taken to generate the page: 0.02524 seconds
|