mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-21 13:08:18 +02:00
component palette popup menu now searches for virtual units
git-svn-id: trunk@7883 -
This commit is contained in:
parent
00692af0ed
commit
859081d346
@ -1,6 +1,5 @@
|
|||||||
{ This file was automatically created by Lazarus. Do not edit!
|
{ This file was automatically created by Lazarus. Do not edit!
|
||||||
This source is only used to compile and install
|
This source is only used to compile and install the package.
|
||||||
the package InterbaseLaz 1.0.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unit InterbaseLaz;
|
unit InterbaseLaz;
|
||||||
@ -18,5 +17,5 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterPackage('InterbaseLaz', @Register)
|
RegisterPackage('InterbaseLaz', @Register);
|
||||||
end.
|
end.
|
||||||
|
@ -40,7 +40,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, Controls, Dialogs, Graphics, ExtCtrls, Buttons,
|
Classes, SysUtils, LCLProc, Controls, Dialogs, Graphics, ExtCtrls, Buttons,
|
||||||
Menus, LResources, AVL_Tree,
|
Menus, LResources, AVL_Tree,
|
||||||
PropEdits, FormEditingIntf,
|
PropEdits, FormEditingIntf, LazIDEIntf,
|
||||||
{$IFDEF CustomIDEComps}
|
{$IFDEF CustomIDEComps}
|
||||||
CustomIDEComps,
|
CustomIDEComps,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -162,6 +162,7 @@ procedure TComponentPalette.PopupMenuPopup(Sender: TObject);
|
|||||||
var
|
var
|
||||||
PkgComponent: TPkgComponent;
|
PkgComponent: TPkgComponent;
|
||||||
APackage: TLazPackage;
|
APackage: TLazPackage;
|
||||||
|
UnitFilename: String;
|
||||||
begin
|
begin
|
||||||
PkgComponent:=TPkgComponent(FindButton(PopupMenu.PopupComponent));
|
PkgComponent:=TPkgComponent(FindButton(PopupMenu.PopupComponent));
|
||||||
APackage:=nil;
|
APackage:=nil;
|
||||||
@ -173,8 +174,13 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
OpenPackageMenuItem.Caption:='Open Package '+APackage.IDAsString;
|
OpenPackageMenuItem.Caption:='Open Package '+APackage.IDAsString;
|
||||||
OpenPackageMenuItem.Visible:=true;
|
OpenPackageMenuItem.Visible:=true;
|
||||||
OpenUnitMenuItem.Caption:='Open Unit '+PkgComponent.PkgFile.Filename;
|
UnitFilename:=PkgComponent.PkgFile.Filename;
|
||||||
|
if not FileExists(UnitFilename) then
|
||||||
|
UnitFilename:=LazarusIDE.FindSourceFile(ExtractFilename(UnitFilename),
|
||||||
|
APackage.Directory,[]);
|
||||||
|
OpenUnitMenuItem.Caption:='Open Unit '+UnitFilename;
|
||||||
OpenUnitMenuItem.Visible:=true;
|
OpenUnitMenuItem.Visible:=true;
|
||||||
|
OpenUnitMenuItem.Enabled:=FileExists(UnitFilename);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ uses
|
|||||||
Classes, SysUtils, Forms, Controls, Dialogs, Menus, FileUtil, LCLProc,
|
Classes, SysUtils, Forms, Controls, Dialogs, Menus, FileUtil, LCLProc,
|
||||||
Laz_XMLCfg,
|
Laz_XMLCfg,
|
||||||
SynEdit, CodeCache, CodeToolManager,
|
SynEdit, CodeCache, CodeToolManager,
|
||||||
MenuIntf, IDECommands,
|
MenuIntf, IDECommands, LazIDEIntf,
|
||||||
LazConf, DebugOptionsFrm,
|
LazConf, DebugOptionsFrm,
|
||||||
CompilerOptions, EditorOptions, EnvironmentOpts, KeyMapping, UnitEditor,
|
CompilerOptions, EditorOptions, EnvironmentOpts, KeyMapping, UnitEditor,
|
||||||
Project, IDEProcs, InputHistory, Debugger,
|
Project, IDEProcs, InputHistory, Debugger,
|
||||||
|
@ -117,14 +117,6 @@ type
|
|||||||
);
|
);
|
||||||
TCodeToolsFlags = set of TCodeToolsFlag;
|
TCodeToolsFlags = set of TCodeToolsFlag;
|
||||||
|
|
||||||
// find source flags
|
|
||||||
TFindSourceFlag = (
|
|
||||||
fsfSearchForProject,
|
|
||||||
fsfUseIncludePaths,
|
|
||||||
fsfUseDebugPath
|
|
||||||
);
|
|
||||||
TFindSourceFlags = set of TFindSourceFlag;
|
|
||||||
|
|
||||||
{ TMainIDEInterface }
|
{ TMainIDEInterface }
|
||||||
|
|
||||||
TMainIDEInterface = class(TLazIDEInterface)
|
TMainIDEInterface = class(TLazIDEInterface)
|
||||||
@ -145,9 +137,6 @@ type
|
|||||||
procedure HideIDE; virtual; abstract;
|
procedure HideIDE; virtual; abstract;
|
||||||
procedure UnhideIDE; virtual; abstract;
|
procedure UnhideIDE; virtual; abstract;
|
||||||
|
|
||||||
function FindUnitFile(const AFilename: string): string; virtual; abstract;
|
|
||||||
function FindSourceFile(const AFilename, BaseDirectory: string;
|
|
||||||
Flags: TFindSourceFlags): string; virtual; abstract;
|
|
||||||
procedure GetCurrentUnitInfo(var ActiveSourceEditor: TSourceEditorInterface;
|
procedure GetCurrentUnitInfo(var ActiveSourceEditor: TSourceEditorInterface;
|
||||||
var ActiveUnitInfo: TUnitInfo); virtual; abstract;
|
var ActiveUnitInfo: TUnitInfo); virtual; abstract;
|
||||||
procedure GetUnitInfoForDesigner(ADesigner: TIDesigner;
|
procedure GetUnitInfoForDesigner(ADesigner: TIDesigner;
|
||||||
|
@ -76,6 +76,14 @@ type
|
|||||||
);
|
);
|
||||||
TSearchIDEFileFlags = set of TSearchIDEFileFlag;
|
TSearchIDEFileFlags = set of TSearchIDEFileFlag;
|
||||||
|
|
||||||
|
// find source flags
|
||||||
|
TFindSourceFlag = (
|
||||||
|
fsfSearchForProject,
|
||||||
|
fsfUseIncludePaths,
|
||||||
|
fsfUseDebugPath
|
||||||
|
);
|
||||||
|
TFindSourceFlags = set of TFindSourceFlag;
|
||||||
|
|
||||||
{ TLazIDEInterface }
|
{ TLazIDEInterface }
|
||||||
|
|
||||||
TLazIDEInterface = class(TComponent)
|
TLazIDEInterface = class(TComponent)
|
||||||
@ -85,6 +93,10 @@ type
|
|||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
|
function FindUnitFile(const AFilename: string): string; virtual; abstract;
|
||||||
|
function FindSourceFile(const AFilename, BaseDirectory: string;
|
||||||
|
Flags: TFindSourceFlags): string; virtual; abstract;
|
||||||
|
|
||||||
function DoNewEditorFile(NewFileDescriptor: TProjectFileDescriptor;
|
function DoNewEditorFile(NewFileDescriptor: TProjectFileDescriptor;
|
||||||
NewFilename: string; const NewSource: string;
|
NewFilename: string; const NewSource: string;
|
||||||
NewFlags: TNewFlags): TModalResult;
|
NewFlags: TNewFlags): TModalResult;
|
||||||
|
Loading…
Reference in New Issue
Block a user