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 and background color of a row
GridCtrl and background color of a row [message #41918] Wed, 05 February 2014 19:09 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I am fighting with the GridCtrl. This code:

class RowColor : public GridDisplay
{ public:
  virtual void Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style,
				           Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe);	
};

void RowColor::Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style, Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe)
{   if (AsString(val)=="0") {
     //parent->GetRow().Bg(LtRed);
     GridDisplay::Paint(w, x, y, cx, cy, val, style, fg, LtRed(), fnt, found, fs, fe);
   }
   if (AsString(val)=="") {
     //parent->GetRow().Bg(Yellow);
     GridDisplay::Paint(w, x, y, cx, cy, val, style, fg, Yellow(), fnt, found, fs, fe);
   }  
}

and

grid.AddColumn("Status", t_("Status"), 4).Ctrls(Avail3bis).Default(true).SetDisplay(Single<RowColor >());

permit me to change the background color of a column depending a three status button and it works:

index.php?t=getfile&id=4426&private=0

I would like to extend the red/yellow color to the WHOLE row. Unfortunately I can't get the row correspondent to the right column.
Any idea?

Thanks,
Luigi
 
Read Message
Read Message
Previous Topic: AddColumn(0, ...) crashes
Next Topic: Icon + text inside ArrayCtrl cell
Goto Forum:
  


Current Time: Wed Apr 24 16:28:07 CEST 2024

Total time taken to generate the page: 0.02302 seconds