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 previous message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior 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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridCtrl bug
Next Topic: DropGrid .t file
Goto Forum:
  


Current Time: Fri Apr 26 15:35:25 CEST 2024

Total time taken to generate the page: 0.02676 seconds