mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:19:27 +02:00
IDE: source editor popup menu: open fpdoc file of unit
git-svn-id: trunk@34841 -
This commit is contained in:
parent
9c60f59d00
commit
9238bba3a6
@ -214,6 +214,8 @@ type
|
|||||||
const Filename: string): TPascalHelpContextList; override;
|
const Filename: string): TPascalHelpContextList; override;
|
||||||
function ConvertCodePosToPascalHelpContext(
|
function ConvertCodePosToPascalHelpContext(
|
||||||
ACodePos: PCodeXYPosition): TPascalHelpContextList;
|
ACodePos: PCodeXYPosition): TPascalHelpContextList;
|
||||||
|
function GetFPDocFilenameForSource(SrcFilename: string;
|
||||||
|
ResolveIncludeFiles: Boolean; out AnOwner: TObject): string; override;
|
||||||
public
|
public
|
||||||
property FCLHelpDB: THelpDatabase read FFCLHelpDB;
|
property FCLHelpDB: THelpDatabase read FFCLHelpDB;
|
||||||
property FCLHelpDBPath: THelpBaseURLObject read FFCLHelpDBPath;
|
property FCLHelpDBPath: THelpBaseURLObject read FFCLHelpDBPath;
|
||||||
@ -1504,6 +1506,15 @@ begin
|
|||||||
AddContextsBackwards(TCodeTool(Tool),Node);
|
AddContextsBackwards(TCodeTool(Tool),Node);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TIDEHelpManager.GetFPDocFilenameForSource(SrcFilename: string;
|
||||||
|
ResolveIncludeFiles: Boolean; out AnOwner: TObject): string;
|
||||||
|
var
|
||||||
|
CacheWasUsed: boolean;
|
||||||
|
begin
|
||||||
|
Result:=CodeHelpBoss.GetFPDocFilenameForSource(SrcFilename,ResolveIncludeFiles,
|
||||||
|
CacheWasUsed,AnOwner);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
procedure TIDEHelpManager.ShowHelpForMessage(Line: integer);
|
||||||
|
|
||||||
function ParseMessage(MsgItem: TIDEMessageLine): TStringList;
|
function ParseMessage(MsgItem: TIDEMessageLine): TStringList;
|
||||||
|
@ -5344,6 +5344,8 @@ var
|
|||||||
CurWordAtCursor: String;
|
CurWordAtCursor: String;
|
||||||
AtIdentifier: Boolean;
|
AtIdentifier: Boolean;
|
||||||
MainCodeBuf: TCodeBuffer;
|
MainCodeBuf: TCodeBuffer;
|
||||||
|
AnOwner: TObject;
|
||||||
|
FPDocSrc: String;
|
||||||
begin
|
begin
|
||||||
SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
|
SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
|
||||||
SourceEditorMenuRoot.BeginUpdate;
|
SourceEditorMenuRoot.BeginUpdate;
|
||||||
@ -5450,11 +5452,11 @@ begin
|
|||||||
if (MainCodeBuf<>nil) and (MainCodeBuf<>ASrcEdit.CodeBuffer)
|
if (MainCodeBuf<>nil) and (MainCodeBuf<>ASrcEdit.CodeBuffer)
|
||||||
and (not MainCodeBuf.IsVirtual) then begin
|
and (not MainCodeBuf.IsVirtual) then begin
|
||||||
// this is an include file => add link to open unit
|
// this is an include file => add link to open unit
|
||||||
AddContextPopupMenuItem(
|
|
||||||
Format(lisOpenLfm,[CreateRelativePath(MainCodeBuf.Filename,ASrcEdit.Filename)]),
|
|
||||||
true,@OnPopupMenuOpenFile);
|
|
||||||
CurFilename:=MainCodeBuf.Filename;
|
CurFilename:=MainCodeBuf.Filename;
|
||||||
ShortFileName:=ExtractFileName(CurFilename);
|
ShortFileName:=ExtractFileName(CurFilename);
|
||||||
|
AddContextPopupMenuItem(
|
||||||
|
Format(lisOpenLfm,[CreateRelativePath(CurFilename,ASrcEdit.Filename)]),
|
||||||
|
true,@OnPopupMenuOpenFile);
|
||||||
end;
|
end;
|
||||||
if FilenameIsPascalUnit(ShortFileName) then begin
|
if FilenameIsPascalUnit(ShortFileName) then begin
|
||||||
MaybeAddPopup('.lfm');
|
MaybeAddPopup('.lfm');
|
||||||
@ -5471,6 +5473,10 @@ begin
|
|||||||
if (CompareFileExt(ShortFileName,'.lpi',true)=0)
|
if (CompareFileExt(ShortFileName,'.lpi',true)=0)
|
||||||
or (CompareFileExt(ShortFileName,'.lpk',true)=0) then
|
or (CompareFileExt(ShortFileName,'.lpk',true)=0) then
|
||||||
AddContextPopupMenuItem(Format(lisOpenLfm,[ShortFileName]),true,@OnPopupMenuOpenFile);
|
AddContextPopupMenuItem(Format(lisOpenLfm,[ShortFileName]),true,@OnPopupMenuOpenFile);
|
||||||
|
FPDocSrc:=LazarusHelp.GetFPDocFilenameForSource(CurFilename,false,AnOwner);
|
||||||
|
if FPDocSrc<>'' then
|
||||||
|
AddContextPopupMenuItem(Format(lisOpenLfm,[CreateRelativePath(FPDocSrc,CurFilename)]),
|
||||||
|
true,@OnPopupMenuOpenFile);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFnDEF SingleSrcWindow}
|
{$IFnDEF SingleSrcWindow}
|
||||||
|
@ -78,6 +78,12 @@ type
|
|||||||
|
|
||||||
function ConvertSourcePosToPascalHelpContext(const CaretPos: TPoint;
|
function ConvertSourcePosToPascalHelpContext(const CaretPos: TPoint;
|
||||||
const Filename: string): TPascalHelpContextList; virtual; abstract;
|
const Filename: string): TPascalHelpContextList; virtual; abstract;
|
||||||
|
|
||||||
|
// fpdoc
|
||||||
|
function GetFPDocFilenameForSource(SrcFilename: string;
|
||||||
|
ResolveIncludeFiles: Boolean;
|
||||||
|
out AnOwner: TObject// a package or a project or LazarusHelp or nil for user defined
|
||||||
|
): string; virtual; abstract;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user