Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Grid cursor and its color
Grid cursor and its color [message #38685] Sun, 06 January 2013 13:46 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I need to use a different color for the cursor of the GridCtrl. Is it possible to change it? I can't find a useful method.

Thanks,
Luigi
Re: Grid cursor and its color [message #39654 is a reply to message #38685] Sat, 13 April 2013 21:29 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
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

Previous Topic: ArrayCtrl: Display depending by value in other column
Next Topic: [Minor bug & patch] ArrayCtrl and HeaderCtrl should use native resizing icons on X11.
Goto Forum:
  


Current Time: Thu Mar 28 17:25:00 CET 2024

Total time taken to generate the page: 0.01057 seconds