You've already forked lazarus-ccr
fix rxdbgrid
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1004 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -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 ускорена отрисовка данных
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -151,7 +151,8 @@ const
|
||||
sButtonAllign = '.ButtonAllign';
|
||||
sOptions = '.Options';
|
||||
sCaption = '.Caption';
|
||||
|
||||
sIndex = '.Index';
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user