mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 12:00:02 +02:00
IDE+codetools: renaming a component now renames in the whole unit
git-svn-id: trunk@10160 -
This commit is contained in:
parent
ba83e8416b
commit
567453b914
@ -356,6 +356,8 @@ type
|
|||||||
var ListOfPCodeXYPosition: TFPList): boolean;
|
var ListOfPCodeXYPosition: TFPList): boolean;
|
||||||
function RenameIdentifier(TreeOfPCodeXYPosition: TAVLTree;
|
function RenameIdentifier(TreeOfPCodeXYPosition: TAVLTree;
|
||||||
const OldIdentifier, NewIdentifier: string): boolean;
|
const OldIdentifier, NewIdentifier: string): boolean;
|
||||||
|
function ReplaceWord(Code: TCodeBuffer; const OldWord, NewWord: string
|
||||||
|
): boolean;
|
||||||
|
|
||||||
// resourcestring sections
|
// resourcestring sections
|
||||||
function GatherResourceStringSections(
|
function GatherResourceStringSections(
|
||||||
@ -1945,6 +1947,24 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCodeToolManager.ReplaceWord(Code: TCodeBuffer; const OldWord,
|
||||||
|
NewWord: string): boolean;
|
||||||
|
var
|
||||||
|
CursorPos, SectionPos, NearestPos: TCodeXYPosition;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
{$IFDEF CTDEBUG}
|
||||||
|
DebugLn('TCodeToolManager.ReplaceWord A ',Code.Filename,' OldWord="',OldWord,'" NewWord="',NewWord,'"');
|
||||||
|
{$ENDIF}
|
||||||
|
if not InitCurCodeTool(Code) then exit;
|
||||||
|
try
|
||||||
|
Result:=FCurCodeTool.ReplaceWord(OldWord, NewWord,
|
||||||
|
SourceChangeCache);
|
||||||
|
except
|
||||||
|
on e: Exception do HandleException(e);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCodeToolManager.GatherResourceStringSections(Code: TCodeBuffer;
|
function TCodeToolManager.GatherResourceStringSections(Code: TCodeBuffer;
|
||||||
X, Y: integer; CodePositions: TCodeXYPositions): boolean;
|
X, Y: integer; CodePositions: TCodeXYPositions): boolean;
|
||||||
var
|
var
|
||||||
|
@ -9,25 +9,6 @@
|
|||||||
<IconPath Value="./"/>
|
<IconPath Value="./"/>
|
||||||
<TargetFileExt Value=""/>
|
<TargetFileExt Value=""/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
|
||||||
<UseVersionInfo Value="False"/>
|
|
||||||
<AutoIncrementBuild Value="False"/>
|
|
||||||
<CurrentVersionNr Value="0"/>
|
|
||||||
<CurrentMajorRevNr Value="0"/>
|
|
||||||
<CurrentMinorRevNr Value="0"/>
|
|
||||||
<CurrentBuildNr Value="0"/>
|
|
||||||
<ProjectVersion Value="1.0.0.0"/>
|
|
||||||
<Language Value="0409"/>
|
|
||||||
<CharSet Value="04E4"/>
|
|
||||||
<Comments Value=""/>
|
|
||||||
<CompanyName Value=""/>
|
|
||||||
<FileDescription Value=""/>
|
|
||||||
<InternalName Value=""/>
|
|
||||||
<LegalCopyright Value=""/>
|
|
||||||
<LegalTrademarks Value=""/>
|
|
||||||
<OriginalFilename Value=""/>
|
|
||||||
<ProductName Value=""/>
|
|
||||||
</VersionInfo>
|
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
MemCheck,
|
MemCheck,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, CodeToolsStrConsts, CodeToolMemManager, FileProcs,
|
Classes, SysUtils, CodeToolsStrConsts, CodeToolMemManager, FileProcs,
|
||||||
ExprEval, SourceLog, KeywordFuncLists, BasicCodeTools;
|
AVL_Tree, ExprEval, SourceLog, KeywordFuncLists, BasicCodeTools;
|
||||||
|
|
||||||
const
|
const
|
||||||
PascalCompilerDefine = ExternalMacroStart+'Compiler';
|
PascalCompilerDefine = ExternalMacroStart+'Compiler';
|
||||||
@ -305,7 +305,7 @@ type
|
|||||||
|
|
||||||
// links
|
// links
|
||||||
property Links[Index: integer]: TSourceLink read GetLinks write SetLinks;
|
property Links[Index: integer]: TSourceLink read GetLinks write SetLinks;
|
||||||
function LinkCount: integer;
|
property LinkCount: integer read FLinkCount;
|
||||||
function LinkIndexAtCleanPos(ACleanPos: integer): integer;
|
function LinkIndexAtCleanPos(ACleanPos: integer): integer;
|
||||||
function LinkIndexAtCursorPos(ACursorPos: integer; ACode: Pointer): integer;
|
function LinkIndexAtCursorPos(ACursorPos: integer; ACode: Pointer): integer;
|
||||||
function LinkSize(Index: integer): integer;
|
function LinkSize(Index: integer): integer;
|
||||||
@ -314,6 +314,7 @@ type
|
|||||||
function FindParentLink(LinkIndex: integer): integer;
|
function FindParentLink(LinkIndex: integer): integer;
|
||||||
function LinkIndexNearCursorPos(ACursorPos: integer; ACode: Pointer;
|
function LinkIndexNearCursorPos(ACursorPos: integer; ACode: Pointer;
|
||||||
var CursorInLink: boolean): integer;
|
var CursorInLink: boolean): integer;
|
||||||
|
function CreateTreeOfSourceCodes: TAVLTree;
|
||||||
|
|
||||||
// source mapping (Cleaned <-> Original)
|
// source mapping (Cleaned <-> Original)
|
||||||
function CleanedSrc: string;
|
function CleanedSrc: string;
|
||||||
@ -760,6 +761,19 @@ begin
|
|||||||
Result:=BestLinkIndex;
|
Result:=BestLinkIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLinkScanner.CreateTreeOfSourceCodes: TAVLTree;
|
||||||
|
var
|
||||||
|
CurCode: Pointer;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result:=TAVLTree.Create(@ComparePointers);
|
||||||
|
for i:=0 to LinkCount-1 do begin
|
||||||
|
CurCode:=FLinks[i].Code;
|
||||||
|
if Result.Find(CurCode)=nil then
|
||||||
|
Result.Add(CurCode);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLinkScanner.LinkIndexAtCleanPos(ACleanPos: integer): integer;
|
function TLinkScanner.LinkIndexAtCleanPos(ACleanPos: integer): integer;
|
||||||
|
|
||||||
procedure ConsistencyError1;
|
procedure ConsistencyError1;
|
||||||
@ -873,11 +887,6 @@ begin
|
|||||||
else inc(FChangeStep);
|
else inc(FChangeStep);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLinkScanner.LinkCount: integer;
|
|
||||||
begin
|
|
||||||
Result:=FLinkCount;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TLinkScanner.ReturnFromIncludeFileAndIsEnd: boolean;
|
function TLinkScanner.ReturnFromIncludeFileAndIsEnd: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
@ -194,7 +194,7 @@ type
|
|||||||
public
|
public
|
||||||
BeautifyCodeOptions: TBeautifyCodeOptions;
|
BeautifyCodeOptions: TBeautifyCodeOptions;
|
||||||
procedure BeginUpdate;
|
procedure BeginUpdate;
|
||||||
procedure EndUpdate;
|
function EndUpdate: boolean;
|
||||||
property MainScanner: TLinkScanner read FMainScanner write SetMainScanner;
|
property MainScanner: TLinkScanner read FMainScanner write SetMainScanner;
|
||||||
property MainScannerNeeded: boolean read FMainScannerNeeded;
|
property MainScannerNeeded: boolean read FMainScannerNeeded;
|
||||||
function Replace(FrontGap, AfterGap: TGapTyp; FromPos, ToPos: integer;
|
function Replace(FrontGap, AfterGap: TGapTyp; FromPos, ToPos: integer;
|
||||||
@ -861,12 +861,13 @@ begin
|
|||||||
inc(FUpdateLock);
|
inc(FUpdateLock);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceChangeCache.EndUpdate;
|
function TSourceChangeCache.EndUpdate: boolean;
|
||||||
begin
|
begin
|
||||||
|
Result:=true;
|
||||||
if FUpdateLock<=0 then exit;
|
if FUpdateLock<=0 then exit;
|
||||||
dec(FUpdateLock);
|
dec(FUpdateLock);
|
||||||
if FUpdateLock<=0 then
|
if FUpdateLock<=0 then
|
||||||
Apply;
|
Result:=Apply;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceChangeCache.SetMainScanner(NewScanner: TLinkScanner);
|
procedure TSourceChangeCache.SetMainScanner(NewScanner: TLinkScanner);
|
||||||
|
@ -222,10 +222,12 @@ type
|
|||||||
var MissingIncludeFilesCodeXYPos: TFPList): boolean;
|
var MissingIncludeFilesCodeXYPos: TFPList): boolean;
|
||||||
|
|
||||||
// search & replace
|
// search & replace
|
||||||
function ReplaceIdentifiers(IdentList: TStrings;
|
function ReplaceWords(IdentList: TStrings;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
function FindNearestIdentifierNode(const CursorPos: TCodeXYPosition;
|
function FindNearestIdentifierNode(const CursorPos: TCodeXYPosition;
|
||||||
IdentTree: TAVLTree): TAVLTreeNode;
|
IdentTree: TAVLTree): TAVLTreeNode;
|
||||||
|
function ReplaceWord(const OldWord, NewWord: string;
|
||||||
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
|
|
||||||
// expressions
|
// expressions
|
||||||
function GetStringConstBounds(const CursorPos: TCodeXYPosition;
|
function GetStringConstBounds(const CursorPos: TCodeXYPosition;
|
||||||
@ -2436,7 +2438,7 @@ begin
|
|||||||
IdentList.Add(OldFormClassName);
|
IdentList.Add(OldFormClassName);
|
||||||
IdentList.Add(NewFormClassName);
|
IdentList.Add(NewFormClassName);
|
||||||
end;
|
end;
|
||||||
Result:=ReplaceIdentifiers(IdentList,SourceChangeCache);
|
Result:=ReplaceWords(IdentList,SourceChangeCache);
|
||||||
finally
|
finally
|
||||||
IdentList.Free;
|
IdentList.Free;
|
||||||
end;
|
end;
|
||||||
@ -2469,17 +2471,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
function TStandardCodeTool.ReplaceIdentifiers(IdentList: TStrings;
|
function TStandardCodeTool.ReplaceWords(IdentList: TStrings;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
|
|
||||||
Search in all used sources (not the cleaned source) for identifiers.
|
Search in all used sources (not only the cleaned source) for identifiers.
|
||||||
It will find all identifiers, except identifiers in compiler directives.
|
It will find all identifiers, except identifiers in compiler directives.
|
||||||
This includes identifiers in string constants and comments.
|
This includes identifiers in string constants and comments.
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
function TStandardCodeTool.ReplaceIdentifiers(IdentList: TStrings;
|
function TStandardCodeTool.ReplaceWords(IdentList: TStrings;
|
||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
|
|
||||||
procedure ReplaceIdentifiersInSource(ACode: TCodeBuffer);
|
procedure ReplaceWordsInSource(ACode: TCodeBuffer);
|
||||||
var
|
var
|
||||||
StartPos, EndPos, MaxPos, IdentStart, IdentEnd: integer;
|
StartPos, EndPos, MaxPos, IdentStart, IdentEnd: integer;
|
||||||
CurSource: string;
|
CurSource: string;
|
||||||
@ -2489,7 +2491,7 @@ function TStandardCodeTool.ReplaceIdentifiers(IdentList: TStrings;
|
|||||||
MaxPos:=length(CurSource);
|
MaxPos:=length(CurSource);
|
||||||
StartPos:=1;
|
StartPos:=1;
|
||||||
// go through all source parts between compiler directives
|
// go through all source parts between compiler directives
|
||||||
DebugLn('TStandardCodeTool.ReplaceIdentifiers ',ACode.Filename);
|
DebugLn('TStandardCodeTool.ReplaceWords ',ACode.Filename);
|
||||||
repeat
|
repeat
|
||||||
EndPos:=FindNextCompilerDirective(CurSource,StartPos,
|
EndPos:=FindNextCompilerDirective(CurSource,StartPos,
|
||||||
Scanner.NestedComments);
|
Scanner.NestedComments);
|
||||||
@ -2507,7 +2509,7 @@ function TStandardCodeTool.ReplaceIdentifiers(IdentList: TStrings;
|
|||||||
begin
|
begin
|
||||||
// identifier found -> replace
|
// identifier found -> replace
|
||||||
IdentEnd:=IdentStart+length(IdentList[i]);
|
IdentEnd:=IdentStart+length(IdentList[i]);
|
||||||
//DebugLn('TStandardCodeTool.ReplaceIdentifiers replacing: ',
|
//DebugLn('TStandardCodeTool.ReplaceWords replacing: ',
|
||||||
//' "',copy(CurSource,IdentStart,IdentEnd-IdentStart),'" -> "',IdentList[i+1],'" at ',IdentStart
|
//' "',copy(CurSource,IdentStart,IdentEnd-IdentStart),'" -> "',IdentList[i+1],'" at ',IdentStart
|
||||||
//);
|
//);
|
||||||
SourceChangeCache.ReplaceEx(gtNone,gtNone,1,1,
|
SourceChangeCache.ReplaceEx(gtNone,gtNone,1,1,
|
||||||
@ -2548,7 +2550,7 @@ begin
|
|||||||
try
|
try
|
||||||
Scanner.FindCodeInRange(1,SrcLen,SourceList);
|
Scanner.FindCodeInRange(1,SrcLen,SourceList);
|
||||||
for i:=0 to SourceList.Count-1 do begin
|
for i:=0 to SourceList.Count-1 do begin
|
||||||
ReplaceIdentifiersInSource(TCodeBuffer(SourceList[i]));
|
ReplaceWordsInSource(TCodeBuffer(SourceList[i]));
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
SourceList.Free;
|
SourceList.Free;
|
||||||
@ -2588,6 +2590,25 @@ begin
|
|||||||
until CurPos.EndPos>SrcLen;
|
until CurPos.EndPos>SrcLen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TStandardCodeTool.ReplaceWord(const OldWord, NewWord: string;
|
||||||
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
|
var
|
||||||
|
IdentList: TStringList;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
if OldWord='' then exit;
|
||||||
|
if OldWord=NewWord then exit(true);
|
||||||
|
if (SourceChangeCache=nil) then exit;
|
||||||
|
IdentList:=TStringList.Create;
|
||||||
|
try
|
||||||
|
IdentList.Add(OldWord);
|
||||||
|
IdentList.Add(NewWord);
|
||||||
|
Result:=ReplaceWords(IdentList,SourceChangeCache);
|
||||||
|
finally
|
||||||
|
IdentList.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TStandardCodeTool.GetStringConstBounds(
|
function TStandardCodeTool.GetStringConstBounds(
|
||||||
const CursorPos: TCodeXYPosition;
|
const CursorPos: TCodeXYPosition;
|
||||||
var StartPos, EndPos: TCodeXYPosition; ResolveComments: boolean): boolean;
|
var StartPos, EndPos: TCodeXYPosition; ResolveComments: boolean): boolean;
|
||||||
@ -3991,8 +4012,10 @@ function TStandardCodeTool.RenamePublishedVariable(const UpperClassName,
|
|||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
var
|
var
|
||||||
TypeNode, VarNode: TCodeTreeNode;
|
TypeNode, VarNode: TCodeTreeNode;
|
||||||
|
ApplyNeeded: Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
BuildTree(false);
|
||||||
VarNode:=FindPublishedVariable(UpperClassName,UpperOldVarName,
|
VarNode:=FindPublishedVariable(UpperClassName,UpperOldVarName,
|
||||||
ExceptionOnClassNotFound);
|
ExceptionOnClassNotFound);
|
||||||
if VarNode<>nil then begin
|
if VarNode<>nil then begin
|
||||||
@ -4001,24 +4024,20 @@ begin
|
|||||||
TypeNode:=FindTypeNodeOfDefinition(VarNode);
|
TypeNode:=FindTypeNodeOfDefinition(VarNode);
|
||||||
MoveCursorToNodeStart(TypeNode);
|
MoveCursorToNodeStart(TypeNode);
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if UpAtomIs(UpperCaseStr(VarType)) then begin
|
SourceChangeCache.MainScanner:=Scanner;
|
||||||
// rename the identifier
|
ApplyNeeded:=false;
|
||||||
MoveCursorToNodeStart(VarNode);
|
if (not AtomIs(VarType)) then begin
|
||||||
ReadNextAtom;
|
// change the type
|
||||||
SourceChangeCache.MainScanner:=Scanner;
|
ApplyNeeded:=true;
|
||||||
if not SourceChangeCache.Replace(gtNone,gtNone,
|
if not SourceChangeCache.Replace(gtNone,gtNone,
|
||||||
CurPos.StartPos,CurPos.EndPos,NewVarName)
|
CurPos.StartPos,CurPos.EndPos,NewVarName)
|
||||||
then begin
|
then begin
|
||||||
RaiseException('Unable to replace name');
|
RaiseException('Unable to replace type');
|
||||||
end;
|
end;
|
||||||
end else begin
|
|
||||||
// auto correct type
|
|
||||||
|
|
||||||
// ToDo: auto correct
|
|
||||||
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[VarType,GetAtom]);
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
Result:=SourceChangeCache.Apply;
|
// rename variable in source
|
||||||
|
if not ReplaceWord(UpperOldVarName,NewVarName,SourceChangeCache) then exit;
|
||||||
|
Result:=(not ApplyNeeded) or SourceChangeCache.Apply;
|
||||||
end else begin
|
end else begin
|
||||||
// old variable not found -> add it
|
// old variable not found -> add it
|
||||||
Result:=AddPublishedVariable(UpperClassName,NewVarName,VarType,
|
Result:=AddPublishedVariable(UpperClassName,NewVarName,VarType,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/10/11]
|
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/09/20]
|
||||||
#
|
#
|
||||||
default: all
|
default: all
|
||||||
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux
|
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux
|
||||||
@ -235,9 +235,13 @@ ifndef LCL_PLATFORM
|
|||||||
ifeq ($(OS_TARGET),win32)
|
ifeq ($(OS_TARGET),win32)
|
||||||
LCL_PLATFORM=win32
|
LCL_PLATFORM=win32
|
||||||
else
|
else
|
||||||
|
ifeq ($(OS_TARGET),win64)
|
||||||
|
LCL_PLATFORM=win32
|
||||||
|
else
|
||||||
LCL_PLATFORM=gtk
|
LCL_PLATFORM=gtk
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
export LCL_PLATFORM
|
export LCL_PLATFORM
|
||||||
ifeq ($(FULL_TARGET),i386-linux)
|
ifeq ($(FULL_TARGET),i386-linux)
|
||||||
override TARGET_UNITS+=runtimetypeinfocontrols.pas
|
override TARGET_UNITS+=runtimetypeinfocontrols.pas
|
||||||
@ -1798,7 +1802,7 @@ ifeq ($(CPU_TARGET),powerpc)
|
|||||||
FPCCPUOPT:=-O1r
|
FPCCPUOPT:=-O1r
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
FPCCPUOPT:=-O2
|
FPCCPUOPT:=-O1r
|
||||||
endif
|
endif
|
||||||
override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
|
override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
|
||||||
override FPCOPTDEF+=RELEASE
|
override FPCOPTDEF+=RELEASE
|
||||||
|
@ -24,9 +24,13 @@ ifndef LCL_PLATFORM
|
|||||||
ifeq ($(OS_TARGET),win32)
|
ifeq ($(OS_TARGET),win32)
|
||||||
LCL_PLATFORM=win32
|
LCL_PLATFORM=win32
|
||||||
else
|
else
|
||||||
|
ifeq ($(OS_TARGET),win64)
|
||||||
|
LCL_PLATFORM=win32
|
||||||
|
else
|
||||||
LCL_PLATFORM=gtk
|
LCL_PLATFORM=gtk
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
export LCL_PLATFORM
|
export LCL_PLATFORM
|
||||||
|
|
||||||
[rules]
|
[rules]
|
||||||
|
@ -5043,10 +5043,10 @@ Begin
|
|||||||
CheckFont;
|
CheckFont;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TSourceNotebook.CloseFile(PageIndex:integer);
|
procedure TSourceNotebook.CloseFile(PageIndex:integer);
|
||||||
var
|
var
|
||||||
TempEditor: TSourceEditor;
|
TempEditor: TSourceEditor;
|
||||||
Begin
|
begin
|
||||||
{$IFDEF IDE_DEBUG}
|
{$IFDEF IDE_DEBUG}
|
||||||
writeln('TSourceNotebook.CloseFile A PageIndex=',PageIndex);
|
writeln('TSourceNotebook.CloseFile A PageIndex=',PageIndex);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -5066,6 +5066,10 @@ Begin
|
|||||||
Notebook.Pages.Delete(PageIndex);
|
Notebook.Pages.Delete(PageIndex);
|
||||||
//writeln('TSourceNotebook.CloseFile C PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount);
|
//writeln('TSourceNotebook.CloseFile C PageIndex=',PageIndex,' Notebook.PageCount=',Notebook.PageCount);
|
||||||
UpdateStatusBar;
|
UpdateStatusBar;
|
||||||
|
// set focus to new editor
|
||||||
|
TempEditor:=FindSourceEditorWithPageIndex(Notebook.PageIndex);
|
||||||
|
if TempEditor<>nil then
|
||||||
|
ActiveControl:=TempEditor.EditorComponent;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
//writeln('TSourceNotebook.CloseFile D PageIndex=',PageIndex);
|
//writeln('TSourceNotebook.CloseFile D PageIndex=',PageIndex);
|
||||||
|
@ -301,7 +301,6 @@ var
|
|||||||
Mess: TLMActivate;
|
Mess: TLMActivate;
|
||||||
begin
|
begin
|
||||||
Result:= True;
|
Result:= True;
|
||||||
DebugLn(['gtkactivateCB ',DbgSName(TControl(Data))]);
|
|
||||||
{$IFDEF EventTrace}
|
{$IFDEF EventTrace}
|
||||||
EventTrace('activate', data);
|
EventTrace('activate', data);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Loading…
Reference in New Issue
Block a user