From 5dcb7e2b5a0f8896ec95f46c122fef7cc911c0db Mon Sep 17 00:00:00 2001 From: david Date: Wed, 12 Nov 2008 16:16:36 +0000 Subject: [PATCH] =?UTF-8?q?GUIBase:=20mejorado=20el=20c=C3=A1culo=20de=20e?= =?UTF-8?q?stilos=20para=20las=20tuplas=20del=20grid=20para=20ver=20si=20m?= =?UTF-8?q?ejora=20el=20rendimiento=20del=20grid.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@328 f4e31baf-9722-1c47-927c-6f952f962d4b --- Source/GUIBase/uViewGrid.dfm | 14 +++++++++- Source/GUIBase/uViewGrid.pas | 54 +++++++++++++++++++++--------------- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/Source/GUIBase/uViewGrid.dfm b/Source/GUIBase/uViewGrid.dfm index 7b908925..0443ad18 100644 --- a/Source/GUIBase/uViewGrid.dfm +++ b/Source/GUIBase/uViewGrid.dfm @@ -80,15 +80,27 @@ inherited frViewGrid: TfrViewGrid Width = 554 ExplicitWidth = 554 inherited txtFiltroTodo: TcxTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 457 Width = 457 end inherited edtFechaIniFiltro: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 240 Width = 240 end inherited edtFechaFinFiltro: TcxDateEdit Left = 344 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 344 ExplicitWidth = 200 Width = 200 @@ -163,7 +175,7 @@ inherited frViewGrid: TfrViewGrid PrinterPage.ScaleMode = smFit PrinterPage._dxMeasurementUnits_ = 0 PrinterPage._dxLastMU_ = 2 - ReportDocument.CreationDate = 39636.760736666660000000 + ReportDocument.CreationDate = 39764.713522488430000000 StyleManager = dmBase.dxPrintStyleManager1 OptionsCards.Shadow.Depth = 0 OptionsExpanding.ExpandGroupRows = True diff --git a/Source/GUIBase/uViewGrid.pas b/Source/GUIBase/uViewGrid.pas index 0038bcef..12eeebce 100644 --- a/Source/GUIBase/uViewGrid.pas +++ b/Source/GUIBase/uViewGrid.pas @@ -229,37 +229,47 @@ end; procedure TfrViewGrid.cxGridViewStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); +var + AFiltrado : Boolean; + AOrdenado : Boolean; + AFilaPar : Boolean; begin inherited; if Assigned(AItem) then begin - if Odd(ARecord.Index) then - AStyle := cxStyle_NORMAL_PAR - else - AStyle := cxStyle_NORMAL_IMPAR; + AFilaPar := Odd(ARecord.Index); + AFiltrado := Filtered; + AOrdenado := AItem.SortOrder <> soNone; - if (AItem.SortOrder <> soNone) then + + if AFilaPar then begin - if Odd(ARecord.Index) then - AStyle := cxStyle_ORDENADO_PAR - else - AStyle := cxStyle_ORDENADO_IMPAR; - end; - - if Filtered then - begin - if Odd(ARecord.Index) then - AStyle := cxStyle_FILTRADO_PAR - else - AStyle := cxStyle_FILTRADO_IMPAR; - - if (AItem.SortOrder <> soNone) then + if AFiltrado then begin - if Odd(ARecord.Index) then + if AOrdenado then AStyle := cxStyle_FILTRADO_ORDENADO_PAR else - AStyle := cxStyle_FILTRADO_ORDENADO_IMPAR; - end; + AStyle := cxStyle_FILTRADO_PAR + end + else // No filtrado + if AOrdenado then + AStyle := cxStyle_ORDENADO_PAR + else + AStyle := cxStyle_NORMAL_PAR + end + else begin + if AFiltrado then + begin + if AOrdenado then + AStyle := cxStyle_FILTRADO_ORDENADO_IMPAR + else + AStyle := cxStyle_FILTRADO_IMPAR + end + else // No filtrado + if AOrdenado then + AStyle := cxStyle_ORDENADO_IMPAR + else + AStyle := cxStyle_NORMAL_IMPAR end; end; end;