mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-26 02:08:14 +02:00
started IDE progress dialog and splitted project sessions
git-svn-id: trunk@8120 -
This commit is contained in:
parent
8d90a2d6ea
commit
c54f333978
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -958,6 +958,9 @@ ide/newprojectdlg.pp svneol=native#text/pascal
|
|||||||
ide/objectlists.pas svneol=native#text/pascal
|
ide/objectlists.pas svneol=native#text/pascal
|
||||||
ide/outputfilter.pas svneol=native#text/pascal
|
ide/outputfilter.pas svneol=native#text/pascal
|
||||||
ide/patheditordlg.pas svneol=native#text/pascal
|
ide/patheditordlg.pas svneol=native#text/pascal
|
||||||
|
ide/progressdlg.lfm svneol=native#text/plain
|
||||||
|
ide/progressdlg.lrs svneol=native#text/plain
|
||||||
|
ide/progressdlg.pas svneol=native#text/plain
|
||||||
ide/project.pp svneol=native#text/pascal
|
ide/project.pp svneol=native#text/pascal
|
||||||
ide/projectdefs.pas svneol=native#text/pascal
|
ide/projectdefs.pas svneol=native#text/pascal
|
||||||
ide/projectinspector.pas svneol=native#text/pascal
|
ide/projectinspector.pas svneol=native#text/pascal
|
||||||
|
@ -294,7 +294,7 @@ type
|
|||||||
function GetPreviousToken(aEditor: TCustomSynEdit): string;
|
function GetPreviousToken(aEditor: TCustomSynEdit): string;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Execute(token: string; aEditor: TCustomSynEdit);
|
procedure Execute(token: string; aEditor: TCustomSynEdit);
|
||||||
property Editors[i: integer]: TCustomSynEdit read GetEditor;
|
property Editors[i: integer]: TCustomSynEdit read GetEditor;
|
||||||
procedure AddEditor(aEditor: TCustomSynEdit);
|
procedure AddEditor(aEditor: TCustomSynEdit);
|
||||||
@ -1423,10 +1423,6 @@ var
|
|||||||
ShortCutShift: TShiftState;
|
ShortCutShift: TShiftState;
|
||||||
begin
|
begin
|
||||||
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
ShortCutToKey(FShortCut, ShortCutKey, ShortCutShift);
|
||||||
//inserted by shane
|
|
||||||
ShortCutKey := word(' ');
|
|
||||||
ShortCutShift := [ssCtrl];
|
|
||||||
//shane
|
|
||||||
|
|
||||||
i := fEditors.IndexOf(Sender);
|
i := fEditors.IndexOf(Sender);
|
||||||
if i <> -1 then begin
|
if i <> -1 then begin
|
||||||
|
@ -2880,6 +2880,8 @@ resourcestring
|
|||||||
lisLazDocBrowseExampleButton = 'Browse';
|
lisLazDocBrowseExampleButton = 'Browse';
|
||||||
lisEnableMakros = 'Enable Makros';
|
lisEnableMakros = 'Enable Makros';
|
||||||
lisCTSelectCodeMacro = 'Select Code Macro';
|
lisCTSelectCodeMacro = 'Select Code Macro';
|
||||||
|
lisPDProgress = 'Progress';
|
||||||
|
lisPDAbort = 'Abort';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
end.
|
end.
|
||||||
|
@ -7098,7 +7098,8 @@ end;
|
|||||||
function TMainIDE.SomethingOfProjectIsModified: boolean;
|
function TMainIDE.SomethingOfProjectIsModified: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=(Project1<>nil)
|
Result:=(Project1<>nil)
|
||||||
and (Project1.SomethingModified or SourceNotebook.SomethingModified);
|
and (Project1.SomethingModified(true,true)
|
||||||
|
or SourceNotebook.SomethingModified);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainIDE.DoSaveAll(Flags: TSaveFlags): TModalResult;
|
function TMainIDE.DoSaveAll(Flags: TSaveFlags): TModalResult;
|
||||||
|
@ -69,7 +69,7 @@ uses
|
|||||||
ProjectIntf, ProjectDefs, Project, PublishModule, BuildLazDialog, Compiler,
|
ProjectIntf, ProjectDefs, Project, PublishModule, BuildLazDialog, Compiler,
|
||||||
LazIDEIntf,
|
LazIDEIntf,
|
||||||
ComponentReg,
|
ComponentReg,
|
||||||
TransferMacros, PropEdits, OutputFilter, IDEDefs, MsgView,
|
TransferMacros, PropEdits, OutputFilter, IDEDefs, MsgView, ProgressDlg,
|
||||||
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
|
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
|
||||||
IDEOptionDefs, CodeToolsDefines, SrcEditorIntf;
|
IDEOptionDefs, CodeToolsDefines, SrcEditorIntf;
|
||||||
|
|
||||||
@ -208,6 +208,9 @@ type
|
|||||||
function GetPrimaryConfigPath: String; override;
|
function GetPrimaryConfigPath: String; override;
|
||||||
function GetSecondaryConfigPath: String; override;
|
function GetSecondaryConfigPath: String; override;
|
||||||
procedure CopySecondaryConfigFile(const AFilename: String); override;
|
procedure CopySecondaryConfigFile(const AFilename: String); override;
|
||||||
|
|
||||||
|
function ShowProgress(const SomeText: string;
|
||||||
|
Step, MaxStep: integer): boolean; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -379,6 +382,12 @@ begin
|
|||||||
LazConf.CopySecondaryConfigFile(AFilename);
|
LazConf.CopySecondaryConfigFile(AFilename);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMainIDEInterface.ShowProgress(const SomeText: string; Step,
|
||||||
|
MaxStep: integer): boolean;
|
||||||
|
begin
|
||||||
|
Result:=ProgressDlg.ShowProgress(SomeText,Step,MaxStep);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFileDescPascalUnitWithForm }
|
{ TFileDescPascalUnitWithForm }
|
||||||
|
|
||||||
constructor TFileDescPascalUnitWithForm.Create;
|
constructor TFileDescPascalUnitWithForm.Create;
|
||||||
|
45
ide/progressdlg.lfm
Normal file
45
ide/progressdlg.lfm
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
object IDEProgressDialog: TIDEProgressDialog
|
||||||
|
ActiveControl = AbortButton
|
||||||
|
Caption = 'IDEProgressDialog'
|
||||||
|
ClientHeight = 132
|
||||||
|
ClientWidth = 400
|
||||||
|
OnCreate = FormCreate
|
||||||
|
PixelsPerInch = 75
|
||||||
|
HorzScrollBar.Page = 399
|
||||||
|
VertScrollBar.Page = 131
|
||||||
|
Left = 286
|
||||||
|
Height = 132
|
||||||
|
Top = 202
|
||||||
|
Width = 400
|
||||||
|
object DescriptionLabel: TLabel
|
||||||
|
Anchors = [akTop]
|
||||||
|
AutoSize = False
|
||||||
|
Caption = 'DescriptionLabel'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
WordWrap = True
|
||||||
|
Left = 152
|
||||||
|
Height = 13
|
||||||
|
Top = 16
|
||||||
|
Width = 95
|
||||||
|
end
|
||||||
|
object AbortButton: TButton
|
||||||
|
Anchors = [akBottom]
|
||||||
|
BorderSpacing.InnerBorder = 2
|
||||||
|
Caption = 'AbortButton'
|
||||||
|
ModalResult = 3
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 130
|
||||||
|
Height = 33
|
||||||
|
Top = 92
|
||||||
|
Width = 139
|
||||||
|
end
|
||||||
|
object ProgressBar: TProgressBar
|
||||||
|
Anchors = [akTop]
|
||||||
|
Max = 100
|
||||||
|
Left = 15
|
||||||
|
Height = 20
|
||||||
|
Top = 64
|
||||||
|
Width = 370
|
||||||
|
end
|
||||||
|
end
|
17
ide/progressdlg.lrs
Normal file
17
ide/progressdlg.lrs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ Dies ist eine automatisch erzeugte Lazarus-Ressourcendatei }
|
||||||
|
|
||||||
|
LazarusResources.Add('TIDEProgressDialog','FORMDATA',[
|
||||||
|
'TPF0'#18'TIDEProgressDialog'#17'IDEProgressDialog'#13'ActiveControl'#7#11'Ab'
|
||||||
|
+'ortButton'#7'Caption'#6#17'IDEProgressDialog'#12'ClientHeight'#3#132#0#11'C'
|
||||||
|
+'lientWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'K'#18
|
||||||
|
+'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3#131#0#4'Left'#3#30#1#6
|
||||||
|
+'Height'#3#132#0#3'Top'#3#202#0#5'Width'#3#144#1#0#6'TLabel'#16'DescriptionL'
|
||||||
|
+'abel'#7'Anchors'#11#5'akTop'#0#8'AutoSize'#8#7'Caption'#6#16'DescriptionLab'
|
||||||
|
+'el'#5'Color'#7#6'clNone'#11'ParentColor'#8#8'WordWrap'#9#4'Left'#3#152#0#6
|
||||||
|
+'Height'#2#13#3'Top'#2#16#5'Width'#2'_'#0#0#7'TButton'#11'AbortButton'#7'Anc'
|
||||||
|
+'hors'#11#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#11'Ab'
|
||||||
|
+'ortButton'#11'ModalResult'#2#3#8'TabOrder'#2#0#4'Left'#3#130#0#6'Height'#2
|
||||||
|
+'!'#3'Top'#2'\'#5'Width'#3#139#0#0#0#12'TProgressBar'#11'ProgressBar'#7'Anch'
|
||||||
|
+'ors'#11#5'akTop'#0#3'Max'#2'd'#4'Left'#2#15#6'Height'#2#20#3'Top'#2'@'#5'Wi'
|
||||||
|
+'dth'#3'r'#1#0#0#0
|
||||||
|
]);
|
80
ide/progressdlg.pas
Normal file
80
ide/progressdlg.pas
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
***************************************************************************
|
||||||
|
* *
|
||||||
|
* This source is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This code is distributed in the hope that it will be useful, but *
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||||
|
* General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* A copy of the GNU General Public License is available on the World *
|
||||||
|
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||||
|
* obtain it by writing to the Free Software Foundation, *
|
||||||
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
* *
|
||||||
|
***************************************************************************
|
||||||
|
|
||||||
|
Author: Mattias Gaertner
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
A dialog for showing the progress of a boring calculation.
|
||||||
|
}
|
||||||
|
unit ProgressDlg;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
|
||||||
|
StdCtrls, ComCtrls, LazarusIDEStrConsts;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TIDEProgressDialog }
|
||||||
|
|
||||||
|
TIDEProgressDialog = class(TForm)
|
||||||
|
AbortButton: TButton;
|
||||||
|
DescriptionLabel: TLabel;
|
||||||
|
ProgressBar: TProgressBar;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
public
|
||||||
|
procedure ApplicationIdle(Sender: TObject);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ShowProgress(const SomeText: string;
|
||||||
|
Step, MaxStep: integer): boolean;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function ShowProgress(const SomeText: string; Step, MaxStep: integer): boolean;
|
||||||
|
begin
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TIDEProgressDialog }
|
||||||
|
|
||||||
|
procedure TIDEProgressDialog.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Caption:=lisPDProgress;
|
||||||
|
DescriptionLabel.Caption:='...';
|
||||||
|
AbortButton.Caption:=lisPDAbort;
|
||||||
|
|
||||||
|
Application.AddOnIdleHandler(@ApplicationIdle);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDEProgressDialog.ApplicationIdle(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ModalResult:=mrOk;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I progressdlg.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -113,6 +113,7 @@ type
|
|||||||
FProject: TProject;
|
FProject: TProject;
|
||||||
FResourceFilename: string;
|
FResourceFilename: string;
|
||||||
FRunFileIfActive: boolean;
|
FRunFileIfActive: boolean;
|
||||||
|
FSessionModified: boolean;
|
||||||
fSource: TCodeBuffer;
|
fSource: TCodeBuffer;
|
||||||
fSyntaxHighlighter: TLazSyntaxHighlighter;
|
fSyntaxHighlighter: TLazSyntaxHighlighter;
|
||||||
fTopLine: integer;
|
fTopLine: integer;
|
||||||
@ -214,7 +215,8 @@ type
|
|||||||
property FileReadOnly: Boolean read fFileReadOnly write SetFileReadOnly;
|
property FileReadOnly: Boolean read fFileReadOnly write SetFileReadOnly;
|
||||||
property HasResources: boolean read GetHasResources write fHasResources;
|
property HasResources: boolean read GetHasResources write fHasResources;
|
||||||
property Loaded: Boolean read fLoaded write SetLoaded;
|
property Loaded: Boolean read fLoaded write SetLoaded;
|
||||||
property Modified: boolean read fModified write fModified;
|
property Modified: boolean read fModified write fModified;// not Session data
|
||||||
|
property SessionModified: boolean read FSessionModified write FSessionModified;
|
||||||
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
||||||
property OnLoadSaveFilename: TOnLoadSaveFilename
|
property OnLoadSaveFilename: TOnLoadSaveFilename
|
||||||
read fOnLoadSaveFilename write fOnLoadSaveFilename;
|
read fOnLoadSaveFilename write fOnLoadSaveFilename;
|
||||||
@ -392,7 +394,6 @@ type
|
|||||||
fLastReadLPIFileDate: TDateTime;
|
fLastReadLPIFileDate: TDateTime;
|
||||||
fLastReadLPIFilename: string;
|
fLastReadLPIFilename: string;
|
||||||
fMainUnitID: Integer;
|
fMainUnitID: Integer;
|
||||||
fModified: boolean;
|
|
||||||
FOnBeginUpdate: TNotifyEvent;
|
FOnBeginUpdate: TNotifyEvent;
|
||||||
FOnEndUpdate: TEndUpdateProjectEvent;
|
FOnEndUpdate: TEndUpdateProjectEvent;
|
||||||
fOnFileBackup: TOnFileBackup;
|
fOnFileBackup: TOnFileBackup;
|
||||||
@ -428,7 +429,6 @@ type
|
|||||||
procedure SetAutoOpenDesignerFormsDisabled(const AValue: boolean);
|
procedure SetAutoOpenDesignerFormsDisabled(const AValue: boolean);
|
||||||
procedure SetCompilerOptions(const AValue: TProjectCompilerOptions);
|
procedure SetCompilerOptions(const AValue: TProjectCompilerOptions);
|
||||||
procedure SetTargetFilename(const NewTargetFilename: string);
|
procedure SetTargetFilename(const NewTargetFilename: string);
|
||||||
procedure SetUnits(Index:integer; AUnitInfo: TUnitInfo);
|
|
||||||
procedure SetMainUnitID(const AValue: Integer);
|
procedure SetMainUnitID(const AValue: Integer);
|
||||||
procedure UpdateProjectDirectory;
|
procedure UpdateProjectDirectory;
|
||||||
procedure UpdateSourceDirectories;
|
procedure UpdateSourceDirectories;
|
||||||
@ -438,11 +438,11 @@ type
|
|||||||
function GetMainFileID: Integer; override;
|
function GetMainFileID: Integer; override;
|
||||||
procedure SetMainFileID(const AValue: Integer); override;
|
procedure SetMainFileID(const AValue: Integer); override;
|
||||||
function GetFiles(Index: integer): TLazProjectFile; override;
|
function GetFiles(Index: integer): TLazProjectFile; override;
|
||||||
procedure SetFiles(Index: integer; const AValue: TLazProjectFile); override;
|
|
||||||
procedure SetFlags(const AValue: TProjectFlags); override;
|
procedure SetFlags(const AValue: TProjectFlags); override;
|
||||||
function GetProjectInfoFile: string; override;
|
function GetProjectInfoFile: string; override;
|
||||||
procedure SetProjectInfoFile(const NewFilename: string); override;
|
procedure SetProjectInfoFile(const NewFilename: string); override;
|
||||||
procedure SetModified(const AValue: boolean); override;
|
procedure SetModified(const AValue: boolean); override;
|
||||||
|
procedure SetSessionModified(const AValue: boolean); override;
|
||||||
protected
|
protected
|
||||||
// special unit lists
|
// special unit lists
|
||||||
procedure AddToList(AnUnitInfo: TUnitInfo; ListType: TUnitInfoList);
|
procedure AddToList(AnUnitInfo: TUnitInfo; ListType: TUnitInfoList);
|
||||||
@ -459,10 +459,11 @@ type
|
|||||||
procedure Clear;
|
procedure Clear;
|
||||||
procedure BeginUpdate(Change: boolean);
|
procedure BeginUpdate(Change: boolean);
|
||||||
procedure EndUpdate;
|
procedure EndUpdate;
|
||||||
|
procedure UnitModified(AnUnitInfo: TUnitInfo);
|
||||||
|
|
||||||
// load/save
|
// load/save
|
||||||
function IsVirtual: boolean;
|
function IsVirtual: boolean;
|
||||||
function SomethingModified: boolean;
|
function SomethingModified(CheckData, CheckSession: boolean): boolean;
|
||||||
procedure MainSourceFilenameChanged;
|
procedure MainSourceFilenameChanged;
|
||||||
procedure GetUnitsChangedOnDisk(var AnUnitList: TList);
|
procedure GetUnitsChangedOnDisk(var AnUnitList: TList);
|
||||||
function ReadProject(const LPIFilename: string): TModalResult;
|
function ReadProject(const LPIFilename: string): TModalResult;
|
||||||
@ -602,10 +603,8 @@ type
|
|||||||
property TargetFileExt: String read FTargetFileExt write FTargetFileExt;
|
property TargetFileExt: String read FTargetFileExt write FTargetFileExt;
|
||||||
property TargetFilename: string
|
property TargetFilename: string
|
||||||
read GetTargetFilename write SetTargetFilename;
|
read GetTargetFilename write SetTargetFilename;
|
||||||
property Units[Index: integer]: TUnitInfo read GetUnits write SetUnits;
|
property Units[Index: integer]: TUnitInfo read GetUnits;
|
||||||
property UpdateLock: integer read FUpdateLock;
|
property UpdateLock: integer read FUpdateLock;
|
||||||
//lazdoc
|
|
||||||
property LazDocPathList: TStrings read FLazDocPathList write FLazDocPathList;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -787,6 +786,7 @@ begin
|
|||||||
FIgnoreFileDateOnDiskValid:=false;
|
FIgnoreFileDateOnDiskValid:=false;
|
||||||
inherited SetIsPartOfProject(false);
|
inherited SetIsPartOfProject(false);
|
||||||
fModified := false;
|
fModified := false;
|
||||||
|
FSessionModified := false;
|
||||||
FRunFileIfActive:=false;
|
FRunFileIfActive:=false;
|
||||||
fSyntaxHighlighter := lshText;
|
fSyntaxHighlighter := lshText;
|
||||||
fTopLine := -1;
|
fTopLine := -1;
|
||||||
@ -889,7 +889,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
fUnitName:=NewUnitName;
|
fUnitName:=NewUnitName;
|
||||||
Modified:=true;
|
Modified:=true;
|
||||||
if Project<>nil then Project.Modified:=true;
|
if (Project<>nil) then Project.UnitModified(Self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1086,7 +1086,7 @@ begin
|
|||||||
NewSource:=Beautified(
|
NewSource:=Beautified(
|
||||||
Descriptor.CreateSource(Filename,NewUnitName,fComponentName));
|
Descriptor.CreateSource(Filename,NewUnitName,fComponentName));
|
||||||
fSource.Source:=NewSource;
|
fSource.Source:=NewSource;
|
||||||
fModified:=true;
|
Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TUnitInfo.GetHasResources:boolean;
|
function TUnitInfo.GetHasResources:boolean;
|
||||||
@ -1259,7 +1259,6 @@ begin
|
|||||||
FJumpHistory.OnCheckPosition:=@JumpHistoryCheckPosition;
|
FJumpHistory.OnCheckPosition:=@JumpHistoryCheckPosition;
|
||||||
FJumpHistory.OnLoadSaveFilename:=@OnLoadSaveFilename;
|
FJumpHistory.OnLoadSaveFilename:=@OnLoadSaveFilename;
|
||||||
fMainUnitID := -1;
|
fMainUnitID := -1;
|
||||||
fModified := false;
|
|
||||||
fProjectInfoFile := '';
|
fProjectInfoFile := '';
|
||||||
FSourceDirectories:=TFileReferenceList.Create;
|
FSourceDirectories:=TFileReferenceList.Create;
|
||||||
FSourceDirectories.OnChanged:=@SourceDirectoriesChanged;
|
FSourceDirectories.OnChanged:=@SourceDirectoriesChanged;
|
||||||
@ -1446,6 +1445,8 @@ begin
|
|||||||
InvalidateFileStateCache;
|
InvalidateFileStateCache;
|
||||||
xmlconfig.Flush;
|
xmlconfig.Flush;
|
||||||
Modified:=false;
|
Modified:=false;
|
||||||
|
SessionModified:=false;
|
||||||
|
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
@ -1703,7 +1704,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
Modified:=true;
|
UnitModified(AnUnit);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -1722,7 +1723,7 @@ begin
|
|||||||
|
|
||||||
BeginUpdate(true);
|
BeginUpdate(true);
|
||||||
OldUnitInfo:=Units[Index];
|
OldUnitInfo:=Units[Index];
|
||||||
Modified:=true;
|
UnitModified(OldUnitInfo);
|
||||||
|
|
||||||
if (MainUnitID>=0) then begin
|
if (MainUnitID>=0) then begin
|
||||||
// remove unit from uses section and from createforms in program file
|
// remove unit from uses section and from createforms in program file
|
||||||
@ -1792,7 +1793,8 @@ begin
|
|||||||
fIconPath := '';
|
fIconPath := '';
|
||||||
FJumpHistory.Clear;
|
FJumpHistory.Clear;
|
||||||
fMainUnitID := -1;
|
fMainUnitID := -1;
|
||||||
fModified := false;
|
Modified := false;
|
||||||
|
SessionModified := false;
|
||||||
fProjectInfoFile := '';
|
fProjectInfoFile := '';
|
||||||
FSourceDirectories.Clear;
|
FSourceDirectories.Clear;
|
||||||
UpdateProjectDirectory;
|
UpdateProjectDirectory;
|
||||||
@ -1823,6 +1825,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TProject.UnitModified(AnUnitInfo: TUnitInfo);
|
||||||
|
begin
|
||||||
|
if AnUnitInfo.IsPartOfProject then
|
||||||
|
Modified:=true
|
||||||
|
else
|
||||||
|
SessionModified:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
function TProject.GetUnits(Index:integer):TUnitInfo;
|
function TProject.GetUnits(Index:integer):TUnitInfo;
|
||||||
begin
|
begin
|
||||||
Result:=TUnitInfo(FUnitList[Index]);
|
Result:=TUnitInfo(FUnitList[Index]);
|
||||||
@ -1848,25 +1858,20 @@ begin
|
|||||||
Result:=Units[Index];
|
Result:=Units[Index];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProject.SetFiles(Index: integer; const AValue: TLazProjectFile);
|
|
||||||
begin
|
|
||||||
Units[Index]:=AValue as TUnitInfo;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TProject.SetModified(const AValue: boolean);
|
procedure TProject.SetModified(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if AValue=Modified then exit;
|
if AValue=Modified then exit;
|
||||||
inherited SetModified(AValue);
|
inherited SetModified(AValue);
|
||||||
if not Modified then PublishOptions.Modified:=false;
|
if not Modified then begin
|
||||||
|
PublishOptions.Modified:=false;
|
||||||
|
CompilerOptions.Modified:=false;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProject.SetUnits(Index:integer; AUnitInfo: TUnitInfo);
|
procedure TProject.SetSessionModified(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if AUnitInfo<>TUnitInfo(FUnitList[Index]) then begin
|
if AValue=SessionModified then exit;
|
||||||
FUnitList[Index]:=AUnitInfo;
|
inherited SetSessionModified(AValue);
|
||||||
Modified:=true;
|
|
||||||
if AUnitInfo<>nil then AUnitInfo.Project:=Self;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.UnitCount:integer;
|
function TProject.UnitCount:integer;
|
||||||
@ -2162,7 +2167,7 @@ begin
|
|||||||
Bookmarks[i].EditorIndex:=Bookmarks[i].EditorIndex-1;
|
Bookmarks[i].EditorIndex:=Bookmarks[i].EditorIndex-1;
|
||||||
dec(i);
|
dec(i);
|
||||||
end;
|
end;
|
||||||
Modified:=true;
|
SessionModified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProject.InsertEditorIndex(EditorIndex:integer);
|
procedure TProject.InsertEditorIndex(EditorIndex:integer);
|
||||||
@ -2189,7 +2194,7 @@ begin
|
|||||||
Bookmarks[i].EditorIndex:=MoveIndex(Bookmarks[i].EditorIndex);
|
Bookmarks[i].EditorIndex:=MoveIndex(Bookmarks[i].EditorIndex);
|
||||||
dec(i);
|
dec(i);
|
||||||
end;
|
end;
|
||||||
Modified:=true;
|
SessionModified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProject.MoveEditorIndex(OldEditorIndex, NewEditorIndex: integer);
|
procedure TProject.MoveEditorIndex(OldEditorIndex, NewEditorIndex: integer);
|
||||||
@ -2232,7 +2237,7 @@ begin
|
|||||||
Bookmarks[i].EditorIndex:=MoveIndex(Bookmarks[i].EditorIndex);
|
Bookmarks[i].EditorIndex:=MoveIndex(Bookmarks[i].EditorIndex);
|
||||||
dec(i);
|
dec(i);
|
||||||
end;
|
end;
|
||||||
Modified:=true;
|
SessionModified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProject.AddToOrRemoveFromEditorWithIndexList(AnUnitInfo: TUnitInfo);
|
procedure TProject.AddToOrRemoveFromEditorWithIndexList(AnUnitInfo: TUnitInfo);
|
||||||
@ -2676,12 +2681,24 @@ begin
|
|||||||
Result:=(i>=0) and (Units[i].EditorIndex>=0);
|
Result:=(i>=0) and (Units[i].EditorIndex>=0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.SomethingModified: boolean;
|
function TProject.SomethingModified(CheckData, CheckSession: boolean): boolean;
|
||||||
var i: integer;
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
Result:=Modified or SessionModified;
|
Result:=true;
|
||||||
for i:=0 to UnitCount-1 do Result:=Result or Units[i].Modified;
|
if CheckData then begin
|
||||||
Result:=Result or CompilerOptions.Modified;
|
if Modified then exit;
|
||||||
|
if CompilerOptions.Modified then exit;
|
||||||
|
for i:=0 to UnitCount-1 do
|
||||||
|
if (Units[i].IsPartOfProject) and Units[i].Modified then exit;
|
||||||
|
end;
|
||||||
|
if CheckSession then begin
|
||||||
|
if SessionModified then exit;
|
||||||
|
for i:=0 to UnitCount-1 do begin
|
||||||
|
if Units[i].SessionModified then exit;
|
||||||
|
if (not Units[i].IsPartOfProject) and Units[i].Modified then exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProject.MainSourceFilenameChanged;
|
procedure TProject.MainSourceFilenameChanged;
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
// Created by Svn2RevisionInc
|
// Created by Svn2RevisionInc
|
||||||
const RevisionStr = '8071:8075M';
|
const RevisionStr = '8117M';
|
||||||
|
@ -129,9 +129,11 @@ type
|
|||||||
|
|
||||||
procedure DoJumpToCodeToolBossError; virtual; abstract;
|
procedure DoJumpToCodeToolBossError; virtual; abstract;
|
||||||
procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract;
|
procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); virtual; abstract;
|
||||||
|
|
||||||
|
function ShowProgress(const SomeText: string;
|
||||||
|
Step, MaxStep: integer): boolean; virtual; abstract; // False if canceled by user
|
||||||
public
|
public
|
||||||
property ActiveProject: TLazProject read GetActiveProject;
|
property ActiveProject: TLazProject read GetActiveProject;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -481,12 +481,11 @@ type
|
|||||||
|
|
||||||
{ TLazProject - interface class to a Lazarus project }
|
{ TLazProject - interface class to a Lazarus project }
|
||||||
|
|
||||||
{ TLazProject }
|
|
||||||
|
|
||||||
TLazProject = class(TPersistent)
|
TLazProject = class(TPersistent)
|
||||||
private
|
private
|
||||||
FLazCompilerOptions: TLazCompilerOptions;
|
FLazCompilerOptions: TLazCompilerOptions;
|
||||||
fModified: boolean;
|
fModified: boolean;
|
||||||
|
FProjectSessionFile: string;
|
||||||
FSessionModified: boolean;
|
FSessionModified: boolean;
|
||||||
fTitle: String;
|
fTitle: String;
|
||||||
FSessionStorage: TProjectSessionStorage;
|
FSessionStorage: TProjectSessionStorage;
|
||||||
@ -498,11 +497,11 @@ type
|
|||||||
function GetMainFileID: Integer; virtual; abstract;
|
function GetMainFileID: Integer; virtual; abstract;
|
||||||
procedure SetMainFileID(const AValue: Integer); virtual; abstract;
|
procedure SetMainFileID(const AValue: Integer); virtual; abstract;
|
||||||
function GetFiles(Index: integer): TLazProjectFile; virtual; abstract;
|
function GetFiles(Index: integer): TLazProjectFile; virtual; abstract;
|
||||||
procedure SetFiles(Index: integer; const AValue: TLazProjectFile); virtual; abstract;
|
|
||||||
procedure SetTitle(const AValue: String); virtual;
|
procedure SetTitle(const AValue: String); virtual;
|
||||||
procedure SetFlags(const AValue: TProjectFlags); virtual;
|
procedure SetFlags(const AValue: TProjectFlags); virtual;
|
||||||
function GetProjectInfoFile: string; virtual; abstract;
|
function GetProjectInfoFile: string; virtual; abstract;
|
||||||
procedure SetProjectInfoFile(const NewFilename: string); virtual; abstract;
|
procedure SetProjectInfoFile(const NewFilename: string); virtual; abstract;
|
||||||
|
procedure SetProjectSessionFile(const AValue: string); virtual;
|
||||||
procedure SetSessionStorage(const AValue: TProjectSessionStorage); virtual;
|
procedure SetSessionStorage(const AValue: TProjectSessionStorage); virtual;
|
||||||
procedure SetModified(const AValue: boolean); virtual;
|
procedure SetModified(const AValue: boolean); virtual;
|
||||||
procedure SetSessionModified(const AValue: boolean); virtual;
|
procedure SetSessionModified(const AValue: boolean); virtual;
|
||||||
@ -520,7 +519,7 @@ type
|
|||||||
function ShortDescription: string;
|
function ShortDescription: string;
|
||||||
public
|
public
|
||||||
property MainFileID: Integer read GetMainFileID write SetMainFileID;
|
property MainFileID: Integer read GetMainFileID write SetMainFileID;
|
||||||
property Files[Index: integer]: TLazProjectFile read GetFiles write SetFiles;
|
property Files[Index: integer]: TLazProjectFile read GetFiles;
|
||||||
property FileCount: integer read GetFileCount;
|
property FileCount: integer read GetFileCount;
|
||||||
property MainFile: TLazProjectFile read GetMainFile;
|
property MainFile: TLazProjectFile read GetMainFile;
|
||||||
property Title: String read fTitle write SetTitle;
|
property Title: String read fTitle write SetTitle;
|
||||||
@ -529,12 +528,17 @@ type
|
|||||||
write SetLazCompilerOptions;
|
write SetLazCompilerOptions;
|
||||||
property ProjectInfoFile: string
|
property ProjectInfoFile: string
|
||||||
read GetProjectInfoFile write SetProjectInfoFile;
|
read GetProjectInfoFile write SetProjectInfoFile;
|
||||||
|
property ProjectSessionFile: string
|
||||||
|
read FProjectSessionFile write SetProjectSessionFile;
|
||||||
property SessionStorage: TProjectSessionStorage read FSessionStorage
|
property SessionStorage: TProjectSessionStorage read FSessionStorage
|
||||||
write SetSessionStorage;
|
write SetSessionStorage;
|
||||||
property Modified: boolean read fModified
|
property Modified: boolean read fModified
|
||||||
write SetModified; // project data (not units, session)
|
write SetModified; // project data (not units, session),
|
||||||
|
// units have their own Modified
|
||||||
property SessionModified: boolean read FSessionModified
|
property SessionModified: boolean read FSessionModified
|
||||||
write SetSessionModified; // project session data (not units, data)
|
write SetSessionModified;
|
||||||
|
// project session data (not units, data),
|
||||||
|
// units have their own SessionModified
|
||||||
property LazDocPathList: TStrings read FLazDocPathList write FLazDocPathList;
|
property LazDocPathList: TStrings read FLazDocPathList write FLazDocPathList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -992,6 +996,13 @@ begin
|
|||||||
FSessionModified:=AValue;
|
FSessionModified:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TLazProject.SetProjectSessionFile(const AValue: string);
|
||||||
|
begin
|
||||||
|
if FProjectSessionFile=AValue then exit;
|
||||||
|
FProjectSessionFile:=AValue;
|
||||||
|
SessionModified:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLazProject.SetLazCompilerOptions(const AValue: TLazCompilerOptions);
|
procedure TLazProject.SetLazCompilerOptions(const AValue: TLazCompilerOptions);
|
||||||
begin
|
begin
|
||||||
if FLazCompilerOptions=AValue then exit;
|
if FLazCompilerOptions=AValue then exit;
|
||||||
|
@ -1150,12 +1150,17 @@ Begin
|
|||||||
begin
|
begin
|
||||||
if not
|
if not
|
||||||
((AWinControl = nil)
|
((AWinControl = nil)
|
||||||
or (AWinControl <> Self) and (GetParentForm(AWinControl) = Self)
|
or ((AWinControl <> Self)
|
||||||
and ((csLoading in ComponentState) or not (Visible and Enabled)
|
and (GetParentForm(AWinControl) = Self)
|
||||||
or AWinControl.CanFocus))
|
and ((csLoading in ComponentState)
|
||||||
then
|
or AWinControl.CanFocus)))
|
||||||
|
then begin
|
||||||
|
{$IFDEF VerboseFocus}
|
||||||
RaiseGDBException(SCannotFocus);
|
RaiseGDBException(SCannotFocus);
|
||||||
// EInvalidOperation.Create(SCannotFocus);
|
{$ELSE}
|
||||||
|
EInvalidOperation.Create(SCannotFocus);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
{$IFDEF VerboseFocus}
|
{$IFDEF VerboseFocus}
|
||||||
DbgOut('TCustomForm.SetActiveControl ',Name,':',ClassName,' FActive=',DbgS(FActive));
|
DbgOut('TCustomForm.SetActiveControl ',Name,':',ClassName,' FActive=',DbgS(FActive));
|
||||||
if FActiveControl<>nil then
|
if FActiveControl<>nil then
|
||||||
|
@ -1570,7 +1570,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Control := Self;
|
Control := Self;
|
||||||
repeat
|
repeat
|
||||||
if not (Control.IsVisible and Control.Enabled) then Exit;
|
if not (Control.IsControlVisible and Control.Enabled) then Exit;
|
||||||
if Control = Form then break;
|
if Control = Form then break;
|
||||||
Control := Control.Parent;
|
Control := Control.Parent;
|
||||||
until false;
|
until false;
|
||||||
|
Loading…
Reference in New Issue
Block a user