Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ColorRows() in GridCtrl - Strange code. Help pls.
ColorRows() in GridCtrl - Strange code. Help pls. [message #19591] |
Mon, 22 December 2008 01:39 |
|
I try to set custom even and odd colors of GridCtrl. Then I switch on Coloring mode - ColorRows() , - but GridCtrl set for even rows some default color.
I try to set directly ColoringMode(2); - work fine - custom colors are right.
I found code, which very strange -
GridCtrl& ColorRows(bool b = true) { return ColoringMode(2 * b).EvenColor(); }
And see to EvenColor definition :
GridCtrl& EvenColor(Color fg = SColorText, Color bg = Blend(SColorHighlight, SColorPaper, 220));
That is, the operator ColoringMode(2 * b).EvenColor(); call EvenColor without parameters - thus replaces my custom color.
Maybe this logic is wrong?
I suggested that in some cases so convenient to initialize color even lines by default.
But what about when you need to set their color does not match the default.
I propose that the code
GridCtrl& ColorRows(bool b = true) { return ColoringMode(2 * b).EvenColor(); }
replaced by the code
GridCtrl& ColorRows(bool b = true) { return ColoringMode(2 * b); }
, and the even color initialize another method.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Goto Forum:
Current Time: Sat May 18 03:53:30 CEST 2024
Total time taken to generate the page: 0.02508 seconds
|