RxFPC:fix find dialog in RxDBGrid with collumn.options=coDisableDialogFind

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6917 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2019-05-17 06:56:30 +00:00
parent 3d061ebeb1
commit 7e66929867
2 changed files with 31 additions and 35 deletions

View File

@ -17,9 +17,9 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideBottom.Control = Edit1 AnchorSideBottom.Control = Edit1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 17
Top = 6 Top = 6
Width = 73 Width = 69
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Text to find' Caption = 'Text to find'
FocusControl = Edit1 FocusControl = Edit1
@ -32,9 +32,9 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideBottom.Control = ComboBox1 AnchorSideBottom.Control = ComboBox1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 17
Top = 68 Top = 69
Width = 77 Width = 72
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Find at filed' Caption = 'Find at filed'
ParentColor = False ParentColor = False
@ -44,9 +44,9 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 337 Left = 337
Height = 39 Height = 41
Top = 215 Top = 213
Width = 87 Width = 86
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -63,10 +63,10 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 430 Left = 429
Height = 39 Height = 41
Top = 215 Top = 213
Width = 57 Width = 58
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Top = 8 BorderSpacing.Top = 8
@ -84,8 +84,8 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 18 Left = 18
Height = 31 Height = 34
Top = 31 Top = 29
Width = 469 Width = 469
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -98,8 +98,8 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 12 Left = 12
Height = 31 Height = 33
Top = 93 Top = 92
Width = 475 Width = 475
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -116,10 +116,10 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Panel1 AnchorSideBottom.Control = Panel1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 150 Left = 139
Height = 66 Height = 66
Top = 130 Top = 131
Width = 337 Width = 348
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
AutoFill = True AutoFill = True
AutoSize = True AutoSize = True
@ -135,8 +135,8 @@ object rxDBGridFindForm: TrxDBGridFindForm
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3 ChildSizing.ControlsPerLine = 3
ClientHeight = 46 ClientHeight = 48
ClientWidth = 335 ClientWidth = 346
Columns = 3 Columns = 3
Items.Strings = ( Items.Strings = (
'All' 'All'
@ -151,12 +151,12 @@ object rxDBGridFindForm: TrxDBGridFindForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 66 Height = 66
Top = 130 Top = 131
Width = 138 Width = 127
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
ClientHeight = 66 ClientHeight = 66
ClientWidth = 138 ClientWidth = 127
TabOrder = 5 TabOrder = 5
object CheckBox2: TCheckBox object CheckBox2: TCheckBox
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
@ -165,7 +165,7 @@ object rxDBGridFindForm: TrxDBGridFindForm
Left = 7 Left = 7
Height = 23 Height = 23
Top = 36 Top = 36
Width = 95 Width = 88
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Partial key' Caption = 'Partial key'
TabOrder = 0 TabOrder = 0
@ -176,7 +176,7 @@ object rxDBGridFindForm: TrxDBGridFindForm
Left = 7 Left = 7
Height = 23 Height = 23
Top = 7 Top = 7
Width = 124 Width = 113
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Case sensetive' Caption = 'Case sensetive'
TabOrder = 1 TabOrder = 1

View File

@ -122,11 +122,13 @@ var
R:boolean; R:boolean;
begin begin
{ TODO -oalexs : Необходимо переделать поиск по колонке - искать всегда по строковому представлению. Иначе не ищет по дате-времени } { TODO -oalexs : Необходимо переделать поиск по колонке - искать всегда по строковому представлению. Иначе не ищет по дате-времени }
if Edit1.Text<>'' then if (Edit1.Text<>'') and (ComboBox1.ItemIndex>=0) and (ComboBox1.ItemIndex<ComboBox1.Items.Count) and (ComboBox1.Text<>'') then
begin begin
try try
FieldName:=FGrid.Columns[ComboBox1.ItemIndex].FieldName; //FieldName:=FGrid.Columns[ComboBox1.ItemIndex].FieldName;
//FieldName:=FGrid.ColumnByFieldName(ComboBox1.Text).FieldName;
FieldName:=ComboBox1.Text;
LOptions:=[]; LOptions:=[];
if not CheckBox1.Checked then if not CheckBox1.Checked then
LOptions:=LOptions+[loCaseInsensitive]; LOptions:=LOptions+[loCaseInsensitive];
@ -158,11 +160,7 @@ begin
end; end;
end; end;
end; end;
{
type
THckGrid = class(TCustomDBGrid)
end;
}
procedure TrxDBGridFindForm.SetGrid(AGrid: TRxDBGrid); procedure TrxDBGridFindForm.SetGrid(AGrid: TRxDBGrid);
var var
i:integer; i:integer;
@ -184,8 +182,6 @@ begin
FDataSet:=nil; FDataSet:=nil;
if Assigned(FGrid) and Assigned(FGrid.DataSource) then if Assigned(FGrid) and Assigned(FGrid.DataSource) then
FDataSet:=FGrid.DataSource.DataSet; FDataSet:=FGrid.DataSource.DataSet;
{ if Assigned(FGrid) and Assigned(THckGrid(FGrid).DataSource) then
FDataSet:=THckGrid(FGrid).DataSource.DataSet;}
BtnFind.Enabled:=Assigned(FDataSet) and FDataSet.Active BtnFind.Enabled:=Assigned(FDataSet) and FDataSet.Active
end; end;