From 5870a6f972f276b6bbecb293034d24e626e21dbd Mon Sep 17 00:00:00 2001 From: alexs75 Date: Fri, 17 May 2019 10:51:57 +0000 Subject: [PATCH] RxFPC:RxDBGrid - fix find dialog git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6918 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../rx/trunk/rxdb/rxdbgrid_findunit.lfm | 68 +++++++++---------- .../rx/trunk/rxdb/rxdbgrid_findunit.pas | 8 +-- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/components/rx/trunk/rxdb/rxdbgrid_findunit.lfm b/components/rx/trunk/rxdb/rxdbgrid_findunit.lfm index d35471a8d..56535e335 100644 --- a/components/rx/trunk/rxdb/rxdbgrid_findunit.lfm +++ b/components/rx/trunk/rxdb/rxdbgrid_findunit.lfm @@ -17,9 +17,9 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideBottom.Control = Edit1 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 17 + Height = 13 Top = 6 - Width = 69 + Width = 56 BorderSpacing.Around = 6 Caption = 'Text to find' FocusControl = Edit1 @@ -32,9 +32,9 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideBottom.Control = ComboBox1 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 17 - Top = 69 - Width = 72 + Height = 13 + Top = 52 + Width = 56 BorderSpacing.Around = 6 Caption = 'Find at filed' ParentColor = False @@ -43,10 +43,10 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideRight.Control = Button2 AnchorSideBottom.Control = Owner AnchorSideBottom.Side = asrBottom - Left = 337 - Height = 41 - Top = 213 - Width = 86 + Left = 340 + Height = 31 + Top = 223 + Width = 81 Anchors = [akRight, akBottom] AutoSize = True BorderSpacing.Around = 6 @@ -63,10 +63,10 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideRight.Side = asrBottom AnchorSideBottom.Control = Owner AnchorSideBottom.Side = asrBottom - Left = 429 - Height = 41 - Top = 213 - Width = 58 + Left = 427 + Height = 31 + Top = 223 + Width = 60 Anchors = [akRight, akBottom] AutoSize = True BorderSpacing.Top = 8 @@ -84,8 +84,8 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom Left = 18 - Height = 34 - Top = 29 + Height = 21 + Top = 25 Width = 469 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 @@ -98,12 +98,12 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom Left = 12 - Height = 33 - Top = 92 + Height = 21 + Top = 71 Width = 475 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 - ItemHeight = 0 + ItemHeight = 13 Style = csDropDownList TabOrder = 1 end @@ -116,10 +116,10 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideRight.Side = asrBottom AnchorSideBottom.Control = Panel1 AnchorSideBottom.Side = asrBottom - Left = 139 - Height = 66 - Top = 131 - Width = 348 + Left = 119 + Height = 54 + Top = 98 + Width = 368 Anchors = [akTop, akLeft, akRight, akBottom] AutoFill = True AutoSize = True @@ -135,8 +135,8 @@ object rxDBGridFindForm: TrxDBGridFindForm ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 - ClientHeight = 48 - ClientWidth = 346 + ClientHeight = 36 + ClientWidth = 364 Columns = 3 Items.Strings = ( 'All' @@ -150,22 +150,22 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideTop.Control = ComboBox1 AnchorSideTop.Side = asrBottom Left = 6 - Height = 66 - Top = 131 - Width = 127 + Height = 54 + Top = 98 + Width = 107 AutoSize = True BorderSpacing.Around = 6 - ClientHeight = 66 - ClientWidth = 127 + ClientHeight = 54 + ClientWidth = 107 TabOrder = 5 object CheckBox2: TCheckBox AnchorSideLeft.Control = Panel1 AnchorSideTop.Control = CheckBox1 AnchorSideTop.Side = asrBottom Left = 7 - Height = 23 - Top = 36 - Width = 88 + Height = 17 + Top = 30 + Width = 70 BorderSpacing.Around = 6 Caption = 'Partial key' TabOrder = 0 @@ -174,9 +174,9 @@ object rxDBGridFindForm: TrxDBGridFindForm AnchorSideLeft.Control = Panel1 AnchorSideTop.Control = Panel1 Left = 7 - Height = 23 + Height = 17 Top = 7 - Width = 113 + Width = 93 BorderSpacing.Around = 6 Caption = 'Case sensetive' TabOrder = 1 diff --git a/components/rx/trunk/rxdb/rxdbgrid_findunit.pas b/components/rx/trunk/rxdb/rxdbgrid_findunit.pas index 2c921409b..9e210897b 100644 --- a/components/rx/trunk/rxdb/rxdbgrid_findunit.pas +++ b/components/rx/trunk/rxdb/rxdbgrid_findunit.pas @@ -120,15 +120,15 @@ var SearchOrigin:TRxSearchDirection; P:TBookMark; R:boolean; + FC: TRxColumn; begin { TODO -oalexs : Необходимо переделать поиск по колонке - искать всегда по строковому представлению. Иначе не ищет по дате-времени } if (Edit1.Text<>'') and (ComboBox1.ItemIndex>=0) and (ComboBox1.ItemIndex'') then begin try - - //FieldName:=FGrid.Columns[ComboBox1.ItemIndex].FieldName; - //FieldName:=FGrid.ColumnByFieldName(ComboBox1.Text).FieldName; - FieldName:=ComboBox1.Text; + FC:=FGrid.ColumnByCaption(ComboBox1.Text); + if not Assigned(FC) then Exit; + FieldName:=FC.FieldName; LOptions:=[]; if not CheckBox1.Checked then LOptions:=LOptions+[loCaseInsensitive];