Subject [IBO] Re: bmp in tib_grid
Author stanw1950
Thanks John that does help. What I found kind of confusing was that
with the tdbgrid I used the DrawColumnCell procedure to set up the
font and colors and, if necessary the drawing of bitmaps. With the
tib_grid I need to use the DrawCell for the drawing and GetCellProps
for the font and colors. I was hoping to get everything done in one
procedure.

Stan Walker



--- In IBObjects@y..., "John Peterson" <jcp@i...> wrote:
> It can be done easily....the below snippet should get you
started.....
>
> Assign the onDrawCell Event.....
>
> procedure TilvsClientForm.JobGridDrawCell(Sender: TObject; ACol,
ARow:
> Integer;
> Rect: TRect; State: TGridDrawState);
> begin
> if jobGrid.DataSource.DataSet.Active then
> if ACol = BOOLEANCOLUMN then begin
> if JobGrid.BuffFields[Acol-1].AsBoolean = TRUE then
> JobGrid.Canvas.Draw(Rect.Left,Rect.Top,BitMapTick)
> else
> JobGrid.Canvas.Draw(Rect.Left,Rect.Top,BitMapCross);
> end else
> with jobGrid do DefaultDrawCell( ACol, ARow,
> Rect,
> State,
> GetCellDisplayText( ACol, ARow ),
> GetCellAlignment( ACol, ARow ));
> end;
>
> You need to set the column width the match the bitmap width also.
>
> Similar code can also place bitmaps in the Header Row, by hooking
the
> onDrawTitle event, and detecting the correct ACol.
>
> hth
> John
>
> ----- Original Message -----
> From: "stanw1950" <stanw@e...>
> To: <IBObjects@y...>
> Sent: Tuesday, June 04, 2002 8:50 AM
> Subject: [IBO] Re: bmp in tib_grid
>
>
> > Since I am not getting an answer to this question, can I assume
that
> > it can't be done? There are no examples in the sample apps.
Thanks.
> >
> > Stan Walker
> >
> >
> > --- In IBObjects@y..., "stanw1950" <stanw@e...> wrote:
> > > I want to draw a bmp in a tib_grid in the getcellprops
procedure. I
> > > finally got the row coloring and the cell coloring the way I
want
> > it,
> > > but if one field is 'Y' then I want to show a bmp in the cell
> > instead
> > > of 'Y'. I have the bmp in a resource file, so it is readily
> > > available. (D6; IBO4.2hc). Thanks in advance.
> > >
> > > Stan Walker
> >
> >
> >
> >
>
______________________________________________________________________
_____
> > 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/
> >
> >
> >