Subject RE: [IBO] image in title of ib_grid
Author Alan McDonald
Dion,
it's very simple to just draw the lot yourself...

here's an example of a No and Name column set with the correct customglyphs
drawn on the title canvas
In this case, the titles are left justified and the glyphs are drawn
rightjustified which you can;t do by normal property settings

Alan

case ACol of
1: { ID }
begin
with (Sender as TmetaGrid).Canvas do begin
Font.Style := Font.Style+[fsBold];
Font.Color := clBlue;
TextRect(Rect, Rect.Left+2, Rect.Top+2, 'No');
if (Abs(dmLocalStore.IB_QProject.OrderingItemNo)=1) then
if dmLocalStore.IB_QProject.OrderingItemNo<0 then
metaGrid1.CustomGlyphs.Draw((Sender as TmetaGrid).Canvas,
Rect.Right-18, Rect.Top+1, 7)
else
metaGrid1.CustomGlyphs.Draw((Sender as TmetaGrid).Canvas,
Rect.Right-18, Rect.Top+1, 6)
else
metaGrid1.CustomGlyphs.Draw((Sender as TmetaGrid).Canvas,
Rect.Right-18, Rect.Top+1, 2)
end;
end;
2: { NAME }
begin
with (Sender as TmetaGrid).Canvas do begin
Font.Style := Font.Style+[fsBold];
Font.Color := clNavy;
TextRect(Rect, Rect.Left+2, Rect.Top+2, 'Name');
if (Abs(dmLocalStore.IB_QProject.OrderingItemNo)=2) then
if dmLocalStore.IB_QProject.OrderingItemNo<0 then
metaGrid1.CustomGlyphs.Draw((Sender as TmetaGrid).Canvas,
Rect.Right-18, Rect.Top+1, 7)
else
metaGrid1.CustomGlyphs.Draw((Sender as TmetaGrid).Canvas,
Rect.Right-18, Rect.Top+1, 6)
else
metaGrid1.CustomGlyphs.Draw((Sender as TmetaGrid).Canvas,
Rect.Right-18, Rect.Top+1, 2)
end;
end;
end;

> -----Original Message-----
> From: Dion Oliphant [mailto:dion@...]
> Sent: Thursday, 5 December 2002 21:34
> To: IBObjects@yahoogroups.com
> Subject: [IBO] image in title of ib_grid
>
>
> Hi,
>
> When I use the OnTitleDraw event, the other images(ie Desc & Asc)
> disappear,
> as well as the other column titles. I want those drawn by
> default. In other
> words I want to adjust a column title after the default drawing has taken
> place.
>
> Thanks,
> Dion.
>
>
>
>
> __________________________________________________________________
> _________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> __________________________________________________________________
> _________
> http://www.ibobjects.com - your IBO community resource for Tech
> Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>