mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-28 14:01:39 +01:00
* forgotten in last commit :(
This commit is contained in:
parent
c3065106d5
commit
fa2ffb0242
@ -257,7 +257,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
W:=TryToOpenFile(nil,fn,0,Line);
|
W:=TryToOpenFile(nil,fn,0,Line,false);
|
||||||
if assigned(W) then
|
if assigned(W) then
|
||||||
begin
|
begin
|
||||||
W^.Editor^.SetHighlightRow(Line);
|
W^.Editor^.SetHighlightRow(Line);
|
||||||
@ -281,7 +281,7 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ should now be open }
|
{ should now be open }
|
||||||
W:=TryToOpenFile(nil,fn,0,Line);
|
W:=TryToOpenFile(nil,fn,0,Line,true);
|
||||||
W^.Editor^.SetHighlightRow(Line);
|
W^.Editor^.SetHighlightRow(Line);
|
||||||
W^.Editor^.TrackCursor(true);
|
W^.Editor^.TrackCursor(true);
|
||||||
if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
|
if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
|
||||||
@ -678,7 +678,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.17 1999-03-02 13:48:28 peter
|
Revision 1.18 1999-03-16 00:44:42 peter
|
||||||
|
* forgotten in last commit :(
|
||||||
|
|
||||||
|
Revision 1.17 1999/03/02 13:48:28 peter
|
||||||
* fixed far problem is fpdebug
|
* fixed far problem is fpdebug
|
||||||
* tile/cascading with message window
|
* tile/cascading with message window
|
||||||
* grep fixes
|
* grep fixes
|
||||||
|
|||||||
@ -366,7 +366,7 @@ begin
|
|||||||
Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
|
Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
|
||||||
Desktop^.Lock;
|
Desktop^.Lock;
|
||||||
P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
|
P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
|
||||||
W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y);
|
W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y,true);
|
||||||
if W<>nil then
|
if W<>nil then
|
||||||
begin
|
begin
|
||||||
BW:=LastBrowserWindow;
|
BW:=LastBrowserWindow;
|
||||||
@ -387,7 +387,7 @@ function TSymbolView.GotoReference(R: PReference): boolean;
|
|||||||
var W: PSourceWindow;
|
var W: PSourceWindow;
|
||||||
begin
|
begin
|
||||||
Desktop^.Lock;
|
Desktop^.Lock;
|
||||||
W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1);
|
W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
|
||||||
if W<>nil then W^.Select;
|
if W<>nil then W^.Select;
|
||||||
Desktop^.UnLock;
|
Desktop^.UnLock;
|
||||||
GotoReference:=W<>nil;
|
GotoReference:=W<>nil;
|
||||||
@ -911,11 +911,15 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.12 1999-03-01 15:42:02 peter
|
Revision 1.13 1999-03-16 00:44:44 peter
|
||||||
|
* forgotten in last commit :(
|
||||||
|
|
||||||
|
Revision 1.12 1999/03/01 15:42:02 peter
|
||||||
+ Added dummy entries for functions not yet implemented
|
+ Added dummy entries for functions not yet implemented
|
||||||
* MenuBar didn't update itself automatically on command-set changes
|
* MenuBar didn't update itself automatically on command-set changes
|
||||||
* Fixed Debugging/Profiling options dialog
|
* Fixed Debugging/Profiling options dialog
|
||||||
* TCodeEditor converts spaces to tabs at save only if efUseTabChars is
set
|
* TCodeEditor converts spaces to tabs at save only if efUseTabChars is
|
||||||
|
set
|
||||||
* efBackSpaceUnindents works correctly
|
* efBackSpaceUnindents works correctly
|
||||||
+ 'Messages' window implemented
|
+ 'Messages' window implemented
|
||||||
+ Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
|
+ Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
|
||||||
|
|||||||
@ -296,7 +296,7 @@ procedure TranslateMouseClick(View: PView; var Event: TEvent);
|
|||||||
|
|
||||||
function GetNextEditorBounds(var Bounds: TRect): boolean;
|
function GetNextEditorBounds(var Bounds: TRect): boolean;
|
||||||
function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
|
function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
|
||||||
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
|
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
|
||||||
|
|
||||||
function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
|
function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
|
||||||
|
|
||||||
@ -1286,7 +1286,7 @@ begin
|
|||||||
W^.Editor^.SetCurPtr(Col,Row);
|
W^.Editor^.SetCurPtr(Col,Row);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
W:=TryToOpenFile(@R,P^.GetModuleName,Col,Row);
|
W:=TryToOpenFile(@R,P^.GetModuleName,Col,Row,true);
|
||||||
if W<>nil then
|
if W<>nil then
|
||||||
begin
|
begin
|
||||||
W^.Select;
|
W^.Select;
|
||||||
@ -1310,7 +1310,7 @@ begin
|
|||||||
Desktop^.Lock;
|
Desktop^.Lock;
|
||||||
if P^.Row>0 then Row:=P^.Row-1 else Row:=0;
|
if P^.Row>0 then Row:=P^.Row-1 else Row:=0;
|
||||||
if P^.Col>0 then Col:=P^.Col-1 else Col:=0;
|
if P^.Col>0 then Col:=P^.Col-1 else Col:=0;
|
||||||
W:=TryToOpenFile(nil,P^.GetModuleName,Col,Row);
|
W:=TryToOpenFile(nil,P^.GetModuleName,Col,Row,true);
|
||||||
Message(Owner,evCommand,cmClose,nil);
|
Message(Owner,evCommand,cmClose,nil);
|
||||||
Desktop^.UnLock;
|
Desktop^.UnLock;
|
||||||
end;
|
end;
|
||||||
@ -2055,84 +2055,98 @@ begin
|
|||||||
OpenEditorWindow:=W;
|
OpenEditorWindow:=W;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
|
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
|
||||||
var D : DirStr;
|
var D : DirStr;
|
||||||
N : NameStr;
|
N : NameStr;
|
||||||
E : ExtStr;
|
E : ExtStr;
|
||||||
DrStr : String;
|
DrStr : String;
|
||||||
|
|
||||||
function CheckDir(NewDir: DirStr; NewName: NameStr; NewExt: ExtStr): boolean;
|
function CheckDir(NewDir: DirStr; NewName: NameStr; NewExt: ExtStr): boolean;
|
||||||
var OK: boolean;
|
var OK: boolean;
|
||||||
begin
|
|
||||||
NewDir:=CompleteDir(NewDir);
|
|
||||||
OK:=ExistsFile(NewDir+NewName+NewExt);
|
|
||||||
if OK then begin D:=NewDir; N:=NewName; E:=NewExt; end;
|
|
||||||
CheckDir:=OK;
|
|
||||||
end;
|
|
||||||
function CheckExt(NewExt: ExtStr): boolean;
|
|
||||||
var OK: boolean;
|
|
||||||
begin
|
|
||||||
OK:=false;
|
|
||||||
if D<>'' then OK:=CheckDir(D,N,NewExt) else
|
|
||||||
if CheckDir('.'+DirSep,N,NewExt) then OK:=true;
|
|
||||||
CheckExt:=OK;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TryToOpen(const DD : dirstr): PSourceWindow;
|
|
||||||
var Found: boolean;
|
|
||||||
W : PSourceWindow;
|
|
||||||
begin
|
|
||||||
D:=CompleteDir(DD);
|
|
||||||
Found:=true;
|
|
||||||
if E<>'' then Found:=CheckExt(E) else
|
|
||||||
if CheckExt('.pp') then Found:=true else
|
|
||||||
if CheckExt('.pas') then Found:=true else
|
|
||||||
if CheckExt('.inc')=false then
|
|
||||||
Found:=false;
|
|
||||||
if Found=false then W:=nil else
|
|
||||||
begin
|
|
||||||
FileName:=FExpand(D+N+E);
|
|
||||||
W:=OpenEditorWindow(Bounds,FileName,CurX,CurY);
|
|
||||||
end;
|
|
||||||
TryToOpen:=W;
|
|
||||||
end;
|
|
||||||
function SearchOnDesktop: PSourceWindow;
|
|
||||||
var W: PWindow;
|
|
||||||
I: integer;
|
|
||||||
Found: boolean;
|
|
||||||
SName : string;
|
|
||||||
begin
|
|
||||||
for I:=1 to 100 do
|
|
||||||
begin
|
begin
|
||||||
W:=SearchWindowWithNo(I);
|
NewDir:=CompleteDir(NewDir);
|
||||||
if (W<>nil) and (W^.HelpCtx=hcSourceWindow) then
|
OK:=ExistsFile(NewDir+NewName+NewExt);
|
||||||
begin
|
if OK then begin D:=NewDir; N:=NewName; E:=NewExt; end;
|
||||||
if (D='') then
|
CheckDir:=OK;
|
||||||
SName:=NameAndExtOf(PSourceWindow(W)^.Editor^.FileName)
|
|
||||||
else
|
|
||||||
SName:=PSourceWindow(W)^.Editor^.FileName;
|
|
||||||
SName:=UpcaseStr(SName);
|
|
||||||
|
|
||||||
if E<>'' then
|
|
||||||
begin
|
|
||||||
if D<>'' then
|
|
||||||
Found:=SName=UpcaseStr(D+N+E)
|
|
||||||
else
|
|
||||||
Found:=SName=UpcaseStr(N+E);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
Found:=SName=UpcaseStr(N+'.pp');
|
|
||||||
if Found=false then
|
|
||||||
Found:=SName=UpcaseStr(N+'.pas');
|
|
||||||
end;
|
|
||||||
if Found then Break;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
if Found=false then W:=nil;
|
|
||||||
SearchOnDesktop:=PSourceWindow(W);
|
function CheckExt(NewExt: ExtStr): boolean;
|
||||||
end;
|
var OK: boolean;
|
||||||
var W: PSourceWindow;
|
begin
|
||||||
|
OK:=false;
|
||||||
|
if D<>'' then OK:=CheckDir(D,N,NewExt) else
|
||||||
|
if CheckDir('.'+DirSep,N,NewExt) then OK:=true;
|
||||||
|
CheckExt:=OK;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TryToOpen(const DD : dirstr): PSourceWindow;
|
||||||
|
var Found: boolean;
|
||||||
|
W : PSourceWindow;
|
||||||
|
begin
|
||||||
|
D:=CompleteDir(DD);
|
||||||
|
Found:=true;
|
||||||
|
if (E<>'') or (not tryexts) then
|
||||||
|
Found:=CheckExt(E)
|
||||||
|
else
|
||||||
|
if CheckExt('.pp') then
|
||||||
|
Found:=true
|
||||||
|
else
|
||||||
|
if CheckExt('.pas') then
|
||||||
|
Found:=true
|
||||||
|
else
|
||||||
|
if CheckExt('.inc') then
|
||||||
|
Found:=true
|
||||||
|
else
|
||||||
|
Found:=false;
|
||||||
|
if Found=false then
|
||||||
|
W:=nil
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
FileName:=FExpand(D+N+E);
|
||||||
|
W:=OpenEditorWindow(Bounds,FileName,CurX,CurY);
|
||||||
|
end;
|
||||||
|
TryToOpen:=W;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function SearchOnDesktop: PSourceWindow;
|
||||||
|
var W: PWindow;
|
||||||
|
I: integer;
|
||||||
|
Found: boolean;
|
||||||
|
SName : string;
|
||||||
|
begin
|
||||||
|
for I:=1 to 100 do
|
||||||
|
begin
|
||||||
|
W:=SearchWindowWithNo(I);
|
||||||
|
if (W<>nil) and (W^.HelpCtx=hcSourceWindow) then
|
||||||
|
begin
|
||||||
|
if (D='') then
|
||||||
|
SName:=NameAndExtOf(PSourceWindow(W)^.Editor^.FileName)
|
||||||
|
else
|
||||||
|
SName:=PSourceWindow(W)^.Editor^.FileName;
|
||||||
|
SName:=UpcaseStr(SName);
|
||||||
|
|
||||||
|
if E<>'' then
|
||||||
|
begin
|
||||||
|
if D<>'' then
|
||||||
|
Found:=SName=UpcaseStr(D+N+E)
|
||||||
|
else
|
||||||
|
Found:=SName=UpcaseStr(N+E);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Found:=SName=UpcaseStr(N+'.pp');
|
||||||
|
if Found=false then
|
||||||
|
Found:=SName=UpcaseStr(N+'.pas');
|
||||||
|
end;
|
||||||
|
if Found then Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Found=false then W:=nil;
|
||||||
|
SearchOnDesktop:=PSourceWindow(W);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
W : PSourceWindow;
|
||||||
begin
|
begin
|
||||||
FSplit(FileName,D,N,E);
|
FSplit(FileName,D,N,E);
|
||||||
W:=SearchOnDesktop;
|
W:=SearchOnDesktop;
|
||||||
@ -2406,7 +2420,10 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.21 1999-03-08 14:58:16 peter
|
Revision 1.22 1999-03-16 00:44:45 peter
|
||||||
|
* forgotten in last commit :(
|
||||||
|
|
||||||
|
Revision 1.21 1999/03/08 14:58:16 peter
|
||||||
+ prompt with dialogs for tools
|
+ prompt with dialogs for tools
|
||||||
|
|
||||||
Revision 1.20 1999/03/01 15:42:08 peter
|
Revision 1.20 1999/03/01 15:42:08 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user