unit uViewEpigrafes;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uViewGrid, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, uDADataTable, cxGridLevel,
  cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGrid, uBizEpigrafes, ActnList, Menus,
  cxGridBandedTableView, cxGridDBBandedTableView, JvComponent,
  JvFormAutoSize, PngImageList, ImgList, dxPSGlbl, dxPSUtl, dxPSEngn,
  dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
  dxPSEdgePatterns, cxIntlPrintSys3, dxPSCore, dxPScxCommon, dxPScxGrid6Lnk,
  cxGridCustomPopupMenu, cxGridPopupMenu, uViewFiltroBase, TB2Item, TBX,
  TB2Toolbar, TBXDkPanels, TB2Dock, dxPgsDlg, uDAInterfaces, cxCalendar,
  cxImageComboBox, cxTextEdit;

type
  IViewEpigrafes = interface(IViewGrid)
    ['{E6798DF7-011C-40EC-B368-160C48697445}']
    function GetEpigrafes: IBizEpigrafe;
    procedure SetEpigrafes(const Value: IBizEpigrafe);
    property Epigrafes: IBizEpigrafe read GetEpigrafes write SetEpigrafes;
  end;

  TfrViewEpigrafes = class(TfrViewGrid, IViewEpigrafes)
    cxGridViewDESCRIPCION: TcxGridDBColumn;
    cxGridViewREF_EPIGRAFE: TcxGridDBColumn;
    cxGridViewID: TcxGridDBColumn;
    PngImageList: TPngImageList;
    procedure cxGridViewIDCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
      AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
  protected
    FEpigrafes: IBizEpigrafe;
    function GetEpigrafes: IBizEpigrafe; virtual;
    procedure SetEpigrafes(const Value: IBizEpigrafe); virtual;
  public
    property Epigrafes: IBizEpigrafe read GetEpigrafes write SetEpigrafes;
  end;

implementation
{$R *.dfm}

{ TfrViewEpigrafes }

{
******************************* TfrViewEpigrafes *******************************
}
function TfrViewEpigrafes.GetEpigrafes: IBizEpigrafe;
begin
  Result := FEpigrafes;
end;

procedure TfrViewEpigrafes.SetEpigrafes(const Value: IBizEpigrafe);
begin
  FEpigrafes := Value;
  if Assigned(FEpigrafes) then
    dsDataSource.DataTable := FEpigrafes.DataTable;
end;


procedure TfrViewEpigrafes.cxGridViewIDCustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
  R : TRect;
begin
  inherited;
  R := AViewInfo.ContentBounds;
  ACanvas.FillRect(R);
  ACanvas.DrawImage(PngImageList, R.Left, R.Top, 1);
  ADone := True;
end;

end.
