Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Grid cursor and its color
|
Re: Grid cursor and its color [message #39654 is a reply to message #38685] |
Sat, 13 April 2013 21:29  |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
All you need is just to override display of your GridCtrl.
First of all, we need to create display class:
class MyGridDisplay : 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)
{
if (bg == SColorHighlight) {
bg = Color(255, 0, 0); // <- Change background color to red.
}
GridDisplay::Paint(w, x, y, cx, cy, val, style, fg, bg, fnt, found, fs, fe);
return;
}
};
After that, we are going to use your display class:
GridCtrl grid;
grid.SetDisplay(Single <MyGridDisplay> ());
Let me know, If this code works.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 14 April 2013 02:58] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:41:12 CEST 2025
Total time taken to generate the page: 0.00407 seconds
|