From c07616b99c600099cb615299c8a82a459bbb8e29 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 2 Jan 2008 20:37:08 +0000 Subject: [PATCH] Filtros avanzados en las columnas de los grids. git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@207 c93665c3-c93d-084d-9b98-7d5f4a9c3376 --- Source/Base/GUIBase/uEditorGridBase.dfm | 6 +++--- Source/Base/GUIBase/uEditorGridBase.pas | 10 ++++++---- Source/Base/GUIBase/uViewGrid.dfm | 5 +++-- Source/Base/GUIBase/uViewGrid.pas | 2 +- Source/Base/GUIBase/uViewGridBase.pas | 26 +++++++++++++++++++++++-- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Source/Base/GUIBase/uEditorGridBase.dfm b/Source/Base/GUIBase/uEditorGridBase.dfm index 23d50433..52d2fb60 100644 --- a/Source/Base/GUIBase/uEditorGridBase.dfm +++ b/Source/Base/GUIBase/uEditorGridBase.dfm @@ -5,7 +5,7 @@ inherited fEditorGridBase: TfEditorGridBase ClientHeight = 444 ClientWidth = 543 ExplicitWidth = 551 - ExplicitHeight = 478 + ExplicitHeight = 471 PixelsPerInch = 96 TextHeight = 13 inherited JvNavPanelHeader: TJvNavPanelHeader @@ -146,7 +146,7 @@ inherited fEditorGridBase: TfEditorGridBase end end object TBXTMain2: TTBXToolbar - Left = 337 + Left = 341 Top = 49 Caption = 'tbxMain' ChevronHint = 'M'#225's botones|' @@ -214,7 +214,7 @@ inherited fEditorGridBase: TfEditorGridBase end object actFiltrar: TAction Category = 'Buscar' - Caption = 'Filtrar m'#225's..' + Caption = 'Filtrar m'#225's...' OnExecute = actFiltrarExecute OnUpdate = actFiltrarUpdate end diff --git a/Source/Base/GUIBase/uEditorGridBase.pas b/Source/Base/GUIBase/uEditorGridBase.pas index f76b7d86..12bf7169 100644 --- a/Source/Base/GUIBase/uEditorGridBase.pas +++ b/Source/Base/GUIBase/uEditorGridBase.pas @@ -179,14 +179,16 @@ begin if Assigned(ViewGrid) then if ViewGrid.ViewFiltros.VerFiltros then begin - tbxEditFiltro.Visible := False; - TBXItem7.Visible := False; + tbxEditFiltro.Enabled := False; + TBXItem7.Enabled := False; + ViewGrid.VerFiltroColumnas := True; end else begin + ViewGrid.VerFiltroColumnas := False; tbxEditFiltro.Text := ''; - tbxEditFiltro.Visible := True; - TBXItem7.Visible := True; + tbxEditFiltro.Enabled := True; + TBXItem7.Enabled := True; end; end; diff --git a/Source/Base/GUIBase/uViewGrid.dfm b/Source/Base/GUIBase/uViewGrid.dfm index 8bcc1eda..fc28a638 100644 --- a/Source/Base/GUIBase/uViewGrid.dfm +++ b/Source/Base/GUIBase/uViewGrid.dfm @@ -19,7 +19,7 @@ inherited frViewGrid: TfrViewGrid LookAndFeel.Kind = lfOffice11 LookAndFeel.NativeStyle = True object cxGridView: TcxGridDBTableView - OnDblClick = cxGridViewDblClick + OnDblClick = cxGridViewDblClick NavigatorButtons.ConfirmDelete = False FilterBox.Visible = fvNever DataController.DataSource = dsDataSource @@ -47,6 +47,7 @@ inherited frViewGrid: TfrViewGrid OptionsView.GridLines = glHorizontal OptionsView.GroupByBox = False OptionsView.HeaderEndEllipsis = True + OptionsView.NewItemRowInfoText = 'Click here to add a new row' Styles.Inactive = cxStyleSelection Styles.Selection = cxStyleSelection Styles.OnGetContentStyle = cxGridViewStylesGetContentStyle @@ -154,7 +155,7 @@ inherited frViewGrid: TfrViewGrid PrinterPage.ScaleMode = smFit PrinterPage._dxMeasurementUnits_ = 0 PrinterPage._dxLastMU_ = 2 - ReportDocument.CreationDate = 39296.809313506940000000 + ReportDocument.CreationDate = 39449.781622719910000000 StyleManager = dxPrintStyleManager1 OptionsCards.Shadow.Depth = 0 OptionsExpanding.ExpandGroupRows = True diff --git a/Source/Base/GUIBase/uViewGrid.pas b/Source/Base/GUIBase/uViewGrid.pas index cf63992e..9b2cb08c 100644 --- a/Source/Base/GUIBase/uViewGrid.pas +++ b/Source/Base/GUIBase/uViewGrid.pas @@ -1,4 +1,4 @@ -{*******************************************************} +{*******************************************************} { } { Administración de puntos de venta } { } diff --git a/Source/Base/GUIBase/uViewGridBase.pas b/Source/Base/GUIBase/uViewGridBase.pas index 293a96de..37be12a9 100644 --- a/Source/Base/GUIBase/uViewGridBase.pas +++ b/Source/Base/GUIBase/uViewGridBase.pas @@ -72,13 +72,17 @@ type procedure SetViewFiltros(const Value: IViewFiltroBase); property ViewFiltros: IViewFiltroBase read GetViewFiltros write SetViewFiltros; - function esSeleccionCeldaDatos: Boolean; + function EsSeleccionCeldaDatos: Boolean; - function getNumSeleccionados: Integer; + function GetNumSeleccionados: Integer; property NumSeleccionados: Integer read getNumSeleccionados; function Locate(const AItemIndex: Integer; const AValue: String; const APartialCompare: Boolean = False) : Boolean; + + function GetVerFiltroColumnas: Boolean; + procedure SetVerFiltroColumnas(const Value: Boolean); + property VerFiltroColumnas: Boolean read GetVerFiltroColumnas write SetVerFiltroColumnas; end; @@ -112,6 +116,8 @@ type procedure SetViewFiltros(const Value: IViewFiltroBase); virtual; procedure FilterChanged(Sender : TObject); virtual; + function GetVerFiltroColumnas: Boolean; + procedure SetVerFiltroColumnas(const Value: Boolean); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -152,6 +158,7 @@ type property PopupMenu: TPopupMenu read GetPopupMenu write SetPopupMenu; property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect; property NumSeleccionados: Integer read getNumSeleccionados; + property VerFiltroColumnas: Boolean read GetVerFiltroColumnas write SetVerFiltroColumnas; end; procedure Register; @@ -237,6 +244,11 @@ begin Result := FPopupMenu; end; +function TfrViewGridBase.GetVerFiltroColumnas: Boolean; +begin + Result := _FocusedView.OptionsCustomize.ColumnFiltering; +end; + function TfrViewGridBase.GetViewFiltros: IViewFiltroBase; begin Result := FViewFiltros; @@ -340,6 +352,16 @@ begin FPopupMenu := Value; end; +procedure TfrViewGridBase.SetVerFiltroColumnas(const Value: Boolean); +begin + _FocusedView.BeginUpdate; + try + _FocusedView.OptionsCustomize.ColumnFiltering := Value; + finally + _FocusedView.EndUpdate; + end; +end; + procedure TfrViewGridBase.SetViewFiltros(const Value: IViewFiltroBase); begin if Assigned(FViewFiltros) then