RxFPC:add filter to TSelectDataSetForm

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8874 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2023-07-04 11:51:39 +00:00
parent f94507c050
commit c1e6d2dca6
5 changed files with 56 additions and 24 deletions

View File

@ -124,7 +124,8 @@ begin
if ASize>-1 then
begin
//ASize1 := MulDiv(ASize, Screen.PixelsPerInch, 96);
ASize1 := MulDiv(ASize, 96, Screen.PixelsPerInch);
if Screen.PixelsPerInch <> 0 then
ASize1 := MulDiv(ASize, 96, Screen.PixelsPerInch);
Result := IntToStr(ASize1);
end;
end;

View File

@ -133,6 +133,7 @@ const
'',
'',
'',
'',
''
{$IFDEF RX_USE_DELPHI_EXT_FIELD_TYPES}
, ''
@ -141,7 +142,6 @@ const
, ''
, ''
, ''
, ''
{$ENDIF}
);

View File

@ -1,7 +1,7 @@
object SelectDataSetForm: TSelectDataSetForm
Left = 445
Left = 527
Height = 315
Top = 197
Top = 337
Width = 400
ActiveControl = CheckBox1
Caption = 'Select dataset to copy to'
@ -9,7 +9,7 @@ object SelectDataSetForm: TSelectDataSetForm
ClientWidth = 400
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '2.1.0.0'
LCLVersion = '3.99.0.0'
object Label1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = CheckBox1
@ -17,7 +17,7 @@ object SelectDataSetForm: TSelectDataSetForm
Left = 6
Height = 17
Top = 35
Width = 89
Width = 88
BorderSpacing.Around = 6
Caption = 'Sourse dataset'
FocusControl = DataSetList
@ -37,17 +37,18 @@ object SelectDataSetForm: TSelectDataSetForm
end
object DataSetList: TListBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Label1
AnchorSideTop.Control = ListFilterEdit1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel1
Left = 6
Height = 199
Top = 58
Height = 174
Top = 87
Width = 388
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
BorderSpacing.Left = 6
BorderSpacing.Right = 6
ItemHeight = 0
OnDblClick = ListBox1DblClick
OnKeyPress = ListBox1KeyPress
@ -57,8 +58,8 @@ object SelectDataSetForm: TSelectDataSetForm
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 46
Top = 263
Height = 42
Top = 267
Width = 388
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
@ -71,4 +72,25 @@ object SelectDataSetForm: TSelectDataSetForm
TabOrder = 2
ShowButtons = [pbOK, pbCancel, pbHelp]
end
object ListFilterEdit1: TListFilterEdit
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 29
Top = 58
Width = 388
ButtonWidth = 23
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
NumGlyphs = 1
MaxLength = 0
Spacing = 0
TabOrder = 3
Text = 'listfilteredit1'
FilteredListbox = DataSetList
end
end

View File

@ -37,7 +37,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, ComponentEditors, DB, ButtonPanel;
Buttons, ComponentEditors, ListFilterEdit, DB, ButtonPanel;
type
@ -48,6 +48,7 @@ type
CheckBox1: TCheckBox;
Label1: TLabel;
DataSetList: TListBox;
ListFilterEdit1: TListFilterEdit;
procedure CheckBox1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ListBox1DblClick(Sender: TObject);
@ -80,10 +81,10 @@ type
function SelectDataSet(ADesigner: TComponentEditorDesigner; const ACaption: string;
ExcludeDataSet: TDataSet): TDataSet;
{
var
SelectDataSetForm: TSelectDataSetForm;
}
implementation
uses rxmemds, rxdconst;
@ -138,8 +139,10 @@ var
Component, F: TComponent;
begin
DataSetList.Items.BeginUpdate;
ListFilterEdit1.Items.BeginUpdate;
try
DataSetList.Clear;
ListFilterEdit1.Items.Clear;
FExclude := '';
if ExcludeDataSet <> nil then FExclude := ExcludeDataSet.Name;
@ -168,21 +171,24 @@ begin
end;
end;
ListFilterEdit1.ResetFilter;
with DataSetList do
begin
if Items.Count > 0 then ItemIndex := 0;
Enabled := Items.Count > 0;
Enabled := ListFilterEdit1.Items.Count > 0;
ButtonPanel1.OKButton.Enabled:= (ItemIndex >= 0);
end;
finally
DataSetList.Items.EndUpdate;
ListFilterEdit1.Items.EndUpdate;
end;
end;
procedure TSelectDataSetForm.AddDataSet(const S: string; ADS: TDataSet);
begin
if (S <> '') and (S <> FExclude) then
DataSetList.Items.AddObject(S, ADS);
//DataSetList.Items.AddObject(S, ADS);
ListFilterEdit1.Items.AddObject(S, ADS);
end;
{ TMemDataSetEditor }

View File

@ -25,7 +25,7 @@
Copyright (c) 1998 Master-Bank
translate to Lazarus by alexs in 2005 - 2021"/>
<License Value="LGPL"/>
<Version Major="3" Minor="4" Release="1" Build="234"/>
<Version Major="3" Minor="4" Release="1" Build="235"/>
<Files Count="70">
<Item1>
<Filename Value="registerrx.pas"/>
@ -330,20 +330,23 @@ translate to Lazarus by alexs in 2005 - 2021"/>
<EnableI18N Value="True"/>
<OutDir Value="languages"/>
</i18n>
<RequiredPkgs Count="4">
<RequiredPkgs Count="5">
<Item1>
<PackageName Value="rxtools"/>
<PackageName Value="LazControlDsgn"/>
</Item1>
<Item2>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
<PackageName Value="rxtools"/>
</Item2>
<Item3>
<PackageName Value="IDEIntf"/>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
</Item3>
<Item4>
<PackageName Value="LCL"/>
<PackageName Value="IDEIntf"/>
</Item4>
<Item5>
<PackageName Value="LCL"/>
</Item5>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)"/>