RxFPC:fix AV in RxFilterBy form. tnx naum_off

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5232 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75 2016-09-29 13:49:49 +00:00
parent be413db8f0
commit 5a55a015c0
2 changed files with 121 additions and 121 deletions

View File

@ -16,7 +16,7 @@ object rxFilterByForm: TrxFilterByForm
Left = 6
Height = 20
Top = 6
Width = 211
Width = 214
BorderSpacing.Around = 6
Caption = 'Select filter expression for data'
Font.Style = [fsBold]
@ -30,7 +30,7 @@ object rxFilterByForm: TrxFilterByForm
Left = 6
Height = 20
Top = 32
Width = 58
Width = 57
BorderSpacing.Around = 6
Caption = 'On field:'
Font.Color = clRed
@ -44,7 +44,7 @@ object rxFilterByForm: TrxFilterByForm
Left = 168
Height = 20
Top = 32
Width = 76
Width = 75
BorderSpacing.Around = 6
Caption = 'Operation :'
Font.Color = clRed
@ -88,7 +88,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideBottom.Side = asrBottom
Left = 527
Height = 20
Top = 408
Top = 426
Width = 29
Anchors = [akLeft, akBottom]
Caption = 'End.'
@ -102,7 +102,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
Left = 6
Height = 34
Height = 36
Top = 58
Width = 153
BorderSpacing.Around = 6
@ -114,7 +114,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
Left = 168
Height = 34
Height = 36
Top = 58
Width = 96
BorderSpacing.Around = 6
@ -129,7 +129,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 271
Height = 30
Height = 37
Top = 58
Width = 250
Anchors = [akTop, akLeft, akRight]
@ -143,7 +143,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Height = 36
Top = 58
Width = 111
Anchors = [akTop, akRight]
@ -163,8 +163,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 100
Height = 36
Top = 102
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -181,8 +181,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 98
Height = 36
Top = 100
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -199,8 +199,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 98
Height = 37
Top = 100
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -214,8 +214,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 98
Height = 36
Top = 100
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -234,8 +234,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 142
Height = 36
Top = 146
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -252,8 +252,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 140
Height = 36
Top = 144
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -270,8 +270,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 140
Height = 37
Top = 144
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -285,8 +285,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 140
Height = 36
Top = 144
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -305,8 +305,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 184
Height = 36
Top = 190
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -323,8 +323,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 182
Height = 36
Top = 188
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -341,8 +341,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 182
Height = 37
Top = 188
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -356,8 +356,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 182
Height = 36
Top = 188
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -376,8 +376,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 226
Height = 36
Top = 234
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -394,8 +394,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 224
Height = 36
Top = 232
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -412,8 +412,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 224
Height = 37
Top = 232
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -427,8 +427,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 224
Height = 36
Top = 232
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -447,8 +447,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 268
Height = 36
Top = 278
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -465,8 +465,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 266
Height = 36
Top = 276
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -483,8 +483,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 266
Height = 37
Top = 276
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -498,8 +498,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 266
Height = 36
Top = 276
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -518,8 +518,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 310
Height = 36
Top = 322
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -536,8 +536,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 308
Height = 36
Top = 320
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -554,8 +554,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 308
Height = 37
Top = 320
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -569,8 +569,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 308
Height = 36
Top = 320
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -589,8 +589,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 352
Height = 36
Top = 366
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -607,8 +607,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 350
Height = 36
Top = 364
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -625,8 +625,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 350
Height = 37
Top = 364
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -640,8 +640,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 527
Height = 34
Top = 350
Height = 36
Top = 364
Width = 111
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
@ -660,8 +660,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox1
AnchorSideRight.Side = asrBottom
Left = 8
Height = 34
Top = 394
Height = 36
Top = 410
Width = 149
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -678,8 +678,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = ComboBox2
AnchorSideRight.Side = asrBottom
Left = 168
Height = 34
Top = 392
Height = 36
Top = 408
Width = 96
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -696,8 +696,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ComboBox3
Left = 270
Height = 30
Top = 392
Height = 37
Top = 408
Width = 251
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -710,8 +710,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 34
Top = 405
Height = 36
Top = 403
Width = 58
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
@ -729,10 +729,10 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 589
Height = 32
Top = 407
Width = 49
Left = 585
Height = 36
Top = 403
Width = 53
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
@ -745,10 +745,10 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Button1
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 527
Height = 32
Top = 407
Width = 56
Left = 519
Height = 36
Top = 403
Width = 60
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
@ -761,10 +761,10 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Button2
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 440
Height = 32
Top = 407
Width = 81
Left = 429
Height = 36
Top = 403
Width = 84
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6

View File

@ -130,35 +130,35 @@ begin
end;
procedure TrxFilterByForm.ComboBoxChange(Sender: TObject);
Var
CBN : Integer;
CB : TComboBox;
var
CBN : Integer;
CB : TComboBox;
begin
CB := (Sender AS TComboBox);
CBN := FindCombo(CB);
if CBN=0 Then Exit;
if (CB.Text=' IS NULL ') Or (CB.Text=' IS NOT NULL ') Then
Begin
CB := (Sender AS TComboBox);
CBN := FindCombo(CB);
if CBN=0 Then Exit;
if (CB.Text=' IS NULL ') Or (CB.Text=' IS NOT NULL ') Then
begin
Edit_1[CBN].Text := '';
Edit_1[CBN].Enabled := False;
Edit_1[CBN].Color := clInactiveCaption;
End
Else
Begin
end
else
begin
Edit_1[CBN].Enabled := True;
Edit_1[CBN].Color := clWindow;
End;
end;
end;
procedure TrxFilterByForm.EditChange(Sender: TObject);
Var
EDN : Integer;
ED : TEdit;
var
EDN : Integer;
ED : TEdit;
begin
ED := (Sender AS TEdit);
EDN := FindEdit(ED);
if EDN=0 Then Exit;
if ED.Text='' Then Combo_1[EDN].ItemIndex:=-1;
ED := (Sender AS TEdit);
EDN := FindEdit(ED);
if EDN=0 Then Exit;
if ED.Text='' Then Combo_1[EDN].ItemIndex:=-1;
end;
procedure TrxFilterByForm.FormCreate(Sender: TObject);
@ -176,28 +176,28 @@ end;
procedure TrxFilterByForm.Button1Click(Sender: TObject);
begin
ModalResult := mrOK;
ModalResult := mrOK;
end;
procedure TrxFilterByForm.ClearALL(AGrid: TRxDBGrid);
var
i : Integer;
begin
//*****************************************************************************
Combo_1[1].Items.Clear;
Combo_1[1].Items.Add('');
for i := 0 To AGrid.Columns.Count-1 do
begin
if (AGrid.Columns[i].Field.FieldKind=fkData) and (AGrid.Columns[i].Visible) then
Combo_1[1].Items.Objects[Combo_1[1].Items.Add(AGrid.Columns[i].Title.Caption)]:=AGrid.Columns[i].Field;
end;
//*****************************************************************************
Combo_1[1].Items.Clear;
Combo_1[1].Items.Add('');
for i := 0 To AGrid.Columns.Count-1 do
begin
if Assigned(AGrid.Columns[i].Field) and (AGrid.Columns[i].Field.FieldKind=fkData) and (AGrid.Columns[i].Visible) then
Combo_1[1].Items.Objects[Combo_1[1].Items.Add(AGrid.Columns[i].Title.Caption)]:=AGrid.Columns[i].Field;
end;
Combo_1[1].ItemIndex := 0;
for i := 2 To 9 do
Begin
begin
Combo_1[i].Items.Assign(Combo_1[1].Items);
Combo_1[i].ItemIndex := 0;
End;
end;
Combo_2[1].Items.Clear;
Combo_2[1].Items.Add(' = ');
@ -225,13 +225,13 @@ end;
function TrxFilterByForm.Execute(AGrid: TRxDBGrid; var FilterStr: String;
var LastFilter: TstringList): Boolean;
Var
X : Integer;
P : Integer;
S, S1 : String;
SD : String;
C : TColumn;
Begin
var
X : Integer;
P : Integer;
S, S1 : String;
SD : String;
C : TColumn;
begin
Result := False;
//*****************************************************************************
Combo_1[1]:= ComboBox1;