* first big merge from fixes branch

This commit is contained in:
pierre 2000-08-22 09:41:38 +00:00
parent f1bd579bf4
commit 738c8f905d
25 changed files with 1290 additions and 175 deletions

View File

@ -1,5 +1,5 @@
# #
# Makefile generated by fpcmake v1.00 [2000/07/31] # Makefile generated by fpcmake v1.00 [2000/08/22]
# #
defaultrule: all defaultrule: all
@ -1048,7 +1048,7 @@ ifdef INSTALLPPUFILES
ifdef PPUFILES ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES)) INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES))) INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif endif
endif endif
@ -1213,7 +1213,7 @@ ifdef CLEANPPUFILES
ifdef PPUFILES ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES)) CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES))) CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif endif
endif endif

View File

@ -1,3 +1,36 @@
Gabor's log to 10/8/2000 commits
========================= Already fixed ================================
[*] 'Auto save editor files' option did the opposite than expected, due
to a typo in FPIDE.PAS
========================= Improvements ================================
[+] saving of source files before compilation is no longer neccessary.
When a modified editor file is involved in the compilation, then the
IDE saves it's contents to a memory stream and passes this to the
compiler (instead of the file on the disk)
Gabor's log to 19/7/2000 commits
========================= Improvements ================================
[+] the .ini parser now handles string delimiters more flexible
(you can now include quotation-marks in an entry value if you use no
delimiters at all, or if you use aphostrophes as delimiters)
[+] new .TDF view type added: MEMO.
Memos can have an additional property, "FileName". After closing the
toolparams dialog box the contents of the memo are saved in a file,
and the reference to the memo field in the tool command-line is
replaced with the name of this file. (If no filename is specified the
file is stored under a unique name in the temp dir.)
Gabor's log to 18/7/2000 commits
========================= Already fixed ================================
[*] pressing Enter on the last line (eg. appending a line) in the editor
didn't scroll the editor window
[*] the IDE switches now correctly back to the last video mode at startup
Gabors's log to 26/6/2000 commits Gabors's log to 26/6/2000 commits
========================= Already fixed ================================ ========================= Already fixed ================================

View File

@ -39,7 +39,7 @@ uses
{$ifdef EDITORS}Editors{$else}WEditor,WCEdit{$endif}, {$ifdef EDITORS}Editors{$else}WEditor,WCEdit{$endif},
ASCIITab,Calc, ASCIITab,Calc,
WUtils,WViews,WHTMLScn, WUtils,WViews,WHTMLScn,
FPIDE,FPCalc,FPCompile, FPIDE,FPCalc,FPCompil,
FPIni,FPViews,FPConst,FPVars,FPUtils,FPHelp,FPSwitch,FPUsrScr, FPIni,FPViews,FPConst,FPVars,FPUtils,FPHelp,FPSwitch,FPUsrScr,
FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk, FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk,
FPCodTmp,FPCodCmp; FPCodTmp,FPCodCmp;
@ -212,8 +212,9 @@ BEGIN
InitCodeTemplates; InitCodeTemplates;
InitCodeComplete; InitCodeComplete;
ReadSwitches(SwitchesPath);
IDEApp.Init; IDEApp.Init;
CheckINIFile;
ReadSwitches(SwitchesPath);
{ load all options after init because of open files } { load all options after init because of open files }
ReadINIFile; ReadINIFile;
InitDesktopFile; InitDesktopFile;
@ -270,7 +271,19 @@ BEGIN
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.2 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.1 2000/07/18 05:50:22 michael
+ Merged Gabors fixes
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.47 2000/06/16 08:50:40 pierre Revision 1.47 2000/06/16 08:50:40 pierre

View File

@ -14,7 +14,7 @@
**********************************************************************} **********************************************************************}
{$i globdir.inc} {$i globdir.inc}
unit FPCompile; unit FPCompil;
interface interface
@ -27,8 +27,9 @@ interface
uses uses
Objects, Objects,
files,
Drivers,Views,Dialogs, Drivers,Views,Dialogs,
WUtils,WViews, WUtils,WViews,WCEdit,
FPSymbol, FPSymbol,
FPViews; FPViews;
@ -59,6 +60,8 @@ type
procedure ClearMessages; procedure ClearMessages;
constructor Load(var S: TStream); constructor Load(var S: TStream);
procedure Store(var S: TStream); procedure Store(var S: TStream);
procedure SetState(AState: Word; Enable: Boolean); virtual;
procedure UpdateCommands; virtual;
private private
{CompileShowed : boolean;} {CompileShowed : boolean;}
{Mode : TCompileMode;} {Mode : TCompileMode;}
@ -75,6 +78,20 @@ type
procedure Update; procedure Update;
end; end;
PFPInputFile = ^TFPInputFile;
TFPInputFile = object(tinputfile)
constructor Init(AEditor: PFileEditor);
{$ifdef FPC}protected{$else}public{$endif}
function fileopen(const filename: string): boolean; virtual;
function fileseek(pos: longint): boolean; virtual;
function fileread(var databuf; maxsize: longint): longint; virtual;
function fileeof: boolean; virtual;
function fileclose: boolean; virtual;
private
Editor: PFileEditor;
S: PStream;
end;
const const
CompilerMessageWindow : PCompilerMessageWindow = nil; CompilerMessageWindow : PCompilerMessageWindow = nil;
CompilerStatusDialog : PCompilerStatusDialog = nil; CompilerStatusDialog : PCompilerStatusDialog = nil;
@ -404,6 +421,22 @@ begin
PutSubViewPtr(S,MsgLB); PutSubViewPtr(S,MsgLB);
end; end;
procedure TCompilerMessageWindow.UpdateCommands;
var Active: boolean;
begin
Active:=GetState(sfActive);
SetCmdState(CompileCmds,Active);
Message(Application,evBroadcast,cmCommandSetChanged,nil);
end;
procedure TCompilerMessageWindow.SetState(AState: Word; Enable: Boolean);
var OldState: word;
begin
OldState:=State;
inherited SetState(AState,Enable);
if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
UpdateCommands;
end;
destructor TCompilerMessageWindow.Done; destructor TCompilerMessageWindow.Done;
begin begin
@ -543,6 +576,29 @@ procedure CompilerStop; {$ifndef FPC}far;{$endif}
begin begin
end; end;
Function CompilerGetNamedFileTime(const filename : string) : Longint; {$ifndef FPC}far;{$endif}
var t: longint;
W: PSourceWindow;
begin
W:=EditorWindowFile(FExpand(filename));
if Assigned(W) and (W^.Editor^.GetModified) then
t:=Now
else
t:=def_getnamedfiletime(filename);
CompilerGetNamedFileTime:=t;
end;
function CompilerOpenInputFile(const filename: string): pinputfile; {$ifndef FPC}far;{$endif}
var f: pinputfile;
W: PSourceWindow;
begin
W:=EditorWindowFile(FExpand(filename));
if Assigned(W) and (W^.Editor^.GetModified) then
f:=new(PFPInputFile, Init(W^.Editor))
else
f:=def_openinputfile(filename);
CompilerOpenInputFile:=f;
end;
function CompilerComment(Level:Longint; const s:string):boolean; {$ifndef FPC}far;{$endif} function CompilerComment(Level:Longint; const s:string):boolean; {$ifndef FPC}far;{$endif}
begin begin
@ -616,9 +672,9 @@ begin
FileName:=PrimaryFileMain FileName:=PrimaryFileMain
else else
begin begin
if P^.Editor^.GetModified and (not P^.Editor^.Save) then (* if P^.Editor^.GetModified and (not P^.Editor^.Save) then
FileName:='*' { file not saved } FileName:='*' { file not saved }
else else*) { no longer needed - Gabor }
FileName:=P^.Editor^.FileName; FileName:=P^.Editor^.FileName;
end; end;
end; end;
@ -693,10 +749,14 @@ begin
do_status:=CompilerStatus; do_status:=CompilerStatus;
do_stop:=CompilerStop; do_stop:=CompilerStop;
do_comment:=CompilerComment; do_comment:=CompilerComment;
do_openinputfile:=CompilerOpenInputFile;
do_getnamedfiletime:=CompilerGetNamedFileTime;
{$else not TP} {$else not TP}
do_status:=@CompilerStatus; do_status:=@CompilerStatus;
do_stop:=@CompilerStop; do_stop:=@CompilerStop;
do_comment:=@CompilerComment; do_comment:=@CompilerComment;
do_openinputfile:=@CompilerOpenInputFile;
do_getnamedfiletime:=@CompilerGetNamedFileTime;
{$endif TP} {$endif TP}
do_initsymbolinfo:=InitBrowserCol; do_initsymbolinfo:=InitBrowserCol;
do_donesymbolinfo:=DoneBrowserCol; do_donesymbolinfo:=DoneBrowserCol;
@ -755,23 +815,31 @@ begin
Inc(status.errorCount); Inc(status.errorCount);
ClearFormatParams; AddFormatParamStr(ExeFile); ClearFormatParams; AddFormatParamStr(ExeFile);
CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0); CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0);
{$I-}
Assign(ErrFile,FPErrFileName); Assign(ErrFile,FPErrFileName);
Reset(ErrFile); Reset(ErrFile);
LinkErrorCount:=0; if EatIO<>0 then
While not eof(ErrFile) and (LinkErrorCount<25) do ErrorBox(FormatStrStr(msg_cantopenfile,FPErrFileName),nil)
begin else
readln(ErrFile,s);
CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
inc(LinkErrorCount);
end;
if not eof(ErrFile) then
begin begin
ClearFormatParams; AddFormatParamStr(FPErrFileName); LinkErrorCount:=0;
CompilerMessageWindow^.AddMessage(V_error, While not eof(ErrFile) and (LinkErrorCount<25) do
FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0); begin
end; readln(ErrFile,s);
CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
inc(LinkErrorCount);
end;
if not eof(ErrFile) then
begin
ClearFormatParams; AddFormatParamStr(FPErrFileName);
CompilerMessageWindow^.AddMessage(V_error,
FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0);
end;
Close(ErrFile); Close(ErrFile);
end;
EatIO;
{$I+}
end; end;
end; end;
{$ifdef TEMPHEAP} {$ifdef TEMPHEAP}
@ -899,6 +967,78 @@ begin
NeedRecompile:=Need; NeedRecompile:=Need;
end; end;
constructor TFPInputFile.Init(AEditor: PFileEditor);
begin
if not Assigned(AEditor) then Fail;
if inherited Init(AEditor^.FileName)=false then
Fail;
Editor:=AEditor;
end;
function TFPInputFile.fileopen(const filename: string): boolean;
var OK: boolean;
begin
S:=New(PMemoryStream, Init(0,0));
OK:=Assigned(S) and (S^.Status=stOK);
if OK then OK:=Editor^.SaveToStream(S);
if OK then
S^.Seek(0)
else
begin
if Assigned(S) then Dispose(S, Done);
S:=nil;
end;
fileopen:=OK;
end;
function TFPInputFile.fileseek(pos: longint): boolean;
var OK: boolean;
begin
OK:=assigned(S);
if OK then
begin
S^.Reset;
S^.Seek(pos);
OK:=(S^.Status=stOK);
end;
fileseek:=OK;
end;
function TFPInputFile.fileread(var databuf; maxsize: longint): longint;
var
size: longint;
begin
if not assigned(S) then size:=0 else
begin
size:=min(maxsize,(S^.GetSize-S^.GetPos));
S^.Read(databuf,size);
if S^.Status<>stOK then size:=0;
end;
fileread:=size;
end;
function TFPInputFile.fileeof: boolean;
var EOF: boolean;
begin
EOF:=not assigned(S);
if not EOF then
EOF:=(S^.Status<>stOK) or (S^.GetPos=S^.GetSize);
fileeof:=EOF;
end;
function TFPInputFile.fileclose: boolean;
var OK: boolean;
begin
OK:=assigned(S);
if OK then
begin
S^.Reset;
Dispose(S, Done);
OK:=true;
end;
fileclose:=OK;
end;
procedure RegisterFPCompile; procedure RegisterFPCompile;
begin begin
{$ifndef NOOBJREG} {$ifndef NOOBJREG}
@ -911,7 +1051,38 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.4 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.3 2000/08/15 03:40:53 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1.2.2 2000/08/10 07:10:37 michael
* 'Auto save editor files' option did the opposite than expected, due
to a typo in FPIDE.PAS
+ saving of source files before compilation is no longer neccessary.
When a modified editor file is involved in the compilation, then the
IDE saves it's contents to a memory stream and passes this to the
compiler (instead of the file on the disk)
Revision 1.1.2.1 2000/07/18 05:50:22 michael
+ Merged Gabors fixes
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.60 2000/06/22 09:07:11 pierre Revision 1.60 2000/06/22 09:07:11 pierre

View File

@ -21,7 +21,7 @@ uses Views,App,Commands,
WViews,WEditor; WViews,WEditor;
const const
VersionStr = '0.9'; VersionStr = '0.9.1';
MaxRecentFileCount = 5; MaxRecentFileCount = 5;
MaxToolCount = 16; MaxToolCount = 16;
@ -31,6 +31,7 @@ const
CompilerStatusUpdateDelay = 0.8; { in secs } CompilerStatusUpdateDelay = 0.8; { in secs }
ININame = 'fp.ini'; ININame = 'fp.ini';
DirInfoName = 'fp.dir';
SwitchesName = 'fp.cfg'; SwitchesName = 'fp.cfg';
DesktopName = 'fp.dsk'; DesktopName = 'fp.dsk';
BrowserName = 'fp.brw'; BrowserName = 'fp.brw';
@ -407,7 +408,19 @@ implementation
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.2 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.1 2000/07/15 20:54:42 pierre
* Version increased to 0.9.1
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.42 2000/06/26 07:29:22 pierre Revision 1.42 2000/06/26 07:29:22 pierre

View File

@ -349,7 +349,7 @@ uses
{$endif win32} {$endif win32}
Systems, Systems,
FPString,FPVars,FPUtils,FPConst,FPSwitch, FPString,FPVars,FPUtils,FPConst,FPSwitch,
FPIntf,FPCompile,FPIde,FPHelp, FPIntf,FPCompil,FPIde,FPHelp,
Validate,WEditor,WUtils; Validate,WEditor,WUtils;
const const
@ -3346,7 +3346,13 @@ end.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.1 2000/07/18 05:50:22 michael
+ Merged Gabors fixes
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.63 2000/06/22 09:07:11 pierre Revision 1.63 2000/06/22 09:07:11 pierre

View File

@ -46,7 +46,7 @@ implementation
uses Dos, uses Dos,
Objects,Drivers,Video, Objects,Drivers,Video,
Views,App,HistList,BrowCol, Views,App,HistList,BrowCol,
WResourc,WViews,WEditor, WUtils,WResourc,WViews,WEditor,
{$ifndef NODEBUG} {$ifndef NODEBUG}
fpdebug, fpdebug,
{$endif ndef NODEBUG} {$endif ndef NODEBUG}
@ -795,7 +795,13 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.1 2000/07/20 11:02:15 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.29 2000/06/22 09:07:12 pierre Revision 1.29 2000/06/22 09:07:12 pierre

View File

@ -383,7 +383,7 @@ procedure HelpTopicSearch(Editor: PEditor);
var S: string; var S: string;
begin begin
if Editor=nil then S:='' else if Editor=nil then S:='' else
S:=GetEditorCurWord(Editor); S:=GetEditorCurWord(Editor,[]);
HelpTopic(S); HelpTopic(S);
end; end;
@ -518,7 +518,21 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.1 2000/08/15 03:40:53 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.35 2000/06/26 07:29:23 pierre Revision 1.35 2000/06/26 07:29:23 pierre

View File

@ -119,6 +119,8 @@ type
procedure HelpUsingHelp; procedure HelpUsingHelp;
procedure HelpFiles; procedure HelpFiles;
procedure About; procedure About;
public
procedure SourceWindowClosed;
private private
SaveCancelled: boolean; SaveCancelled: boolean;
InsideDone : boolean; InsideDone : boolean;
@ -156,7 +158,7 @@ uses
Dos,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx, Dos,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx,
Systems, Systems,
WUtils,WHlpView,WViews, WUtils,WHlpView,WViews,
FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp, FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp,
FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir, FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
FPDesk,FPCodCmp,FPCodTmp; FPDesk,FPCodCmp,FPCodTmp;
@ -241,6 +243,7 @@ begin
{$endif TP} {$endif TP}
{$endif} {$endif}
inherited Init; inherited Init;
InitAdvMsgBox;
InsideDone:=false; InsideDone:=false;
MenuBar^.GetBounds(R); R.A.X:=R.B.X-8; MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
New(ClockView, Init(R)); New(ClockView, Init(R));
@ -561,7 +564,7 @@ begin
if (OpenFileName<>'') and if (OpenFileName<>'') and
((DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0)) then ((DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0)) then
begin begin
TempS:=LocateFile(OpenFileName); TempS:=LocateSourceFile(OpenFileName,false);
if TempS='' then if TempS='' then
ForceDlg:=true ForceDlg:=true
else else
@ -718,6 +721,11 @@ end;
procedure TIDEApp.ShowUserScreen; procedure TIDEApp.ShowUserScreen;
begin begin
{$ifdef linux}
{ We need to get the IDE screen's contents from the API's video buffer (JM) }
if assigned(userscreen) then
userscreen^.capture;
{$endif linux}
DoneSysError; DoneSysError;
DoneEvents; DoneEvents;
DoneKeyboard; DoneKeyboard;
@ -737,9 +745,11 @@ end;
procedure TIDEApp.ShowIDEScreen; procedure TIDEApp.ShowIDEScreen;
begin begin
{$ifndef linux}
{ the video has to be initialized already for linux (JM) }
if Assigned(UserScreen) then if Assigned(UserScreen) then
UserScreen^.SwitchBack; UserScreen^.SwitchBack;
{$endif linux}
InitDosMem; InitDosMem;
{$ifndef go32v2} {$ifndef go32v2}
InitScreen; InitScreen;
@ -753,6 +763,10 @@ begin
InitSysError; InitSysError;
CurDirChanged; CurDirChanged;
Message(Application,evBroadcast,cmUpdate,nil); Message(Application,evBroadcast,cmUpdate,nil);
{$ifdef linux}
if Assigned(UserScreen) then
UserScreen^.SwitchBack;
{$endif linux}
{$ifndef go32v2} {$ifndef go32v2}
UpdateScreen(true); UpdateScreen(true);
{$endif go32v2} {$endif go32v2}
@ -768,7 +782,7 @@ begin
if IOK=false then if IOK=false then
ErrorBox(error_saving_cfg_file,nil); ErrorBox(error_saving_cfg_file,nil);
end; end;
if (AutoSaveOptions and asEditorFiles)=0 then if (AutoSaveOptions and asEditorFiles)<>0 then { was a typo here ("=0") - Gabor }
SOK:=SaveAll; SOK:=SaveAll;
if (AutoSaveOptions and asDesktop)<>0 then if (AutoSaveOptions and asDesktop)<>0 then
begin begin
@ -786,7 +800,7 @@ end;
function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile: string; ExecType: TExecType): boolean; function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile: string; ExecType: TExecType): boolean;
var CanRun: boolean; var CanRun: boolean;
posexe : longint; PosExe: sw_integer;
begin begin
SaveCancelled:=false; SaveCancelled:=false;
CanRun:=AutoSave; CanRun:=AutoSave;
@ -851,6 +865,12 @@ begin
Message(Application,evBroadcast,cmCommandSetChanged,nil); Message(Application,evBroadcast,cmCommandSetChanged,nil);
end; end;
procedure TIDEApp.SourceWindowClosed;
begin
if not IsClosing then
Update;
end;
procedure TIDEApp.CurDirChanged; procedure TIDEApp.CurDirChanged;
begin begin
Message(Application,evBroadcast,cmUpdateTitle,nil); Message(Application,evBroadcast,cmUpdateTitle,nil);
@ -1060,7 +1080,53 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.7 2000/08/21 12:10:19 jonas
* fixed errors in my previous commit, it now works properly
Revision 1.1.2.5 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.4 2000/08/15 03:40:53 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1.2.3 2000/08/10 07:10:37 michael
* 'Auto save editor files' option did the opposite than expected, due
to a typo in FPIDE.PAS
+ saving of source files before compilation is no longer neccessary.
When a modified editor file is involved in the compilation, then the
IDE saves it's contents to a memory stream and passes this to the
compiler (instead of the file on the disk)
Revision 1.1.2.2 2000/08/04 14:05:18 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1.2.1 2000/07/18 05:50:22 michael
+ Merged Gabors fixes
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.65 2000/06/22 09:07:12 pierre Revision 1.65 2000/06/22 09:07:12 pierre

View File

@ -20,6 +20,7 @@ uses
FPUtils; FPUtils;
procedure InitINIFile; procedure InitINIFile;
procedure CheckINIFile;
function ReadINIFile: boolean; function ReadINIFile: boolean;
function WriteINIFile: boolean; function WriteINIFile: boolean;
@ -27,10 +28,10 @@ function WriteINIFile: boolean;
implementation implementation
uses uses
Dos,Objects,Drivers, Dos,Objects,Drivers,Commands,
WINI,{$ifndef EDITORS}WEditor,WCEdit{$else}Editors{$endif}, WConsts,WUtils,WINI,WViews,{$ifndef EDITORS}WEditor,WCEdit{$else}Editors{$endif},
{$ifndef NODEBUG}FPDebug,{$endif}FPConst,FPVars, {$ifndef NODEBUG}FPDebug,{$endif}FPConst,FPVars,
FPIntf,FPTools,FPSwitch; FPIntf,FPTools,FPSwitch,FPString;
const const
{ INI file sections } { INI file sections }
@ -101,6 +102,47 @@ begin
IniFileName:=FExpand(IniFileName); IniFileName:=FExpand(IniFileName);
end; end;
procedure CheckINIFile;
var IniDir,CurDir: DirStr;
INI: PINIFile;
const Btns : array[1..2] of longstring = (btn_config_copyexisting,btn_config_createnew);
begin
IniDir:=DirOf(IniFileName); CurDir:=GetCurDir;
if CompareText(IniDir,CurDir)<>0 then
if not ExistsFile(CurDir+DirInfoName) then
if ConfirmBox(FormatStrStr(msg_doyouwanttocreatelocalconfigfile,IniDir),nil,false)=cmYes then
begin
if (not ExistsFile(IniFileName)) or
(ChoiceBox(msg_configcopyexistingorcreatenew,nil,
Btns,false)=cmUserBtn2) then
begin
{ create new config here }
IniFileName:=CurDir+IniName;
SwitchesPath:=CurDir+SwitchesName;
end
else
begin
{ copy config here }
if CopyFile(IniFileName,CurDir+IniName)=false then
ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+IniName),nil)
else
IniFileName:=CurDir+IniName;
if CopyFile(SwitchesPath,CurDir+SwitchesName)=false then
ErrorBox(FormatStrStr(msg_errorwritingfile,CurDir+SwitchesName),nil)
else
SwitchesPath:=CurDir+SwitchesName;
end;
end
else
begin
New(INI, Init(CurDir+DirInfoName));
INI^.SetEntry(MainSectionName,'Comment','Do NOT delete this file!!!');
if INI^.Update=false then
ErrorBox(FormatStrStr(msg_errorwritingfile,INI^.GetFileName),nil);
Dispose(INI, Done);
end;
end;
function PaletteToStr(S: string): string; function PaletteToStr(S: string): string;
var C: string; var C: string;
I: integer; I: integer;
@ -528,7 +570,19 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:34 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.2 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.1 2000/07/20 11:02:15 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:34 michael
+ Initial import + Initial import
Revision 1.30 2000/06/22 09:07:12 pierre Revision 1.30 2000/06/22 09:07:12 pierre

View File

@ -56,6 +56,7 @@ begin
SwitchesMode:=TSwitchMode(RB^.Value); SwitchesMode:=TSwitchMode(RB^.Value);
Dispose(D, Done); Dispose(D, Done);
UpdateMode; UpdateMode;
UpdateTarget;
end; end;
procedure TIDEApp.DoCompilerSwitch; procedure TIDEApp.DoCompilerSwitch;
@ -401,10 +402,18 @@ begin
Insert(New(PLabel, Init(R2, label_linker_preferredlibtype, RB2))); Insert(New(PLabel, Init(R2, label_linker_preferredlibtype, RB2)));
end; end;
InsertButtons(D); InsertButtons(D);
RB2^.Select;
if Desktop^.ExecView(D)=cmOK then if Desktop^.ExecView(D)=cmOK then
begin begin
{ SetEXEFormat(TEXEFormat(RB1^.Value+1));} { SetEXEFormat(TEXEFormat(RB1^.Value+1));}
LibLinkerSwitches^.SetCurrSel(RB2^.Value); LibLinkerSwitches^.SetCurrSel(RB2^.Value);
if LibLinkerSwitches^.GetCurrSelParam='X' then
if CompareText(TargetSwitches^.GetCurrSelParam,'win32')=0 then
if CompareText(AsmOutputSwitches^.GetCurrSelParam,'pecoff')<>0 then
if ConfirmBox(
FormatStrStr3(msg_xmustbesettoyforz_doyouwanttochangethis,
label_compiler_assembleroutput,'pecoff','smartlinking'),nil,false)=cmYes then
AsmOutputSwitches^.SetCurrSelParam('pecoff');
end; end;
Dispose(D, Done); Dispose(D, Done);
end; end;
@ -1214,7 +1223,25 @@ end;
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:35 michael Revision 1.2 2000-08-22 09:41:39 pierre
* first big merge from fixes branch
Revision 1.1.2.2 2000/08/04 14:05:18 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1.2.1 2000/07/15 21:02:08 pierre
* Target is Mode dependent
Revision 1.1 2000/07/13 09:48:35 michael
+ Initial import + Initial import
Revision 1.35 2000/06/16 08:50:41 pierre Revision 1.35 2000/06/16 08:50:41 pierre

View File

@ -55,8 +55,13 @@ var Title,ProgramPath,Params: string;
begin begin
if (Idx<1) or (Idx>GetToolCount) then Exit; if (Idx<1) or (Idx>GetToolCount) then Exit;
GetToolParams(Idx-1,Title,ProgramPath,Params,Wo); GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
InitToolTempFiles;
Err:=ParseToolParams(Params,false); Err:=ParseToolParams(Params,false);
if Err=-1 then Exit; if Err=-1 then
begin
DoneToolTempFiles;
Exit;
end;
if Err<>0 then if Err<>0 then
begin ErrorBox(msg_errorparsingtoolparams,nil); Exit; end; begin ErrorBox(msg_errorparsingtoolparams,nil); Exit; end;
if CaptureToolTo<>capNone then if CaptureToolTo<>capNone then
@ -133,6 +138,7 @@ begin
EraseFile(CaptureFile); EraseFile(CaptureFile);
EraseFile(FilterCaptureName); EraseFile(FilterCaptureName);
{$endif} {$endif}
DoneToolTempFiles;
end; end;
@ -294,7 +300,13 @@ end;
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:35 michael Revision 1.2 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.1.2.1 2000/07/20 11:02:15 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:35 michael
+ Initial import + Initial import
Revision 1.21 2000/06/16 08:50:41 pierre Revision 1.21 2000/06/16 08:50:41 pierre

View File

@ -99,7 +99,9 @@ begin
LB^.Default:=true; LB^.Default:=true;
LB^.NewList(C); LB^.NewList(C);
UpdateList; UpdateList;
if C^.Count>=2 then LB^.FocusItem(1); { focus the 2nd one } if C^.Count>=2 then
if PWindow(C^.At(1))^.GetState(sfVisible) then
LB^.FocusItem(1); { focus the 2nd one }
Insert(LB); Insert(LB);
R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1; R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1;
Insert(New(PLabel, Init(R2, label_wndlist_windows, LB))); Insert(New(PLabel, Init(R2, label_wndlist_windows, LB)));
@ -122,17 +124,19 @@ begin
end; end;
procedure TWindowListDialog.UpdateList; procedure TWindowListDialog.UpdateList;
var VisState: boolean;
procedure AddIt(P: PView); {$ifndef FPC}far;{$endif} procedure AddIt(P: PView); {$ifndef FPC}far;{$endif}
begin begin
if (P<>pointer(Desktop^.Background)) and if (P<>pointer(Desktop^.Background)) and
(P^.GetState(sfDisabled)=false) and (P^.GetState(sfDisabled)=false) and
((P^.Options and ofSelectable)<>0) {and ((P^.Options and ofSelectable)<>0) and
(P^.GetState(sfVisible)) }then (P^.GetState(sfVisible)=VisState) then
C^.Insert(P); C^.Insert(P);
end; end;
begin begin
C^.DeleteAll; C^.DeleteAll;
Desktop^.ForEach(@AddIt); VisState:=true; Desktop^.ForEach(@AddIt); { add visible windows to list }
VisState:=false; Desktop^.ForEach(@AddIt); { add hidden windows }
LB^.SetRange(C^.Count); LB^.SetRange(C^.Count);
UpdateButtons; UpdateButtons;
ReDraw; ReDraw;
@ -227,7 +231,21 @@ end;
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:35 michael Revision 1.2 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.1.2.1 2000/08/15 03:40:53 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1 2000/07/13 09:48:35 michael
+ Initial import + Initial import
Revision 1.18 2000/06/16 08:50:41 pierre Revision 1.18 2000/06/16 08:50:41 pierre

View File

@ -594,6 +594,17 @@ const
msg_nothingtodebug = 'Oooops, nothing to debug.'; msg_nothingtodebug = 'Oooops, nothing to debug.';
msg_startingdebugger = 'Starting debugger'; msg_startingdebugger = 'Starting debugger';
msg_doyouwanttocreatelocalconfigfile =
'The Free Pascal IDE was never started in this directory before. '+
'Do you want to create a new config file in this directory? '{#13+
'(If you answer with "No", the IDE will use '+
'the config file located in "%s")'};
msg_configcopyexistingorcreatenew =
'Do you want to copy the existing configuration or '+
'create a new one from scratch?';
btn_config_copyexisting = 'Copy ~e~xisting';
btn_config_createnew = ' Create ~n~ew ';
{ Desktop file messages } { Desktop file messages }
msg_readingdesktopfile = 'Reading desktop file...'; msg_readingdesktopfile = 'Reading desktop file...';
msg_writingdesktopfile = 'Writing desktop file...'; msg_writingdesktopfile = 'Writing desktop file...';
@ -748,6 +759,7 @@ const
opt_listsource = '~L~ist source'; opt_listsource = '~L~ist source';
opt_listregisterallocation = 'list ~r~egister allocation'; opt_listregisterallocation = 'list ~r~egister allocation';
opt_listtempallocation = 'list ~t~emp allocation'; opt_listtempallocation = 'list ~t~emp allocation';
opt_usedefaultas = 'Use ~d~efault output';
opt_usegnuas = 'Use ~G~NU as'; opt_usegnuas = 'Use ~G~NU as';
opt_usenasmcoff = 'Use ~N~ASM coff'; opt_usenasmcoff = 'Use ~N~ASM coff';
opt_usenasmelf = 'Use NASM ~e~lf'; opt_usenasmelf = 'Use NASM ~e~lf';
@ -772,8 +784,10 @@ const
opt_objectdirectories = '~O~bject directories'; opt_objectdirectories = '~O~bject directories';
opt_exeppudirectories = '~E~XE & PPU directories'; opt_exeppudirectories = '~E~XE & PPU directories';
{ Library options } { Library options }
opt_librariesdefault = '~T~arget default';
opt_dynamiclibraries = '~D~ynamic libraries'; opt_dynamiclibraries = '~D~ynamic libraries';
opt_staticlibraries = '~S~tatic libraries'; opt_staticlibraries = '~S~tatic libraries';
opt_smartlibraries = 'S~m~art libraries';
{ Symbol info options } { Symbol info options }
opt_stripalldebugsymbols = '~S~trip all debug symbols from executable'; opt_stripalldebugsymbols = '~S~trip all debug symbols from executable';
opt_gendebugsymbolinfo = 'Generate ~d~ebug symbol information'; opt_gendebugsymbolinfo = 'Generate ~d~ebug symbol information';
@ -782,6 +796,10 @@ const
opt_noprofileinfo = '~N~o profile information'; opt_noprofileinfo = '~N~o profile information';
opt_gprofinfo = 'Generate profile code for g~p~rof'; opt_gprofinfo = 'Generate profile code for g~p~rof';
msg_xmustbesettoyforz_doyouwanttochangethis =
'%s must be set to "%s" for %s. '+
'Do you want to change this option automatically?';
{ Debugger messages and status hints } { Debugger messages and status hints }
msg_programexitedwithcodeandsteps = #3'Program exited with '#13+ msg_programexitedwithcodeandsteps = #3'Program exited with '#13+
#3'exitcode = %d'#13+ #3'exitcode = %d'#13+
@ -961,7 +979,31 @@ const
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:35 michael Revision 1.2 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.1.2.3 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.2 2000/08/04 14:05:18 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1.2.1 2000/07/15 21:16:23 pierre
+ some new texts
Revision 1.1 2000/07/13 09:48:35 michael
+ Initial import + Initial import
Revision 1.4 2000/06/16 08:50:41 pierre Revision 1.4 2000/06/16 08:50:41 pierre
@ -977,4 +1019,4 @@ const
* new set of Gabor changes: see fixes.txt * new set of Gabor changes: see fixes.txt
} }

View File

@ -594,6 +594,17 @@ const
msg_nothingtodebug = 'Hopp , nincs mit debuggolni.'; msg_nothingtodebug = 'Hopp , nincs mit debuggolni.';
msg_startingdebugger = 'Debugger ind¡t sa'; msg_startingdebugger = 'Debugger ind¡t sa';
msg_doyouwanttocreatelocalconfigfile =
'A Free Pascal IDE mg sosem lett ind¡tva ebben a k”nyvt rban. '+
'Ltre akar hozni egy £j konfigur ci¢s f jlt itt? '{#13+
'(If you answer with "No", the IDE will use '+
'the config file located in "%s")'};
msg_configcopyexistingorcreatenew =
'A m r ltez konfigur ci¢t m soljam le, vagy hozzak '+
'ltre egy teljesen £jat?';
btn_config_copyexisting = '~M~ sold le!';
btn_config_createnew = '~H~ozd ltre!';
{ Desktop file messages } { Desktop file messages }
msg_readingdesktopfile = 'Asztal-f jl olvas sa...'; msg_readingdesktopfile = 'Asztal-f jl olvas sa...';
msg_writingdesktopfile = 'Asztal-f jl ¡r sa...'; msg_writingdesktopfile = 'Asztal-f jl ¡r sa...';
@ -748,6 +759,7 @@ const
opt_listsource = 'Forr s ~l~ist z sa'; opt_listsource = 'Forr s ~l~ist z sa';
opt_listregisterallocation = '~r~egister-foglal s list.'; opt_listregisterallocation = '~r~egister-foglal s list.';
opt_listtempallocation = ' ~t~meneti foglal s list.'; opt_listtempallocation = ' ~t~meneti foglal s list.';
opt_usedefaultas = 'Use ~d~efault output'; { NOT TRANSLATED }
opt_usegnuas = '~G~NU as haszn lata'; opt_usegnuas = '~G~NU as haszn lata';
opt_usenasmcoff = '~N~ASM coff haszn lata'; opt_usenasmcoff = '~N~ASM coff haszn lata';
opt_usenasmelf = 'Use NASM ~e~lf haszn lata'; opt_usenasmelf = 'Use NASM ~e~lf haszn lata';
@ -772,8 +784,10 @@ const
opt_objectdirectories = '~O~bject k”nyvt rak'; opt_objectdirectories = '~O~bject k”nyvt rak';
opt_exeppudirectories = '~E~XE & PPU k”nyvt rak'; opt_exeppudirectories = '~E~XE & PPU k”nyvt rak';
{ Library options } { Library options }
opt_librariesdefault = '~T~arget default'; { NOT TRANSLATED }
opt_dynamiclibraries = '~D~inamikus k”nyvt rak'; opt_dynamiclibraries = '~D~inamikus k”nyvt rak';
opt_staticlibraries = '~S~tatikus k”nyvt rak'; opt_staticlibraries = '~S~tatikus k”nyvt rak';
opt_smartlibraries = 'S~m~art libraries'; { NOT TRANSLATED }
{ Symbol info options } { Symbol info options }
opt_stripalldebugsymbols = 'Debug szimb¢lumok elt vol¡t ~s~a'; opt_stripalldebugsymbols = 'Debug szimb¢lumok elt vol¡t ~s~a';
opt_gendebugsymbolinfo = '~D~ebug szimb¢lum info gener l sa'; opt_gendebugsymbolinfo = '~D~ebug szimb¢lum info gener l sa';
@ -782,6 +796,11 @@ const
opt_noprofileinfo = '~N~incs profile inform ci¢'; opt_noprofileinfo = '~N~incs profile inform ci¢';
opt_gprofinfo = 'Profile inf¢ gener l sa g~p~rof-hoz'; opt_gprofinfo = 'Profile inf¢ gener l sa g~p~rof-hoz';
msg_xmustbesettoyforz_doyouwanttochangethis =
'Az %s rtkt "%s"-re kell  ll¡tani a %s-hez. '+
'K¡v nja, hogy ezt a be ll¡t st automatikusan megtegyem?';
{ Debugger messages and status hints } { Debugger messages and status hints }
msg_programexitedwithcodeandsteps = #3'A program kilpett '#13+ msg_programexitedwithcodeandsteps = #3'A program kilpett '#13+
#3'exitcode = %d'#13+ #3'exitcode = %d'#13+
@ -961,7 +980,31 @@ const
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:36 michael Revision 1.2 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.1.2.3 2000/08/16 18:46:14 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.2 2000/08/04 14:05:19 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1.2.1 2000/07/15 21:16:23 pierre
+ some new texts
Revision 1.1 2000/07/13 09:48:36 michael
+ Initial import + Initial import
Revision 1.4 2000/06/16 08:50:42 pierre Revision 1.4 2000/06/16 08:50:42 pierre
@ -977,4 +1020,4 @@ const
* new set of Gabor changes: see fixes.txt * new set of Gabor changes: see fixes.txt
} }

View File

@ -1,7 +1,7 @@
{ {
$Id$ $Id$
This file is part of the Free Pascal Integrated Development Environment This file is part of the Free Pascal Integrated Development Environment
Copyright (c) 1998 by Berczi Gabor Copyright (c) 1998-2000 by Berczi Gabor
Compiler switches routines for the IDE Compiler switches routines for the IDE
@ -59,7 +59,10 @@ type
PSelectItem = ^TSelectItem; PSelectItem = ^TSelectItem;
TSelectItem = object(TSwitchItem) TSelectItem = object(TSwitchItem)
IsDefault : boolean;
constructor Init(const n,p:string; AID: TParamID); constructor Init(const n,p:string; AID: TParamID);
{ Select to avoid anything in config file }
constructor InitDefault(const n:string);
end; end;
PBooleanItem = ^TBooleanItem; PBooleanItem = ^TBooleanItem;
@ -103,6 +106,7 @@ type
function ItemParam(index:integer):string; function ItemParam(index:integer):string;
{ type specific } { type specific }
procedure AddSelectItem(const name,param:string; AID: TParamID); procedure AddSelectItem(const name,param:string; AID: TParamID);
procedure AddDefaultSelect(const name:string);
procedure AddBooleanItem(const name,param:string; AID: TParamID); procedure AddBooleanItem(const name,param:string; AID: TParamID);
procedure AddLongintItem(const name,param:string; AID: TParamID); procedure AddLongintItem(const name,param:string; AID: TParamID);
procedure AddStringItem(const name,param:string;AID: TParamID;mult:boolean); procedure AddStringItem(const name,param:string;AID: TParamID;mult:boolean);
@ -239,8 +243,15 @@ constructor TSelectItem.Init(const n,p:string; AID: TParamID);
begin begin
Inherited Init(n,p,AID); Inherited Init(n,p,AID);
Typ:=ot_Select; Typ:=ot_Select;
IsDefault:=false;
end; end;
constructor TSelectItem.InitDefault(const n:string);
begin
Inherited Init(n,'',idNone);
Typ:=ot_Select;
IsDefault:=true;
end;
{***************************************************************************** {*****************************************************************************
TBooleanItem TBooleanItem
@ -378,6 +389,12 @@ begin
end; end;
procedure TSwitches.AddDefaultSelect(const name:string);
begin
Items^.Insert(New(PSelectItem,InitDefault(name)));
end;
procedure TSwitches.AddBooleanItem(const name,param:string; AID: TParamID); procedure TSwitches.AddBooleanItem(const name,param:string; AID: TParamID);
begin begin
Items^.Insert(New(PBooleanItem,Init(name,Param,AID))); Items^.Insert(New(PBooleanItem,Init(name,Param,AID)));
@ -569,10 +586,16 @@ var
end; end;
end; end;
var
P : PSelectItem;
begin begin
Pref:=Prefix; Pref:=Prefix;
if IsSel then if IsSel then
writeln(CfgFile,' '+ItemParam(SelNr[SwitchesMode])) begin
P:=Items^.At(SelNr[SwitchesMode]);
if not P^.IsDefault then
writeln(CfgFile,' '+ItemParam(SelNr[SwitchesMode]));
end
else else
Items^.ForEach(@writeitem); Items^.ForEach(@writeitem);
end; end;
@ -602,7 +625,7 @@ function TSwitches.ReadItemsCfg(const s:string):boolean;
begin begin
{ empty items are not equivalent to others !! } { empty items are not equivalent to others !! }
CheckItem:=((S='') and (P^.Param='')) or CheckItem:=((S='') and (P^.Param='')) or
((Length(S)>0) and (P^.Param=Copy(s,1,length(P^.Param)))); ((Length(P^.Param)>0) and (P^.Param=Copy(s,1,length(P^.Param))));
end; end;
var var
@ -867,6 +890,7 @@ begin
New(AsmOutputSwitches,InitSelect('A')); New(AsmOutputSwitches,InitSelect('A'));
with AsmOutputSwitches^ do with AsmOutputSwitches^ do
begin begin
AddDefaultSelect(opt_usedefaultas);
AddSelectItem(opt_usegnuas,'as',idNone); AddSelectItem(opt_usegnuas,'as',idNone);
AddSelectItem(opt_usenasmcoff,'nasmcoff',idNone); AddSelectItem(opt_usenasmcoff,'nasmcoff',idNone);
AddSelectItem(opt_usenasmelf,'nasmelf',idNone); AddSelectItem(opt_usenasmelf,'nasmelf',idNone);
@ -907,8 +931,10 @@ begin
New(LibLinkerSwitches,InitSelect('X')); New(LibLinkerSwitches,InitSelect('X'));
with LibLinkerSwitches^ do with LibLinkerSwitches^ do
begin begin
AddDefaultSelect(opt_librariesdefault);
AddSelectItem(opt_dynamiclibraries,'D',idNone); AddSelectItem(opt_dynamiclibraries,'D',idNone);
AddSelectItem(opt_staticlibraries,'S',idNone); AddSelectItem(opt_staticlibraries,'S',idNone);
AddSelectItem(opt_smartlibraries,'X',idNone);
end; end;
New(DebugInfoSwitches,InitSelect('g')); New(DebugInfoSwitches,InitSelect('g'));
with DebugInfoSwitches^ do with DebugInfoSwitches^ do
@ -1113,7 +1139,29 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:36 michael Revision 1.2 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.1.2.3 2000/08/04 14:05:19 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1.2.2 2000/07/15 21:38:47 pierre
+ Add default selection that does not write anything to config file
+ Add smart link
Revision 1.1.2.1 2000/07/15 21:30:06 pierre
* Wrong commit text
Revision 1.1 2000/07/13 09:48:36 michael
+ Initial import + Initial import
Revision 1.23 2000/06/22 09:07:12 pierre Revision 1.23 2000/06/22 09:07:12 pierre
@ -1222,4 +1270,5 @@ end.
+ Switches updated + Switches updated
+ Run program + Run program
} }

View File

@ -134,6 +134,8 @@ procedure AddToolCommand(Command: string);
procedure AddToolMessage(ModuleName, Text: string; Row, Col: longint); procedure AddToolMessage(ModuleName, Text: string; Row, Col: longint);
procedure ClearToolMessages; procedure ClearToolMessages;
procedure UpdateToolMessages; procedure UpdateToolMessages;
procedure InitToolTempFiles;
procedure DoneToolTempFiles;
const const
ToolFilter : string[{$ifndef GABOR}128{$else}40{$endif}] = ''; ToolFilter : string[{$ifndef GABOR}128{$else}40{$endif}] = '';
@ -149,7 +151,7 @@ implementation
uses Dos, uses Dos,
Commands,App,MsgBox, Commands,App,MsgBox,
WINI,WEditor, WConsts,WUtils,WINI,WEditor,
FPConst,FPString,FPVars,FPUtils; FPConst,FPString,FPVars,FPUtils;
{$ifndef NOOBJREG} {$ifndef NOOBJREG}
@ -189,6 +191,7 @@ const
Tools : PToolCollection = nil; Tools : PToolCollection = nil;
AbortTool : boolean = false; AbortTool : boolean = false;
ToolTempFiles: PUnsortedStringCollection = nil;
function GetHotKeyCount: integer; function GetHotKeyCount: integer;
begin begin
@ -647,17 +650,21 @@ const
{ Additional Label view section entries } { Additional Label view section entries }
tieLink = 'LINK'; tieLink = 'LINK';
tieText = 'TEXT'; tieText = 'TEXT';
{ Additional Memo view section entries }
tieFileName = 'FILENAME';
{ View types } { View types }
vtCheckBox = 1; vtCheckBox = 1;
vtRadioButton = 2; vtRadioButton = 2;
vtInputLine = 3; vtInputLine = 3;
vtMemo = 4;
vtLabel = 127; vtLabel = 127;
vtsCheckBox = 'CHECKBOX'; vtsCheckBox = 'CHECKBOX';
vtsRadioButton = 'RADIOBUTTON'; vtsRadioButton = 'RADIOBUTTON';
vtsInputLine = 'INPUTLINE'; vtsInputLine = 'INPUTLINE';
vtsLabel = 'LABEL'; vtsLabel = 'LABEL';
vtsMemo = 'MEMO';
var Title : string; var Title : string;
DSize : TPoint; DSize : TPoint;
@ -698,6 +705,7 @@ var
if Typ=vtsRadioButton then ViewTypes[ViewCount]:=vtRadioButton else if Typ=vtsRadioButton then ViewTypes[ViewCount]:=vtRadioButton else
if Typ=vtsInputLine then ViewTypes[ViewCount]:=vtInputLine else if Typ=vtsInputLine then ViewTypes[ViewCount]:=vtInputLine else
if Typ=vtsLabel then ViewTypes[ViewCount]:=vtLabel else if Typ=vtsLabel then ViewTypes[ViewCount]:=vtLabel else
if Typ=vtsMemo then ViewTypes[ViewCount]:=vtMemo else
begin OK:=false; ErrorBox(FormatStrStr(msg_unknowntypein,Sec^.GetName),nil); Exit; end; begin OK:=false; ErrorBox(FormatStrStr(msg_unknowntypein,Sec^.GetName),nil); Exit; end;
ViewNames[ViewCount]:=Sec^.GetName; ViewNames[ViewCount]:=Sec^.GetName;
@ -715,6 +723,7 @@ var
begin ErrorBox(FormatStrStr(msg_requiredpropertymissingin,Sec^.GetName),nil); Exit; end; begin ErrorBox(FormatStrStr(msg_requiredpropertymissingin,Sec^.GetName),nil); Exit; end;
end; end;
vtInputLine : ; vtInputLine : ;
vtMemo : ;
vtCheckBox : vtCheckBox :
begin begin
OK:=OK and (Sec^.SearchEntry(tieName)<>nil); OK:=OK and (Sec^.SearchEntry(tieName)<>nil);
@ -780,6 +789,14 @@ begin
case ViewTypes[Idx] of case ViewTypes[Idx] of
vtLabel : vtLabel :
S:=''; S:='';
vtMemo :
begin
S:=F^.GetEntry(ViewNames[Idx],tieFileName,'');
if S='' then S:=GenTempFileName;
ToolTempFiles^.InsertStr(S);
if PFPMemo(ViewPtrs[Idx])^.SaveToFile(S)=false then
ErrorBox(FormatStrStr(msg_errorsavingfile,S),nil);
end;
vtInputLine : vtInputLine :
S:=PInputLine(ViewPtrs[Idx])^.Data^; S:=PInputLine(ViewPtrs[Idx])^.Data^;
vtCheckBox : vtCheckBox :
@ -850,6 +867,7 @@ var R: TRect;
Re: integer; Re: integer;
OK: boolean; OK: boolean;
I,J,MaxLen: integer; I,J,MaxLen: integer;
Memo: PFPMemo;
IL: PInputLine; IL: PInputLine;
CB: PCheckBoxes; CB: PCheckBoxes;
RB: PRadioButtons; RB: PRadioButtons;
@ -858,6 +876,7 @@ var R: TRect;
S: string; S: string;
P: PView; P: PView;
begin begin
OK:=true;
R.Assign(0,0,DSize.X,DSize.Y); R.Assign(0,0,DSize.X,DSize.Y);
New(PromptDialog, Init(R, Title)); New(PromptDialog, Init(R, Title));
with PromptDialog^ do with PromptDialog^ do
@ -882,6 +901,14 @@ begin
IL^.Data^:=ViewValues[I]; IL^.Data^:=ViewValues[I];
ViewPtrs[I]:=IL; ViewPtrs[I]:=IL;
end; end;
vtMemo :
begin
{ MaxLen:=F^.GetIntEntry(ViewNames[I],tieMaxLen,80);}
New(Memo, Init(ViewBounds[I],nil,nil,nil));
if ViewValues[I]<>'' then
Memo^.AddLine(ViewValues[I]);
ViewPtrs[I]:=Memo;
end;
vtCheckBox : vtCheckBox :
begin begin
New(CB, Init(ViewBounds[I], New(CB, Init(ViewBounds[I],
@ -1303,6 +1330,23 @@ begin
ProcessMessageFile:=OK; ProcessMessageFile:=OK;
end; end;
procedure InitToolTempFiles;
begin
if not Assigned(ToolTempFiles) then
New(ToolTempFiles, Init(10,10));
end;
procedure DoneToolTempFiles;
procedure DeleteIt(P: PString); {$ifndef FPC}far;{$endif}
begin
DeleteFile(GetStr(P));
end;
begin
if not Assigned(ToolTempFiles) then Exit;
ToolTempFiles^.ForEach(@DeleteIt);
Dispose(ToolTempFiles, Done); ToolTempFiles:=nil;
end;
constructor TToolMessage.Init(AModule: PString; ALine: string; ARow, ACol: sw_integer); constructor TToolMessage.Init(AModule: PString; ALine: string; ARow, ACol: sw_integer);
begin begin
inherited Init(0,ALine,AModule,ARow,ACol); inherited Init(0,ALine,AModule,ARow,ACol);
@ -1507,7 +1551,13 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:36 michael Revision 1.2 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.1.2.1 2000/07/20 11:02:15 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:36 michael
+ Initial import + Initial import
Revision 1.20 2000/06/22 09:07:12 pierre Revision 1.20 2000/06/22 09:07:12 pierre

View File

@ -494,6 +494,10 @@ end;
procedure TLinuxScreen.Capture; procedure TLinuxScreen.Capture;
begin begin
if assigned(IDE_screen) then
dispose(IDE_screen);
new(IDE_screen);
move(videobuf^,IDE_screen^,videobufsize);
end; end;
@ -725,7 +729,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.2 2000-08-21 10:57:01 jonas Revision 1.3 2000-08-22 09:41:40 pierre
* first big merge from fixes branch
Revision 1.2 2000/08/21 10:57:01 jonas
* IDE screen saving/restoring implemented for Linux (merged from fixes * IDE screen saving/restoring implemented for Linux (merged from fixes
branch) branch)

View File

@ -63,14 +63,11 @@ function NameOf(const S: string): string;
function NameAndExtOf(const S: string): string; function NameAndExtOf(const S: string): string;
function StrToExtended(S: string): Extended; function StrToExtended(S: string): Extended;
function Power(const A,B: double): double; function Power(const A,B: double): double;
function GetCurDir: string;
function MatchesMask(What, Mask: string): boolean; function MatchesMask(What, Mask: string): boolean;
function MatchesMaskList(What, MaskList: string): boolean; function MatchesMaskList(What, MaskList: string): boolean;
function MatchesFileList(What, FileList: string): boolean; function MatchesFileList(What, FileList: string): boolean;
function EatIO: integer; function EatIO: integer;
function RenameFile(const OldFileName,NewFileName: string): boolean; function RenameFile(const OldFileName,NewFileName: string): boolean;
function ExistsFile(const FileName: string): boolean;
function CompleteDir(const Path: string): string;
function LocateFile(FileList: string): string; function LocateFile(FileList: string): string;
function LocatePasFile(const FileName:string):string; function LocatePasFile(const FileName:string):string;
function LocateExeFile(var FileName:string): boolean; function LocateExeFile(var FileName:string): boolean;
@ -87,7 +84,7 @@ implementation
uses Dos, uses Dos,
WUtils, WUtils,
FPVars; FPVars,FPSwitch;
function IntToStr(L: longint): string; function IntToStr(L: longint): string;
var S: string; var S: string;
@ -312,14 +309,6 @@ begin
else Power:=exp(B*ln(A)); else Power:=exp(B*ln(A));
end; end;
function GetCurDir: string;
var S: string;
begin
GetDir(0,S);
if copy(S,length(S),1)<>DirSep then S:=S+DirSep;
GetCurDir:=S;
end;
function IntToHex(L: longint): string; function IntToHex(L: longint): string;
const HexNums : string[16] = '0123456789ABCDEF'; const HexNums : string[16] = '0123456789ABCDEF';
var S: string; var S: string;
@ -511,27 +500,6 @@ begin
RenameFile:=(EatIO=0); RenameFile:=(EatIO=0);
end; end;
function ExistsFile(const FileName: string): boolean;
var
Dir : SearchRec;
begin
FindFirst(FileName,Archive+ReadOnly,Dir);
ExistsFile:=(DosError=0);
{$ifdef FPC}
FindClose(Dir);
{$endif def FPC}
end;
function CompleteDir(const Path: string): string;
begin
{ keep c: untouched PM }
if (Path<>'') and (Path[Length(Path)]<>DirSep) and
(Path[Length(Path)]<>':') then
CompleteDir:=Path+DirSep
else
CompleteDir:=Path;
end;
function LocateFile(FileList: string): string; function LocateFile(FileList: string): string;
var FilePath: string; var FilePath: string;
function CheckFile(Path,Name: string): boolean; function CheckFile(Path,Name: string): boolean;
@ -664,7 +632,24 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:36 michael Revision 1.2 2000-08-22 09:41:41 pierre
* first big merge from fixes branch
Revision 1.1.2.2 2000/08/15 03:40:53 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1.2.1 2000/07/20 11:02:15 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:36 michael
+ Initial import + Initial import
Revision 1.16 2000/06/22 09:07:13 pierre Revision 1.16 2000/06/22 09:07:13 pierre

View File

@ -170,6 +170,7 @@ type
function GetPalette: PPalette; virtual; function GetPalette: PPalette; virtual;
constructor Load(var S: TStream); constructor Load(var S: TStream);
procedure Store(var S: TStream); procedure Store(var S: TStream);
procedure Close; virtual;
destructor Done; virtual; destructor Done; virtual;
end; end;
@ -388,7 +389,7 @@ procedure DisposeTabItem(P: PTabItem);
function NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef; function NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef;
procedure DisposeTabDef(P: PTabDef); procedure DisposeTabDef(P: PTabDef);
function GetEditorCurWord(Editor: PEditor): string; function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
procedure InitReservedWords; procedure InitReservedWords;
procedure DoneReservedWords; procedure DoneReservedWords;
function GetReservedWordCount: integer; function GetReservedWordCount: integer;
@ -403,6 +404,7 @@ function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts: boolean): PSourceWindow; function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts: boolean): PSourceWindow;
function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts, ShowIt, function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts, ShowIt,
ForceNewWindow:boolean): PSourceWindow; ForceNewWindow:boolean): PSourceWindow;
function LocateSourceFile(const FileName: string; tryexts: boolean): string;
function SearchWindow(const Title: string): PWindow; function SearchWindow(const Title: string): PWindow;
@ -446,7 +448,7 @@ uses
gdbint, gdbint,
{$endif NODEBUG} {$endif NODEBUG}
{$ifdef VESA}Vesa,{$endif} {$ifdef VESA}Vesa,{$endif}
FPString,FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompile,FPHelp, FPString,FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompil,FPHelp,
FPTools,FPIDE,FPCodTmp,FPCodCmp; FPTools,FPIDE,FPCodTmp,FPCodCmp;
const const
@ -622,7 +624,7 @@ begin
EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow)); EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow));
end; end;
function GetEditorCurWord(Editor: PEditor): string; function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
var S: string; var S: string;
PS,PE: byte; PS,PE: byte;
function Trim(S: string): string; function Trim(S: string): string;
@ -641,7 +643,7 @@ begin
{$else} {$else}
S:=GetLineText(CurPos.Y); S:=GetLineText(CurPos.Y);
PS:=CurPos.X; while (PS>0) and (Upcase(S[PS]) in AlphaNum) do Dec(PS); PS:=CurPos.X; while (PS>0) and (Upcase(S[PS]) in AlphaNum) do Dec(PS);
PE:=CurPos.X; while (PE<length(S)) and (Upcase(S[PE+1]) in AlphaNum) do Inc(PE); PE:=CurPos.X; while (PE<length(S)) and (Upcase(S[PE+1]) in (AlphaNum+ValidSpecChars)) do Inc(PE);
S:=Trim(copy(S,PS+1,PE-PS)); S:=Trim(copy(S,PS+1,PE-PS));
{$endif} {$endif}
end; end;
@ -1150,12 +1152,14 @@ begin
{$endif DebugUndo} {$endif DebugUndo}
cmBrowseAtCursor: cmBrowseAtCursor:
begin begin
S:=LowerCaseStr(GetEditorCurWord(@Self)); S:=LowerCaseStr(GetEditorCurWord(@Self,[]));
OpenOneSymbolBrowser(S); OpenOneSymbolBrowser(S);
end; end;
cmOpenAtCursor : cmOpenAtCursor :
begin begin
S:=LowerCaseStr(GetEditorCurWord(@Self)); S:=LowerCaseStr(GetEditorCurWord(@Self,['.']));
if Pos('.',S)<>0 then
OpenFileName:=S else
OpenFileName:=S+'.pp'+ListSeparator+ OpenFileName:=S+'.pp'+ListSeparator+
S+'.pas'+ListSeparator+ S+'.pas'+ListSeparator+
S+'.inc'; S+'.inc';
@ -1448,7 +1452,7 @@ begin
Hide; Hide;
cmSave : cmSave :
if Editor^.IsClipboard=false then if Editor^.IsClipboard=false then
if Editor^.FileName='' then if (Editor^.FileName='') and Editor^.GetModified then
Editor^.SaveAs Editor^.SaveAs
else else
Editor^.Save; Editor^.Save;
@ -1543,12 +1547,18 @@ begin
PopStatus; PopStatus;
end; end;
procedure TSourceWindow.Close;
begin
inherited Close;
end;
destructor TSourceWindow.Done; destructor TSourceWindow.Done;
begin begin
PushStatus(FormatStrStr(msg_closingfile,GetStr(Title))); PushStatus(FormatStrStr(msg_closingfile,GetStr(Title)));
if not IDEApp.IsClosing then if not IDEApp.IsClosing then
Message(Application,evBroadcast,cmSourceWndClosing,@Self); Message(Application,evBroadcast,cmSourceWndClosing,@Self);
inherited Done; inherited Done;
IDEApp.SourceWindowClosed;
{ if not IDEApp.IsClosing then { if not IDEApp.IsClosing then
Message(Application,evBroadcast,cmUpdate,@Self);} Message(Application,evBroadcast,cmUpdate,@Self);}
PopStatus; PopStatus;
@ -2834,12 +2844,10 @@ begin
TryToOpenFile:=ITryToOpenFile(Bounds,FileName,CurX,CurY,tryexts,true,false); TryToOpenFile:=ITryToOpenFile(Bounds,FileName,CurX,CurY,tryexts,true,false);
end; end;
function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean; function LocateSingleSourceFile(const FileName: string; tryexts: boolean): string;
ShowIt,ForceNewWindow: boolean): PSourceWindow;
var D : DirStr; var D : DirStr;
N : NameStr; N : NameStr;
E : ExtStr; E : ExtStr;
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;
@ -2859,9 +2867,8 @@ var D : DirStr;
CheckExt:=OK; CheckExt:=OK;
end; end;
function TryToOpen(const DD : dirstr): PSourceWindow; function TryToLocateIn(const DD : dirstr): boolean;
var Found: boolean; var Found: boolean;
W : PSourceWindow;
begin begin
D:=CompleteDir(DD); D:=CompleteDir(DD);
Found:=true; Found:=true;
@ -2876,21 +2883,55 @@ var D : DirStr;
else else
if CheckExt('.inc') then if CheckExt('.inc') then
Found:=true Found:=true
{ try also without extension if no other exist }
else
if CheckExt('') then
Found:=true
else else
Found:=false; Found:=false;
if Found=false then TryToLocateIn:=Found;
W:=nil
else
begin
FileName:=FExpand(D+N+E);
W:=IOpenEditorWindow(Bounds,FileName,CurX,CurY,ShowIt);
end;
TryToOpen:=W;
end; end;
var Path,DrStr: string;
Found: boolean;
begin
FSplit(FileName,D,N,E);
Found:=CheckDir(D,N,E);
if not found then
Found:=TryToLocateIn('.');
DrStr:=GetSourceDirectories;
if not Found then
While pos(ListSeparator,DrStr)>0 do
Begin
Found:=TryToLocateIn(Copy(DrStr,1,pos(ListSeparator,DrStr)-1));
if Found then
break;
DrStr:=Copy(DrStr,pos(ListSeparator,DrStr)+1,High(DrStr));
End;
if Found then Path:=FExpand(D+N+E) else Path:='';
LocateSingleSourceFile:=Path;
end;
function LocateSourceFile(const FileName: string; tryexts: boolean): string;
var P: integer;
FN,S: string;
FFN: string;
begin
FN:=FileName;
repeat
P:=Pos(ListSeparator,FN); if P=0 then P:=length(FN)+1;
S:=copy(FN,1,P-1); Delete(FN,1,P);
FFN:=LocateSingleSourceFile(S,tryexts);
until (FFN<>'') or (FN='');
LocateSourceFile:=FFN;
end;
function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean;
ShowIt,ForceNewWindow: boolean): PSourceWindow;
var var
W : PSourceWindow; W : PSourceWindow;
DrStr: string;
begin begin
W:=nil;
if ForceNewWindow then if ForceNewWindow then
W:=nil W:=nil
else else
@ -2904,20 +2945,9 @@ begin
end end
else else
begin begin
FSplit(FileName,D,N,E); DrStr:=LocateSourceFile(FileName,tryexts);
if D<>'' then if DrStr<>'' then
W:=TryToOpen(D); W:=IOpenEditorWindow(Bounds,DrStr,CurX,CurY,ShowIt);
DrStr:=GetSourceDirectories;
if not assigned(W) then
While pos(';',DrStr)>0 do
Begin
W:=TryToOpen(Copy(DrStr,1,pos(';',DrStr)-1));
if assigned(W) then
break;
DrStr:=Copy(DrStr,pos(';',DrStr)+1,255);
End;
if not assigned(W) then
W:=TryToOpen(DrStr);
NewEditorOpened:=W<>nil; NewEditorOpened:=W<>nil;
if assigned(W) then if assigned(W) then
W^.Editor^.SetCurPtr(CurX,CurY); W^.Editor^.SetCurPtr(CurX,CurY);
@ -3471,7 +3501,46 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:36 michael Revision 1.2 2000-08-22 09:41:41 pierre
* first big merge from fixes branch
Revision 1.1.2.6 2000/08/21 21:23:27 pierre
* fix loading problem for sources in other dirs
Revision 1.1.2.5 2000/08/15 03:40:54 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1.2.4 2000/08/04 14:05:19 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1.2.3 2000/07/20 11:02:15 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1.2.2 2000/07/15 21:35:32 pierre
* Avoid asking twice for Unsaved New File at exit
* Load files without extensions at startup
Revision 1.1.2.1 2000/07/15 21:30:06 pierre
* Wrong commit text
Revision 1.1 2000/07/13 09:48:36 michael
+ Initial import + Initial import
Revision 1.73 2000/06/22 09:07:13 pierre Revision 1.73 2000/06/22 09:07:13 pierre

View File

@ -1530,25 +1530,16 @@ begin
end; end;
function TFileEditor.LoadFile: boolean; function TFileEditor.LoadFile: boolean;
var S: PBufStream; var OK: boolean;
OK: boolean;
PA : Array[1..2] of pointer; PA : Array[1..2] of pointer;
begin begin
New(S, Init(FileName,stOpenRead,EditorTextBufSize)); OK:=LoadFromFile(FileName);
OK:=Assigned(S);
{$ifdef TEST_PARTIAL_SYNTAX}
SetSyntaxCompleted(false);
{ Idle necessary }
EventMask:=EventMask or evIdle;
{$endif TEST_PARTIAL_SYNTAX}
if OK then OK:=LoadFromStream(S);
if GetModified then if GetModified then
begin begin
PA[1]:=@FileName; PA[1]:=@FileName;
longint(PA[2]):=Core^.GetChangedLine; longint(PA[2]):=Core^.GetChangedLine;
EditorDialog(edChangedOnloading,@PA); EditorDialog(edChangedOnloading,@PA);
end; end;
if Assigned(S) then Dispose(S, Done);
OnDiskLoadTime:=GetFileTime(FileName); OnDiskLoadTime:=GetFileTime(FileName);
LoadFile:=OK; LoadFile:=OK;
end; end;
@ -1561,7 +1552,6 @@ end;
function TFileEditor.SaveFile: boolean; function TFileEditor.SaveFile: boolean;
var OK: boolean; var OK: boolean;
BAKName: string; BAKName: string;
S: PBufStream;
f: text; f: text;
begin begin
If IsChangedOnDisk then If IsChangedOnDisk then
@ -1584,10 +1574,7 @@ begin
EatIO; EatIO;
end; end;
{$I+} {$I+}
New(S, Init(FileName,stCreate,EditorTextBufSize)); OK:=SaveToFile(FileName);
OK:=Assigned(S) and (S^.Status=stOK);
if OK then OK:=SaveToStream(S);
if Assigned(S) then Dispose(S, Done);
if OK then if OK then
SetModified(false) SetModified(false)
{ Restore the original } { Restore the original }
@ -1690,8 +1677,8 @@ var OK: boolean;
begin begin
OK:=inherited Valid(Command); OK:=inherited Valid(Command);
if OK and ((Command=cmClose) or (Command=cmQuit)) then if OK and ((Command=cmClose) or (Command=cmQuit)) then
if IsClipboard=false then if IsClipboard=false then
OK:=SaveAsk(Command=cmQuit); OK:=SaveAsk(Command=cmQuit);
Valid:=OK; Valid:=OK;
end; end;

View File

@ -471,6 +471,8 @@ type
{a}function LoadFromStream(Stream: PStream): boolean; virtual; {a}function LoadFromStream(Stream: PStream): boolean; virtual;
{a}function SaveToStream(Stream: PStream): boolean; virtual; {a}function SaveToStream(Stream: PStream): boolean; virtual;
{a}function SaveAreaToStream(Stream: PStream; StartP,EndP: TPoint): boolean;virtual; {a}function SaveAreaToStream(Stream: PStream; StartP,EndP: TPoint): boolean;virtual;
function LoadFromFile(const AFileName: string): boolean; virtual;
function SaveToFile(const AFileName: string): boolean; virtual;
public public
{a}function InsertFrom(Editor: PCustomCodeEditor): Boolean; virtual; {a}function InsertFrom(Editor: PCustomCodeEditor): Boolean; virtual;
{a}function InsertText(const S: string): Boolean; virtual; {a}function InsertText(const S: string): Boolean; virtual;
@ -1615,9 +1617,9 @@ begin
S:=GetLineText(Line); S:=GetLineText(Line);
TabSize:=GetTabSize; TabSize:=GetTabSize;
CP:=1; RX:=0; CP:=1; RX:=0;
while (CP<=length(S)) and (CP<=CharIdx) do while {(CP<=length(S)) and }(CP<=CharIdx) do
begin begin
if S[CP]=TAB then if (CP<=length(S)) and (S[CP]=TAB) then
Inc(RX,GetTabSize-(RX mod TabSize)) Inc(RX,GetTabSize-(RX mod TabSize))
else else
Inc(RX); Inc(RX);
@ -1977,7 +1979,7 @@ var
end; end;
if EndX+1>=StartX then if EndX+1>=StartX then
FillChar(Format[StartX],EndX+1-StartX,C); FillChar(Format[StartX],EndX+1-StartX,C);
if IsAsmPrefix(WordS) and if IsAsmPrefix(WordS) and (InString=false) and
(InAsm=false) and (InComment=false) and (InDirective=false) then (InAsm=false) and (InComment=false) and (InDirective=false) then
InAsm:=true; InAsm:=true;
end; end;
@ -2519,6 +2521,34 @@ begin
SaveAreaToStream:=false; SaveAreaToStream:=false;
end; end;
function TCustomCodeEditor.LoadFromFile(const AFileName: string): boolean;
var S: PBufStream;
OK: boolean;
begin
New(S, Init(AFileName,stOpenRead,EditorTextBufSize));
OK:=Assigned(S);
{$ifdef TEST_PARTIAL_SYNTAX}
SetSyntaxCompleted(false);
{ Idle necessary }
EventMask:=EventMask or evIdle;
{$endif TEST_PARTIAL_SYNTAX}
if OK then OK:=LoadFromStream(S);
if Assigned(S) then Dispose(S, Done);
LoadFromFile:=OK;
end;
function TCustomCodeEditor.SaveToFile(const AFileName: string): boolean;
var OK: boolean;
S: PBufStream;
begin
New(S, Init(AFileName,stCreate,EditorTextBufSize));
OK:=Assigned(S) and (S^.Status=stOK);
if OK then OK:=SaveToStream(S);
if Assigned(S) then Dispose(S, Done);
SaveToFile:=OK;
end;
function TCustomCodeEditor.InsertFrom(Editor: PCustomCodeEditor): Boolean; function TCustomCodeEditor.InsertFrom(Editor: PCustomCodeEditor): Boolean;
var OK: boolean; var OK: boolean;
LineDelta,LineCount: Sw_integer; LineDelta,LineCount: Sw_integer;
@ -2990,7 +3020,10 @@ begin
cmTextEnd : TextEnd; cmTextEnd : TextEnd;
cmWindowStart : WindowStart; cmWindowStart : WindowStart;
cmWindowEnd : WindowEnd; cmWindowEnd : WindowEnd;
cmNewLine : InsertNewLine; cmNewLine : begin
InsertNewLine;
TrackCursor(false);
end;
cmBreakLine : BreakLine; cmBreakLine : BreakLine;
cmBackSpace : BackSpace; cmBackSpace : BackSpace;
cmDelChar : DelChar; cmDelChar : DelChar;
@ -4591,7 +4624,8 @@ begin
end; end;
end; end;
UpdateAttrs(CurPos.Y,attrAll); UpdateAttrs(CurPos.Y,attrAll);
AdjustSelection(CurPos.X-SP.X,CurPos.Y-SP.Y); if GetInsertMode then
AdjustSelection(CurPos.X-SP.X,CurPos.Y-SP.Y);
DrawLines(CurPos.Y); DrawLines(CurPos.Y);
SetStoreUndo(HoldUndo); SetStoreUndo(HoldUndo);
SetModified(true); SetModified(true);
@ -5794,7 +5828,12 @@ begin
Name:=Name+DefaultSaveExt; Name:=Name+DefaultSaveExt;
AskOW:=(Name<>PString(Info)^); AskOW:=(Name<>PString(Info)^);
end; end;
edWriteBlock : AskOW:=true; edWriteBlock :
begin
if ExtOf(Name)='' then
Name:=Name+DefaultSaveExt;
AskOW:=true;
end;
edReadBlock : AskOW:=false; edReadBlock : AskOW:=false;
else AskOW:=true; else AskOW:=true;
end; end;
@ -5858,7 +5897,31 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:37 michael Revision 1.2 2000-08-22 09:41:41 pierre
* first big merge from fixes branch
Revision 1.1.2.4 2000/08/15 03:40:54 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1.2.3 2000/07/20 11:02:16 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1.2.2 2000/07/18 05:50:22 michael
+ Merged Gabors fixes
Revision 1.1.2.1 2000/07/15 21:30:06 pierre
* Do not consider ASM inside a string as a assembler statement start
* Add .pas extension to edWriteBlock if no extension is choosen
Revision 1.1 2000/07/13 09:48:37 michael
+ Initial import + Initial import
Revision 1.95 2000/06/22 09:07:13 pierre Revision 1.95 2000/06/22 09:07:13 pierre

View File

@ -57,6 +57,7 @@ type
TINIFile = object(TObject) TINIFile = object(TObject)
MakeNullEntries: boolean; MakeNullEntries: boolean;
constructor Init(const AFileName: string); constructor Init(const AFileName: string);
function GetFileName: string;
function Read: boolean; virtual; function Read: boolean; virtual;
function Update: boolean; virtual; function Update: boolean; virtual;
function IsModified: boolean; virtual; function IsModified: boolean; virtual;
@ -79,6 +80,7 @@ type
const MainSectionName : string[40] = 'MainSection'; const MainSectionName : string[40] = 'MainSection';
CommentChar : char = ';'; CommentChar : char = ';';
ValidStrDelimiters: set of char = ['''','"'];
implementation implementation
@ -141,21 +143,24 @@ end;
procedure TINIEntry.Split; procedure TINIEntry.Split;
var S,ValueS: string; var S,ValueS: string;
P,P2: byte; P,P2,StartP: byte;
C: char; C: char;
InString: boolean; InString: boolean;
Delimiter: char;
begin begin
S:=GetText; S:=GetText; Delimiter:=#0;
P:=Pos('=',S); P2:=Pos(CommentChar,S); P:=Pos('=',S); P2:=Pos(CommentChar,S);
if (P2<>0) and (P2<P) then P:=0; if (P2<>0) and (P2<P) then P:=0;
if P<>0 then if P<>0 then
begin begin
Tag:=NewStr(copy(S,1,P-1)); Tag:=NewStr(copy(S,1,P-1));
P2:=P+1; InString:=false; ValueS:=''; P2:=P+1; InString:=false; ValueS:='';
StartP:=P2;
while (P2<=length(S)) do while (P2<=length(S)) do
begin begin
C:=S[P2]; C:=S[P2];
if C='"' then InString:=not InString else if (P2=StartP) and (C in ValidStrDelimiters) then begin Delimiter:=C; InString:=true; end else
if C=Delimiter then InString:=not InString else
if (C=CommentChar) and (InString=false) then Break else if (C=CommentChar) and (InString=false) then Break else
ValueS:=ValueS+C; ValueS:=ValueS+C;
Inc(P2); Inc(P2);
@ -259,6 +264,11 @@ begin
Read; Read;
end; end;
function TINIFile.GetFileName: string;
begin
GetFileName:=GetStr(FileName);
end;
function TINIFile.Read: boolean; function TINIFile.Read: boolean;
var f: text; var f: text;
OK: boolean; OK: boolean;
@ -478,7 +488,30 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:37 michael Revision 1.2 2000-08-22 09:41:41 pierre
* first big merge from fixes branch
Revision 1.1.2.3 2000/08/16 18:46:15 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.2 2000/08/15 03:40:55 peter
[*] no more fatal exits when the IDE can't find the error file (containing
the redirected assembler/linker output) after compilation
[*] hidden windows are now added always at the end of the Window List
[*] TINIFile parsed entries encapsulated in string delimiters incorrectly
[*] selection was incorrectly adjusted when typing in overwrite mode
[*] the line wasn't expanded when it's end was reached in overw. mode
[*] the IDE now tries to locate source files also in the user specified
unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
[*] 'Open at cursor' is now aware of the extension (if specified)
Revision 1.1.2.1 2000/07/20 11:02:16 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:37 michael
+ Initial import + Initial import
Revision 1.10 2000/06/22 09:07:15 pierre Revision 1.10 2000/06/22 09:07:15 pierre

View File

@ -23,6 +23,11 @@ interface
uses uses
Dos,Objects; Dos,Objects;
const
TempFirstChar = {$ifndef Linux}'~'{$else}'_'{$endif};
TempExt = '.tmp';
TempNameLen = 8;
type type
PByteArray = ^TByteArray; PByteArray = ^TByteArray;
TByteArray = array[0..MaxBytes] of byte; TByteArray = array[0..MaxBytes] of byte;
@ -127,15 +132,20 @@ function GetFileTime(const FileName: string): longint;
function GetShortName(const n:string):string; function GetShortName(const n:string):string;
function GetLongName(const n:string):string; function GetLongName(const n:string):string;
function TrimEndSlash(const Path: string): string; function TrimEndSlash(const Path: string): string;
function CompleteDir(const Path: string): string;
function GetCurDir: string;
function OptimizePath(Path: string; MaxLen: integer): string; function OptimizePath(Path: string; MaxLen: integer): string;
function CompareText(S1, S2: string): integer; function CompareText(S1, S2: string): integer;
function ExistsDir(const DirName: string): boolean;
function ExistsFile(const FileName: string): boolean;
function DeleteFile(const FileName: string): integer;
function CopyFile(const SrcFileName, DestFileName: string): boolean;
function GenTempFileName: string;
function FormatPath(Path: string): string; function FormatPath(Path: string): string;
function CompletePath(const Base, InComplete: string): string; function CompletePath(const Base, InComplete: string): string;
function CompleteURL(const Base, URLRef: string): string; function CompleteURL(const Base, URLRef: string): string;
function DeleteFile(const FileName: string): integer;
function EatIO: integer; function EatIO: integer;
function Now: longint; function Now: longint;
@ -1010,6 +1020,86 @@ begin
{$I+} {$I+}
end; end;
function ExistsFile(const FileName: string): boolean;
var
Dir : SearchRec;
begin
Dos.FindFirst(FileName,Archive+ReadOnly,Dir);
ExistsFile:=(DosError=0);
{$ifdef FPC}
Dos.FindClose(Dir);
{$endif def FPC}
end;
function ExistsDir(const DirName: string): boolean;
var
Dir : SearchRec;
begin
Dos.FindFirst(TrimEndSlash(DirName),Directory,Dir);
ExistsDir:=(DosError=0);
{$ifdef FPC}
Dos.FindClose(Dir);
{$endif def FPC}
end;
function CompleteDir(const Path: string): string;
begin
{ keep c: untouched PM }
if (Path<>'') and (Path[Length(Path)]<>DirSep) and
(Path[Length(Path)]<>':') then
CompleteDir:=Path+DirSep
else
CompleteDir:=Path;
end;
function GetCurDir: string;
var S: string;
begin
GetDir(0,S);
if copy(S,length(S),1)<>DirSep then S:=S+DirSep;
GetCurDir:=S;
end;
function GenTempFileName: string;
var Dir: string;
Name: string;
I: integer;
OK: boolean;
Path: string;
begin
Dir:=GetEnv('TEMP');
if Dir='' then Dir:=GetEnv('TMP');
if (Dir<>'') then if not ExistsDir(Dir) then Dir:='';
if Dir='' then Dir:=GetCurDir;
repeat
Name:=TempFirstChar;
for I:=2 to TempNameLen do
Name:=Name+chr(ord('a')+random(ord('z')-ord('a')+1));
Name:=Name+TempExt;
Path:=CompleteDir(Dir)+Name;
OK:=not ExistsFile(Path);
until OK;
GenTempFileName:=Path;
end;
function CopyFile(const SrcFileName, DestFileName: string): boolean;
var SrcF,DestF: PBufStream;
OK: boolean;
begin
SrcF:=nil; DestF:=nil;
New(SrcF, Init(SrcFileName,stOpenRead,4096));
OK:=Assigned(SrcF) and (SrcF^.Status=stOK);
if OK then
begin
New(DestF, Init(DestFileName,stCreate,1024));
OK:=Assigned(DestF) and (DestF^.Status=stOK);
end;
if OK then DestF^.CopyFrom(SrcF^,SrcF^.GetSize);
if Assigned(DestF) then Dispose(DestF, Done);
if Assigned(SrcF) then Dispose(SrcF, Done);
CopyFile:=OK;
end;
procedure GiveUpTimeSlice; procedure GiveUpTimeSlice;
{$ifdef GO32V2}{$define DOS}{$endif} {$ifdef GO32V2}{$define DOS}{$endif}
{$ifdef TP}{$define DOS}{$endif} {$ifdef TP}{$define DOS}{$endif}
@ -1037,15 +1127,31 @@ begin
{$endif} {$endif}
end; end;
BEGIN
Randomize;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:37 michael Revision 1.2 2000-08-22 09:41:42 pierre
* first big merge from fixes branch
Revision 1.1.2.3 2000/08/20 15:00:23 peter
* windows fix
Revision 1.1.2.2 2000/08/16 18:46:15 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.1 2000/07/20 11:02:16 michael
+ Fixes from gabor. See fixes.txt
Revision 1.1 2000/07/13 09:48:37 michael
+ Initial import + Initial import
Revision 1.27 2000/07/03 08:54:54 pierre Revision 1.27 2000/07/03 08:54:54 pierre
* Some enhancements for WinHelp support by G abor * Some enhancements for WinHelp support by G abor
Revision 1.26 2000/06/26 07:29:23 pierre Revision 1.26 2000/06/26 07:29:23 pierre
* new bunch of Gabor's changes * new bunch of Gabor's changes
@ -1144,4 +1250,4 @@ END.
Revision 1.1 1999/03/01 15:51:43 peter Revision 1.1 1999/03/01 15:51:43 peter
+ Log + Log
} }

View File

@ -25,9 +25,22 @@ const
cmUpdate = 54101; cmUpdate = 54101;
cmListFocusChanged = 54102; cmListFocusChanged = 54102;
mfUserBtn1 = $00010000;
mfUserBtn2 = $00020000;
mfUserBtn3 = $00040000;
mfUserBtn4 = $00080000;
mfCantCancel = $00100000;
cmUserBtn1 = $fee0;
cmUserBtn2 = $fee1;
cmUserBtn3 = $fee2;
cmUserBtn4 = $fee3;
CPlainCluster = #7#8#9#9; CPlainCluster = #7#8#9#9;
type type
longstring = {$ifdef TP}string{$else}ansistring{$endif};
PCenterDialog = ^TCenterDialog; PCenterDialog = ^TCenterDialog;
TCenterDialog = object(TDialog) TCenterDialog = object(TDialog)
constructor Init(var Bounds: TRect; ATitle: TTitleStr); constructor Init(var Bounds: TRect; ATitle: TTitleStr);
@ -180,6 +193,12 @@ type
constructor Init(var Bounds: TRect); constructor Init(var Bounds: TRect);
end; end;
PAdvMessageBox = ^TAdvMessageBox;
TAdvMessageBox = object(TDialog)
CanCancel: boolean;
procedure HandleEvent(var Event: TEvent); virtual;
end;
procedure InsertOK(ADialog: PDialog); procedure InsertOK(ADialog: PDialog);
procedure InsertButtons(ADialog: PDialog); procedure InsertButtons(ADialog: PDialog);
@ -188,6 +207,7 @@ procedure ErrorBox(const S: string; Params: pointer);
procedure WarningBox(const S: string; Params: pointer); procedure WarningBox(const S: string; Params: pointer);
procedure InformationBox(const S: string; Params: pointer); procedure InformationBox(const S: string; Params: pointer);
function ConfirmBox(const S: string; Params: pointer; CanCancel: boolean): word; function ConfirmBox(const S: string; Params: pointer; CanCancel: boolean): word;
function ChoiceBox(const S: string; Params: pointer; Buttons: array of longstring; CanCancel: boolean): word;
procedure ShowMessage(Msg: string); procedure ShowMessage(Msg: string);
procedure HideMessage; procedure HideMessage;
@ -219,14 +239,22 @@ procedure AddFormatParamStr(const S: string);
function FormatStrF(const Format: string; var Params): string; function FormatStrF(const Format: string; var Params): string;
function FormatStrStr(const Format, Param: string): string; function FormatStrStr(const Format, Param: string): string;
function FormatStrStr2(const Format, Param1,Param2: string): string; function FormatStrStr2(const Format, Param1,Param2: string): string;
function FormatStrStr3(const Format, Param1,Param2,Param3: string): string;
function FormatStrInt(const Format: string; L: longint): string; function FormatStrInt(const Format: string; L: longint): string;
const UserButtonName : array[1..4] of string[40] = ('User~1~','User~2~','User~3~','User~4~');
procedure InitAdvMsgBox;
function AdvMessageBox(const Msg: String; Params: Pointer; AOptions: longint): Word;
function AdvMessageBoxRect(var R: TRect; const Msg: String; Params: Pointer; AOptions: longint): Word;
procedure DoneAdvMsgBox;
procedure RegisterWViews; procedure RegisterWViews;
implementation implementation
uses Mouse, uses Mouse,
Commands,App,MsgBox, Resource,Commands,App,MsgBox,
WConsts,WUtils; WConsts,WUtils;
{$ifndef NOOBJREG} {$ifndef NOOBJREG}
@ -259,6 +287,7 @@ const
const const
MessageDialog : PCenterDialog = nil; MessageDialog : PCenterDialog = nil;
UserButtonCmd : array[Low(UserButtonName)..High(UserButtonName)] of word = (cmUserBtn1,cmUserBtn2,cmUserBtn3,cmUserBtn4);
function ColorIndex(Color: byte): word; function ColorIndex(Color: byte): word;
begin begin
@ -1425,22 +1454,43 @@ end;
procedure ErrorBox(const S: string; Params: pointer); procedure ErrorBox(const S: string; Params: pointer);
begin begin
MessageBox(S,Params,mfError+mfInsertInApp+mfOKButton); AdvMessageBox(S,Params,mfError+mfInsertInApp+mfOKButton);
end; end;
procedure WarningBox(const S: string; Params: pointer); procedure WarningBox(const S: string; Params: pointer);
begin begin
MessageBox(S,Params,mfWarning+mfInsertInApp+mfOKButton); AdvMessageBox(S,Params,mfWarning+mfInsertInApp+mfOKButton);
end; end;
procedure InformationBox(const S: string; Params: pointer); procedure InformationBox(const S: string; Params: pointer);
begin begin
MessageBox(S,Params,mfInformation+mfInsertInApp+mfOKButton); AdvMessageBox(S,Params,mfInformation+mfInsertInApp+mfOKButton);
end;
function b2i(B: boolean): longint;
begin
if b then b2i:=1 else b2i:=0;
end; end;
function ConfirmBox(const S: string; Params: pointer; CanCancel: boolean): word; function ConfirmBox(const S: string; Params: pointer; CanCancel: boolean): word;
begin begin
ConfirmBox:=MessageBox(S,Params,mfConfirmation+mfInsertInApp+mfYesButton+mfNoButton+integer(CanCancel)*mfCancelButton); ConfirmBox:=AdvMessageBox(S,Params,mfConfirmation+mfInsertInApp+mfYesButton+mfNoButton+
b2i(CanCancel)*mfCancelButton+b2i(not CanCancel)*mfCantCancel);
end;
function ChoiceBox(const S: string; Params: pointer; Buttons: array of longstring; CanCancel: boolean): word;
var BtnMask,M: longint;
I,BtnCount: integer;
begin
BtnCount:=Min(High(Buttons)-Low(Buttons)+1,High(UserButtonName)-Low(UserButtonName)+1);
BtnMask:=0; M:=mfUserBtn1;
for I:=Low(Buttons) to Low(Buttons)+BtnCount-1 do
begin
UserButtonName[Low(UserButtonName)+I-Low(Buttons)]:=Buttons[I];
BtnMask:=BtnMask or M; M:=M shl 1;
end;
ChoiceBox:=AdvMessageBox(S,Params,mfConfirmation+BtnMask+
b2i(CanCancel)*mfCancelButton+b2i(not CanCancel)*mfCantCancel);
end; end;
function IsSeparator(P: PMenuItem): boolean; function IsSeparator(P: PMenuItem): boolean;
@ -1928,8 +1978,9 @@ end;
procedure TDropDownListBox.DropList(Drop: boolean); procedure TDropDownListBox.DropList(Drop: boolean);
var R: TRect; var R: TRect;
LB: PListBox;
begin begin
if ListDropped=Drop then Exit; if (ListDropped=Drop) then Exit;
if Drop then if Drop then
begin begin
@ -1952,8 +2003,8 @@ begin
if ListBox<>nil then if ListBox<>nil then
begin begin
{ ListBox^.List:=nil;} { ListBox^.List:=nil;}
Dispose(ListBox, Done); LB:=ListBox; ListBox:=nil; { this prevents GPFs while deleting }
ListBox:=nil; Dispose(LB, Done);
end; end;
if SB<>nil then if SB<>nil then
begin begin
@ -2114,6 +2165,26 @@ begin
GrowMode:=gfGrowHiX+gfGrowHiY; GrowMode:=gfGrowHiX+gfGrowHiY;
end; end;
procedure TAdvMessageBox.HandleEvent(var Event: TEvent);
var I: integer;
begin
if (not CanCancel) and (Event.What=evCommand) and (Event.Command=cmCancel) then
ClearEvent(Event);
inherited HandleEvent(Event);
case Event.What of
evCommand:
begin
for I:=Low(UserButtonCmd) to High(UserButtonCmd) do
if Event.Command=UserButtonCmd[I] then
if State and sfModal <> 0 then
begin
EndModal(Event.Command);
ClearEvent(Event);
end;
end;
end;
end;
procedure ClearFormatParams; procedure ClearFormatParams;
begin begin
FormatParamCount:=0; FillChar(FormatParams,sizeof(FormatParams),0); FormatParamCount:=0; FillChar(FormatParams,sizeof(FormatParams),0);
@ -2168,6 +2239,15 @@ begin
FormatStrStr2:=S; FormatStrStr2:=S;
end; end;
function FormatStrStr3(const Format, Param1,Param2,Param3: string): string;
var S: string;
P: array[1..3] of pointer;
begin
P[1]:=@Param1; P[2]:=@Param2; P[3]:=@Param3;
FormatStr(S,Format,P);
FormatStrStr3:=S;
end;
function FormatStrInt(const Format: string; L: longint): string; function FormatStrInt(const Format: string; L: longint): string;
var S: string; var S: string;
begin begin
@ -2175,6 +2255,153 @@ begin
FormatStrInt:=S; FormatStrInt:=S;
end; end;
const
Cmds: array[0..3] of word =
(cmYes, cmNo, cmOK, cmCancel);
var
ButtonName: array[0..3] of string;
Titles: array[0..3] of string;
function AdvMessageBox(const Msg: String; Params: Pointer; AOptions: longint): Word;
var
R: TRect;
begin
R.Assign(0, 0, 0, 0);
AdvMessageBox := AdvMessageBoxRect(R, Msg, Params, AOptions);
end;
procedure GetStaticTextDimensions(const S: string; ViewWidth: integer; var MaxCols, Rows: integer);
var
Color: Byte;
Center: Boolean;
I, J, L, P, Y: Sw_Integer;
CurLine: string;
begin
MaxCols:=0;
L := Length(S);
P := 1;
Y := 0;
Center := False;
while (Y < 32767) and (P<=length(S)) do
begin
CurLine:='';
if P <= L then
begin
if S[P] = #3 then
begin
Center := True;
Inc(P);
end;
I := P;
repeat
J := P;
while (P <= L) and (S[P] = ' ') do Inc(P);
while (P <= L) and (S[P] <> ' ') and (S[P] <> #13) do Inc(P);
until (P > L) or (P >= I + ViewWidth) or (S[P] = #13);
if P > I + ViewWidth then
if J > I then P := J else P := I + ViewWidth;
if Center then J := (ViewWidth - P + I) div 2 else J := 0;
CurLine:=CurLine+copy(S,I,P-I);
{ MoveBuf(B[J], S[I], Color, P - I);}
while (P <= L) and (S[P] = ' ') do Inc(P);
if (P <= L) and (S[P] = #13) then
begin
Center := False;
Inc(P);
if (P <= L) and (S[P] = #10) then Inc(P);
end;
end;
if length(CurLine)>MaxCols then
MaxCols:=length(CurLine);
{ WriteLine(0, Y, Size.X, 1, B);}
Inc(Y);
end;
Rows:=Y;
end;
function AdvMessageBoxRect(var R: TRect; const Msg: String; Params: Pointer; AOptions: longint): Word;
var
I, X, ButtonCount: Sw_Integer;
Dialog: PAdvMessageBox;
Control: PView;
ButtonList: array[0..4] of PView;
S,BtnName: String;
Cols,Rows: integer;
begin
FormatStr(S, Msg, Params^);
if R.Empty then
begin
GetStaticTextDimensions(S,40,Cols,Rows);
if Cols<30 then Cols:=30; if Rows=0 then Rows:=1;
R.Assign(0,0,3+Cols+3,Rows+6);
if (AOptions and mfInsertInApp)= 0 then
R.Move((Desktop^.Size.X-(R.B.X-R.A.X)) div 2,(Desktop^.Size.Y-(R.B.Y-R.A.Y)) div 2)
else
R.Move((Application^.Size.X-(R.B.X-R.A.X)) div 2,(Application^.Size.Y-(R.B.Y-R.A.Y)) div 2);
end;
New(Dialog,Init(R, Titles[AOptions and $3]));
with Dialog^ do
begin
CanCancel:=(Options and mfCantCancel)=0;
R.Assign(3,2, Size.X-2,Size.Y-3);
Control := New(PStaticText, Init(R, S));
Insert(Control);
X := -2;
ButtonCount := 0;
for I := 0 to 3 do
if AOptions and ($10000 shl I) <> 0 then
begin
BtnName:=UserButtonName[I+1];
R.Assign(0, 0, Max(10,length(BtnName)+2), 2);
Control := New(PButton, Init(R, BtnName, UserButtonCmd[I+1], bfNormal));
Inc(X, Control^.Size.X + 2);
ButtonList[ButtonCount] := Control;
Inc(ButtonCount);
end;
for I := 0 to 3 do
if AOptions and ($0100 shl I) <> 0 then
begin
R.Assign(0, 0, 10, 2);
Control := New(PButton, Init(R, ButtonName[I], Cmds[i], bfNormal));
Inc(X, Control^.Size.X + 2);
ButtonList[ButtonCount] := Control;
Inc(ButtonCount);
end;
X := (Size.X - X) div 2;
for I := 0 to ButtonCount - 1 do
begin
Control := ButtonList[I];
Insert(Control);
Control^.MoveTo(X, Size.Y - 3);
Inc(X, Control^.Size.X + 2);
end;
SelectNext(False);
end;
if AOptions and mfInsertInApp = 0 then
AdvMessageBoxRect := DeskTop^.ExecView(Dialog)
else
AdvMessageBoxRect := Application^.ExecView(Dialog);
Dispose(Dialog, Done);
end;
procedure InitAdvMsgBox;
begin
ButtonName[0] := Labels^.Get(slYes);
ButtonName[1] := Labels^.Get(slNo);
ButtonName[2] := Labels^.Get(slOk);
ButtonName[3] := Labels^.Get(slCancel);
Titles[0] := Labels^.Get(sWarning);
Titles[1] := Labels^.Get(sError);
Titles[2] := Labels^.Get(sInformation);
Titles[3] := Labels^.Get(sConfirm);
end;
procedure DoneAdvMsgBox;
begin
end;
procedure RegisterWViews; procedure RegisterWViews;
begin begin
{$ifndef NOOBJREG} {$ifndef NOOBJREG}
@ -2189,7 +2416,28 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.1 2000-07-13 09:48:37 michael Revision 1.2 2000-08-22 09:41:42 pierre
* first big merge from fixes branch
Revision 1.1.2.2 2000/08/16 18:46:15 peter
[*] double clicking on a droplistbox caused GPF (due to invalid recurson)
[*] Make, Build now possible even in Compiler Messages Window
[+] when started in a new dir the IDE now ask whether to create a local
config, or to use the one located in the IDE dir
Revision 1.1.2.1 2000/08/04 14:05:20 michael
* Fixes from Gabor:
[*] the IDE now doesn't disable Compile|Make & Build when all windows
are closed, but there's still a primary file set
(set bug 1059 to fixed!)
[*] the IDE didn't read some compiler options correctly back from the
FP.CFG file, for ex. the linker options. Now it read everything
correctly, and also automatically handles smartlinking option synch-
ronization.
(set bug 1048 to fixed!)
Revision 1.1 2000/07/13 09:48:37 michael
+ Initial import + Initial import
Revision 1.15 2000/06/22 09:07:15 pierre Revision 1.15 2000/06/22 09:07:15 pierre