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 » Accessing embedded controls in a gridCtrl
Re: Accessing embedded controls in a gridCtrl [message #22568 is a reply to message #22565] Mon, 27 July 2009 17:04 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I don't actually use GridCtrl and I haven't tested it, but this should work:

struct ProgressValue {
	int actual;	
	int total;
	
	ProgressValue(int _actual, int _total) 
		: actual(_actual), total(_total) {}
	operator Value() const { return RawToValue<ProgressValue>(*this); }
};

struct EmbeddedProgress : public ProgressIndicator
{
	virtual void SetData(const Value& data) {
		if (IsTypeRaw<ProgressValue>(data)) {
			const ProgressValue &pv = ValueTo<ProgressValue>(data);
			ProgressIndicator::Set(pv.actual, pv.total);
		}
		else
			return ProgressIndicator::SetData(data);
	}
};

If you add this ctrl instead then you can update it using:
gridctrl.Set(row, column, ProgressValue(actual, total));

It's a bit of a hack, but not too bad. Or you can just use ArrayCtrl::SetCtrl.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WhenCtrlsAction event
Next Topic: ArrayCtrl column width problem
Goto Forum:
  


Current Time: Fri Jul 18 15:28:16 CEST 2025

Total time taken to generate the page: 0.03689 seconds