Subject Re: Icons in TIB_Grid
Author georgethenorge
I used a TIB_ControlGrid instead. Use a TDB_Text control, becuase it has a=
canvas (from version IBO v.4).

procedure TfrmWorkOrderOverview.dbtxtStatusGetDisplayText(Sender: TObject;
var AString: String);
var
B: TBitmap;
iIndex: integer;
begin
inherited;
B := TBitmap.Create;
iIndex := strtointdef(AString, 0); //get bitmap index
if (frmMain.imlStatus.count > iIndex) then begin
frmMain.imlStatus.GetBitmap(iIndex,B); //get right bitmap from image lis=
t
dbtxtStatus.Canvas.Draw(0, 0, B); //draw bitmap
end;
B.Free;
AString := ''; //prevents text from being rendered
end;


--- In IBObjects@y..., Ale¹ Kahánek <ales.kahanek@n...> wrote:
> Hi,
> does anybody have some experience with drawing icons in TIB_Grid? I would=

> prefer to create TIB_Grid descendant with property ImageList and posibili=
ty
> to draw Icons on the basis of icon numbers in the associated dataset´s
> column.
>
> Example
> CREATE TABLE MYTABLE(
> ID INTEGER,
> ICON INTEGER, /*this is number of the desired icon from the image list*=
/
> ANOTHERFIELD VARCHAR(20),
> ...
> )
>
> In the TIB_Query.CollumnAttributes I can specify this entry
> ICON=BMP_FIELD=1
> and then in the drawing method I could test if the BMP_FIELD attribute is=

> set to 1. But, what is the best TIB_Grid method to override when drawing =
the
> icon?
>
> Or is there better solution?
>
> Thanks in advance.
> Ales Kahanek>
> > Thanks in advance.
> > Ales Kahanek
> >