From dbbfca4b767a372c7fb64275770cd21da3a86ed2 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Sat, 23 Jan 2010 07:14:50 +0000 Subject: [PATCH] ifx autosize columns in rxdbgrid git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1132 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/docs/WhatsNew.rus.txt | 2 +- components/rx/rxdbgrid.pas | 10 ++++++++-- components/rx/rxnew.lpk | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/components/rx/docs/WhatsNew.rus.txt b/components/rx/docs/WhatsNew.rus.txt index 07e61e9ae..ad0e35dde 100644 --- a/components/rx/docs/WhatsNew.rus.txt +++ b/components/rx/docs/WhatsNew.rus.txt @@ -43,7 +43,7 @@ + В RxDBGrid в функции поиска колонки по её наименованию TRxDBGrid.ColumnByCaption не учитывается регистр символов + В RxDBGrid сохраняется между сеансами порядок сортировки - + + В RxDBGrid при автоматическом подборе ширины колонки учитывается ширина заголовка 22.05.2008 - версия 2.0.0.136 (svn revision 100) + У объекта TRxCustomDBLookupCombo введён контроль на CircularDataLink + У объекта TRxCustomDBLookupCombo ускорена отрисовка данных diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index 92b06ea99..678b1da12 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -451,7 +451,9 @@ type property TabOrder; property TabStop; property TitleFont; + property TitleImageList; property TitleStyle; + property UseXORFeatures; property Visible; property OnCellClick; property OnColEnter; @@ -2264,7 +2266,12 @@ begin GetMem(WA, SizeOf(Integer) * AColList.Count); for I := 0 to AColList.Count-1 do - WA^[i]:=20; + begin + if TRxColumnTitle(TRxColumn(AColList[i]).Title).CaptionLinesCount>1 then + WA^[i]:=Max(Canvas.TextWidth(TRxColumnTitle(TRxColumn(AColList[i]).Title).CaptionLine(TRxColumnTitle(TRxColumn(AColList[i]).Title).CaptionLinesCount - 1).Caption ) + 8, 20) + else + WA^[i]:=Max(Canvas.TextWidth(TRxColumn(AColList[i]).Title.Caption) + 8, 20); + end; with DataSource.DataSet do begin @@ -2276,7 +2283,6 @@ begin begin for I := 0 to AColList.Count-1 do begin -// W:=Canvas.TextWidth(TRxColumn(AColList[i]).Field.DisplayText) + 6; S:=TRxColumn(AColList[i]).Field.DisplayText; with TRxColumn(AColList[i]) do if (KeyList.Count > 0) and (PickList.Count > 0) then diff --git a/components/rx/rxnew.lpk b/components/rx/rxnew.lpk index 90c02226a..d376d2a6b 100644 --- a/components/rx/rxnew.lpk +++ b/components/rx/rxnew.lpk @@ -25,7 +25,7 @@ translate to Lazarus by alexs in 2005 - 2009 "/> - +