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 » ArrayCtrl cell color
Re: ArrayCtrl cell color [message #791 is a reply to message #789] Thu, 02 February 2006 21:46 Go to previous messageGo to previous message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
luzr wrote on Thu, 02 February 2006 14:43


Means, to solve the trouble, use Margin(0) (but you will perhaps have to provide some margins in your Display).
Providing the margin inside the Display results in other problems: If the column contains cells with different Display-s (such as lots of StdDisplay cells) all of them should be subclassed to provide the margin. And there seems to be no easy way to make the margin size settable on a per-column basis if the margin is provided by the Display (any many other classes). It is inconvenient for the client code to create multiple subclasses (adding margin for every flavor of Display) just to modify the background color of a cell. I have some other alternative ideas for customizing the margin color withouth removing the margin, or definig several new classes.
Alternative 1: (new method)
void Display::PaintMargin(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword s) const 
{
  w.DrawRect(r, paper);
}
Alternative 2: (new field in the Column and CellInfo):
class Column : FormatConvert {
	ArrayCtrl            *arrayctrl;
	Mitor<int>            pos;
	const Convert        *convert;
	Ptr<Ctrl>             edit;
	const Display        *display;
	const Display        *marginDisplay;
        ....}

Obviously both of these alternatives need a small modification in the ArrayCtrl::Paint, to use the method for painting the margin area. And both alternatives have a really small performace hit. But the common benefit of them is that the client code could keep the settable margin in columns and mixed Display cells in the same column withouth subclassing every Display flavor. Would you consider adding one of these solutions to the library?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to set/get data in a composite embedded ctrl in an arrayctrl
Next Topic: Combine Cells?
Goto Forum:
  


Current Time: Tue May 14 22:14:15 CEST 2024

Total time taken to generate the page: 0.02379 seconds