* 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
@ -1048,7 +1048,7 @@ ifdef INSTALLPPUFILES
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
endif
@ -1213,7 +1213,7 @@ ifdef CLEANPPUFILES
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
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
========================= Already fixed ================================

View File

@ -39,7 +39,7 @@ uses
{$ifdef EDITORS}Editors{$else}WEditor,WCEdit{$endif},
ASCIITab,Calc,
WUtils,WViews,WHTMLScn,
FPIDE,FPCalc,FPCompile,
FPIDE,FPCalc,FPCompil,
FPIni,FPViews,FPConst,FPVars,FPUtils,FPHelp,FPSwitch,FPUsrScr,
FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk,
FPCodTmp,FPCodCmp;
@ -212,8 +212,9 @@ BEGIN
InitCodeTemplates;
InitCodeComplete;
ReadSwitches(SwitchesPath);
IDEApp.Init;
CheckINIFile;
ReadSwitches(SwitchesPath);
{ load all options after init because of open files }
ReadINIFile;
InitDesktopFile;
@ -270,7 +271,19 @@ BEGIN
END.
{
$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
Revision 1.47 2000/06/16 08:50:40 pierre

View File

@ -14,7 +14,7 @@
**********************************************************************}
{$i globdir.inc}
unit FPCompile;
unit FPCompil;
interface
@ -27,8 +27,9 @@ interface
uses
Objects,
files,
Drivers,Views,Dialogs,
WUtils,WViews,
WUtils,WViews,WCEdit,
FPSymbol,
FPViews;
@ -59,6 +60,8 @@ type
procedure ClearMessages;
constructor Load(var S: TStream);
procedure Store(var S: TStream);
procedure SetState(AState: Word; Enable: Boolean); virtual;
procedure UpdateCommands; virtual;
private
{CompileShowed : boolean;}
{Mode : TCompileMode;}
@ -75,6 +78,20 @@ type
procedure Update;
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
CompilerMessageWindow : PCompilerMessageWindow = nil;
CompilerStatusDialog : PCompilerStatusDialog = nil;
@ -404,6 +421,22 @@ begin
PutSubViewPtr(S,MsgLB);
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;
begin
@ -543,6 +576,29 @@ procedure CompilerStop; {$ifndef FPC}far;{$endif}
begin
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}
begin
@ -616,9 +672,9 @@ begin
FileName:=PrimaryFileMain
else
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 }
else
else*) { no longer needed - Gabor }
FileName:=P^.Editor^.FileName;
end;
end;
@ -693,10 +749,14 @@ begin
do_status:=CompilerStatus;
do_stop:=CompilerStop;
do_comment:=CompilerComment;
do_openinputfile:=CompilerOpenInputFile;
do_getnamedfiletime:=CompilerGetNamedFileTime;
{$else not TP}
do_status:=@CompilerStatus;
do_stop:=@CompilerStop;
do_comment:=@CompilerComment;
do_openinputfile:=@CompilerOpenInputFile;
do_getnamedfiletime:=@CompilerGetNamedFileTime;
{$endif TP}
do_initsymbolinfo:=InitBrowserCol;
do_donesymbolinfo:=DoneBrowserCol;
@ -755,23 +815,31 @@ begin
Inc(status.errorCount);
ClearFormatParams; AddFormatParamStr(ExeFile);
CompilerMessageWindow^.AddMessage(V_error,FormatStrF(msg_couldnotcreatefile,FormatParams),'',0,0);
{$I-}
Assign(ErrFile,FPErrFileName);
Reset(ErrFile);
LinkErrorCount:=0;
While not eof(ErrFile) and (LinkErrorCount<25) do
begin
readln(ErrFile,s);
CompilerMessageWindow^.AddMessage(V_error,s,'',0,0);
inc(LinkErrorCount);
end;
if not eof(ErrFile) then
if EatIO<>0 then
ErrorBox(FormatStrStr(msg_cantopenfile,FPErrFileName),nil)
else
begin
ClearFormatParams; AddFormatParamStr(FPErrFileName);
CompilerMessageWindow^.AddMessage(V_error,
FormatStrF(msg_therearemoreerrorsinfile,FormatParams),'',0,0);
end;
LinkErrorCount:=0;
While not eof(ErrFile) and (LinkErrorCount<25) do
begin
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;
{$ifdef TEMPHEAP}
@ -899,6 +967,78 @@ begin
NeedRecompile:=Need;
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;
begin
{$ifndef NOOBJREG}
@ -911,7 +1051,38 @@ end;
end.
{
$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
Revision 1.60 2000/06/22 09:07:11 pierre

View File

@ -21,7 +21,7 @@ uses Views,App,Commands,
WViews,WEditor;
const
VersionStr = '0.9';
VersionStr = '0.9.1';
MaxRecentFileCount = 5;
MaxToolCount = 16;
@ -31,6 +31,7 @@ const
CompilerStatusUpdateDelay = 0.8; { in secs }
ININame = 'fp.ini';
DirInfoName = 'fp.dir';
SwitchesName = 'fp.cfg';
DesktopName = 'fp.dsk';
BrowserName = 'fp.brw';
@ -407,7 +408,19 @@ implementation
END.
{
$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
Revision 1.42 2000/06/26 07:29:22 pierre

View File

@ -349,7 +349,7 @@ uses
{$endif win32}
Systems,
FPString,FPVars,FPUtils,FPConst,FPSwitch,
FPIntf,FPCompile,FPIde,FPHelp,
FPIntf,FPCompil,FPIde,FPHelp,
Validate,WEditor,WUtils;
const
@ -3346,7 +3346,13 @@ end.
{
$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
Revision 1.63 2000/06/22 09:07:11 pierre

View File

@ -46,7 +46,7 @@ implementation
uses Dos,
Objects,Drivers,Video,
Views,App,HistList,BrowCol,
WResourc,WViews,WEditor,
WUtils,WResourc,WViews,WEditor,
{$ifndef NODEBUG}
fpdebug,
{$endif ndef NODEBUG}
@ -795,7 +795,13 @@ end;
END.
{
$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
Revision 1.29 2000/06/22 09:07:12 pierre

View File

@ -383,7 +383,7 @@ procedure HelpTopicSearch(Editor: PEditor);
var S: string;
begin
if Editor=nil then S:='' else
S:=GetEditorCurWord(Editor);
S:=GetEditorCurWord(Editor,[]);
HelpTopic(S);
end;
@ -518,7 +518,21 @@ end;
END.
{
$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
Revision 1.35 2000/06/26 07:29:23 pierre

View File

@ -119,6 +119,8 @@ type
procedure HelpUsingHelp;
procedure HelpFiles;
procedure About;
public
procedure SourceWindowClosed;
private
SaveCancelled: boolean;
InsideDone : boolean;
@ -156,7 +158,7 @@ uses
Dos,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx,
Systems,
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,
FPDesk,FPCodCmp,FPCodTmp;
@ -241,6 +243,7 @@ begin
{$endif TP}
{$endif}
inherited Init;
InitAdvMsgBox;
InsideDone:=false;
MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
New(ClockView, Init(R));
@ -561,7 +564,7 @@ begin
if (OpenFileName<>'') and
((DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0)) then
begin
TempS:=LocateFile(OpenFileName);
TempS:=LocateSourceFile(OpenFileName,false);
if TempS='' then
ForceDlg:=true
else
@ -718,6 +721,11 @@ end;
procedure TIDEApp.ShowUserScreen;
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;
DoneEvents;
DoneKeyboard;
@ -737,9 +745,11 @@ end;
procedure TIDEApp.ShowIDEScreen;
begin
{$ifndef linux}
{ the video has to be initialized already for linux (JM) }
if Assigned(UserScreen) then
UserScreen^.SwitchBack;
{$endif linux}
InitDosMem;
{$ifndef go32v2}
InitScreen;
@ -753,6 +763,10 @@ begin
InitSysError;
CurDirChanged;
Message(Application,evBroadcast,cmUpdate,nil);
{$ifdef linux}
if Assigned(UserScreen) then
UserScreen^.SwitchBack;
{$endif linux}
{$ifndef go32v2}
UpdateScreen(true);
{$endif go32v2}
@ -768,7 +782,7 @@ begin
if IOK=false then
ErrorBox(error_saving_cfg_file,nil);
end;
if (AutoSaveOptions and asEditorFiles)=0 then
if (AutoSaveOptions and asEditorFiles)<>0 then { was a typo here ("=0") - Gabor }
SOK:=SaveAll;
if (AutoSaveOptions and asDesktop)<>0 then
begin
@ -786,7 +800,7 @@ end;
function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile: string; ExecType: TExecType): boolean;
var CanRun: boolean;
posexe : longint;
PosExe: sw_integer;
begin
SaveCancelled:=false;
CanRun:=AutoSave;
@ -851,6 +865,12 @@ begin
Message(Application,evBroadcast,cmCommandSetChanged,nil);
end;
procedure TIDEApp.SourceWindowClosed;
begin
if not IsClosing then
Update;
end;
procedure TIDEApp.CurDirChanged;
begin
Message(Application,evBroadcast,cmUpdateTitle,nil);
@ -1060,7 +1080,53 @@ end;
END.
{
$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
Revision 1.65 2000/06/22 09:07:12 pierre

View File

@ -20,6 +20,7 @@ uses
FPUtils;
procedure InitINIFile;
procedure CheckINIFile;
function ReadINIFile: boolean;
function WriteINIFile: boolean;
@ -27,10 +28,10 @@ function WriteINIFile: boolean;
implementation
uses
Dos,Objects,Drivers,
WINI,{$ifndef EDITORS}WEditor,WCEdit{$else}Editors{$endif},
Dos,Objects,Drivers,Commands,
WConsts,WUtils,WINI,WViews,{$ifndef EDITORS}WEditor,WCEdit{$else}Editors{$endif},
{$ifndef NODEBUG}FPDebug,{$endif}FPConst,FPVars,
FPIntf,FPTools,FPSwitch;
FPIntf,FPTools,FPSwitch,FPString;
const
{ INI file sections }
@ -101,6 +102,47 @@ begin
IniFileName:=FExpand(IniFileName);
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;
var C: string;
I: integer;
@ -528,7 +570,19 @@ end;
end.
{
$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
Revision 1.30 2000/06/22 09:07:12 pierre

View File

@ -56,6 +56,7 @@ begin
SwitchesMode:=TSwitchMode(RB^.Value);
Dispose(D, Done);
UpdateMode;
UpdateTarget;
end;
procedure TIDEApp.DoCompilerSwitch;
@ -401,10 +402,18 @@ begin
Insert(New(PLabel, Init(R2, label_linker_preferredlibtype, RB2)));
end;
InsertButtons(D);
RB2^.Select;
if Desktop^.ExecView(D)=cmOK then
begin
{ SetEXEFormat(TEXEFormat(RB1^.Value+1));}
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;
Dispose(D, Done);
end;
@ -1214,7 +1223,25 @@ end;
{
$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
Revision 1.35 2000/06/16 08:50:41 pierre

View File

@ -55,8 +55,13 @@ var Title,ProgramPath,Params: string;
begin
if (Idx<1) or (Idx>GetToolCount) then Exit;
GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
InitToolTempFiles;
Err:=ParseToolParams(Params,false);
if Err=-1 then Exit;
if Err=-1 then
begin
DoneToolTempFiles;
Exit;
end;
if Err<>0 then
begin ErrorBox(msg_errorparsingtoolparams,nil); Exit; end;
if CaptureToolTo<>capNone then
@ -133,6 +138,7 @@ begin
EraseFile(CaptureFile);
EraseFile(FilterCaptureName);
{$endif}
DoneToolTempFiles;
end;
@ -294,7 +300,13 @@ end;
{
$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
Revision 1.21 2000/06/16 08:50:41 pierre

View File

@ -99,7 +99,9 @@ begin
LB^.Default:=true;
LB^.NewList(C);
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);
R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1;
Insert(New(PLabel, Init(R2, label_wndlist_windows, LB)));
@ -122,17 +124,19 @@ begin
end;
procedure TWindowListDialog.UpdateList;
var VisState: boolean;
procedure AddIt(P: PView); {$ifndef FPC}far;{$endif}
begin
if (P<>pointer(Desktop^.Background)) and
(P^.GetState(sfDisabled)=false) and
((P^.Options and ofSelectable)<>0) {and
(P^.GetState(sfVisible)) }then
((P^.Options and ofSelectable)<>0) and
(P^.GetState(sfVisible)=VisState) then
C^.Insert(P);
end;
begin
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);
UpdateButtons;
ReDraw;
@ -227,7 +231,21 @@ end;
{
$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
Revision 1.18 2000/06/16 08:50:41 pierre

View File

@ -594,6 +594,17 @@ const
msg_nothingtodebug = 'Oooops, nothing to debug.';
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 }
msg_readingdesktopfile = 'Reading desktop file...';
msg_writingdesktopfile = 'Writing desktop file...';
@ -748,6 +759,7 @@ const
opt_listsource = '~L~ist source';
opt_listregisterallocation = 'list ~r~egister allocation';
opt_listtempallocation = 'list ~t~emp allocation';
opt_usedefaultas = 'Use ~d~efault output';
opt_usegnuas = 'Use ~G~NU as';
opt_usenasmcoff = 'Use ~N~ASM coff';
opt_usenasmelf = 'Use NASM ~e~lf';
@ -772,8 +784,10 @@ const
opt_objectdirectories = '~O~bject directories';
opt_exeppudirectories = '~E~XE & PPU directories';
{ Library options }
opt_librariesdefault = '~T~arget default';
opt_dynamiclibraries = '~D~ynamic libraries';
opt_staticlibraries = '~S~tatic libraries';
opt_smartlibraries = 'S~m~art libraries';
{ Symbol info options }
opt_stripalldebugsymbols = '~S~trip all debug symbols from executable';
opt_gendebugsymbolinfo = 'Generate ~d~ebug symbol information';
@ -782,6 +796,10 @@ const
opt_noprofileinfo = '~N~o profile information';
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 }
msg_programexitedwithcodeandsteps = #3'Program exited with '#13+
#3'exitcode = %d'#13+
@ -961,7 +979,31 @@ const
{
$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
Revision 1.4 2000/06/16 08:50:41 pierre
@ -977,4 +1019,4 @@ const
* new set of Gabor changes: see fixes.txt
}
}

View File

@ -594,6 +594,17 @@ const
msg_nothingtodebug = 'Hopp , nincs mit debuggolni.';
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 }
msg_readingdesktopfile = 'Asztal-f jl olvas sa...';
msg_writingdesktopfile = 'Asztal-f jl ¡r sa...';
@ -748,6 +759,7 @@ const
opt_listsource = 'Forr s ~l~ist z sa';
opt_listregisterallocation = '~r~egister-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_usenasmcoff = '~N~ASM coff haszn lata';
opt_usenasmelf = 'Use NASM ~e~lf haszn lata';
@ -772,8 +784,10 @@ const
opt_objectdirectories = '~O~bject k”nyvt rak';
opt_exeppudirectories = '~E~XE & PPU k”nyvt rak';
{ Library options }
opt_librariesdefault = '~T~arget default'; { NOT TRANSLATED }
opt_dynamiclibraries = '~D~inamikus k”nyvt rak';
opt_staticlibraries = '~S~tatikus k”nyvt rak';
opt_smartlibraries = 'S~m~art libraries'; { NOT TRANSLATED }
{ Symbol info options }
opt_stripalldebugsymbols = 'Debug szimb¢lumok elt vol¡t ~s~a';
opt_gendebugsymbolinfo = '~D~ebug szimb¢lum info gener l sa';
@ -782,6 +796,11 @@ const
opt_noprofileinfo = '~N~incs profile inform ci¢';
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 }
msg_programexitedwithcodeandsteps = #3'A program kilpett '#13+
#3'exitcode = %d'#13+
@ -961,7 +980,31 @@ const
{
$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
Revision 1.4 2000/06/16 08:50:42 pierre
@ -977,4 +1020,4 @@ const
* new set of Gabor changes: see fixes.txt
}
}

View File

@ -1,7 +1,7 @@
{
$Id$
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
@ -59,7 +59,10 @@ type
PSelectItem = ^TSelectItem;
TSelectItem = object(TSwitchItem)
IsDefault : boolean;
constructor Init(const n,p:string; AID: TParamID);
{ Select to avoid anything in config file }
constructor InitDefault(const n:string);
end;
PBooleanItem = ^TBooleanItem;
@ -103,6 +106,7 @@ type
function ItemParam(index:integer):string;
{ type specific }
procedure AddSelectItem(const name,param:string; AID: TParamID);
procedure AddDefaultSelect(const name:string);
procedure AddBooleanItem(const name,param:string; AID: TParamID);
procedure AddLongintItem(const name,param:string; AID: TParamID);
procedure AddStringItem(const name,param:string;AID: TParamID;mult:boolean);
@ -239,8 +243,15 @@ constructor TSelectItem.Init(const n,p:string; AID: TParamID);
begin
Inherited Init(n,p,AID);
Typ:=ot_Select;
IsDefault:=false;
end;
constructor TSelectItem.InitDefault(const n:string);
begin
Inherited Init(n,'',idNone);
Typ:=ot_Select;
IsDefault:=true;
end;
{*****************************************************************************
TBooleanItem
@ -378,6 +389,12 @@ begin
end;
procedure TSwitches.AddDefaultSelect(const name:string);
begin
Items^.Insert(New(PSelectItem,InitDefault(name)));
end;
procedure TSwitches.AddBooleanItem(const name,param:string; AID: TParamID);
begin
Items^.Insert(New(PBooleanItem,Init(name,Param,AID)));
@ -569,10 +586,16 @@ var
end;
end;
var
P : PSelectItem;
begin
Pref:=Prefix;
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
Items^.ForEach(@writeitem);
end;
@ -602,7 +625,7 @@ function TSwitches.ReadItemsCfg(const s:string):boolean;
begin
{ empty items are not equivalent to others !! }
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;
var
@ -867,6 +890,7 @@ begin
New(AsmOutputSwitches,InitSelect('A'));
with AsmOutputSwitches^ do
begin
AddDefaultSelect(opt_usedefaultas);
AddSelectItem(opt_usegnuas,'as',idNone);
AddSelectItem(opt_usenasmcoff,'nasmcoff',idNone);
AddSelectItem(opt_usenasmelf,'nasmelf',idNone);
@ -907,8 +931,10 @@ begin
New(LibLinkerSwitches,InitSelect('X'));
with LibLinkerSwitches^ do
begin
AddDefaultSelect(opt_librariesdefault);
AddSelectItem(opt_dynamiclibraries,'D',idNone);
AddSelectItem(opt_staticlibraries,'S',idNone);
AddSelectItem(opt_smartlibraries,'X',idNone);
end;
New(DebugInfoSwitches,InitSelect('g'));
with DebugInfoSwitches^ do
@ -1113,7 +1139,29 @@ end;
end.
{
$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
Revision 1.23 2000/06/22 09:07:12 pierre
@ -1222,4 +1270,5 @@ end.
+ Switches updated
+ Run program
}
}

View File

@ -134,6 +134,8 @@ procedure AddToolCommand(Command: string);
procedure AddToolMessage(ModuleName, Text: string; Row, Col: longint);
procedure ClearToolMessages;
procedure UpdateToolMessages;
procedure InitToolTempFiles;
procedure DoneToolTempFiles;
const
ToolFilter : string[{$ifndef GABOR}128{$else}40{$endif}] = '';
@ -149,7 +151,7 @@ implementation
uses Dos,
Commands,App,MsgBox,
WINI,WEditor,
WConsts,WUtils,WINI,WEditor,
FPConst,FPString,FPVars,FPUtils;
{$ifndef NOOBJREG}
@ -189,6 +191,7 @@ const
Tools : PToolCollection = nil;
AbortTool : boolean = false;
ToolTempFiles: PUnsortedStringCollection = nil;
function GetHotKeyCount: integer;
begin
@ -647,17 +650,21 @@ const
{ Additional Label view section entries }
tieLink = 'LINK';
tieText = 'TEXT';
{ Additional Memo view section entries }
tieFileName = 'FILENAME';
{ View types }
vtCheckBox = 1;
vtRadioButton = 2;
vtInputLine = 3;
vtMemo = 4;
vtLabel = 127;
vtsCheckBox = 'CHECKBOX';
vtsRadioButton = 'RADIOBUTTON';
vtsInputLine = 'INPUTLINE';
vtsLabel = 'LABEL';
vtsMemo = 'MEMO';
var Title : string;
DSize : TPoint;
@ -698,6 +705,7 @@ var
if Typ=vtsRadioButton then ViewTypes[ViewCount]:=vtRadioButton else
if Typ=vtsInputLine then ViewTypes[ViewCount]:=vtInputLine 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;
ViewNames[ViewCount]:=Sec^.GetName;
@ -715,6 +723,7 @@ var
begin ErrorBox(FormatStrStr(msg_requiredpropertymissingin,Sec^.GetName),nil); Exit; end;
end;
vtInputLine : ;
vtMemo : ;
vtCheckBox :
begin
OK:=OK and (Sec^.SearchEntry(tieName)<>nil);
@ -780,6 +789,14 @@ begin
case ViewTypes[Idx] of
vtLabel :
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 :
S:=PInputLine(ViewPtrs[Idx])^.Data^;
vtCheckBox :
@ -850,6 +867,7 @@ var R: TRect;
Re: integer;
OK: boolean;
I,J,MaxLen: integer;
Memo: PFPMemo;
IL: PInputLine;
CB: PCheckBoxes;
RB: PRadioButtons;
@ -858,6 +876,7 @@ var R: TRect;
S: string;
P: PView;
begin
OK:=true;
R.Assign(0,0,DSize.X,DSize.Y);
New(PromptDialog, Init(R, Title));
with PromptDialog^ do
@ -882,6 +901,14 @@ begin
IL^.Data^:=ViewValues[I];
ViewPtrs[I]:=IL;
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 :
begin
New(CB, Init(ViewBounds[I],
@ -1303,6 +1330,23 @@ begin
ProcessMessageFile:=OK;
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);
begin
inherited Init(0,ALine,AModule,ARow,ACol);
@ -1507,7 +1551,13 @@ end;
END.
{
$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
Revision 1.20 2000/06/22 09:07:12 pierre

View File

@ -494,6 +494,10 @@ end;
procedure TLinuxScreen.Capture;
begin
if assigned(IDE_screen) then
dispose(IDE_screen);
new(IDE_screen);
move(videobuf^,IDE_screen^,videobufsize);
end;
@ -725,7 +729,10 @@ end;
end.
{
$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
branch)

View File

@ -63,14 +63,11 @@ function NameOf(const S: string): string;
function NameAndExtOf(const S: string): string;
function StrToExtended(S: string): Extended;
function Power(const A,B: double): double;
function GetCurDir: string;
function MatchesMask(What, Mask: string): boolean;
function MatchesMaskList(What, MaskList: string): boolean;
function MatchesFileList(What, FileList: string): boolean;
function EatIO: integer;
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 LocatePasFile(const FileName:string):string;
function LocateExeFile(var FileName:string): boolean;
@ -87,7 +84,7 @@ implementation
uses Dos,
WUtils,
FPVars;
FPVars,FPSwitch;
function IntToStr(L: longint): string;
var S: string;
@ -312,14 +309,6 @@ begin
else Power:=exp(B*ln(A));
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;
const HexNums : string[16] = '0123456789ABCDEF';
var S: string;
@ -511,27 +500,6 @@ begin
RenameFile:=(EatIO=0);
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;
var FilePath: string;
function CheckFile(Path,Name: string): boolean;
@ -664,7 +632,24 @@ end;
END.
{
$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
Revision 1.16 2000/06/22 09:07:13 pierre

View File

@ -170,6 +170,7 @@ type
function GetPalette: PPalette; virtual;
constructor Load(var S: TStream);
procedure Store(var S: TStream);
procedure Close; virtual;
destructor Done; virtual;
end;
@ -388,7 +389,7 @@ procedure DisposeTabItem(P: PTabItem);
function NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef;
procedure DisposeTabDef(P: PTabDef);
function GetEditorCurWord(Editor: PEditor): string;
function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
procedure InitReservedWords;
procedure DoneReservedWords;
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 ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts, ShowIt,
ForceNewWindow:boolean): PSourceWindow;
function LocateSourceFile(const FileName: string; tryexts: boolean): string;
function SearchWindow(const Title: string): PWindow;
@ -446,7 +448,7 @@ uses
gdbint,
{$endif NODEBUG}
{$ifdef VESA}Vesa,{$endif}
FPString,FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompile,FPHelp,
FPString,FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompil,FPHelp,
FPTools,FPIDE,FPCodTmp,FPCodCmp;
const
@ -622,7 +624,7 @@ begin
EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow));
end;
function GetEditorCurWord(Editor: PEditor): string;
function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
var S: string;
PS,PE: byte;
function Trim(S: string): string;
@ -641,7 +643,7 @@ begin
{$else}
S:=GetLineText(CurPos.Y);
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));
{$endif}
end;
@ -1150,12 +1152,14 @@ begin
{$endif DebugUndo}
cmBrowseAtCursor:
begin
S:=LowerCaseStr(GetEditorCurWord(@Self));
S:=LowerCaseStr(GetEditorCurWord(@Self,[]));
OpenOneSymbolBrowser(S);
end;
cmOpenAtCursor :
begin
S:=LowerCaseStr(GetEditorCurWord(@Self));
S:=LowerCaseStr(GetEditorCurWord(@Self,['.']));
if Pos('.',S)<>0 then
OpenFileName:=S else
OpenFileName:=S+'.pp'+ListSeparator+
S+'.pas'+ListSeparator+
S+'.inc';
@ -1448,7 +1452,7 @@ begin
Hide;
cmSave :
if Editor^.IsClipboard=false then
if Editor^.FileName='' then
if (Editor^.FileName='') and Editor^.GetModified then
Editor^.SaveAs
else
Editor^.Save;
@ -1543,12 +1547,18 @@ begin
PopStatus;
end;
procedure TSourceWindow.Close;
begin
inherited Close;
end;
destructor TSourceWindow.Done;
begin
PushStatus(FormatStrStr(msg_closingfile,GetStr(Title)));
if not IDEApp.IsClosing then
Message(Application,evBroadcast,cmSourceWndClosing,@Self);
inherited Done;
IDEApp.SourceWindowClosed;
{ if not IDEApp.IsClosing then
Message(Application,evBroadcast,cmUpdate,@Self);}
PopStatus;
@ -2834,12 +2844,10 @@ begin
TryToOpenFile:=ITryToOpenFile(Bounds,FileName,CurX,CurY,tryexts,true,false);
end;
function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean;
ShowIt,ForceNewWindow: boolean): PSourceWindow;
function LocateSingleSourceFile(const FileName: string; tryexts: boolean): string;
var D : DirStr;
N : NameStr;
E : ExtStr;
DrStr : String;
function CheckDir(NewDir: DirStr; NewName: NameStr; NewExt: ExtStr): boolean;
var OK: boolean;
@ -2859,9 +2867,8 @@ var D : DirStr;
CheckExt:=OK;
end;
function TryToOpen(const DD : dirstr): PSourceWindow;
function TryToLocateIn(const DD : dirstr): boolean;
var Found: boolean;
W : PSourceWindow;
begin
D:=CompleteDir(DD);
Found:=true;
@ -2876,21 +2883,55 @@ var D : DirStr;
else
if CheckExt('.inc') then
Found:=true
{ try also without extension if no other exist }
else
if CheckExt('') then
Found:=true
else
Found:=false;
if Found=false then
W:=nil
else
begin
FileName:=FExpand(D+N+E);
W:=IOpenEditorWindow(Bounds,FileName,CurX,CurY,ShowIt);
end;
TryToOpen:=W;
TryToLocateIn:=Found;
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
W : PSourceWindow;
DrStr: string;
begin
W:=nil;
if ForceNewWindow then
W:=nil
else
@ -2904,20 +2945,9 @@ begin
end
else
begin
FSplit(FileName,D,N,E);
if D<>'' then
W:=TryToOpen(D);
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);
DrStr:=LocateSourceFile(FileName,tryexts);
if DrStr<>'' then
W:=IOpenEditorWindow(Bounds,DrStr,CurX,CurY,ShowIt);
NewEditorOpened:=W<>nil;
if assigned(W) then
W^.Editor^.SetCurPtr(CurX,CurY);
@ -3471,7 +3501,46 @@ end;
END.
{
$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
Revision 1.73 2000/06/22 09:07:13 pierre

View File

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

View File

@ -471,6 +471,8 @@ type
{a}function LoadFromStream(Stream: PStream): boolean; virtual;
{a}function SaveToStream(Stream: PStream): 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
{a}function InsertFrom(Editor: PCustomCodeEditor): Boolean; virtual;
{a}function InsertText(const S: string): Boolean; virtual;
@ -1615,9 +1617,9 @@ begin
S:=GetLineText(Line);
TabSize:=GetTabSize;
CP:=1; RX:=0;
while (CP<=length(S)) and (CP<=CharIdx) do
while {(CP<=length(S)) and }(CP<=CharIdx) do
begin
if S[CP]=TAB then
if (CP<=length(S)) and (S[CP]=TAB) then
Inc(RX,GetTabSize-(RX mod TabSize))
else
Inc(RX);
@ -1977,7 +1979,7 @@ var
end;
if EndX+1>=StartX then
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:=true;
end;
@ -2519,6 +2521,34 @@ begin
SaveAreaToStream:=false;
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;
var OK: boolean;
LineDelta,LineCount: Sw_integer;
@ -2990,7 +3020,10 @@ begin
cmTextEnd : TextEnd;
cmWindowStart : WindowStart;
cmWindowEnd : WindowEnd;
cmNewLine : InsertNewLine;
cmNewLine : begin
InsertNewLine;
TrackCursor(false);
end;
cmBreakLine : BreakLine;
cmBackSpace : BackSpace;
cmDelChar : DelChar;
@ -4591,7 +4624,8 @@ begin
end;
end;
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);
SetStoreUndo(HoldUndo);
SetModified(true);
@ -5794,7 +5828,12 @@ begin
Name:=Name+DefaultSaveExt;
AskOW:=(Name<>PString(Info)^);
end;
edWriteBlock : AskOW:=true;
edWriteBlock :
begin
if ExtOf(Name)='' then
Name:=Name+DefaultSaveExt;
AskOW:=true;
end;
edReadBlock : AskOW:=false;
else AskOW:=true;
end;
@ -5858,7 +5897,31 @@ end;
END.
{
$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
Revision 1.95 2000/06/22 09:07:13 pierre

View File

@ -57,6 +57,7 @@ type
TINIFile = object(TObject)
MakeNullEntries: boolean;
constructor Init(const AFileName: string);
function GetFileName: string;
function Read: boolean; virtual;
function Update: boolean; virtual;
function IsModified: boolean; virtual;
@ -79,6 +80,7 @@ type
const MainSectionName : string[40] = 'MainSection';
CommentChar : char = ';';
ValidStrDelimiters: set of char = ['''','"'];
implementation
@ -141,21 +143,24 @@ end;
procedure TINIEntry.Split;
var S,ValueS: string;
P,P2: byte;
P,P2,StartP: byte;
C: char;
InString: boolean;
Delimiter: char;
begin
S:=GetText;
S:=GetText; Delimiter:=#0;
P:=Pos('=',S); P2:=Pos(CommentChar,S);
if (P2<>0) and (P2<P) then P:=0;
if P<>0 then
begin
Tag:=NewStr(copy(S,1,P-1));
P2:=P+1; InString:=false; ValueS:='';
StartP:=P2;
while (P2<=length(S)) do
begin
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
ValueS:=ValueS+C;
Inc(P2);
@ -259,6 +264,11 @@ begin
Read;
end;
function TINIFile.GetFileName: string;
begin
GetFileName:=GetStr(FileName);
end;
function TINIFile.Read: boolean;
var f: text;
OK: boolean;
@ -478,7 +488,30 @@ end;
END.
{
$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
Revision 1.10 2000/06/22 09:07:15 pierre

View File

@ -23,6 +23,11 @@ interface
uses
Dos,Objects;
const
TempFirstChar = {$ifndef Linux}'~'{$else}'_'{$endif};
TempExt = '.tmp';
TempNameLen = 8;
type
PByteArray = ^TByteArray;
TByteArray = array[0..MaxBytes] of byte;
@ -127,15 +132,20 @@ function GetFileTime(const FileName: string): longint;
function GetShortName(const n:string):string;
function GetLongName(const n: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 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 CompletePath(const Base, InComplete: string): string;
function CompleteURL(const Base, URLRef: string): string;
function DeleteFile(const FileName: string): integer;
function EatIO: integer;
function Now: longint;
@ -1010,6 +1020,86 @@ begin
{$I+}
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;
{$ifdef GO32V2}{$define DOS}{$endif}
{$ifdef TP}{$define DOS}{$endif}
@ -1037,15 +1127,31 @@ begin
{$endif}
end;
BEGIN
Randomize;
END.
{
$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
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
* new bunch of Gabor's changes
@ -1144,4 +1250,4 @@ END.
Revision 1.1 1999/03/01 15:51:43 peter
+ Log
}
}

View File

@ -25,9 +25,22 @@ const
cmUpdate = 54101;
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;
type
longstring = {$ifdef TP}string{$else}ansistring{$endif};
PCenterDialog = ^TCenterDialog;
TCenterDialog = object(TDialog)
constructor Init(var Bounds: TRect; ATitle: TTitleStr);
@ -180,6 +193,12 @@ type
constructor Init(var Bounds: TRect);
end;
PAdvMessageBox = ^TAdvMessageBox;
TAdvMessageBox = object(TDialog)
CanCancel: boolean;
procedure HandleEvent(var Event: TEvent); virtual;
end;
procedure InsertOK(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 InformationBox(const S: string; Params: pointer);
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 HideMessage;
@ -219,14 +239,22 @@ procedure AddFormatParamStr(const S: string);
function FormatStrF(const Format: string; var Params): string;
function FormatStrStr(const Format, Param: 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;
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;
implementation
uses Mouse,
Commands,App,MsgBox,
Resource,Commands,App,MsgBox,
WConsts,WUtils;
{$ifndef NOOBJREG}
@ -259,6 +287,7 @@ const
const
MessageDialog : PCenterDialog = nil;
UserButtonCmd : array[Low(UserButtonName)..High(UserButtonName)] of word = (cmUserBtn1,cmUserBtn2,cmUserBtn3,cmUserBtn4);
function ColorIndex(Color: byte): word;
begin
@ -1425,22 +1454,43 @@ end;
procedure ErrorBox(const S: string; Params: pointer);
begin
MessageBox(S,Params,mfError+mfInsertInApp+mfOKButton);
AdvMessageBox(S,Params,mfError+mfInsertInApp+mfOKButton);
end;
procedure WarningBox(const S: string; Params: pointer);
begin
MessageBox(S,Params,mfWarning+mfInsertInApp+mfOKButton);
AdvMessageBox(S,Params,mfWarning+mfInsertInApp+mfOKButton);
end;
procedure InformationBox(const S: string; Params: pointer);
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;
function ConfirmBox(const S: string; Params: pointer; CanCancel: boolean): word;
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;
function IsSeparator(P: PMenuItem): boolean;
@ -1928,8 +1978,9 @@ end;
procedure TDropDownListBox.DropList(Drop: boolean);
var R: TRect;
LB: PListBox;
begin
if ListDropped=Drop then Exit;
if (ListDropped=Drop) then Exit;
if Drop then
begin
@ -1952,8 +2003,8 @@ begin
if ListBox<>nil then
begin
{ ListBox^.List:=nil;}
Dispose(ListBox, Done);
ListBox:=nil;
LB:=ListBox; ListBox:=nil; { this prevents GPFs while deleting }
Dispose(LB, Done);
end;
if SB<>nil then
begin
@ -2114,6 +2165,26 @@ begin
GrowMode:=gfGrowHiX+gfGrowHiY;
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;
begin
FormatParamCount:=0; FillChar(FormatParams,sizeof(FormatParams),0);
@ -2168,6 +2239,15 @@ begin
FormatStrStr2:=S;
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;
var S: string;
begin
@ -2175,6 +2255,153 @@ begin
FormatStrInt:=S;
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;
begin
{$ifndef NOOBJREG}
@ -2189,7 +2416,28 @@ end;
END.
{
$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
Revision 1.15 2000/06/22 09:07:15 pierre