I can draw bitmaps into the data cells using OnDrawColumnCell, but
haven't been able to draw into the title cells.
The help for TCustomDBGrid.OnDrawColumnCell says:
'The State parameter indicates whether the cell has input focus, whether
the cell is selected, and whether the cell is a fixed (non-data) cell
such as a column header.'
This would be fine, except that OnDrawColumnCell only seems to be
drawing the data cells.
How can I intercept the drawing of the title cells?
Thanks,
Graham
inherited DrawCell(ACol, ARow, ARect, AState );
if (gdFixed in AState) and Assigned(fOnDrawFixedCell) then
fOnDrawFixedCell(Self, ACol, ARow, ARect, AState );
--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.q...@neosys.xrs.qwe.si
No questions via email, unless explicitly invited.
Graham Falkenberg wrote in message <38E6A46D...@senet.com.au>...
I worked around it but doing my drawing when the grid's first row was
getting drawn. Probably a little inefficient but it's not noticible
visually. The way I determine it's the first row is when Rect.Top is at
it's lowest value (about 17 in my case).
Paul / ColumbuSoft
www.columbusoft.com
Graham Falkenberg <gfalk...@senet.com.au> wrote in message
news:38E6A46D...@senet.com.au...
Paul / ColumbuSoft
www.columbusoft.com
Robert Cerny <robert.q...@neosys.xrs.qwe.si> wrote in message
news:8c8ms7...@neosys.xrs.si...
See my other post for solution.
--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.q...@neosys.xrs.qwe.si
No questions via email, unless explicitly invited.
Paul Ferrara wrote in message <8c8imp$ja...@bornews.borland.com>...
Any help with this is greatly appreciated.
Thanks,
Graham
Robert Cerny wrote:
> You have to override the DrawCell method and from there call event
> DrawFixedCell. You have to add that event too:
>
> inherited DrawCell(ACol, ARow, ARect, AState );
> if (gdFixed in AState) and Assigned(fOnDrawFixedCell) then
> fOnDrawFixedCell(Self, ACol, ARow, ARect, AState );
>
> --
> ----------------------
> Regards
> Robert Cerny
> Remove both qwe when replying
> email: robert.q...@neosys.xrs.qwe.si
>
> No questions via email, unless explicitly invited.
> Graham Falkenberg wrote in message <38E6A46D...@senet.com.au>...
The rest of code goes into implementation of this method.
--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.q...@neosys.xrs.qwe.si
No questions via email, unless explicitly invited.
Paul Ferrara wrote in message <8ca2lr$7f...@bornews.borland.com>...
>This sounds like a much better solution than the one I came up with but I
>can't get it to compile. Delphi complains about 'undeclared identifier:
>DrawCell'
>
>
>Paul / ColumbuSoft
>www.columbusoft.com
>
>
>Robert Cerny <robert.q...@neosys.xrs.qwe.si> wrote in message
>news:8c8ms7...@neosys.xrs.si...
TForm is a class like any other, so overriding methods goes in the same
fashion for any class/component/control.
BTW, don't overquote.
--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.q...@neosys.xrs.qwe.si
No questions via email, unless explicitly invited.
Graham Falkenberg wrote in message <38E89D12...@senet.com.au>...
But one thing amazes me: I'm finding tons of
sample code for these events where it's checking
the gdFixed state. How are they doing it !!!!
If there's something I can set or hack without
subclassing the control, I'd love to hear it!
David
In article <8caaqb...@neosys.xrs.si>,
"Robert Cerny"
<robert.q...@neosys.xrs.qwe.si> wrote:
> It's not a bug. You may call it "missing
functionality", but not a bug. This
> behaviour is documented.
> OnDrawColumnCell event made OnDrawDataCell
obsolete, but they do the same
> thing.
>
> See my other post for solution.
>
> --
> ----------------------
> Regards
> Robert Cerny
> Remove both qwe when replying
> email: robert.q...@neosys.xrs.qwe.si
>
> No questions via email, unless explicitly
invited.
> Paul Ferrara wrote in message
<8c8imp$ja...@bornews.borland.com>...
> >The problem is that the VCL code that draws
the title never calls the
> >OnDrawColumnCell or OnDrawDataCell so those
methods never get called when
> >state is gdFixed. I reported as a bug a few
weeks ago but haven't heard
> >anything on it.
> >
> >I worked around it but doing my drawing when
the grid's first row was
> >getting drawn. Probably a little inefficient
but it's not noticible
> >visually. The way I determine it's the first
row is when Rect.Top is at
> >it's lowest value (about 17 in my case).
> >
> >Paul / ColumbuSoft
> >www.columbusoft.com
> >
> >
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.