/
UConsGrupo.~pas
53 lines (43 loc) · 1.25 KB
/
UConsGrupo.~pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
unit UConsGrupo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, IBCustomDataSet, IBQuery, Grids, DBGrids, ExtCtrls;
type
TFrmConsGrupo = class(TForm)
Panel1: TPanel;
dbgrid1: TDBGrid;
IBQuery1: TIBQuery;
DataSource1: TDataSource;
procedure dbgrid1DblClick(Sender: TObject);
procedure dbgrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmConsGrupo: TFrmConsGrupo;
implementation
uses Unit1, UProd_Serv;
{$R *.dfm}
procedure TFrmConsGrupo.dbgrid1DblClick(Sender: TObject);
begin
FRMCADPROD.TxtGrupo.Text := IntToStr(dbGrid1.Fields[0].AsString);
FrmConsGrupo.Close();
end;
procedure TFrmConsGrupo.dbgrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if State = [] then
begin
if IBQuery1.RecNo mod 2 = 1 then
DBGrid1.Canvas.Brush.Color := clAqua
else
DBGrid1.Canvas.Brush.Color := clWhite;
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end.