fixed closing an empty TTIPropertyGrid

git-svn-id: trunk@9866 -
This commit is contained in:
mattias 2006-09-12 16:39:51 +00:00
parent 50d7aaf797
commit ef77b40e9f
5 changed files with 13 additions and 6 deletions

View File

@ -38,7 +38,8 @@ interface
uses
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Dialogs, FileUtil,
CodeCache, CodeToolManager, AVL_Tree, LazIDEIntf,
CodeCache, CodeToolManager, AVL_Tree,
LazIDEIntf,
IDEProcs, LazarusIDEStrConsts, IDEDialogs;
type

View File

@ -5424,6 +5424,7 @@ begin
NewSrcEdit.EditorComponent.BeginUpdate;
NewSrcEdit.CodeBuffer:=AnUnitInfo.Source;
AnUnitInfo.ClearModifieds;
DebugLn(['TMainIDE.DoOpenFileInSourceEditor NewCaretXY=',dbgs(NewCaretXY),' NewTopLine=',NewTopLine]);
end;
// update editor indices in project
@ -5866,6 +5867,7 @@ var
FilenameNoPath: String;
LoadBufferFlags: TLoadBufferFlags;
DiskFilename: String;
NewSrcEdit: TSourceEditor;
function OpenResource: TModalResult;
begin
@ -6047,7 +6049,11 @@ begin
if ofRevert in Flags then
Include(LoadBufferFlags,lbfRevert);
end;
NewSrcEdit:=SourceNotebook.FindSourceEditorWithPageIndex(PageIndex);
if NewSrcEdit<>nil then DebugLn(['TMainIDE.DoOpenEditorFile AAA ',AFilename,' TopLine=',NewSrcEdit.EditorComponent.TopLine]);
Result:=LoadCodeBuffer(NewBuf,AFileName,LoadBufferFlags);
NewSrcEdit:=SourceNotebook.FindSourceEditorWithPageIndex(PageIndex);
if NewSrcEdit<>nil then DebugLn(['TMainIDE.DoOpenEditorFile BBB ',AFilename,' TopLine=',NewSrcEdit.EditorComponent.TopLine]);
if Result<>mrOk then begin
DebugLn(['TMainIDE.DoOpenEditorFile failed LoadCodeBuffer: ',AFilename]);
exit;

View File

@ -2108,9 +2108,9 @@ procedure TSourceEditor.OnCodeBufferChanged(Sender: TSourceLog;
var StartPos, EndPos, MoveToPos: TPoint;
begin
{$IFDEF IDE_DEBUG}
writeln('[TSourceEditor.OnCodeBufferChanged] A ',FIgnoreCodeBufferLock,' ',SrcLogEntry<>nil);
{$ENDIF}
{ $IFDEF IDE_DEBUG}
writeln('[TSourceEditor.OnCodeBufferChanged] A ',FIgnoreCodeBufferLock,' ',SrcLogEntry<>nil);
{ $ENDIF}
if FIgnoreCodeBufferLock>0 then exit;
if SrcLogEntry<>nil then begin
FEditor.BeginUpdate;

View File

@ -899,7 +899,7 @@ procedure TOICustomPropertyGrid.Notification(AComponent: TComponent;
var
i: LongInt;
begin
if Operation=opRemove then begin
if (Operation=opRemove) and (FNotificationComponents<>nil) then begin
FNotificationComponents.Remove(AComponent);
i:=FSelection.IndexOf(AComponent);
if i>=0 then begin

View File

@ -2490,7 +2490,7 @@ begin
Result:=mrOk;
if (OldFilename=NewFilename) then
exit;
debugln('TPkgManager.OnRenameFile A OldFilename="',OldFilename,'" New="',NewFilename,'"');
//debugln('TPkgManager.OnRenameFile A OldFilename="',OldFilename,'" New="',NewFilename,'"');
OldPkgFile:=PackageGraph.FindFileInAllPackages(OldFilename,false,true,
not IsPartOfProject);
if (OldPkgFile=nil) or (OldPkgFile.LazPackage.ReadOnly) then