mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-03 14:27:18 +01:00
fixed TMemo.WordWrap
git-svn-id: trunk@2931 -
This commit is contained in:
parent
f1b308771f
commit
6a44a5d1a9
38
ide/main.pp
38
ide/main.pp
@ -565,6 +565,8 @@ type
|
|||||||
function GetProjPublishDir: string;
|
function GetProjPublishDir: string;
|
||||||
procedure OnMacroSubstitution(TheMacro: TTransferMacro; var s:string;
|
procedure OnMacroSubstitution(TheMacro: TTransferMacro; var s:string;
|
||||||
var Handled, Abort: boolean);
|
var Handled, Abort: boolean);
|
||||||
|
function OnSubstituteCompilerOption(Options: TParsedCompilerOptions;
|
||||||
|
const UnparsedValue: string): string;
|
||||||
function OnMacroPromptFunction(const s:string; var Abort: boolean):string;
|
function OnMacroPromptFunction(const s:string; var Abort: boolean):string;
|
||||||
procedure OnCmdLineCreate(var CmdLine: string; var Abort:boolean);
|
procedure OnCmdLineCreate(var CmdLine: string; var Abort:boolean);
|
||||||
procedure GetIDEFileState(Sender: TObject; const AFilename: string;
|
procedure GetIDEFileState(Sender: TObject; const AFilename: string;
|
||||||
@ -1265,6 +1267,8 @@ begin
|
|||||||
MacroList.Add(TTransferMacro.Create('ProjPublishDir','',
|
MacroList.Add(TTransferMacro.Create('ProjPublishDir','',
|
||||||
lisPublishProjDir,nil,[]));
|
lisPublishProjDir,nil,[]));
|
||||||
MacroList.OnSubstitution:=@OnMacroSubstitution;
|
MacroList.OnSubstitution:=@OnMacroSubstitution;
|
||||||
|
|
||||||
|
CompilerOptions.OnParseString:=@OnSubstituteCompilerOption;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SetupControlSelection;
|
procedure TMainIDE.SetupControlSelection;
|
||||||
@ -2592,6 +2596,9 @@ Begin
|
|||||||
ReadSettings(EnvironmentOptions);
|
ReadSettings(EnvironmentOptions);
|
||||||
end;
|
end;
|
||||||
if EnvironmentOptionsDialog.ShowModal=mrOk then begin
|
if EnvironmentOptionsDialog.ShowModal=mrOk then begin
|
||||||
|
// invalidate cached substituted macros
|
||||||
|
IncreaseParseStamp;
|
||||||
|
|
||||||
// load settings from EnvironmentOptionsDialog to EnvironmentOptions
|
// load settings from EnvironmentOptionsDialog to EnvironmentOptions
|
||||||
OldCompilerFilename:=EnvironmentOptions.CompilerFilename;
|
OldCompilerFilename:=EnvironmentOptions.CompilerFilename;
|
||||||
EnvironmentOptionsDialog.WriteSettings(EnvironmentOptions);
|
EnvironmentOptionsDialog.WriteSettings(EnvironmentOptions);
|
||||||
@ -3724,6 +3731,10 @@ begin
|
|||||||
// update source notebook page names
|
// update source notebook page names
|
||||||
UpdateSourceNames;
|
UpdateSourceNames;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// invalidate cached substituted macros
|
||||||
|
IncreaseParseStamp;
|
||||||
|
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4649,6 +4660,9 @@ Begin
|
|||||||
writeln('TMainIDE.DoNewProject A');
|
writeln('TMainIDE.DoNewProject A');
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
|
|
||||||
|
// invalidate cached substituted macros
|
||||||
|
IncreaseParseStamp;
|
||||||
|
|
||||||
// close current project first
|
// close current project first
|
||||||
If Project1<>nil then begin
|
If Project1<>nil then begin
|
||||||
if SomethingOfProjectIsModified then begin
|
if SomethingOfProjectIsModified then begin
|
||||||
@ -4718,6 +4732,7 @@ writeln('TMainIDE.DoNewProject A');
|
|||||||
for i:=0 to Project1.UnitCount-1 do
|
for i:=0 to Project1.UnitCount-1 do
|
||||||
Project1.Units[i].Modified:=false;
|
Project1.Units[i].Modified:=false;
|
||||||
Project1.Modified:=false;
|
Project1.Modified:=false;
|
||||||
|
IncreaseParseStamp;
|
||||||
|
|
||||||
writeln('TMainIDE.DoNewProject end ',CodeToolBoss.ConsistencyCheck);
|
writeln('TMainIDE.DoNewProject end ',CodeToolBoss.ConsistencyCheck);
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
@ -4839,6 +4854,7 @@ begin
|
|||||||
if Result=mrAbort then exit;
|
if Result=mrAbort then exit;
|
||||||
end;
|
end;
|
||||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoCloseProject B');{$ENDIF}
|
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoCloseProject B');{$ENDIF}
|
||||||
|
IncreaseParseStamp;
|
||||||
// close Project
|
// close Project
|
||||||
FreeThenNil(Project1);
|
FreeThenNil(Project1);
|
||||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoCloseProject C');{$ENDIF}
|
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoCloseProject C');{$ENDIF}
|
||||||
@ -4936,6 +4952,7 @@ begin
|
|||||||
writeln('TMainIDE.DoOpenProjectFile C');
|
writeln('TMainIDE.DoOpenProjectFile C');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoOpenProjectFile C');{$ENDIF}
|
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoOpenProjectFile C');{$ENDIF}
|
||||||
|
IncreaseParseStamp;
|
||||||
|
|
||||||
// restore files
|
// restore files
|
||||||
LastEditorIndex:=-1;
|
LastEditorIndex:=-1;
|
||||||
@ -5009,6 +5026,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
Project1.Modified:=false;
|
Project1.Modified:=false;
|
||||||
|
|
||||||
|
IncreaseParseStamp;
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
{$IFDEF IDE_VERBOSE}
|
{$IFDEF IDE_VERBOSE}
|
||||||
writeln('TMainIDE.DoOpenProjectFile end CodeToolBoss.ConsistencyCheck=',CodeToolBoss.ConsistencyCheck);
|
writeln('TMainIDE.DoOpenProjectFile end CodeToolBoss.ConsistencyCheck=',CodeToolBoss.ConsistencyCheck);
|
||||||
@ -5036,6 +5054,7 @@ begin
|
|||||||
if ShowDialog then begin
|
if ShowDialog then begin
|
||||||
Result:=ShowPublishProjectDialog(Project1.PublishOptions);
|
Result:=ShowPublishProjectDialog(Project1.PublishOptions);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
|
IncreaseParseStamp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// save project
|
// save project
|
||||||
@ -5048,9 +5067,7 @@ begin
|
|||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
writeln('TMainIDE.DoPublishProject A "',CommandAfter,'"');
|
|
||||||
SplitCmdLine(CommandAfter,CmdAfterExe,CmdAfterParams);
|
SplitCmdLine(CommandAfter,CmdAfterExe,CmdAfterParams);
|
||||||
writeln('TMainIDE.DoPublishProject B "',CmdAfterExe,'" "',CmdAfterParams,'"');
|
|
||||||
if (CmdAfterExe<>'') and not FileIsExecutable(CmdAfterExe) then begin
|
if (CmdAfterExe<>'') and not FileIsExecutable(CmdAfterExe) then begin
|
||||||
ShowErrorForCommandAfter;
|
ShowErrorForCommandAfter;
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
@ -5059,7 +5076,6 @@ writeln('TMainIDE.DoPublishProject B "',CmdAfterExe,'" "',CmdAfterParams,'"');
|
|||||||
|
|
||||||
// clear destination directory
|
// clear destination directory
|
||||||
DestDir:=GetProjPublishDir;
|
DestDir:=GetProjPublishDir;
|
||||||
writeln('TMainIDE.DoPublishProject C ',DestDir);
|
|
||||||
if (DestDir='') then begin
|
if (DestDir='') then begin
|
||||||
MessageDlg('Invalid destination directory',
|
MessageDlg('Invalid destination directory',
|
||||||
'Destination directory "'+DestDir+'" is invalid.'#13
|
'Destination directory "'+DestDir+'" is invalid.'#13
|
||||||
@ -5090,7 +5106,6 @@ writeln('TMainIDE.DoPublishProject C ',DestDir);
|
|||||||
// write a filtered .lpi file
|
// write a filtered .lpi file
|
||||||
NewProjectFilename:=DestDir+ExtractFilename(Project1.ProjectInfoFile);
|
NewProjectFilename:=DestDir+ExtractFilename(Project1.ProjectInfoFile);
|
||||||
DeleteFile(NewProjectFilename);
|
DeleteFile(NewProjectFilename);
|
||||||
writeln('TMainIDE.DoPublishProject C ',NewProjectFilename);
|
|
||||||
Result:=Project1.WriteProject(Project1.PublishOptions.WriteFlags,
|
Result:=Project1.WriteProject(Project1.PublishOptions.WriteFlags,
|
||||||
NewProjectFilename);
|
NewProjectFilename);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
@ -5159,6 +5174,7 @@ begin
|
|||||||
Project1.ProjectInfoFile:=ChangeFileExt(ProgramBuf.Filename,'.lpi');
|
Project1.ProjectInfoFile:=ChangeFileExt(ProgramBuf.Filename,'.lpi');
|
||||||
Project1.CompilerOptions.CompilerPath:='$(CompPath)';
|
Project1.CompilerOptions.CompilerPath:='$(CompPath)';
|
||||||
UpdateCaption;
|
UpdateCaption;
|
||||||
|
IncreaseParseStamp;
|
||||||
|
|
||||||
// set project type specific things
|
// set project type specific things
|
||||||
ds:=PathDelim;
|
ds:=PathDelim;
|
||||||
@ -6125,8 +6141,7 @@ procedure TMainIDE.OnMacroSubstitution(TheMacro: TTransferMacro; var s:string;
|
|||||||
var MacroName:string;
|
var MacroName:string;
|
||||||
begin
|
begin
|
||||||
if TheMacro=nil then begin
|
if TheMacro=nil then begin
|
||||||
MessageDlg('Unknown Macro',
|
MessageDlg('Unknown Macro','Macro not defined: "'+s+'".',
|
||||||
'Macro not defined: "'+s+'".',
|
|
||||||
mtError,[mbAbort],0);
|
mtError,[mbAbort],0);
|
||||||
Abort:=true;
|
Abort:=true;
|
||||||
exit;
|
exit;
|
||||||
@ -6208,6 +6223,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMainIDE.OnSubstituteCompilerOption(Options: TParsedCompilerOptions;
|
||||||
|
const UnparsedValue: string): string;
|
||||||
|
begin
|
||||||
|
CurrentParsedCompilerOption:=Options;
|
||||||
|
Result:=UnparsedValue;
|
||||||
|
MacroList.SubstituteStr(Result);
|
||||||
|
end;
|
||||||
|
|
||||||
function TMainIDE.OnMacroPromptFunction(const s:string;
|
function TMainIDE.OnMacroPromptFunction(const s:string;
|
||||||
var Abort: boolean):string;
|
var Abort: boolean):string;
|
||||||
begin
|
begin
|
||||||
@ -8265,6 +8288,9 @@ end.
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.522 2003/04/15 08:54:26 mattias
|
||||||
|
fixed TMemo.WordWrap
|
||||||
|
|
||||||
Revision 1.521 2003/04/13 22:39:19 mattias
|
Revision 1.521 2003/04/13 22:39:19 mattias
|
||||||
implemented package links, automatic package loading
|
implemented package links, automatic package loading
|
||||||
|
|
||||||
|
|||||||
@ -18,5 +18,16 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ TMemo }
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
function TMemo.WordWrapIsStored: boolean;
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TMemo.WordWrapIsStored: boolean;
|
||||||
|
begin
|
||||||
|
Result:=not WordWrap;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// included by stdctrls.pp
|
// included by stdctrls.pp
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user