mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 16:37:54 +02:00
This commit is contained in:
parent
c0aab03941
commit
e9b2eb209a
@ -2825,6 +2825,7 @@ resourcestring
|
|||||||
lisPLDOnlinePackagesCannotBeDeleted = 'Online packages cannot be deleted';
|
lisPLDOnlinePackagesCannotBeDeleted = 'Online packages cannot be deleted';
|
||||||
lisPESortFilesAlphabetically = 'Sort files alphabetically';
|
lisPESortFilesAlphabetically = 'Sort files alphabetically';
|
||||||
lisPEShowDirectoryHierarchy = 'Show directory hierarchy';
|
lisPEShowDirectoryHierarchy = 'Show directory hierarchy';
|
||||||
|
lisClearFilter = 'Clear filter';
|
||||||
dlgCaseSensitive = '&Case sensitive';
|
dlgCaseSensitive = '&Case sensitive';
|
||||||
lisDistinguishBigAndSmallLettersEGAAndA = 'Distinguish big and small letters e.g. A and a';
|
lisDistinguishBigAndSmallLettersEGAAndA = 'Distinguish big and small letters e.g. A and a';
|
||||||
dlgWholeWordsOnly = '&Whole words only';
|
dlgWholeWordsOnly = '&Whole words only';
|
||||||
|
@ -3352,6 +3352,7 @@ var
|
|||||||
LFMClassName: String;
|
LFMClassName: String;
|
||||||
anUnitName: String;
|
anUnitName: String;
|
||||||
LFMCode: TCodeBuffer;
|
LFMCode: TCodeBuffer;
|
||||||
|
AlreadyOpen: Boolean;
|
||||||
begin
|
begin
|
||||||
if Project1=nil then exit(mrCancel);
|
if Project1=nil then exit(mrCancel);
|
||||||
MainIDE.GetCurrentUnit(ActiveSourceEditor, ActiveUnitInfo);
|
MainIDE.GetCurrentUnit(ActiveSourceEditor, ActiveUnitInfo);
|
||||||
@ -3360,6 +3361,7 @@ begin
|
|||||||
CurUnitInfo:=Project1.Units[i];
|
CurUnitInfo:=Project1.Units[i];
|
||||||
if not CurUnitInfo.IsPartOfProject then
|
if not CurUnitInfo.IsPartOfProject then
|
||||||
Continue;
|
Continue;
|
||||||
|
AlreadyOpen := CurUnitInfo.OpenEditorInfoCount > 0;
|
||||||
if ItemType in [piComponent, piFrame] then
|
if ItemType in [piComponent, piFrame] then
|
||||||
begin
|
begin
|
||||||
// add all form names of project
|
// add all form names of project
|
||||||
@ -3368,7 +3370,7 @@ begin
|
|||||||
if (ItemType = piComponent) or
|
if (ItemType = piComponent) or
|
||||||
((ItemType = piFrame) and (CurUnitInfo.ResourceBaseClass = pfcbcFrame)) then
|
((ItemType = piFrame) and (CurUnitInfo.ResourceBaseClass = pfcbcFrame)) then
|
||||||
ItemList.Add(CurUnitInfo.ComponentName,
|
ItemList.Add(CurUnitInfo.ComponentName,
|
||||||
CurUnitInfo.Filename, i, CurUnitInfo = ActiveUnitInfo);
|
CurUnitInfo.Filename, i, CurUnitInfo = ActiveUnitInfo, AlreadyOpen);
|
||||||
end else if FilenameIsAbsolute(CurUnitInfo.Filename)
|
end else if FilenameIsAbsolute(CurUnitInfo.Filename)
|
||||||
and FilenameIsPascalSource(CurUnitInfo.Filename)
|
and FilenameIsPascalSource(CurUnitInfo.Filename)
|
||||||
and FileExistsCached(CurUnitInfo.Filename) then
|
and FileExistsCached(CurUnitInfo.Filename) then
|
||||||
@ -3385,7 +3387,7 @@ begin
|
|||||||
if anUnitName='' then
|
if anUnitName='' then
|
||||||
anUnitName:=ExtractFileNameOnly(LFMFilename);
|
anUnitName:=ExtractFileNameOnly(LFMFilename);
|
||||||
ItemList.Add(LFMComponentName, CurUnitInfo.Filename,
|
ItemList.Add(LFMComponentName, CurUnitInfo.Filename,
|
||||||
i, CurUnitInfo = ActiveUnitInfo);
|
i, CurUnitInfo = ActiveUnitInfo, AlreadyOpen);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3397,7 +3399,7 @@ begin
|
|||||||
AUnitName := ExtractFileName(CurUnitInfo.Filename);
|
AUnitName := ExtractFileName(CurUnitInfo.Filename);
|
||||||
if ItemList.Find(AUnitName) = nil then
|
if ItemList.Find(AUnitName) = nil then
|
||||||
ItemList.Add(AUnitName, CurUnitInfo.Filename,
|
ItemList.Add(AUnitName, CurUnitInfo.Filename,
|
||||||
i, CurUnitInfo = ActiveUnitInfo);
|
i, CurUnitInfo = ActiveUnitInfo, AlreadyOpen);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Project1.MainUnitID = i then
|
if Project1.MainUnitID = i then
|
||||||
@ -3409,7 +3411,7 @@ begin
|
|||||||
if (AUnitName <> '') and (ItemList.Find(AUnitName) = nil) then
|
if (AUnitName <> '') and (ItemList.Find(AUnitName) = nil) then
|
||||||
begin
|
begin
|
||||||
ItemList.Add(AUnitName, MainUnitInfo.Filename,
|
ItemList.Add(AUnitName, MainUnitInfo.Filename,
|
||||||
i, MainUnitInfo = ActiveUnitInfo);
|
i, MainUnitInfo = ActiveUnitInfo, MainUnitInfo.OpenEditorInfoCount > 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3556,7 +3558,7 @@ begin
|
|||||||
for S2SItem in UnitToFilename do begin
|
for S2SItem in UnitToFilename do begin
|
||||||
AnUnitName:=S2SItem^.Name;
|
AnUnitName:=S2SItem^.Name;
|
||||||
AFilename:=S2SItem^.Value;
|
AFilename:=S2SItem^.Value;
|
||||||
UnitList.Add(AnUnitName,AFilename,i,false);
|
UnitList.Add(AnUnitName,AFilename,i,false,false);
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
// show dialog
|
// show dialog
|
||||||
@ -3595,7 +3597,7 @@ Begin
|
|||||||
if (AnUnitInfo.IsPartOfProject) and (i<>Project1.MainUnitID) then
|
if (AnUnitInfo.IsPartOfProject) and (i<>Project1.MainUnitID) then
|
||||||
begin
|
begin
|
||||||
AName := Project1.RemoveProjectPathFromFilename(AnUnitInfo.FileName);
|
AName := Project1.RemoveProjectPathFromFilename(AnUnitInfo.FileName);
|
||||||
ViewUnitEntries.Add(AName,AnUnitInfo.FileName,i,false);
|
ViewUnitEntries.Add(AName,AnUnitInfo.FileName,i,false,false);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if ShowViewUnitsDlg(ViewUnitEntries,true,lisRemoveFromProject,piUnit) <> mrOk then
|
if ShowViewUnitsDlg(ViewUnitEntries,true,lisRemoveFromProject,piUnit) <> mrOk then
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
object ViewUnitDialog: TViewUnitDialog
|
object ViewUnitDialog: TViewUnitDialog
|
||||||
Left = 330
|
Left = 308
|
||||||
Height = 386
|
Height = 386
|
||||||
Top = 280
|
Top = 275
|
||||||
Width = 378
|
Width = 378
|
||||||
HorzScrollBar.Page = 377
|
HorzScrollBar.Page = 377
|
||||||
HorzScrollBar.Range = 112
|
HorzScrollBar.Range = 112
|
||||||
@ -16,11 +16,11 @@ object ViewUnitDialog: TViewUnitDialog
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '2.3.0.0'
|
||||||
object Listbox: TListBox
|
object Listbox: TListBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 272
|
Height = 279
|
||||||
Top = 41
|
Top = 35
|
||||||
Width = 366
|
Width = 366
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -36,8 +36,8 @@ object ViewUnitDialog: TViewUnitDialog
|
|||||||
end
|
end
|
||||||
object ButtonPanel: TButtonPanel
|
object ButtonPanel: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 35
|
Height = 34
|
||||||
Top = 345
|
Top = 346
|
||||||
Width = 366
|
Width = 366
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
@ -56,19 +56,19 @@ object ViewUnitDialog: TViewUnitDialog
|
|||||||
end
|
end
|
||||||
object BtnPanel: TPanel
|
object BtnPanel: TPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 29
|
Height = 23
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 366
|
Width = 366
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 29
|
ClientHeight = 23
|
||||||
ClientWidth = 366
|
ClientWidth = 366
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object SortAlphabeticallySpeedButton: TSpeedButton
|
object SortAlphabeticallySpeedButton: TSpeedButton
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 29
|
Height = 23
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 25
|
Width = 25
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
@ -82,13 +82,14 @@ object ViewUnitDialog: TViewUnitDialog
|
|||||||
end
|
end
|
||||||
object FilterEdit: TListFilterEdit
|
object FilterEdit: TListFilterEdit
|
||||||
Left = 31
|
Left = 31
|
||||||
Height = 29
|
Height = 23
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 335
|
Width = 335
|
||||||
|
ButtonHint = 'Clear Filter'
|
||||||
ButtonWidth = 23
|
ButtonWidth = 23
|
||||||
NumGlyphs = 1
|
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
|
NumGlyphs = 1
|
||||||
MaxLength = 0
|
MaxLength = 0
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -98,7 +99,7 @@ object ViewUnitDialog: TViewUnitDialog
|
|||||||
object ProgressBar1: TProgressBar
|
object ProgressBar1: TProgressBar
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 20
|
Height = 20
|
||||||
Top = 319
|
Top = 320
|
||||||
Width = 366
|
Width = 366
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
@ -107,8 +108,8 @@ object ViewUnitDialog: TViewUnitDialog
|
|||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
object popListBox: TPopupMenu
|
object popListBox: TPopupMenu
|
||||||
left = 144
|
Left = 144
|
||||||
top = 112
|
Top = 112
|
||||||
object mniMultiSelect: TMenuItem
|
object mniMultiSelect: TMenuItem
|
||||||
AutoCheck = True
|
AutoCheck = True
|
||||||
Caption = 'Multi Select'
|
Caption = 'Multi Select'
|
||||||
|
@ -70,8 +70,9 @@ type
|
|||||||
Name: string;
|
Name: string;
|
||||||
ID: integer;
|
ID: integer;
|
||||||
Selected: boolean;
|
Selected: boolean;
|
||||||
|
Open: boolean;
|
||||||
Filename: string;
|
Filename: string;
|
||||||
constructor Create(const AName, AFilename: string; AnID: integer; ASelected: boolean);
|
constructor Create(const AName, AFilename: string; AnID: integer; ASelected, AOpen: boolean);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TViewUnitsEntryEnumerator }
|
{ TViewUnitsEntryEnumerator }
|
||||||
@ -96,7 +97,7 @@ type
|
|||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
function Add(AName, AFilename: string; AnID: integer; ASelected: boolean): TViewUnitsEntry;
|
function Add(AName, AFilename: string; AnID: integer; ASelected, AOpen: boolean): TViewUnitsEntry;
|
||||||
function Find(const aName: string): TViewUnitsEntry; inline;
|
function Find(const aName: string): TViewUnitsEntry; inline;
|
||||||
function Count: integer; inline;
|
function Count: integer; inline;
|
||||||
function GetFiles: TStringList;
|
function GetFiles: TStringList;
|
||||||
@ -277,7 +278,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TViewUnitEntries.Add(AName, AFilename: string; AnID: integer;
|
function TViewUnitEntries.Add(AName, AFilename: string; AnID: integer;
|
||||||
ASelected: boolean): TViewUnitsEntry;
|
ASelected, AOpen: boolean): TViewUnitsEntry;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
@ -287,19 +288,20 @@ begin
|
|||||||
inc(i);
|
inc(i);
|
||||||
AName:=AName+'('+IntToStr(i)+')';
|
AName:=AName+'('+IntToStr(i)+')';
|
||||||
end;
|
end;
|
||||||
Result:=TViewUnitsEntry.Create(AName,AFilename,AnID,ASelected);
|
Result:=TViewUnitsEntry.Create(AName,AFilename,AnID,ASelected,AOpen);
|
||||||
fItems[AName]:=Result;
|
fItems[AName]:=Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TViewUnitsEntry }
|
{ TViewUnitsEntry }
|
||||||
|
|
||||||
constructor TViewUnitsEntry.Create(const AName, AFilename: string;
|
constructor TViewUnitsEntry.Create(const AName, AFilename: string;
|
||||||
AnID: integer; ASelected: boolean);
|
AnID: integer; ASelected, AOpen: boolean);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
Name := AName;
|
Name := AName;
|
||||||
ID := AnID;
|
ID := AnID;
|
||||||
Selected := ASelected;
|
Selected := ASelected;
|
||||||
|
Open := AOpen;
|
||||||
Filename := AFilename;
|
Filename := AFilename;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -317,6 +319,7 @@ begin
|
|||||||
ButtonPanel.HelpButton.Caption:=lisMenuHelp;
|
ButtonPanel.HelpButton.Caption:=lisMenuHelp;
|
||||||
ButtonPanel.CancelButton.Caption:=lisCancel;
|
ButtonPanel.CancelButton.Caption:=lisCancel;
|
||||||
SortAlphabeticallySpeedButton.Hint:=lisPESortFilesAlphabetically;
|
SortAlphabeticallySpeedButton.Hint:=lisPESortFilesAlphabetically;
|
||||||
|
FilterEdit.ButtonHint:=lisClearFilter;
|
||||||
IDEImages.AssignImage(SortAlphabeticallySpeedButton, 'pkg_sortalphabetically');
|
IDEImages.AssignImage(SortAlphabeticallySpeedButton, 'pkg_sortalphabetically');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -348,6 +351,7 @@ begin
|
|||||||
mniMultiselect.Checked := EnableMultiSelect;
|
mniMultiselect.Checked := EnableMultiSelect;
|
||||||
ListBox.MultiSelect := mniMultiselect.Enabled;
|
ListBox.MultiSelect := mniMultiselect.Enabled;
|
||||||
ShowEntries;
|
ShowEntries;
|
||||||
|
FilterEdit.SimpleSelection := true;
|
||||||
|
|
||||||
if aStartFilename<>'' then begin
|
if aStartFilename<>'' then begin
|
||||||
// init search for units
|
// init search for units
|
||||||
@ -382,6 +386,8 @@ begin
|
|||||||
IDEImages.Images_16.Draw(Canvas, 1, aTop, FImageIndex);
|
IDEImages.Images_16.Draw(Canvas, 1, aTop, FImageIndex);
|
||||||
aTop := (ARect.Bottom + ARect.Top - Canvas.TextHeight('Šj9')) div 2;
|
aTop := (ARect.Bottom + ARect.Top - Canvas.TextHeight('Šj9')) div 2;
|
||||||
Canvas.TextRect(ARect, ARect.Left + IDEImages.Images_16.Width + Scale96ToFont(4), aTop, Items[Index]);
|
Canvas.TextRect(ARect, ARect.Left + IDEImages.Images_16.Width + Scale96ToFont(4), aTop, Items[Index]);
|
||||||
|
if Items.Objects[Index] <> nil then // already open indicator
|
||||||
|
Canvas.TextRect(ARect, ARect.Right - Scale96ToFont(8), aTop, '•');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -519,13 +525,18 @@ end;
|
|||||||
procedure TViewUnitDialog.ShowEntries;
|
procedure TViewUnitDialog.ShowEntries;
|
||||||
var
|
var
|
||||||
UEntry: TViewUnitsEntry;
|
UEntry: TViewUnitsEntry;
|
||||||
|
flags: PtrInt;
|
||||||
begin
|
begin
|
||||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TViewUnitDialog.ShowEntries'){$ENDIF};
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TViewUnitDialog.ShowEntries'){$ENDIF};
|
||||||
try
|
try
|
||||||
// Data items
|
// Data items
|
||||||
FilterEdit.Items.Clear;
|
FilterEdit.Items.Clear;
|
||||||
for UEntry in fEntries do
|
for UEntry in fEntries do begin
|
||||||
FilterEdit.Items.Add(UEntry.Name);
|
flags := PtrInt(UEntry.Selected);
|
||||||
|
if UEntry.Open then
|
||||||
|
flags := flags or 2;
|
||||||
|
FilterEdit.Items.AddObject(UEntry.Name, TObject(flags));
|
||||||
|
end;
|
||||||
FilterEdit.InvalidateFilter;
|
FilterEdit.InvalidateFilter;
|
||||||
finally
|
finally
|
||||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TViewUnitDialog.ShowEntries'){$ENDIF};
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TViewUnitDialog.ShowEntries'){$ENDIF};
|
||||||
@ -538,7 +549,7 @@ var
|
|||||||
begin
|
begin
|
||||||
fEntries.Clear;
|
fEntries.Clear;
|
||||||
for F2SItem in fFoundFiles do
|
for F2SItem in fFoundFiles do
|
||||||
fEntries.Add(F2SItem^.Value,F2SItem^.Name,-1,false);
|
fEntries.Add(F2SItem^.Value,F2SItem^.Name,-1,false,false);
|
||||||
ShowEntries;
|
ShowEntries;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user