unit uViewConfiguracionCapitulo;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uViewDetallesArticulos, cxStyles, cxCustomData, cxGraphics, cxFilter,
  cxData, cxDataStorage, cxEdit, DB, cxDBData, cxImageComboBox, cxTextEdit,
  cxRichEdit, cxCurrencyEdit, cxCheckBox, ImgList, PngImageList, uDAInterfaces,
  uDADataTable, StdActns, ExtActns, ActnList, TB2Item, TBX, TB2Dock, TB2Toolbar,
  cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
  cxClasses, cxControls, cxGridCustomView, cxGrid, ComCtrls, StdCtrls,
  JvExStdCtrls, JvCombobox, JvColorCombo, ToolWin, cxContainer, cxMaskEdit,
  cxDropDownEdit, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, uBizDetallesPresupuestoCliente;

type
  TfrViewConfiguracionCapitulo = class(TfrViewDetallesArticulos)
    cxLookupComboBox: TcxLookupComboBox;
    DAPropiedades: TDADataSource;
    procedure CustomViewShow(Sender: TObject);
    procedure cxGridViewDESCRIPCIONGetPropertiesForEdit(
      Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
      var AProperties: TcxCustomEditProperties);
    procedure CustomViewDestroy(Sender: TObject);
  protected
    FPropiedades: IBizPropiedades;
  public
    { Public declarations }
  end;

implementation
{$R *.dfm}

uses uDetallesPresupuestoClienteController;

procedure TfrViewConfiguracionCapitulo.CustomViewDestroy(Sender: TObject);
begin
  FPropiedades := Nil;
  inherited;
end;

procedure TfrViewConfiguracionCapitulo.CustomViewShow(Sender: TObject);
begin
  inherited;
  if not Assigned(FPropiedades) then
  begin
    FPropiedades := (Controller as IDetallesPresupuestoClienteController).DarPropiedades;
    FPropiedades.DataTable.Active := True;
    DAPropiedades.DataTable := FPropiedades.DataTable;
  end;

  if Assigned(Detalles) then
     Detalles.Active := True;
end;

procedure TfrViewConfiguracionCapitulo.cxGridViewDESCRIPCIONGetPropertiesForEdit(
  Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
  var AProperties: TcxCustomEditProperties);
begin
  inherited;
  AProperties := cxLookupComboBox.Properties;
end;

end.
