Subject | Re: [IBO] Different font color for cells in TIB_Grid? |
---|---|
Author | Andreas Pohl |
Post date | 2001-08-13T14:01:01Z |
There are samples coming with IBO itself (contact), provided in IBO list
(search at yahoogroups) or take a look of this:
procedure TSchichtbericht.IBP_Grid1GetCellProps(Sender: TObject; ACol,
ARow: Integer; AState: TGridDrawState; var AColor: TColor;
const AFont: TFont);
begin
inherited;
with IBP_Query1 do begin
if Active and (arow>0) then begin
BufferRowNum := IBP_grid1.DataRow[ ARow ];
if (BufferRowNum > 0) then begin
if (arow<>rownum) or ((arow=rownum) and ((state=dssBrowse) or
((state<>dssBrowse) and (acol=0)))) then begin
case BufferFieldByName('Schicht').AsInteger of
1:acolor:=$00E3E1CE;
2:acolor:=$00C4DCFD;
3,4:acolor:=$00DDDDDD;
end;
if BufferFieldByName('Lohnart').AsString='S' then
aFont.Style:=[fsbold];
end;
end;
end;
end;
end;
BTW, with this construct color scheme while editing/inserting is not
overwritten.
Mit freundlichem Gruss & Best Regards
Andreas Pohl
apohl@...
www.ibp-consult.com
(search at yahoogroups) or take a look of this:
procedure TSchichtbericht.IBP_Grid1GetCellProps(Sender: TObject; ACol,
ARow: Integer; AState: TGridDrawState; var AColor: TColor;
const AFont: TFont);
begin
inherited;
with IBP_Query1 do begin
if Active and (arow>0) then begin
BufferRowNum := IBP_grid1.DataRow[ ARow ];
if (BufferRowNum > 0) then begin
if (arow<>rownum) or ((arow=rownum) and ((state=dssBrowse) or
((state<>dssBrowse) and (acol=0)))) then begin
case BufferFieldByName('Schicht').AsInteger of
1:acolor:=$00E3E1CE;
2:acolor:=$00C4DCFD;
3,4:acolor:=$00DDDDDD;
end;
if BufferFieldByName('Lohnart').AsString='S' then
aFont.Style:=[fsbold];
end;
end;
end;
end;
end;
BTW, with this construct color scheme while editing/inserting is not
overwritten.
Mit freundlichem Gruss & Best Regards
Andreas Pohl
apohl@...
www.ibp-consult.com
----- Original Message -----
From: "Thomas Steinmaurer" <thomas.steinmaurer@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, August 13, 2001 3:40 PM
Subject: [IBO] Different font color for cells in TIB_Grid?
> Hi,
>
> I want to customize the visualization of records in a TIB_Grid in such a
way
> that the font color of certain data cells depend on values of one column.
>
> For example drawing a data cell with font color red if the value is
smaller
> than 10. What is the proper event to use?
>
> Thomas
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>