{*******************************************************}
{                                                       }
{       Administración de puntos de venta               }
{                                                       }
{       Copyright (C) 2006 Rodax Software S.L.          }
{                                                       }
{*******************************************************}

unit uViewGrid;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uViewBase, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, uDADataTable, cxGridLevel,
  cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGrid, Menus, ActnList, Grids,
  DBGrids, JvComponent, JvFormAutoSize, dxPSGlbl, dxPSUtl, dxPSEngn,
  dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
  dxPSEdgePatterns, dxPSCore, dxPScxCommon, dxPScxGridLnk, dxPrnDlg,
  cxIntlPrintSys3, dxPSPrvwAdv, uViewGridBase;

type
  IViewGrid = interface(IViewGridBase)
  ['{7EA40980-AD73-4590-A53A-932316C7B121}']
  end;

  TfrViewGrid = class(TfrViewGridBase, IViewGrid)
    cxGrid: TcxGrid;
    cxGridLevel: TcxGridLevel;
    cxGridView: TcxGridDBTableView;
    dxComponentPrinter: TdxComponentPrinter;
    dxPSEngineController1: TdxPSEngineController;
    cxStyleRepository1: TcxStyleRepository;
    cxStyleEven: TcxStyle;
    cxStyleOdd: TcxStyle;
    cxStyleSelection: TcxStyle;
    cxStyleSinOrden: TcxStyle;
    cxStyleConOrden: TcxStyle;
    procedure cxGridViewStylesGetContentStyle(
      Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
      AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
  protected
    function GetGrid : TcxGrid; override;
    function GetFocusedView : TcxGridDBTableView; override;
  end;

implementation

uses
  uDataModuleBase, uDBSelectionList;

{$R *.dfm}

{
********************************* TfrViewGrid **********************************
}

{ TfrViewGrid }
function TfrViewGrid.GetFocusedView: TcxGridDBTableView;
begin
  Result := cxGridView;
end;

function TfrViewGrid.GetGrid: TcxGrid;
begin
  Result := cxGrid;
end;

procedure TfrViewGrid.cxGridViewStylesGetContentStyle(
  Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
  AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
begin
  inherited;
  if Assigned(AItem) then
  begin
    if AItem.SortOrder = soNone then
      AStyle := cxStyleSinOrden
    else
      AStyle := cxStyleConOrden;
  end;
end;

end.

