From f2f97822dac5b7a4c0880e04b2fd7f2cf3216c40 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 18 Aug 2002 08:55:49 +0000 Subject: [PATCH] reduced focus handling and improved focus setting git-svn-id: trunk@2903 - --- ide/main.pp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ide/main.pp b/ide/main.pp index 7dbe1b15a4..16867b398f 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -3713,6 +3713,7 @@ begin AnUnitInfo.SyntaxHighlighter:= ExtensionToLazSyntaxHighlighter(ExtractFileExt(AFilename)); + NewSrcEditorCreated:=false; if (not (ofRevert in Flags)) or (PageIndex<0) then begin // create a new source editor @@ -3731,7 +3732,6 @@ begin NewSrcEdit.CodeBuffer:=AnUnitInfo.Source; NewSrcEdit.Modified:=false; AnUnitInfo.Modified:=false; - NewSrcEditorCreated:=false; end; // update editor indices in project @@ -3750,7 +3750,9 @@ begin // mark unit as loaded AnUnitInfo.Loaded:=true; - // update statusbar + // update statusbar and focus editor + if (not (ofProjectLoading in Flags)) then + SourceNotebook.FocusEditor; SourceNoteBook.UpdateStatusBar; Result:=mrOk; @@ -6049,7 +6051,7 @@ begin if FocusEditor then begin //SourceNotebook.BringToFront; BringWindowToTop(SourceNoteBook.Handle); - SrcEdit.EditorComponent.SetFocus; + SourceNotebook.FocusEditor; end; SrcEdit.EditorComponent.CaretXY:=CaretXY; SrcEdit.EditorComponent.TopLine:=TopLine; @@ -6679,9 +6681,9 @@ begin BlockEnd:=CaretXY; TopLine:=NewTopLine; LeftChar:=Max(NewX-CharsInWindow,1); - BringWindowToTop(SourceNoteBook.Handle); - SetFocus; end; + BringWindowToTop(SourceNoteBook.Handle); + SourceNotebook.FocusEditor; UpdateSourceNames; Result:=mrOk; end; @@ -6782,8 +6784,8 @@ begin BlockEnd:=CaretXY; if CodeToolBoss.ErrorTopLine>0 then TopLine:=CodeToolBoss.ErrorTopLine; - SetFocus; end; + SourceNotebook.FocusEditor; SourceNotebook.ClearErrorLines; ActiveSrcEdit.ErrorLine:=ErrorCaret.Y; end; @@ -8002,6 +8004,9 @@ end. { ============================================================================= $Log$ + Revision 1.494 2003/03/25 10:45:40 mattias + reduced focus handling and improved focus setting + Revision 1.493 2003/03/17 13:00:35 mattias improved but not fixed transient windows