Files
Rootvin-pluginHDCRTN/frmPredvyrobaDetail.pas
2025-05-21 21:06:33 +02:00

69 lines
1.9 KiB
ObjectPascal

unit frmPredvyrobaDetail;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
ddPlugin_TLB, Vcl.ExtCtrls, Data.DB, Vcl.Grids, Vcl.DBGrids, Vcl.StdCtrls;
type
TformPredvyrobaDetail = class(TForm)
GridPanel1: TGridPanel;
grdPredvyrobaDetail: TDBGrid;
GridPanel2: TGridPanel;
Label1: TLabel;
GridPanel3: TGridPanel;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Panel6: TPanel;
procedure FormShow(Sender: TObject);
procedure grdPredvyrobaDetailDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
private
public
Helios: IHelios;
idKmen: integer;
end;
var
formPredvyrobaDetail: TformPredvyrobaDetail;
implementation
uses System.StrUtils, System.DateUtils,
datMod, helUtils, helTabsBIDs;
{$R *.dfm}
procedure TformPredvyrobaDetail.FormShow (Sender: TObject);
begin
dm.NactiPredvyrobuDetail (self, idKmen);
end;
procedure TformPredvyrobaDetail.grdPredvyrobaDetailDrawColumnCell (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
var fld: TField;
begin
fld:= Column.Field;
if (Assigned(fld) and SameText(fld.FieldName, 'colStav')) then
begin
case (VarToStr(fld.Value).ToInteger) of
0: grdPredvyrobaDetail.Canvas.Brush.Color:= Panel2.Color;
1: grdPredvyrobaDetail.Canvas.Brush.Color:= Panel3.Color;
2: grdPredvyrobaDetail.Canvas.Brush.Color:= Panel4.Color;
3: grdPredvyrobaDetail.Canvas.Brush.Color:= Panel6.Color;
4: grdPredvyrobaDetail.Canvas.Brush.Color:= Panel5.Color;
5: grdPredvyrobaDetail.Canvas.Brush.Color:= Panel1.Color;
end;
end;
grdPredvyrobaDetail.DefaultDrawColumnCell (Rect, DataCol, Column, State);
end;
end.