1
0
mirror of synced 2024-11-15 00:43:50 +00:00
unitswitcher/Source/CmpSwFilterConfiguration.pas

82 lines
2.2 KiB
ObjectPascal
Raw Permalink Normal View History

{: Contains the filter configuration dialog.
Last changed: $Date$
Revision: $Rev$
Author: $Author$
}
unit CmpSwFilterConfiguration;
interface
uses
Classes,
Controls,
ExtCtrls,
Forms,
StdCtrls,
CmpSwFilters;
type
TfrmCmpSwFilterConfiguration = class(TForm)
2007-12-16 13:06:21 +00:00
btnCancel: TButton;
btnOk: TButton;
bvlHelp: TBevel;
chkIncludeDescendants: TCheckBox;
chkVisible: TCheckBox;
edtName: TEdit;
gbMain: TGroupBox;
lblFilter: TLabel;
lblHelp: TLabel;
lblHelpText: TLabel;
lblHelpText2: TLabel;
lblHelpText3: TLabel;
lblName: TLabel;
mmoFilter: TMemo;
pnlButtons: TPanel;
protected
function InternalExecute(AGroup: TCmpSwFilterGroup): Boolean;
public
class function Execute(AGroup: TCmpSwFilterGroup): Boolean;
end;
implementation
{$R *.dfm}
{ TfrmCmpSwFilterConfiguration }
class function TfrmCmpSwFilterConfiguration.Execute(AGroup: TCmpSwFilterGroup): Boolean;
begin
with Self.Create(nil) do
try
Result := InternalExecute(AGroup);
finally
Free();
end;
end;
function TfrmCmpSwFilterConfiguration.InternalExecute(AGroup: TCmpSwFilterGroup): Boolean;
begin
2007-12-16 13:06:21 +00:00
edtName.Text := AGroup.Name;
chkIncludeDescendants.Checked := AGroup.IncludeDescendants;
chkVisible.Checked := AGroup.Visible;
mmoFilter.Lines.Assign(AGroup.Filter);
Result := (ShowModal() = mrOk);
2007-12-16 13:06:21 +00:00
if Result then
begin
AGroup.Name := edtName.Text;
AGroup.IncludeDescendants := chkIncludeDescendants.Checked;
AGroup.Visible := chkVisible.Checked;
AGroup.Filter.Assign(mmoFilter.Lines);
end;
end;
end.