This commit is contained in:
David Arranz 2007-09-18 17:12:25 +00:00
parent f74169f352
commit 7877631c95
2 changed files with 0 additions and 183 deletions

View File

@ -1,72 +0,0 @@
object frViewFiltrosStock: TfrViewFiltrosStock
Left = 0
Top = 0
Width = 537
Height = 105
Color = clWindow
ParentBackground = False
ParentColor = False
TabOrder = 0
object dxLayoutControl1: TdxLayoutControl
Left = 0
Top = 0
Width = 537
Height = 41
Align = alTop
ParentBackground = True
TabOrder = 0
AutoContentSizes = [acsWidth, acsHeight]
object cbColeccion: TcxComboBox
Left = 64
Top = 10
Properties.DropDownListStyle = lsFixedList
Properties.DropDownRows = 18
Properties.ReadOnly = False
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 0
Width = 168
end
object ccbCentro: TJvCheckedComboBox
Left = 280
Top = 10
Width = 191
Height = 21
CapSelectAll = '&Select all'
CapDeSelectAll = '&Deselect all'
NoFocusColor = clWindow
QuoteStyle = qsSingle
DropDownLines = 20
TabOrder = 1
end
object dxLayoutControl1Group_Root: TdxLayoutGroup
ShowCaption = False
Hidden = True
LayoutDirection = ldHorizontal
ShowBorder = False
object dxLayoutControl1Item1: TdxLayoutItem
AutoAligns = [aaVertical]
Caption = 'Colecci'#243'n:'
Control = cbColeccion
ControlOptions.ShowBorder = False
end
object dxLayoutControl1Item3: TdxLayoutItem
AutoAligns = [aaVertical]
AlignHorz = ahClient
Caption = 'Centro:'
Control = ccbCentro
ControlOptions.ShowBorder = False
end
end
end
end

View File

@ -1,111 +0,0 @@
unit uViewFiltrosStock;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxLayoutControl, cxControls, uViewControlGrid,
cxGraphics, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, DB, cxDBData,
cxGridLevel, cxClasses, cxGridCustomView, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxGrid, cxCheckComboBox, StdCtrls,
Mask, JvExMask, JvToolEdit, JvCombobox;
type
IViewFiltrosStock = interface
['{ABC745C3-64F0-44E4-AF4B-118AE5060150}']
procedure SetFocusedView (const Value : TcxGridDBTableView);
function GetFocusedView : TcxGridDBTableView;
property FocusedView : TcxGridDBTableView read GetFocusedView write SetFocusedView;
procedure Refresh;
end;
TfrViewFiltrosStock = class(TFrame, IViewFiltrosStock)
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
cbColeccion: TcxComboBox;
dxLayoutControl1Item1: TdxLayoutItem;
dxLayoutControl1Item3: TdxLayoutItem;
ccbCentro: TJvCheckedComboBox;
private
FFocusedView : TcxGridDBTableView;
function GetFilterValueList(AColumnIndex: Integer): TStringList;
protected
procedure RellenarFiltros;
procedure SetFocusedView (const Value : TcxGridDBTableView);
function GetFocusedView : TcxGridDBTableView;
public
CentroColumnIndex : Integer;
ColeccionColumnIndex : Integer;
property FocusedView : TcxGridDBTableView read GetFocusedView write SetFocusedView;
procedure Refresh;
end;
implementation
{$R *.dfm}
{ TfrViewFiltrosStock }
function TfrViewFiltrosStock.GetFilterValueList(AColumnIndex: Integer): TStringList;
var
AValueList : TcxDataFilterValueList;
i : Integer;
begin
Result := TStringList.Create;
if AColumnIndex < 0 then
Exit;
AValueList := TcxDataFilterValueList.Create(FFocusedView.DataController.Filter);
try
AValueList.Load(AColumnIndex);
for i := 0 to AValueList.Count - 1 do
Result.Add(AValueList[i].DisplayText);
finally
FreeAndNil(AValueList);
end;
end;
function TfrViewFiltrosStock.GetFocusedView: TcxGridDBTableView;
begin
Result := FFocusedView;
end;
procedure TfrViewFiltrosStock.Refresh;
begin
inherited;
RellenarFiltros;
end;
procedure TfrViewFiltrosStock.RellenarFiltros;
begin
if ColeccionColumnIndex >= 0 then
with cbColeccion.Properties do
begin
Items.Clear;
Items.AddStrings(GetFilterValueList(ColeccionColumnIndex));
Items.Delete(1);
Items.Strings[0] := 'Todos';
cbColeccion.Text := 'Todos';
end;
if CentroColumnIndex >= 0 then
with ccbCentro do
begin
Items.Clear;
Items.AddStrings(GetFilterValueList(CentroColumnIndex));
Items.Delete(1);
Items.Strings[0] := 'Todos';
Checked[0] := True;
end;
end;
procedure TfrViewFiltrosStock.SetFocusedView(
const Value: TcxGridDBTableView);
begin
FFocusedView := Value;
end;
end.