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 and converters
Re: ArrayCtrl and converters [message #27514 is a reply to message #27513] Wed, 21 July 2010 16:41 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Firstly, instead of using Disable on the EditCtrls you could use ReadOnly and ClearFrames to get what you want.

But I'm pretty you actually want to use ArrayCtrl::SetDisplay. You can even link it to any Convert classes you have:
template<class T>
class ConvertDisplay : public Display
{
private:
	T convert;
public:
	virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
	{
		Display &d = StdDisplay();
		d.PaintBackground(w, r, q, ink, paper, style);
		d.Paint(w, r, convert.Format(q), ink, paper, style);
	}
};
// For instance:
typedef ConvertDisplay<ConvertHex> DisplayHex;

(untested, but the principle is sound)
 
Read Message
Read Message
Read Message
Previous Topic: GridCtrl and diff Edit()'s per row, same column
Next Topic: [Bug] ArrayCtrl::Serialize
Goto Forum:
  


Current Time: Thu Apr 25 06:05:50 CEST 2024

Total time taken to generate the page: 0.02967 seconds