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 » How to create a GridCtrl with fixed cell size
Re: How to create a GridCtrl with fixed cell size [message #15999 is a reply to message #15984] Thu, 22 May 2008 11:50 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1427
Registered: September 2007
Ultimate Contributor
[quote title=unodgs wrote on Wed, 21 May 2008 18:45]
Quote:


Ok, now I understand. One cell holds one Value object. If you want key/value pair conected with one cell you have to use some structure as Value. As for displaying. You have to extend GridDisplay class which contain some useful methods like SetLeft/Right/CenterImage.

Yes, I know that. This was not a question of how, it was a question of principle. I was asking why isn't there and easier method of doing it. The scenario I described is a fairly common one IMO. It's great that you can use a Display and do really fancy stuff if you need it, but in most cases I just want to display a simple text extracted from the Value in exactly the same position and with same style as if I had inserted a string directly. In such cases, using Display is a little overkill, and witting them can be repetitive and tedious.

Let's take for example a Paint method from Dispaly:
virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const

It has 6 parameters, and all have useful predefined values which you'll rarely ignore or change and go ahead and use them. A large portion of these displays consists of a simple w.DrawText and maybe some position calculation. Since U++ is in general good at detecting common idioms and offering some API, mechanism or clever trick for it, I was wondering why it doesn't offer something like that in this case. For example, something like:
struct MyDisplay: TextDisplay
{
    virtual String Text(const Value &q) const;
}
 
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
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: bad align of an optionbutton in gridctrl
Next Topic: GridCtrl - copy all [Feature Request]
Goto Forum:
  


Current Time: Sat Jun 21 01:17:29 CEST 2025

Total time taken to generate the page: 0.03957 seconds