2006-01-07 19:56:40 +00:00
|
|
|
{: Contains the UnitSwitcher main dialog.
|
|
|
|
|
|
|
|
Last changed: $Date$
|
|
|
|
Revision: $Rev$
|
|
|
|
Author: $Author$
|
|
|
|
}
|
2006-01-05 06:03:24 +00:00
|
|
|
unit UnSwDialog;
|
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
{$WARN SYMBOL_PLATFORM OFF}
|
|
|
|
|
2006-01-05 06:03:24 +00:00
|
|
|
interface
|
|
|
|
uses
|
2006-01-09 19:24:56 +00:00
|
|
|
ActnList,
|
2006-01-05 06:03:24 +00:00
|
|
|
Classes,
|
|
|
|
ComCtrls,
|
|
|
|
Controls,
|
|
|
|
ExtCtrls,
|
|
|
|
Forms,
|
2006-01-07 19:56:40 +00:00
|
|
|
Graphics,
|
2006-01-05 06:03:24 +00:00
|
|
|
ImgList,
|
2006-01-13 20:34:45 +00:00
|
|
|
Menus,
|
2006-01-05 06:03:24 +00:00
|
|
|
StdCtrls,
|
|
|
|
Windows,
|
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
BaseSwDialog,
|
2007-12-07 15:33:00 +00:00
|
|
|
BaseSwFilters,
|
|
|
|
BaseSwObjects,
|
2006-01-05 21:04:59 +00:00
|
|
|
UnSwObjects,
|
|
|
|
UnSwFilters;
|
2006-01-05 06:03:24 +00:00
|
|
|
|
|
|
|
type
|
2007-12-09 12:02:11 +00:00
|
|
|
TUnSwStyleVisitor = class(TBaseSwStyleVisitor, IBaseSwVisitor, IUnSwVisitor)
|
2006-01-05 21:04:59 +00:00
|
|
|
protected
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure VisitItem(const AItem: TBaseSwItem); override;
|
|
|
|
procedure VisitModule(const AUnit: TUnSwModuleUnit); virtual;
|
|
|
|
procedure VisitProject(const AUnit: TUnSwProjectUnit); virtual;
|
2006-01-05 21:04:59 +00:00
|
|
|
end;
|
|
|
|
|
2007-12-07 15:33:00 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
TfrmUnSwDialog = class(TfrmBaseSwDialog)
|
2007-02-16 17:19:22 +00:00
|
|
|
actOpen: TAction;
|
|
|
|
actOpenDFM: TAction;
|
2006-01-26 19:40:23 +00:00
|
|
|
actOpenDFMProperties: TAction;
|
2006-01-13 20:34:45 +00:00
|
|
|
actOpenFolder: TAction;
|
|
|
|
actOpenProperties: TAction;
|
2006-03-14 20:06:31 +00:00
|
|
|
actReadOnly: TAction;
|
2006-01-13 20:34:45 +00:00
|
|
|
actSortByName: TAction;
|
|
|
|
actSortByType: TAction;
|
2006-01-05 21:14:36 +00:00
|
|
|
chkDataModules: TCheckBox;
|
|
|
|
chkForms: TCheckBox;
|
|
|
|
chkProjectSource: TCheckBox;
|
2006-01-13 20:34:45 +00:00
|
|
|
chkUnits: TCheckBox;
|
2007-12-09 12:02:11 +00:00
|
|
|
pmnItemsOpen: TMenuItem;
|
|
|
|
pmnItemsOpenDFM: TMenuItem;
|
|
|
|
pmnItemsOpenDFMProperties: TMenuItem;
|
|
|
|
pmnItemsOpenFolder: TMenuItem;
|
|
|
|
pmnItemsOpenProperties: TMenuItem;
|
|
|
|
pmnItemsReadOnly: TMenuItem;
|
|
|
|
pmnItemsSep1: TMenuItem;
|
|
|
|
pmnItemsSep2: TMenuItem;
|
|
|
|
pmnItemsSep3: TMenuItem;
|
|
|
|
pmnItemsSep4: TMenuItem;
|
|
|
|
pmnItemsSortByName: TMenuItem;
|
|
|
|
pmnItemsSortByType: TMenuItem;
|
2006-01-05 21:14:36 +00:00
|
|
|
pnlIncludeTypes: TPanel;
|
2006-01-05 06:03:24 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
procedure actOpenDFMPropertiesExecute(Sender: TObject);
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure actOpenFolderExecute(Sender: TObject);
|
|
|
|
procedure actOpenPropertiesExecute(Sender: TObject);
|
2006-03-14 20:06:31 +00:00
|
|
|
procedure actReadOnlyExecute(Sender: TObject);
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure btnConfigurationClick(Sender: TObject);
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure lstUnitsDblClick(Sender: TObject);
|
|
|
|
procedure SortExecute(Sender: TObject);
|
|
|
|
procedure TypeFilterChange(Sender: TObject);
|
2007-02-16 17:19:22 +00:00
|
|
|
procedure actOpenExecute(Sender: TObject);
|
|
|
|
procedure actOpenDFMExecute(Sender: TObject);
|
|
|
|
procedure btnOKClick(Sender: TObject);
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure FormShow(Sender: TObject);
|
2006-01-05 06:03:24 +00:00
|
|
|
private
|
2006-01-05 21:14:36 +00:00
|
|
|
FLoading: Boolean;
|
2006-01-05 21:04:59 +00:00
|
|
|
FFormsOnly: Boolean;
|
2007-02-16 17:19:22 +00:00
|
|
|
FOpenDFM: Boolean;
|
2006-01-05 21:04:59 +00:00
|
|
|
|
2006-01-05 06:03:24 +00:00
|
|
|
FTypeFilteredList: TUnSwUnitList;
|
|
|
|
FTypeFilter: TUnSwUnitTypeFilter;
|
2007-12-09 12:02:11 +00:00
|
|
|
protected
|
|
|
|
function InternalExecute(): TBaseSwItemList; override;
|
|
|
|
procedure UpdateTypeFilter(AUpdateList: Boolean);
|
2006-01-05 06:03:24 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function CreateItemList(): TBaseSwItemList; override;
|
|
|
|
function CreateInputFilter(): TBaseSwItemSimpleFilter; override;
|
|
|
|
function CreateStyleVisitor(): TBaseSwStyleVisitor; override;
|
2006-01-05 21:04:59 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function AllowEmptyResult(): Boolean; override;
|
|
|
|
function ColorsEnabled(): Boolean; override;
|
2009-05-01 08:44:18 +00:00
|
|
|
function Wildchars(): Boolean; override;
|
2006-01-05 06:03:24 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function GetBaseItemList(): TBaseSwItemList; override;
|
|
|
|
function GetItemDisplayName(const AItem: TBaseSwItem): String; override;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure UpdateItemActions(); override;
|
2006-01-15 00:22:09 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function GetActiveUnits(): TUnSwUnitList;
|
2006-03-14 20:06:31 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure LoadSettings(); override;
|
|
|
|
procedure SaveSettings(); override;
|
2009-05-01 08:44:18 +00:00
|
|
|
procedure SettingsChanged(); override;
|
2006-01-05 06:03:24 +00:00
|
|
|
public
|
2006-01-05 21:04:59 +00:00
|
|
|
class function Execute(const AUnits: TUnSwUnitList;
|
|
|
|
const AFormsOnly: Boolean;
|
2007-02-16 17:19:22 +00:00
|
|
|
out AOpenDFM: Boolean;
|
2006-01-09 19:24:56 +00:00
|
|
|
const AActive: TUnSwUnit = nil): TUnSwUnitList;
|
2006-01-05 06:03:24 +00:00
|
|
|
end;
|
|
|
|
|
2007-12-07 15:33:00 +00:00
|
|
|
|
2006-01-05 06:03:24 +00:00
|
|
|
implementation
|
|
|
|
uses
|
2006-01-06 20:39:08 +00:00
|
|
|
Messages,
|
2006-01-13 20:34:45 +00:00
|
|
|
ShellAPI,
|
2006-01-07 19:56:40 +00:00
|
|
|
SysUtils,
|
|
|
|
|
|
|
|
UnSwConfiguration,
|
2006-01-26 19:40:23 +00:00
|
|
|
UnSwSettings;
|
2006-01-05 06:03:24 +00:00
|
|
|
|
2007-12-07 15:33:00 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
type
|
2007-12-07 15:33:00 +00:00
|
|
|
TUnSwOpenVisitor = class(TInterfacedPersistent, IBaseSwVisitor, IUnSwVisitor)
|
2006-01-13 20:34:45 +00:00
|
|
|
private
|
|
|
|
FProcessed: TStringList;
|
|
|
|
protected
|
|
|
|
function IsProcessed(const AFileName: String; const ARegister: Boolean = True): Boolean;
|
|
|
|
procedure OpenFile(const AFileName: String); virtual; abstract;
|
|
|
|
|
2007-12-07 15:33:00 +00:00
|
|
|
procedure VisitItem(const AItem: TBaseSwItem); virtual;
|
2006-01-26 19:40:23 +00:00
|
|
|
procedure VisitModule(const AUnit: TUnSwModuleUnit); virtual;
|
|
|
|
procedure VisitProject(const AUnit: TUnSwProjectUnit); virtual;
|
2006-01-13 20:34:45 +00:00
|
|
|
public
|
|
|
|
constructor Create();
|
|
|
|
destructor Destroy(); override;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
TUnSwOpenFolderVisitor = class(TUnSwOpenVisitor)
|
2006-01-13 20:34:45 +00:00
|
|
|
protected
|
|
|
|
procedure OpenFile(const AFileName: String); override;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
TUnSwOpenPropertiesVisitor = class(TUnSwOpenVisitor)
|
2006-01-13 20:34:45 +00:00
|
|
|
protected
|
|
|
|
procedure OpenFile(const AFileName: String); override;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
TUnSwOpenDFMPropertiesVisitor = class(TUnSwOpenPropertiesVisitor)
|
|
|
|
protected
|
|
|
|
procedure VisitModule(const AUnit: TUnSwModuleUnit); override;
|
|
|
|
procedure VisitProject(const AUnit: TUnSwProjectUnit); override;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
TUnSwReadOnlyVisitor = class(TUnSwOpenVisitor)
|
|
|
|
private
|
|
|
|
FReadOnlyCount: Integer;
|
|
|
|
protected
|
|
|
|
procedure OpenFile(const AFileName: String); override;
|
|
|
|
public
|
|
|
|
property ReadOnlyCount: Integer read FReadOnlyCount;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-03-14 20:06:31 +00:00
|
|
|
TUnSwSetReadOnlyVisitor = class(TUnSwOpenVisitor)
|
|
|
|
private
|
|
|
|
FReadOnlyFlag: Boolean;
|
|
|
|
protected
|
|
|
|
procedure OpenFile(const AFileName: String); override;
|
|
|
|
public
|
|
|
|
property ReadOnlyFlag: Boolean read FReadOnlyFlag write FReadOnlyFlag;
|
|
|
|
end;
|
|
|
|
|
2006-01-05 21:04:59 +00:00
|
|
|
|
2007-12-07 15:33:00 +00:00
|
|
|
const
|
|
|
|
SubFilterSeparator = ' '#187' ';
|
|
|
|
|
|
|
|
|
2006-01-05 06:03:24 +00:00
|
|
|
{$R *.dfm}
|
|
|
|
|
2006-01-05 21:04:59 +00:00
|
|
|
|
2006-03-14 20:06:31 +00:00
|
|
|
function IsReadOnly(const AFileName: String): Boolean;
|
|
|
|
var
|
|
|
|
iAttr: Integer;
|
|
|
|
|
|
|
|
begin
|
|
|
|
iAttr := FileGetAttr(AFileName);
|
|
|
|
Result := (iAttr <> -1) and ((iAttr and faReadOnly) <> 0);
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
{ TUnSwOpenVisitor }
|
|
|
|
constructor TUnSwOpenVisitor.Create();
|
|
|
|
begin
|
|
|
|
inherited Create();
|
|
|
|
|
|
|
|
FProcessed := TStringList.Create();
|
|
|
|
FProcessed.CaseSensitive := False;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
destructor TUnSwOpenVisitor.Destroy();
|
|
|
|
begin
|
|
|
|
FreeAndNil(FProcessed);
|
|
|
|
|
|
|
|
inherited;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
function TUnSwOpenVisitor.IsProcessed(const AFileName: String;
|
|
|
|
const ARegister: Boolean): Boolean;
|
|
|
|
begin
|
2006-03-14 20:06:31 +00:00
|
|
|
Result := True;
|
|
|
|
if FileExists(AFileName) or DirectoryExists(AFileName) then
|
|
|
|
begin
|
|
|
|
Result := (FProcessed.IndexOf(AFileName) > -1);
|
|
|
|
if (not Result) and ARegister then
|
|
|
|
FProcessed.Add(AFileName);
|
|
|
|
end;
|
2006-01-13 20:34:45 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-07 15:33:00 +00:00
|
|
|
procedure TUnSwOpenVisitor.VisitItem(const AItem: TBaseSwItem);
|
|
|
|
begin
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure TUnSwOpenVisitor.VisitModule(const AUnit: TUnSwModuleUnit);
|
|
|
|
begin
|
|
|
|
OpenFile(AUnit.FileName);
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure TUnSwOpenVisitor.VisitProject(const AUnit: TUnSwProjectUnit);
|
|
|
|
begin
|
|
|
|
OpenFile(AUnit.FileName);
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwOpenFolderVisitor }
|
|
|
|
procedure TUnSwOpenFolderVisitor.OpenFile(const AFileName: String);
|
|
|
|
var
|
|
|
|
sFile: String;
|
|
|
|
sPath: String;
|
|
|
|
sParams: String;
|
|
|
|
|
|
|
|
begin
|
|
|
|
sFile := ExpandFileName(AFileName);
|
|
|
|
sPath := ExtractFilePath(sFile);
|
|
|
|
if not IsProcessed(sPath) then
|
|
|
|
begin
|
|
|
|
sParams := '/e,';
|
|
|
|
|
|
|
|
// If it's a file, have explorer highlight it
|
2006-03-14 20:06:31 +00:00
|
|
|
if not DirectoryExists(sFile) then
|
2006-01-13 20:34:45 +00:00
|
|
|
sParams := sParams + '/select,';
|
|
|
|
|
|
|
|
sParams := sParams + ExtractShortPathName(sFile);
|
|
|
|
ShellExecute(0, 'open', 'explorer.exe', PChar(sParams), nil, SW_SHOWNORMAL);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwOpenPropertiesVisitor }
|
|
|
|
procedure TUnSwOpenPropertiesVisitor.OpenFile(const AFileName: String);
|
|
|
|
var
|
|
|
|
pInfo: TShellExecuteInfo;
|
|
|
|
|
|
|
|
begin
|
|
|
|
if not IsProcessed(AFileName) then
|
|
|
|
begin
|
|
|
|
// Regular ShellExecute doesn't work
|
|
|
|
FillChar(pInfo, SizeOf(pInfo), #0);
|
|
|
|
pInfo.cbSize := SizeOf(TShellExecuteInfo);
|
|
|
|
pInfo.lpFile := PChar(AFileName);
|
|
|
|
pInfo.nShow := SW_SHOWNORMAL;
|
|
|
|
pInfo.fMask := SEE_MASK_INVOKEIDLIST;
|
|
|
|
pInfo.lpVerb := 'properties';
|
|
|
|
ShellExecuteEx(@pInfo);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
{ TUnSwOpenDFMPropertiesVisitor }
|
|
|
|
procedure TUnSwOpenDFMPropertiesVisitor.VisitModule(const AUnit: TUnSwModuleUnit);
|
|
|
|
begin
|
|
|
|
OpenFile(ChangeFileExt(AUnit.FileName, '.dfm'));
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
procedure TUnSwOpenDFMPropertiesVisitor.VisitProject(const AUnit: TUnSwProjectUnit);
|
|
|
|
begin
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwReadOnlyVisitor }
|
|
|
|
procedure TUnSwReadOnlyVisitor.OpenFile(const AFileName: String);
|
2006-03-14 20:06:31 +00:00
|
|
|
begin
|
|
|
|
if not IsProcessed(AFileName) then
|
|
|
|
if IsReadOnly(AFileName) then
|
|
|
|
Inc(FReadOnlyCount);
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwSetReadOnlyVisitor }
|
|
|
|
procedure TUnSwSetReadOnlyVisitor.OpenFile(const AFileName: String);
|
2006-01-26 19:40:23 +00:00
|
|
|
var
|
2006-03-14 20:06:31 +00:00
|
|
|
fileInfo: TSearchRec;
|
|
|
|
fileAttr: Integer;
|
|
|
|
path: String;
|
2006-01-26 19:40:23 +00:00
|
|
|
|
|
|
|
begin
|
|
|
|
if not IsProcessed(AFileName) then
|
|
|
|
begin
|
2006-03-14 20:06:31 +00:00
|
|
|
path := ExtractFilePath(AFileName);
|
|
|
|
if FindFirst(ChangeFileExt(AFileName, '.*'), faAnyFile, fileInfo) = 0 then
|
|
|
|
begin
|
|
|
|
repeat
|
|
|
|
fileAttr := FileGetAttr(path + fileInfo.Name);
|
|
|
|
if fileAttr <> -1 then
|
|
|
|
begin
|
|
|
|
if ReadOnlyFlag then
|
|
|
|
fileAttr := fileAttr or faReadOnly
|
|
|
|
else
|
|
|
|
fileAttr := fileAttr and not faReadOnly;
|
|
|
|
|
|
|
|
FileSetAttr(path + fileInfo.Name, fileAttr);
|
|
|
|
end;
|
|
|
|
until FindNext(fileInfo) <> 0;
|
|
|
|
|
|
|
|
FindClose(fileInfo);
|
|
|
|
end;
|
2006-01-26 19:40:23 +00:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
{ TUnSwStyleVisitor }
|
2007-12-07 15:33:00 +00:00
|
|
|
procedure TUnSwStyleVisitor.VisitItem(const AItem: TBaseSwItem);
|
2006-03-14 20:06:31 +00:00
|
|
|
begin
|
2007-12-07 15:33:00 +00:00
|
|
|
if (AItem is TUnSwUnit) and IsReadOnly(TUnSwUnit(AItem).FileName) then
|
2007-12-09 12:02:11 +00:00
|
|
|
OverlayIndex := 5
|
2006-03-14 20:06:31 +00:00
|
|
|
else
|
2007-12-09 12:02:11 +00:00
|
|
|
OverlayIndex := -1;
|
2006-03-14 20:06:31 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwStyleVisitor.VisitModule(const AUnit: TUnSwModuleUnit);
|
2006-01-05 21:04:59 +00:00
|
|
|
begin
|
2007-12-07 15:33:00 +00:00
|
|
|
VisitItem(AUnit);
|
2006-01-05 21:04:59 +00:00
|
|
|
case AUnit.UnitType of
|
2006-01-07 19:56:40 +00:00
|
|
|
swutUnit:
|
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Color := Settings.Colors.Units;
|
|
|
|
ImageIndex := 1;
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
swutForm:
|
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Color := Settings.Colors.Forms;
|
|
|
|
ImageIndex := 2;
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
swutDataModule:
|
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Color := Settings.Colors.DataModules;
|
|
|
|
ImageIndex := 3;
|
|
|
|
end;
|
2006-01-05 21:04:59 +00:00
|
|
|
else
|
2007-12-09 12:02:11 +00:00
|
|
|
Color := clWindowText;
|
|
|
|
ImageIndex := 0;
|
2006-01-05 21:04:59 +00:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwStyleVisitor.VisitProject(const AUnit: TUnSwProjectUnit);
|
2006-01-05 21:04:59 +00:00
|
|
|
begin
|
2007-12-07 15:33:00 +00:00
|
|
|
VisitItem(AUnit);
|
2007-12-09 12:02:11 +00:00
|
|
|
Color := Settings.Colors.ProjectSource;
|
|
|
|
ImageIndex := 4;
|
2006-01-05 21:04:59 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-05 06:03:24 +00:00
|
|
|
{ TfrmUnSwDialog }
|
2006-01-05 21:04:59 +00:00
|
|
|
class function TfrmUnSwDialog.Execute(const AUnits: TUnSwUnitList;
|
|
|
|
const AFormsOnly: Boolean;
|
2007-02-16 17:19:22 +00:00
|
|
|
out AOpenDFM: Boolean;
|
2006-01-09 19:24:56 +00:00
|
|
|
const AActive: TUnSwUnit): TUnSwUnitList;
|
2006-01-05 06:03:24 +00:00
|
|
|
begin
|
|
|
|
with Self.Create(nil) do
|
|
|
|
try
|
2007-12-09 12:02:11 +00:00
|
|
|
ItemList := AUnits;
|
|
|
|
ActiveItem := AActive;
|
2006-01-05 21:04:59 +00:00
|
|
|
FFormsOnly := AFormsOnly;
|
2007-02-16 17:19:22 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := TUnSwUnitList(InternalExecute());
|
2007-02-16 17:19:22 +00:00
|
|
|
AOpenDFM := FOpenDFM;
|
2006-01-05 06:03:24 +00:00
|
|
|
finally
|
|
|
|
Free();
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure TfrmUnSwDialog.FormShow(Sender: TObject);
|
2006-01-07 19:56:40 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
UpdateTypeFilter(False);
|
|
|
|
inherited;
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.GetActiveUnits(): TUnSwUnitList;
|
2006-01-09 19:24:56 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := (GetActiveItems() as TUnSwUnitList);
|
2006-01-09 19:24:56 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.GetBaseItemList(): TBaseSwItemList;
|
|
|
|
begin
|
|
|
|
Result := FTypeFilteredList;
|
|
|
|
end;
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.GetItemDisplayName(const AItem: TBaseSwItem): String;
|
2006-01-05 06:03:24 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
if FFormsOnly and (AItem is TUnSwModuleUnit) then
|
|
|
|
Result := TUnSwModuleUnit(AItem).FormName
|
2006-01-06 05:57:45 +00:00
|
|
|
else
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := inherited GetItemDisplayName(AItem);
|
|
|
|
end;
|
2006-01-15 00:22:09 +00:00
|
|
|
|
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.InternalExecute(): TBaseSwItemList;
|
|
|
|
begin
|
|
|
|
FTypeFilteredList := TUnSwUnitList.Create();
|
|
|
|
FTypeFilter := TUnSwUnitTypeFilter.Create;
|
2006-01-05 06:03:24 +00:00
|
|
|
try
|
2006-01-06 20:39:08 +00:00
|
|
|
if FFormsOnly then
|
2006-01-07 19:56:40 +00:00
|
|
|
begin
|
2006-01-13 21:05:07 +00:00
|
|
|
chkProjectSource.Visible := False;
|
|
|
|
chkUnits.Visible := False;
|
|
|
|
Self.Caption := 'UnitSwitcher - View Form';
|
2006-01-07 19:56:40 +00:00
|
|
|
end else
|
2006-01-13 21:05:07 +00:00
|
|
|
Self.Caption := 'UnitSwitcher - View Unit';
|
2006-01-05 21:14:36 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := inherited InternalExecute();
|
2006-01-05 06:03:24 +00:00
|
|
|
finally
|
|
|
|
FreeAndNil(FTypeFilter);
|
|
|
|
FreeAndNil(FTypeFilteredList);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure TfrmUnSwDialog.UpdateItemActions();
|
2006-03-14 20:06:31 +00:00
|
|
|
var
|
|
|
|
bDFM: Boolean;
|
|
|
|
bUnits: Boolean;
|
|
|
|
iUnit: Integer;
|
|
|
|
pUnits: TUnSwUnitList;
|
|
|
|
pVisitor: TUnSwReadOnlyVisitor;
|
|
|
|
sStatus: String;
|
|
|
|
|
|
|
|
begin
|
|
|
|
{ Read-only status }
|
|
|
|
pUnits := GetActiveUnits();
|
|
|
|
if Assigned(pUnits) then
|
|
|
|
try
|
|
|
|
pVisitor := TUnSwReadOnlyVisitor.Create();
|
|
|
|
try
|
|
|
|
pUnits.AcceptVisitor(pVisitor);
|
|
|
|
actReadOnly.Checked := (pVisitor.ReadOnlyCount > 0);
|
|
|
|
|
|
|
|
sStatus := '';
|
|
|
|
if pVisitor.ReadOnlyCount > 0 then
|
|
|
|
if pVisitor.ReadOnlyCount = 1 then
|
|
|
|
sStatus := '1 read-only unit selected'
|
|
|
|
else
|
|
|
|
sStatus := Format('%d read-only units selected',
|
|
|
|
[pVisitor.ReadOnlyCount]);
|
|
|
|
|
|
|
|
sbStatus.Panels[0].Text := sStatus;
|
|
|
|
finally
|
|
|
|
FreeAndNil(pVisitor);
|
|
|
|
end;
|
|
|
|
finally
|
|
|
|
FreeAndNil(pUnits);
|
|
|
|
end;
|
|
|
|
|
|
|
|
{ Properties }
|
|
|
|
bDFM := False;
|
|
|
|
bUnits := False;
|
|
|
|
|
|
|
|
pUnits := GetActiveUnits();
|
|
|
|
if Assigned(pUnits) then
|
|
|
|
try
|
|
|
|
bUnits := (pUnits.Count > 0);
|
|
|
|
|
|
|
|
for iUnit := 0 to Pred(pUnits.Count) do
|
|
|
|
if (pUnits[iUnit] is TUnSwModuleUnit) and
|
|
|
|
(TUnSwModuleUnit(pUnits[iUnit]).UnitType in [swutForm, swutDataModule]) then
|
|
|
|
begin
|
|
|
|
bDFM := True;
|
|
|
|
break;
|
|
|
|
end;
|
|
|
|
finally
|
|
|
|
FreeAndNil(pUnits);
|
|
|
|
end;
|
|
|
|
|
|
|
|
actOpenFolder.Enabled := bUnits;
|
|
|
|
actOpenProperties.Enabled := bUnits;
|
|
|
|
actOpenDFMProperties.Enabled := bDFM;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
function SortByName(Item1, Item2: Pointer): Integer;
|
|
|
|
begin
|
|
|
|
Result := CompareText(TUnSwUnit(Item1).Name, TUnSwUnit(Item2).Name)
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
function SortByType(Item1, Item2: Pointer): Integer;
|
|
|
|
const
|
|
|
|
Above = -1;
|
|
|
|
Equal = 0;
|
|
|
|
Below = 1;
|
|
|
|
|
|
|
|
function SortByModuleType(Item1, Item2: TUnSwUnitType): Integer;
|
|
|
|
begin
|
|
|
|
Result := Equal;
|
|
|
|
if Item1 <> Item2 then
|
|
|
|
case Item1 of
|
|
|
|
swutForm:
|
|
|
|
case Item2 of
|
|
|
|
swutDataModule: Result := Below;
|
|
|
|
swutUnit: Result := Above;
|
|
|
|
end;
|
|
|
|
swutDataModule: Result := Above;
|
|
|
|
swutUnit: Result := Below;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
pItem1: TUnSwUnit;
|
|
|
|
pItem2: TUnSwUnit;
|
|
|
|
|
|
|
|
begin
|
|
|
|
// #ToDo3 Refactor SortByType
|
|
|
|
|
|
|
|
// The following order is assumed:
|
|
|
|
// Project source, DataModules, Forms, Units
|
|
|
|
Result := Equal;
|
|
|
|
pItem1 := TUnSwUnit(Item1);
|
|
|
|
pItem2 := TUnSwUnit(Item2);
|
|
|
|
|
|
|
|
if pItem1.ClassType <> pItem2.ClassType then
|
|
|
|
begin
|
|
|
|
if pItem1 is TUnSwProjectUnit then
|
|
|
|
Result := Above
|
|
|
|
else if pItem2 is TUnSwProjectUnit then
|
|
|
|
Result := Below;
|
|
|
|
end else if pItem1 is TUnSwModuleUnit then
|
|
|
|
Result := SortByModuleType(TUnSwModuleUnit(pItem1).UnitType,
|
|
|
|
TUnSwModuleUnit(pItem2).UnitType);
|
|
|
|
|
|
|
|
if Result = Equal then
|
|
|
|
Result := SortByName(Item1, Item2);
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure TfrmUnSwDialog.UpdateTypeFilter(AUpdateList: Boolean);
|
2006-01-05 21:04:59 +00:00
|
|
|
begin
|
2006-01-13 20:34:45 +00:00
|
|
|
FTypeFilter.IncludeUnits := ((not FFormsOnly) and chkUnits.Checked);
|
2006-01-05 21:04:59 +00:00
|
|
|
FTypeFilter.IncludeProjectSource := ((not FFormsOnly) and chkProjectSource.Checked);
|
2006-01-13 20:34:45 +00:00
|
|
|
FTypeFilter.IncludeForms := chkForms.Checked;
|
|
|
|
FTypeFilter.IncludeDataModules := chkDataModules.Checked;
|
2006-01-05 21:04:59 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
FTypeFilteredList.Clone(ItemList);
|
2007-02-09 13:58:37 +00:00
|
|
|
FTypeFilter.FilterList(FTypeFilteredList);
|
2006-01-13 20:34:45 +00:00
|
|
|
|
|
|
|
if actSortByName.Checked then
|
|
|
|
FTypeFilteredList.Sort(SortByName)
|
|
|
|
else
|
|
|
|
FTypeFilteredList.Sort(SortByType);
|
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
if AUpdateList then
|
2006-01-15 00:22:09 +00:00
|
|
|
UpdateSubFilters();
|
2006-01-05 06:03:24 +00:00
|
|
|
end;
|
|
|
|
|
2006-01-06 20:39:08 +00:00
|
|
|
|
|
|
|
procedure TfrmUnSwDialog.LoadSettings();
|
|
|
|
var
|
2006-01-07 19:56:40 +00:00
|
|
|
dialogSettings: TUnSwDialogSettings;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
|
|
|
begin
|
2006-01-07 19:56:40 +00:00
|
|
|
if FFormsOnly then
|
|
|
|
dialogSettings := Settings.FormsDialog
|
|
|
|
else
|
|
|
|
dialogSettings := Settings.UnitsDialog;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
FLoading := True;
|
|
|
|
try
|
|
|
|
chkDataModules.Checked := dialogSettings.IncludeDataModules;
|
|
|
|
chkForms.Checked := dialogSettings.IncludeForms;
|
2006-01-13 20:34:45 +00:00
|
|
|
chkUnits.Checked := dialogSettings.IncludeUnits;
|
2006-01-07 19:56:40 +00:00
|
|
|
chkProjectSource.Checked := dialogSettings.IncludeProjectSource;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
case dialogSettings.Sort of
|
|
|
|
dsName: actSortByName.Checked := True;
|
|
|
|
dsType: actSortByType.Checked := True;
|
|
|
|
end;
|
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
MRUList.Assign(dialogSettings.MRUList);
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
Self.ClientWidth := dialogSettings.Width;
|
|
|
|
Self.ClientHeight := dialogSettings.Height;
|
2007-12-09 12:02:11 +00:00
|
|
|
|
|
|
|
inherited LoadSettings();
|
2006-01-06 20:39:08 +00:00
|
|
|
finally
|
|
|
|
FLoading := False;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-06 20:39:08 +00:00
|
|
|
procedure TfrmUnSwDialog.SaveSettings();
|
|
|
|
var
|
2006-01-07 19:56:40 +00:00
|
|
|
dialogSettings: TUnSwDialogSettings;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
|
|
|
begin
|
2006-01-07 19:56:40 +00:00
|
|
|
if FFormsOnly then
|
|
|
|
dialogSettings := Settings.FormsDialog
|
|
|
|
else
|
|
|
|
dialogSettings := Settings.UnitsDialog;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
2006-01-26 08:02:12 +00:00
|
|
|
dialogSettings.IncludeDataModules := chkDataModules.Checked;
|
|
|
|
dialogSettings.IncludeForms := chkForms.Checked;
|
2006-01-13 20:34:45 +00:00
|
|
|
dialogSettings.IncludeUnits := chkUnits.Checked;
|
2006-01-07 19:56:40 +00:00
|
|
|
dialogSettings.IncludeProjectSource := chkProjectSource.Checked;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
if actSortByName.Checked then
|
|
|
|
dialogSettings.Sort := dsName
|
|
|
|
else
|
|
|
|
dialogSettings.Sort := dsType;
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
dialogSettings.Width := Self.ClientWidth;
|
|
|
|
dialogSettings.Height := Self.ClientHeight;
|
2006-01-06 20:39:08 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
dialogSettings.MRUList.Assign(MRUList);
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
Settings.Save();
|
2006-01-13 20:34:45 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
inherited SaveSettings();
|
2006-01-13 20:34:45 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2009-05-01 08:44:18 +00:00
|
|
|
procedure TfrmUnSwDialog.SettingsChanged();
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
lstItems.Invalidate();
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure TfrmUnSwDialog.SortExecute(Sender: TObject);
|
|
|
|
begin
|
|
|
|
(Sender as TAction).Checked := True;
|
2007-12-09 12:02:11 +00:00
|
|
|
UpdateTypeFilter(True);
|
2006-01-13 20:34:45 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure TfrmUnSwDialog.actOpenFolderExecute(Sender: TObject);
|
|
|
|
var
|
|
|
|
pUnits: TUnSwUnitList;
|
|
|
|
|
|
|
|
begin
|
|
|
|
pUnits := GetActiveUnits();
|
|
|
|
if Assigned(pUnits) then
|
|
|
|
try
|
|
|
|
pUnits.AcceptVisitor(TUnSwOpenFolderVisitor.Create());
|
|
|
|
finally
|
|
|
|
FreeAndNil(pUnits);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
procedure TfrmUnSwDialog.actOpenPropertiesExecute(Sender: TObject);
|
|
|
|
var
|
|
|
|
pUnits: TUnSwUnitList;
|
|
|
|
|
|
|
|
begin
|
|
|
|
pUnits := GetActiveUnits();
|
|
|
|
if Assigned(pUnits) then
|
|
|
|
try
|
|
|
|
pUnits.AcceptVisitor(TUnSwOpenPropertiesVisitor.Create());
|
|
|
|
finally
|
|
|
|
FreeAndNil(pUnits);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-26 19:40:23 +00:00
|
|
|
procedure TfrmUnSwDialog.actOpenDFMPropertiesExecute(Sender: TObject);
|
|
|
|
var
|
|
|
|
pUnits: TUnSwUnitList;
|
|
|
|
|
|
|
|
begin
|
|
|
|
pUnits := GetActiveUnits();
|
|
|
|
if Assigned(pUnits) then
|
|
|
|
try
|
|
|
|
pUnits.AcceptVisitor(TUnSwOpenDFMPropertiesVisitor.Create());
|
|
|
|
finally
|
|
|
|
FreeAndNil(pUnits);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TfrmUnSwDialog.btnConfigurationClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if TfrmUnSwConfiguration.Execute() then
|
2009-05-01 08:44:18 +00:00
|
|
|
SettingsChanged();
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.CreateItemList(): TBaseSwItemList;
|
2006-01-05 06:03:24 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := TUnSwUnitList.Create();
|
2006-01-05 06:03:24 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.ColorsEnabled(): Boolean;
|
2006-01-05 06:03:24 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := Settings.Colors.Enabled;
|
2006-01-15 00:22:09 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2009-05-01 08:44:18 +00:00
|
|
|
function TfrmUnSwDialog.Wildchars(): Boolean;
|
|
|
|
begin
|
|
|
|
Result := Settings.Filter.Wildchars;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.CreateStyleVisitor(): TBaseSwStyleVisitor;
|
2006-01-15 00:22:09 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
Result := TUnSwStyleVisitor.Create();
|
2006-01-05 06:03:24 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.CreateInputFilter(): TBaseSwItemSimpleFilter;
|
2006-01-05 21:04:59 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
if FFormsOnly then
|
|
|
|
Result := TUnSwUnitSimpleFormNameFilter.Create()
|
|
|
|
else
|
|
|
|
Result := TBaseSwItemSimpleNameFilter.Create();
|
2006-01-05 06:03:24 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure TfrmUnSwDialog.TypeFilterChange(Sender: TObject);
|
2006-01-05 06:03:24 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
if not FLoading then
|
|
|
|
UpdateTypeFilter(True);
|
2006-01-05 06:03:24 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
procedure TfrmUnSwDialog.lstUnitsDblClick(Sender: TObject);
|
2006-01-26 19:40:23 +00:00
|
|
|
begin
|
2007-12-09 12:02:11 +00:00
|
|
|
btnOK.Click();
|
2006-03-14 20:06:31 +00:00
|
|
|
end;
|
2006-01-26 19:40:23 +00:00
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-03-14 20:06:31 +00:00
|
|
|
procedure TfrmUnSwDialog.actReadOnlyExecute(Sender: TObject);
|
|
|
|
var
|
|
|
|
pUnits: TUnSwUnitList;
|
|
|
|
pVisitor: TUnSwSetReadOnlyVisitor;
|
|
|
|
|
|
|
|
begin
|
|
|
|
pUnits := GetActiveUnits();
|
2006-01-26 19:40:23 +00:00
|
|
|
if Assigned(pUnits) then
|
|
|
|
try
|
2006-03-14 20:06:31 +00:00
|
|
|
pVisitor := TUnSwSetReadOnlyVisitor.Create();
|
|
|
|
try
|
|
|
|
pVisitor.ReadOnlyFlag := not actReadOnly.Checked;
|
|
|
|
pUnits.AcceptVisitor(pVisitor);
|
|
|
|
finally
|
|
|
|
FreeAndNil(pVisitor);
|
|
|
|
end;
|
2006-01-26 19:40:23 +00:00
|
|
|
finally
|
|
|
|
FreeAndNil(pUnits);
|
2006-03-14 20:06:31 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
lstItems.Invalidate();
|
|
|
|
UpdateItemActions();
|
2006-01-26 19:40:23 +00:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-16 17:19:22 +00:00
|
|
|
|
2007-12-09 12:02:11 +00:00
|
|
|
function TfrmUnSwDialog.AllowEmptyResult(): Boolean;
|
|
|
|
begin
|
|
|
|
Result := Settings.Filter.AllowEmptyResult;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2007-02-16 17:19:22 +00:00
|
|
|
procedure TfrmUnSwDialog.actOpenExecute(Sender: TObject);
|
|
|
|
begin
|
|
|
|
FOpenDFM := False;
|
|
|
|
ModalResult := mrOk;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmUnSwDialog.actOpenDFMExecute(Sender: TObject);
|
|
|
|
begin
|
|
|
|
FOpenDFM := True;
|
|
|
|
ModalResult := mrOk;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmUnSwDialog.btnOKClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
FOpenDFM := ((GetKeyState(VK_SHIFT) and 128) <> 0);
|
2007-12-09 12:02:11 +00:00
|
|
|
|
|
|
|
inherited;
|
2007-02-16 17:19:22 +00:00
|
|
|
end;
|
|
|
|
|
2006-01-05 06:03:24 +00:00
|
|
|
end.
|