Fixed: Access Violation in View Unit
This commit is contained in:
parent
27a1a5023f
commit
277497d7c5
@ -30,24 +30,25 @@ type
|
|||||||
TfrmUnSwDialog = class(TForm)
|
TfrmUnSwDialog = class(TForm)
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
btnOK: TButton;
|
btnOK: TButton;
|
||||||
|
chkDataModules: TCheckBox;
|
||||||
|
chkForms: TCheckBox;
|
||||||
|
chkProjectSource: TCheckBox;
|
||||||
edtSearch: TEdit;
|
edtSearch: TEdit;
|
||||||
ilsTypes: TImageList;
|
ilsTypes: TImageList;
|
||||||
lstUnits: TListBox;
|
lstUnits: TListBox;
|
||||||
pnlButtons: TPanel;
|
pnlButtons: TPanel;
|
||||||
|
pnlIncludeTypes: TPanel;
|
||||||
pnlMain: TPanel;
|
pnlMain: TPanel;
|
||||||
pnlSearch: TPanel;
|
pnlSearch: TPanel;
|
||||||
sbStatus: TStatusBar;
|
sbStatus: TStatusBar;
|
||||||
chkForms: TCheckBox;
|
|
||||||
chkDataModules: TCheckBox;
|
|
||||||
chkProjectSource: TCheckBox;
|
|
||||||
pnlIncludeTypes: TPanel;
|
|
||||||
procedure TypeFilterChange(Sender: TObject);
|
|
||||||
|
|
||||||
procedure edtSearchChange(Sender: TObject);
|
procedure edtSearchChange(Sender: TObject);
|
||||||
procedure edtSearchKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure edtSearchKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure TypeFilterChange(Sender: TObject);
|
||||||
procedure lstUnitsData(Control: TWinControl; Index: Integer; var Data: string);
|
procedure lstUnitsData(Control: TWinControl; Index: Integer; var Data: string);
|
||||||
procedure lstUnitsDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
|
procedure lstUnitsDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
|
||||||
private
|
private
|
||||||
|
FLoading: Boolean;
|
||||||
FUnitList: TUnSwUnitList;
|
FUnitList: TUnSwUnitList;
|
||||||
FActiveUnit: TUnSwUnit;
|
FActiveUnit: TUnSwUnit;
|
||||||
FFormsOnly: Boolean;
|
FFormsOnly: Boolean;
|
||||||
@ -73,6 +74,7 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
|
DIalogs,
|
||||||
SysUtils,
|
SysUtils,
|
||||||
Graphics;
|
Graphics;
|
||||||
|
|
||||||
@ -122,19 +124,24 @@ function TfrmUnSwDialog.InternalExecute(): TUnSwUnit;
|
|||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
|
||||||
if not FFormsOnly then
|
|
||||||
begin
|
|
||||||
chkForms.Checked := FTypeFilter.IncludeForms;
|
|
||||||
chkDataModules.Checked := FTypeFilter.IncludeDataModules;
|
|
||||||
chkProjectSource.Checked := FTypeFilter.IncludeProjectSource;
|
|
||||||
end else
|
|
||||||
pnlIncludeTypes.Visible := False;
|
|
||||||
|
|
||||||
FTypeFilteredList := TUnSwUnitList.Create();
|
FTypeFilteredList := TUnSwUnitList.Create();
|
||||||
FInputFilteredList := TUnSwUnitList.Create();
|
FInputFilteredList := TUnSwUnitList.Create();
|
||||||
FTypeFilter := TUnSwUnitTypeFilter.Create(FTypeFilteredList);
|
FTypeFilter := TUnSwUnitTypeFilter.Create(FTypeFilteredList);
|
||||||
FInputFilter := TUnSwUnitSimpleFilter.Create(FInputFilteredList);
|
FInputFilter := TUnSwUnitSimpleFilter.Create(FInputFilteredList);
|
||||||
try
|
try
|
||||||
|
if not FFormsOnly then
|
||||||
|
begin
|
||||||
|
FLoading := True;
|
||||||
|
try
|
||||||
|
chkForms.Checked := FTypeFilter.IncludeForms;
|
||||||
|
chkDataModules.Checked := FTypeFilter.IncludeDataModules;
|
||||||
|
chkProjectSource.Checked := FTypeFilter.IncludeProjectSource;
|
||||||
|
finally
|
||||||
|
FLoading := False;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
pnlIncludeTypes.Visible := False;
|
||||||
|
|
||||||
UpdateTypeFilter();
|
UpdateTypeFilter();
|
||||||
|
|
||||||
FIconVisitor := TUnSwIconVisitor.Create();
|
FIconVisitor := TUnSwIconVisitor.Create();
|
||||||
@ -227,6 +234,7 @@ end;
|
|||||||
|
|
||||||
procedure TfrmUnSwDialog.TypeFilterChange(Sender: TObject);
|
procedure TfrmUnSwDialog.TypeFilterChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
if not FLoading then
|
||||||
UpdateTypeFilter();
|
UpdateTypeFilter();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user