mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-31 02:36:58 +02:00
cody: dictionary: started hide other projects
git-svn-id: trunk@33809 -
This commit is contained in:
parent
aa7511f8c6
commit
d87be2153f
@ -1,12 +1,12 @@
|
|||||||
object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
||||||
Left = 250
|
Left = 250
|
||||||
Height = 300
|
Height = 305
|
||||||
Top = 250
|
Top = 250
|
||||||
Width = 521
|
Width = 543
|
||||||
ActiveControl = FilterEdit
|
ActiveControl = FilterEdit
|
||||||
Caption = 'CodyIdentifiersDlg'
|
Caption = 'CodyIdentifiersDlg'
|
||||||
ClientHeight = 300
|
ClientHeight = 305
|
||||||
ClientWidth = 521
|
ClientWidth = 543
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
@ -14,8 +14,8 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 42
|
Height = 42
|
||||||
Top = 252
|
Top = 257
|
||||||
Width = 509
|
Width = 531
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
HelpButton.Name = 'HelpButton'
|
HelpButton.Name = 'HelpButton'
|
||||||
@ -38,14 +38,14 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
end
|
end
|
||||||
object FilterEdit: TEdit
|
object FilterEdit: TEdit
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = InfoLabel
|
AnchorSideTop.Control = HideOtherProjectsCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 35
|
Top = 63
|
||||||
Width = 509
|
Width = 531
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 10
|
BorderSpacing.Top = 10
|
||||||
@ -64,9 +64,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = UnitLabel
|
AnchorSideBottom.Control = UnitLabel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 149
|
Height = 126
|
||||||
Top = 61
|
Top = 89
|
||||||
Width = 509
|
Width = 531
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
@ -74,7 +74,7 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnClick = ItemsListBoxClick
|
OnClick = ItemsListBoxClick
|
||||||
OnSelectionChange = ItemsListBoxSelectionChange
|
OnSelectionChange = ItemsListBoxSelectionChange
|
||||||
ScrollWidth = 507
|
ScrollWidth = 529
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
end
|
end
|
||||||
@ -83,7 +83,7 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideBottom.Control = PackageLabel
|
AnchorSideBottom.Control = PackageLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 211
|
Top = 216
|
||||||
Width = 59
|
Width = 59
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Bottom = 1
|
BorderSpacing.Bottom = 1
|
||||||
@ -95,11 +95,24 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideBottom.Control = ButtonPanel1
|
AnchorSideBottom.Control = ButtonPanel1
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 229
|
Top = 234
|
||||||
Width = 84
|
Width = 84
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Bottom = 1
|
BorderSpacing.Bottom = 1
|
||||||
Caption = 'PackageLabel'
|
Caption = 'PackageLabel'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
|
object HideOtherProjectsCheckBox: TCheckBox
|
||||||
|
AnchorSideLeft.Control = InfoLabel
|
||||||
|
AnchorSideTop.Control = InfoLabel
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 8
|
||||||
|
Height = 22
|
||||||
|
Top = 31
|
||||||
|
Width = 193
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
Caption = 'HideOtherProjectsCheckBox'
|
||||||
|
OnChange = HideOtherProjectsCheckBoxChange
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -112,6 +112,7 @@ type
|
|||||||
TCodyIdentifiersDlg = class(TForm)
|
TCodyIdentifiersDlg = class(TForm)
|
||||||
ButtonPanel1: TButtonPanel;
|
ButtonPanel1: TButtonPanel;
|
||||||
FilterEdit: TEdit;
|
FilterEdit: TEdit;
|
||||||
|
HideOtherProjectsCheckBox: TCheckBox;
|
||||||
InfoLabel: TLabel;
|
InfoLabel: TLabel;
|
||||||
ItemsListBox: TListBox;
|
ItemsListBox: TListBox;
|
||||||
PackageLabel: TLabel;
|
PackageLabel: TLabel;
|
||||||
@ -124,11 +125,13 @@ type
|
|||||||
{%H-}Shift: TShiftState);
|
{%H-}Shift: TShiftState);
|
||||||
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure HideOtherProjectsCheckBoxChange(Sender: TObject);
|
||||||
procedure ItemsListBoxClick(Sender: TObject);
|
procedure ItemsListBoxClick(Sender: TObject);
|
||||||
procedure ItemsListBoxSelectionChange(Sender: TObject; {%H-}User: boolean);
|
procedure ItemsListBoxSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||||
procedure OnIdle(Sender: TObject; var {%H-}Done: Boolean);
|
procedure OnIdle(Sender: TObject; var {%H-}Done: Boolean);
|
||||||
private
|
private
|
||||||
FLastFilter: string;
|
FLastFilter: string;
|
||||||
|
FLastHideOtherProjects: boolean;
|
||||||
FIdleConnected: boolean;
|
FIdleConnected: boolean;
|
||||||
FMaxItems: integer;
|
FMaxItems: integer;
|
||||||
FNoFilterText: string;
|
FNoFilterText: string;
|
||||||
@ -147,8 +150,8 @@ type
|
|||||||
function GetFPCSrcDir(const Directory: string): string;
|
function GetFPCSrcDir(const Directory: string): string;
|
||||||
public
|
public
|
||||||
CurIdentifier: string;
|
CurIdentifier: string;
|
||||||
CurIdentStart: integer;
|
CurIdentStart: integer; // column
|
||||||
CurIdentEnd: integer;
|
CurIdentEnd: integer; // column
|
||||||
CurInitError: TCUParseError;
|
CurInitError: TCUParseError;
|
||||||
CurTool: TCodeTool;
|
CurTool: TCodeTool;
|
||||||
CurCleanPos: integer;
|
CurCleanPos: integer;
|
||||||
@ -571,6 +574,12 @@ begin
|
|||||||
FMaxItems:=20;
|
FMaxItems:=20;
|
||||||
FNoFilterText:=crsFilter;
|
FNoFilterText:=crsFilter;
|
||||||
FItems:=TStringList.Create;
|
FItems:=TStringList.Create;
|
||||||
|
HideOtherProjectsCheckBox.Checked:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCodyIdentifiersDlg.HideOtherProjectsCheckBoxChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
IdleConnected:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodyIdentifiersDlg.ItemsListBoxClick(Sender: TObject);
|
procedure TCodyIdentifiersDlg.ItemsListBoxClick(Sender: TObject);
|
||||||
@ -590,7 +599,8 @@ begin
|
|||||||
CodyUnitDictionary.Load;
|
CodyUnitDictionary.Load;
|
||||||
UpdateGeneralInfo;
|
UpdateGeneralInfo;
|
||||||
end;
|
end;
|
||||||
if FLastFilter<>GetFilterEditText then
|
if (FLastFilter<>GetFilterEditText)
|
||||||
|
or (FLastHideOtherProjects<>HideOtherProjectsCheckBox.Checked) then
|
||||||
UpdateItemsList;
|
UpdateItemsList;
|
||||||
IdleConnected:=false;
|
IdleConnected:=false;
|
||||||
end;
|
end;
|
||||||
@ -629,7 +639,11 @@ var
|
|||||||
UseGroup: Boolean;
|
UseGroup: Boolean;
|
||||||
begin
|
begin
|
||||||
Filter:=GetFilterEditText;
|
Filter:=GetFilterEditText;
|
||||||
|
FLastFilter:=Filter;
|
||||||
FilterP:=PChar(Filter);
|
FilterP:=PChar(Filter);
|
||||||
|
|
||||||
|
FLastHideOtherProjects:=HideOtherProjectsCheckBox.Checked;
|
||||||
|
|
||||||
FItems.Clear;
|
FItems.Clear;
|
||||||
sl:=TStringList.Create;
|
sl:=TStringList.Create;
|
||||||
try
|
try
|
||||||
@ -655,6 +669,7 @@ begin
|
|||||||
// => check if it is the current one
|
// => check if it is the current one
|
||||||
Dir:=ExtractFilePath(Group.Filename);
|
Dir:=ExtractFilePath(Group.Filename);
|
||||||
UseGroup:=CompareFilenames(Dir,FPCSrcDir)=0;
|
UseGroup:=CompareFilenames(Dir,FPCSrcDir)=0;
|
||||||
|
// ToDo: check if ppu is there
|
||||||
end else if FileExistsCached(Group.Filename) then begin
|
end else if FileExistsCached(Group.Filename) then begin
|
||||||
// lpk exists
|
// lpk exists
|
||||||
UseGroup:=true;
|
UseGroup:=true;
|
||||||
@ -774,6 +789,7 @@ begin
|
|||||||
CurIdentifier:=copy(Line,CurIdentStart,CurIdentEnd-CurIdentStart);
|
CurIdentifier:=copy(Line,CurIdentStart,CurIdentEnd-CurIdentStart);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
GetCurOwnerOfUnit;
|
||||||
UpdateGeneralInfo;
|
UpdateGeneralInfo;
|
||||||
FLastFilter:='...'; // force one update
|
FLastFilter:='...'; // force one update
|
||||||
if CurIdentifier='' then
|
if CurIdentifier='' then
|
||||||
@ -831,11 +847,19 @@ procedure TCodyIdentifiersDlg.GetCurOwnerOfUnit;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
CurOwner:=nil;
|
||||||
if CurMainFilename='' then exit;
|
if CurMainFilename='' then exit;
|
||||||
GetBest(PackageEditingInterface.GetOwnersOfUnit(CurMainFilename));
|
GetBest(PackageEditingInterface.GetOwnersOfUnit(CurMainFilename));
|
||||||
if CurOwner=nil then
|
if CurOwner=nil then
|
||||||
GetBest(PackageEditingInterface.GetPossibleOwnersOfUnit(CurMainFilename,
|
GetBest(PackageEditingInterface.GetPossibleOwnersOfUnit(CurMainFilename,
|
||||||
[piosfIncludeSourceDirectories]));
|
[piosfIncludeSourceDirectories]));
|
||||||
|
if CurOwner<>nil then begin
|
||||||
|
if CurOwner is TLazProject then begin
|
||||||
|
//TLazProject(CurOwner).LazCompilerOptions.GetUnitOutputDirectory();
|
||||||
|
end else if CurOwner is TIDEPackage then begin
|
||||||
|
//TIDEPackage(CurOwner);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodyIdentifiersDlg.AddToUsesSection;
|
procedure TCodyIdentifiersDlg.AddToUsesSection;
|
||||||
|
Loading…
Reference in New Issue
Block a user