unit uViewClientes;

interface

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

type
  IViewClientes = interface(IViewContactos)
  ['{7964E0AB-3075-43E7-94BC-513D80A1C116}']
  end;

  TfrViewClientes = class(TfrViewContactos, IViewClientes)
    cxGridViewNOMBRE_COMERCIAL: TcxGridDBColumn;
    cxGridViewLOPD: TcxGridDBColumn;
    cxGridViewTiendaWeb: TcxGridDBColumn;
    cxGridViewPERSONA_CONTACTO: TcxGridDBColumn;
    cxGridViewFECHA_ALTA: TcxGridDBColumn;
    cxGridViewLISTA_NOMBRES: TcxGridDBColumn;
    cxGridViewPROCEDENCIA_CLIENTE: TcxGridDBColumn;
    procedure cxGridViewCODIGOCustomDrawCell(Sender: TcxCustomGridTableView;
      ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
      var ADone: Boolean);
  end;
  

implementation

uses uViewGridBase;


{$R *.dfm}


procedure TfrViewClientes.cxGridViewCODIGOCustomDrawCell(
  Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
  R : TRect;
begin
  //inherited; <- No llamamos al padre porque queremos hacer tratamiento especial
  R := AViewInfo.ContentBounds;
  ACanvas.FillRect(R);
  if (cxGridView.DataController.DisplayTexts[AViewInfo.GridRecord.RecordIndex,
    cxGridViewLOPD.Index] = '1') then
    ACanvas.DrawImage(PngImageList, R.Left + 2, R.Top + 2, 2)
  else
    ACanvas.DrawImage(PngImageList, R.Left + 2, R.Top + 2, 1);
  ADone := True;
end;

end.
