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 » Jsonize colored GridCtrl
Jsonize colored GridCtrl [message #36775] Tue, 03 July 2012 16:54 Go to next message
koldo is currently offline  koldo
Messages: 2990
Registered: August 2008
Veteran
Hello Daniel

Now it is got a runtime error when trying to Jsonize a GridCtrl with colored cells with AttrText.

A solution to this would be changing Vector< Vector<Value> > GridCtrl::GetValues().

Before:
		for(int j = 0; j < cols_cnt; j++)
			v[i][j] = items[i + fixed_rows][j + fixed_cols].val;


After:
		for(int j = 0; j < cols_cnt; j++) {
			Value &val = items[i + fixed_rows][j + fixed_cols].val;
			if(IsType<AttrText>(val)) {
				const AttrText& t = ValueTo<AttrText>(val);
				v[i][j] = t.text;
			} else 
				v[i][j] = val;
		}


Best regards
Iñaki
Re: Jsonize colored GridCtrl [message #36970 is a reply to message #36775] Wed, 01 August 2012 15:41 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 2990
Registered: August 2008
Veteran
Twisted Evil

Best regards
Iñaki
Re: Jsonize colored GridCtrl [message #37274 is a reply to message #36970] Fri, 14 September 2012 08:50 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Fixed. Thank you for ready to apply solution!
Re: Jsonize colored GridCtrl [message #37280 is a reply to message #37274] Fri, 14 September 2012 10:04 Go to previous message
koldo is currently offline  koldo
Messages: 2990
Registered: August 2008
Veteran
Smile

Best regards
Iñaki
Previous Topic: GridCtrl bug
Next Topic: DropGrid .t file
Goto Forum:
  


Current Time: Wed Sep 18 23:47:11 CEST 2019

Total time taken to generate the page: 0.00769 seconds