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 » I found a bug, please help
I found a bug, please help [message #22302] Thu, 02 July 2009 11:45 Go to next message
bubo is currently offline  bubo
Messages: 6
Registered: July 2009
Promising Member
I found a bug in GridCtrl

Description:
I fill a grid with columns and data using simple routine. When I delete grid instance and create a new and I fill grid with same routine => grid shows unexpected column sizes.
I include 2 pictures + simple code to reproduce this bug.
index.php?t=getfile&id=1821&private=0
index.php?t=getfile&id=1822&private=0

class TestGrid : public TopWindow {
public:
	TestGrid();
	~TestGrid();
	
	void	DoTestGrid();
private:
	typedef TestGrid CLASSNAME;
	
	void	ReloadGrid();
	
	GridCtrl*	grid;
	Button		testGridButton;
};

TestGrid::TestGrid()
{
	grid = new GridCtrl();
	
	SetRect(0, 0, 800, 600);
	
	Add(testGridButton.SetLabel("test grid").LeftPos(0, 70).TopPos(0, 28));
	Add(grid->HSizePos().VSizePos(30, 0));
	
	ReloadGrid();
	
	testGridButton <<= THISBACK(DoTestGrid);
}

TestGrid::~TestGrid()
{
	delete grid;
}

void TestGrid::DoTestGrid()
{
	//grid->Clear(true);
	
	// we recreate grid from scratch
	GridCtrl*	tmp;
	tmp = new GridCtrl();
	delete grid;
	grid = tmp;
	Add(grid->HSizePos().VSizePos(30, 0));
	
	ReloadGrid();
}

void TestGrid::ReloadGrid()
{
	// columns
	grid->AddIndex(Id("ID"));
	grid->AddColumn(Id("col1"), "column 1", 10);
	grid->AddColumn(Id("col2"), "column 2", 25);
	grid->AddColumn(Id("col3"), "column 3", 20);
	grid->AddColumn(Id("col4"), "column 4", 15);
	grid->AddColumn(Id("col5"), "column 5", 10);
	grid->AddColumn(Id("col6"), "column 6", 50);
	grid->AddColumn(Id("col7"), "column 7", 20);
	
	// rows
	for (int i = 0; i < 50; i++)
		grid->Add(i, "v1", "v2", "v3", "v4", "v5", "v6", "v7");
}

int main()
{
	TestGrid dlg;
	dlg.RunAppModal();
}

[Updated on: Thu, 02 July 2009 11:51]

Report message to a moderator

Re: I found a bug, please help [message #22304 is a reply to message #22302] Thu, 02 July 2009 13:01 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

In ReloadGrid add at the begining:
grid.Ready(false)
and at the end
grid.Ready(true)
Then everything should be ok.
Re: I found a bug, please help [message #22305 is a reply to message #22304] Thu, 02 July 2009 15:16 Go to previous messageGo to next message
bubo is currently offline  bubo
Messages: 6
Registered: July 2009
Promising Member
thanks, I will try
Re: I found a bug, please help [message #22307 is a reply to message #22305] Thu, 02 July 2009 15:19 Go to previous message
bubo is currently offline  bubo
Messages: 6
Registered: July 2009
Promising Member
It works. Thanks again.
Previous Topic: Fixed column alignment
Next Topic: WhenCtrlsAction event
Goto Forum:
  


Current Time: Mon Apr 29 05:15:18 CEST 2024

Total time taken to generate the page: 0.05389 seconds