reduced focus handling and improved focus setting

git-svn-id: trunk@2903 -
This commit is contained in:
mattias 2002-08-18 08:55:49 +00:00
parent 9f1fdab27e
commit f2f97822da

View File

@ -3713,6 +3713,7 @@ begin
AnUnitInfo.SyntaxHighlighter:= AnUnitInfo.SyntaxHighlighter:=
ExtensionToLazSyntaxHighlighter(ExtractFileExt(AFilename)); ExtensionToLazSyntaxHighlighter(ExtractFileExt(AFilename));
NewSrcEditorCreated:=false;
if (not (ofRevert in Flags)) or (PageIndex<0) then begin if (not (ofRevert in Flags)) or (PageIndex<0) then begin
// create a new source editor // create a new source editor
@ -3731,7 +3732,6 @@ begin
NewSrcEdit.CodeBuffer:=AnUnitInfo.Source; NewSrcEdit.CodeBuffer:=AnUnitInfo.Source;
NewSrcEdit.Modified:=false; NewSrcEdit.Modified:=false;
AnUnitInfo.Modified:=false; AnUnitInfo.Modified:=false;
NewSrcEditorCreated:=false;
end; end;
// update editor indices in project // update editor indices in project
@ -3750,7 +3750,9 @@ begin
// mark unit as loaded // mark unit as loaded
AnUnitInfo.Loaded:=true; AnUnitInfo.Loaded:=true;
// update statusbar // update statusbar and focus editor
if (not (ofProjectLoading in Flags)) then
SourceNotebook.FocusEditor;
SourceNoteBook.UpdateStatusBar; SourceNoteBook.UpdateStatusBar;
Result:=mrOk; Result:=mrOk;
@ -6049,7 +6051,7 @@ begin
if FocusEditor then begin if FocusEditor then begin
//SourceNotebook.BringToFront; //SourceNotebook.BringToFront;
BringWindowToTop(SourceNoteBook.Handle); BringWindowToTop(SourceNoteBook.Handle);
SrcEdit.EditorComponent.SetFocus; SourceNotebook.FocusEditor;
end; end;
SrcEdit.EditorComponent.CaretXY:=CaretXY; SrcEdit.EditorComponent.CaretXY:=CaretXY;
SrcEdit.EditorComponent.TopLine:=TopLine; SrcEdit.EditorComponent.TopLine:=TopLine;
@ -6679,9 +6681,9 @@ begin
BlockEnd:=CaretXY; BlockEnd:=CaretXY;
TopLine:=NewTopLine; TopLine:=NewTopLine;
LeftChar:=Max(NewX-CharsInWindow,1); LeftChar:=Max(NewX-CharsInWindow,1);
BringWindowToTop(SourceNoteBook.Handle);
SetFocus;
end; end;
BringWindowToTop(SourceNoteBook.Handle);
SourceNotebook.FocusEditor;
UpdateSourceNames; UpdateSourceNames;
Result:=mrOk; Result:=mrOk;
end; end;
@ -6782,8 +6784,8 @@ begin
BlockEnd:=CaretXY; BlockEnd:=CaretXY;
if CodeToolBoss.ErrorTopLine>0 then if CodeToolBoss.ErrorTopLine>0 then
TopLine:=CodeToolBoss.ErrorTopLine; TopLine:=CodeToolBoss.ErrorTopLine;
SetFocus;
end; end;
SourceNotebook.FocusEditor;
SourceNotebook.ClearErrorLines; SourceNotebook.ClearErrorLines;
ActiveSrcEdit.ErrorLine:=ErrorCaret.Y; ActiveSrcEdit.ErrorLine:=ErrorCaret.Y;
end; end;
@ -8002,6 +8004,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $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 Revision 1.493 2003/03/17 13:00:35 mattias
improved but not fixed transient windows improved but not fixed transient windows