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 » GridCtrl: how to set label of an Option
Re: GridCtrl: how to set label of an Option [message #35937 is a reply to message #35936] Fri, 06 April 2012 12:08 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Perhaps I must do something like this using SetCtrl

#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>

using namespace Upp;

struct App : TopWindow {
	Array<Option> option;
	GridCtrl grid;
	
	void Do()
	{   int row = grid.GetCurrentRow();
        bool status = option[row].GetData();
		if (status) option[row].SetLabel("false");
		else option[row].SetLabel("true");
	}
	
	typedef App CLASSNAME;
	
	App() {
		grid.AddColumn("Option");
		for(int i = 0; i < 10; i++) {
			grid.Add(true);
			grid.SetCtrl(i, 0, option.Add().SetLabel("---"));			
		}
		Add(grid.SizePos());
		grid.WhenCtrlsAction = THISBACK(Do);
	}
};

GUI_APP_MAIN
{
	App().Run();
}
 
Read Message
Read Message
Previous Topic: Excessive memory use
Next Topic: Autosizing columns
Goto Forum:
  


Current Time: Thu Apr 25 01:26:02 CEST 2024

Total time taken to generate the page: 0.03649 seconds