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 » Redraw rows
Redraw rows [message #42796] Fri, 04 April 2014 11:57 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I'm having a problem for some time now. It keeps occuring in new places since I use the ArrayCtrl a lot in my application. I used a function I got from the forum once to set all cells in a row to use a specific Display class. I want to color the text of some rows red. The following code is the function.

void ArrayCtrl::SetRowDisplay(int i, const Display& d)
{
	if(i >= 0 && i < GetCount())
		for (int j = 0 ; j < GetSize().cx ; j++)	
			cellinfo.At(i).At(j).Set(d);
	RefreshRow(i);
}


When I use virtual counts and I force the control to refresh by, for example, resizing it, the rows turn red as I desired. However, in very many situations the rows don't turn red before I manually resize it. It doesn't matter what I call: SetVirtualCount, Refresh, SetCount, Add, etc. Nothing works to show me the rows in red. What is the problem? Can the control be refreshed so I can see my rows in red?

Regards,
crydev
Re: Redraw rows [message #42797 is a reply to message #42796] Fri, 04 April 2014 12:27 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1758
Registered: August 2008
Location: Czech Republic
Senior Contributor

Hi crydev,

I don't know much about ArrayCtrl, but have you tried to call Layout()? That is called when resizing, so perhaps it would help to trigger the display update you need. Of course, even if it works, it's a workaround at best Smile

Best regards,
Honza
Re: Redraw rows [message #42798 is a reply to message #42797] Fri, 04 April 2014 13:13 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thanks Honza for your reply,

This time I only just found out that my method didn't add the display to the correct row yet because the row wasn't added yet. That did the job. However, I have an ArrayCtrl in a tabwindow too. The same problem occured and I worked around it by refreshing the row count whenever the tabwindow is set active. (TabCtrl::WhenSet).

I will let you know if I run into this problem again.

Thanks! Smile

crydev
Previous Topic: Icon + text inside ArrayCtrl cell
Next Topic: Hide cell content with '*' symbol in GridCtrl
Goto Forum:
  


Current Time: Tue Nov 12 11:50:09 CET 2019

Total time taken to generate the page: 0.02300 seconds