Re: [Fxruby-users] Setting individual cell color with FXTableItem::drawBackground( )?
Status: Inactive
Brought to you by:
lyle
From: Claus W. S. <cws...@ac...> - 2004-03-26 04:05:27
|
I had read that and was trying to avoid subclassing FXTableItem. Oh well, I guess I will have to wait for 1.2 then. If only the API documentation was a bit more complete... Paul Rogers wrote: > This was posted to CLR by Lyle > > Daniel Sperl wrote: > > >>Is there a way to change the color of a _single_ cell? >>Or does anyone know a workaround? > > > There isn't a straightforward way to do this in FOX 1.0. You could > conceivably do it by subclassing FXTableItem and overriding its > drawContent() method, but that is much more problematic than it should > be. Hopefully, Jeroen will address some of these limitations in FOX 1.2. > > > (http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=1072 > 716784.464720%40news.liwest.at&rnum=4&prev=/groups%3Fq%3DFXTable%2Bcell% > 2Bgroup:comp.lang.ruby%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26gro > up%3Dcomp.lang.ruby%26selm%3D1072716784.464720%2540news.liwest.at%26rnum > %3D4 ) > > I don't know if it still applies - It was posted in December of last > year > > > > -----Original Message----- > From: fxr...@li... > [mailto:fxr...@li...] On Behalf Of Claus W. > Spitzer > Sent: 25 March 2004 20:25 > To: fxr...@li... > Subject: [Fxruby-users] Setting individual cell color with > FXTableItem::drawBackground( )? > > > I've recently begun working a bit with FXRuby. While messing around with > > the code for Tables, I found out that I cannot set individual cell > colors with FXTable::setCellColor . Now, looking at the API I noticed > that FXTableItem has an instance method called drawBackground, with the > parameters table, dc, x, y, w, h. I am assuming that dc is a FXDC > object, table the parent table of the FXTableItem in question, x and y > coordinated in pixels, and w and h width and height in pixels. So I > figured that I could possibly set individual cell color with something > along the lines of > @table.getItem( row, col ).drawBackground( @table, dc, x, y, w, h ) > However, my attempts so far have been in vain. I've attempted to get x, > y, w, and h by using > @table.getColumnX( col ), > @table.getRowY( row ), > @table.getItem( row, col ).getWidth( @table ), and > @table.getItem( row, col ).getHeight( @table ) respectively. I > wasn't sure what to use for dc, so I created a new FXDC > by using > dc = FXDC.new( self ) > (which didn't work if I recall correctly). So my question is, is it even > > possible to use FXTableItem.drawBackground or am I on a futile quest? If > > it is possible, what should I use for dc? > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users > |