diff --git a/components/rx/docs/WhatsNew.rus.txt b/components/rx/docs/WhatsNew.rus.txt index 56970c92a..a1cad0551 100644 --- a/components/rx/docs/WhatsNew.rus.txt +++ b/components/rx/docs/WhatsNew.rus.txt @@ -36,6 +36,7 @@ - Исправлено изменение цвета конца недели в RxDateEdit + Добавлена демка для RxDBLookup + У объекта TRxDBLookupCombo опубликовано свойство Text - установка значения для него вызывает поиск по лукап-листу + + Локальная фильтрация в RxDBGrid-е использует значения Field.DisplayText, а не Field.AsString 22.05.2008 - версия 2.0.0.136 (svn revision 100) + У объекта TRxCustomDBLookupCombo введён контроль на CircularDataLink + У объекта TRxCustomDBLookupCombo ускорена отрисовка данных diff --git a/components/rx/rxdbcomb.pas b/components/rx/rxdbcomb.pas index 9a14b337e..422587d85 100644 --- a/components/rx/rxdbcomb.pas +++ b/components/rx/rxdbcomb.pas @@ -116,7 +116,9 @@ type property Values: TStrings read FValues write SetValues; property Visible; property OnChange; + property OnChangeBounds; property OnClick; + property OnCloseUp; property OnDblClick; property OnDragDrop; property OnDragOver; @@ -129,7 +131,12 @@ type property OnKeyPress; property OnKeyUp; property OnMeasureItem; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnSelect; property OnStartDrag; + property OnUTF8KeyPress; property OnContextPopup; property OnEndDock; property OnStartDock; @@ -236,9 +243,9 @@ end; procedure TCustomDBComboBox.Change; begin FDataLink.Edit; - inherited Change; FDataLink.Modified; FDataLink.UpdateRecord; + inherited Change; end; procedure TCustomDBComboBox.Click; diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index f01e163aa..b0a1ef101 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -360,6 +360,7 @@ type procedure ShowFindDialog; procedure ShowColumnsDialog; function ColumnByFieldName(AFieldName:string):TRxColumn; + function ColumnByCaption(ACaption:string):TRxColumn; property Canvas; property DefaultTextStyle; property EditorBorderStyle; @@ -1236,24 +1237,11 @@ begin C:=TRxColumn(Columns[i]); FPropertyStorageLink.Storage.WriteString(S1+sCaption, StrToHexText(C.Title.Caption)); FPropertyStorageLink.Storage.WriteInteger(S1+sWidth, C.Width); + FPropertyStorageLink.Storage.WriteInteger(S1+sIndex, C.Index); end; end; procedure TRxDBGrid.OnIniLoad(Sender: TObject); - -function GetColByCaption(Cap:string):TRxColumn; -var - i:integer; -begin - Result:=nil; - for i:=0 to Columns.Count - 1 do - if Cap = Columns[i].Title.Caption then - begin - Result:=TRxColumn(Columns[i]); - exit; - end; -end; - var i, ACount:integer; S, S1, ColumName:string; @@ -1272,9 +1260,13 @@ begin ColumName:=HexTextToStr(FPropertyStorageLink.Storage.ReadString(S1+sCaption, '')); if ColumName<>'' then begin - C:=GetColByCaption(ColumName); + C:=ColumnByCaption(ColumName); if Assigned(C) then + begin C.Width:=FPropertyStorageLink.Storage.ReadInteger(S1+sWidth, C.Width); + C.Visible:=FPropertyStorageLink.Storage.ReadInteger(S1+sVisible, Ord(C.Visible)) = 1; + C.Index:=FPropertyStorageLink.Storage.ReadInteger(S1+sIndex, C.Index); + end; end; end; end; @@ -2398,7 +2390,7 @@ begin for i:=0 to Columns.Count-1 do begin with TRxColumn(Columns[i]) do - if (Filter.Value<>'') and (Filter.Value<>Field.AsString) then + if (Filter.Value<>'') and (Filter.Value<>Field.DisplayText) then begin Accept:=false; break; @@ -2524,8 +2516,8 @@ begin for i:=0 to Columns.Count-1 do begin C:=TRxColumn(Columns[i]); - if (C.Field<>nil) and (C.Filter.ValueList.IndexOf(C.Field.AsString)<0) then - C.Filter.ValueList.Add(C.Field.AsString); + if (C.Field<>nil) and (C.Filter.ValueList.IndexOf(C.Field.DisplayText)<0) then + C.Filter.ValueList.Add(C.Field.DisplayText); end; DataSource.DataSet.Next; end; @@ -2696,6 +2688,19 @@ begin end; end; +function TRxDBGrid.ColumnByCaption(ACaption: string): TRxColumn; +var + i:integer; +begin + Result:=nil; + for i:=0 to Columns.Count - 1 do + if ACaption = Columns[i].Title.Caption then + begin + Result:=TRxColumn(Columns[i]); + exit; + end; +end; + { TRxDbGridColumns } function TRxDbGridColumns.Add: TRxColumn; begin @@ -3286,6 +3291,7 @@ begin FFont := TFont.Create; FEmptyFont := TFont.Create; FValueList := TStringList.Create; + FValueList.Sorted:=true; FColor := clWhite; // FColor := clSkyBlue; diff --git a/components/rx/rxdconst.pas b/components/rx/rxdconst.pas index 6bbc67dfe..368a11dd6 100644 --- a/components/rx/rxdconst.pas +++ b/components/rx/rxdconst.pas @@ -151,7 +151,8 @@ const sButtonAllign = '.ButtonAllign'; sOptions = '.Options'; sCaption = '.Caption'; - + sIndex = '.Index'; + implementation diff --git a/components/rx/rxlookup.pas b/components/rx/rxlookup.pas index 068f9c795..35311e5f6 100644 --- a/components/rx/rxlookup.pas +++ b/components/rx/rxlookup.pas @@ -7,7 +7,7 @@ interface uses LCLType, LCLProc, LCLIntf, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, DB, EditBtn, DBGrids, StdCtrls, Buttons, - LMessages, DbCtrls, GraphType, dbutils, RxDbGrid, rxpopupunit; + LMessages, DbCtrls, GraphType, dbutils, RxDbGrid, rxpopupunit, Themes; const TextMargin = 5; @@ -1358,7 +1358,7 @@ begin RxFrame3D(Canvas, R, clWindowFrame, clBtnHighlight, 1); RxFrame3D(Canvas, R, clBtnShadow, clBtnFace, 1); end; - + if ClientWidth > 6 then begin SetRect(R1, 3, 3, ClientWidth - 3, ClientHeight - 3);