mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-25 18:16:50 +02:00
IDE: src edit hint: jump to source, windows path delims
git-svn-id: trunk@31188 -
This commit is contained in:
parent
78bb459fc6
commit
1f232dc9cd
@ -74,9 +74,13 @@ type
|
|||||||
{ TLazIPHTMLManager }
|
{ TLazIPHTMLManager }
|
||||||
|
|
||||||
TLazIPHTMLManager = class
|
TLazIPHTMLManager = class
|
||||||
|
private
|
||||||
|
fWaitingForAsync: boolean;
|
||||||
|
procedure OpenNextURL(Data: PtrInt); // called via Application.QueueAsyncCall
|
||||||
public
|
public
|
||||||
NextURL: string;
|
NextURL: string;
|
||||||
procedure OpenNextURL(Data: PtrInt); // called via Application.QueueAsyncCall
|
procedure AsyncOpenURL(URL: string);
|
||||||
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -110,6 +114,15 @@ end;
|
|||||||
|
|
||||||
{ TLazIPHTMLManager }
|
{ TLazIPHTMLManager }
|
||||||
|
|
||||||
|
procedure TLazIPHTMLManager.AsyncOpenURL(URL: string);
|
||||||
|
begin
|
||||||
|
NextURL:=URL;
|
||||||
|
if not fWaitingForAsync then begin
|
||||||
|
Application.QueueAsyncCall(@OpenNextURL,0);
|
||||||
|
fWaitingForAsync:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLazIPHTMLManager.OpenNextURL(Data: PtrInt);
|
procedure TLazIPHTMLManager.OpenNextURL(Data: PtrInt);
|
||||||
var
|
var
|
||||||
URLScheme: string;
|
URLScheme: string;
|
||||||
@ -128,10 +141,18 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
AFilename:=URLPath;
|
AFilename:=URLPath;
|
||||||
end;
|
end;
|
||||||
|
AFilename:=SetDirSeparators(AFilename);
|
||||||
LazarusIDE.DoOpenFileAndJumpToPos(AFilename,p,-1,-1,-1,[]);
|
LazarusIDE.DoOpenFileAndJumpToPos(AFilename,p,-1,-1,-1,[]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TLazIPHTMLManager.Destroy;
|
||||||
|
begin
|
||||||
|
if (Application<>nil) and fWaitingForAsync then
|
||||||
|
Application.RemoveAsyncCalls(Self);
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TLazIpHtmlDataProvider }
|
{ TLazIpHtmlDataProvider }
|
||||||
|
|
||||||
function TLazIpHtmlDataProvider.DoGetStream(const URL: string): TStream;
|
function TLazIpHtmlDataProvider.DoGetStream(const URL: string): TStream;
|
||||||
@ -244,8 +265,7 @@ begin
|
|||||||
// This will close the hint, so the open must be done outside the current event
|
// This will close the hint, so the open must be done outside the current event
|
||||||
if LazIPHTMLManager=nil then
|
if LazIPHTMLManager=nil then
|
||||||
LazIPHTMLManager:=TLazIPHTMLManager.Create;
|
LazIPHTMLManager:=TLazIPHTMLManager.Create;
|
||||||
LazIPHTMLManager.NextURL:=HRef;
|
LazIPHTMLManager.AsyncOpenURL(HRef);
|
||||||
Application.QueueAsyncCall(@LazIPHTMLManager.OpenNextURL,0);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user