MG: find declaration: fixed function in with context

git-svn-id: trunk@1475 -
This commit is contained in:
lazarus 2002-03-04 07:28:53 +00:00
parent c393669985
commit 2e084658ef
7 changed files with 329 additions and 53 deletions

View File

@ -1564,22 +1564,23 @@ writeln('');
Params.Load(OldInput);
end;
if Result.Node<>nil then begin
Result:=Result.Tool.FindBaseTypeOfNode(Params,Result.Node);
if (Result.Node<>nil) and (Result.Node.Desc=ctnProcedure) then begin
if (Result.Node<>nil)
and (Result.Node.Desc in [ctnProcedure,ctnProcedureHead]) then begin
Result.Tool.BuildSubTreeForProcHead(Result.Node,FuncResultNode);
if FuncResultNode<>nil then begin
// this is function
if (NextAtomType in [atSpace,atRoundBracketClose]) then begin
// In Delphi Mode or if there is a @ qualifier return the
// function
// function and not the result type
// ToDo:
end;
// Otherwise return the result type
Result:=Result.Tool.FindBaseTypeOfNode(Params,FuncResultNode);
Include(Params.Flags,fdfFunctionResult);
end;
end;
Result:=Result.Tool.FindBaseTypeOfNode(Params,Result.Node);
end;
end;
@ -2338,6 +2339,7 @@ end;
function TFindDeclarationTool.FindIdentifierInAncestors(
ClassNode: TCodeTreeNode; Params: TFindDeclarationParams): boolean;
{ this function is internally used by FindIdentifierInContext
and FindBaseTypeOfNode
}
var AncestorAtom: TAtomPosition;
OldInput: TFindDeclarationInput;

View File

@ -1187,32 +1187,36 @@ begin
TSynEditPlugin(fPlugins[i]).Free;
fPlugins.Free;
end;
{$IFNDEF SYN_LAZARUS}
fScrollTimer.Free;
{$IFDEF SYN_LAZARUS}fScrollTimer:=nil;{$ENDIF}
fTSearch.Free;
{$IFDEF SYN_LAZARUS}fTSearch:=nil;{$ENDIF}
fMarkList.Free;
{$IFDEF SYN_LAZARUS}fMarkList:=nil;{$ENDIF}
fBookMarkOpt.Free;
fBookMarkOpt := nil;
fKeyStrokes.Free;
{$IFDEF SYN_LAZARUS}fKeyStrokes:=nil;{$ENDIF}
fSelectedColor.Free;
{$IFDEF SYN_LAZARUS}fSelectedColor:=nil;{$ENDIF}
fUndoList.Free;
{$IFDEF SYN_LAZARUS}fUndoList:=nil;{$ENDIF}
fRedoList.Free;
{$IFDEF SYN_LAZARUS}fRedoList:=nil;{$ENDIF}
fGutter.Free;
{$IFDEF SYN_LAZARUS}fGutter:=nil;{$ENDIF}
fTextDrawer.Free;
{$IFDEF SYN_LAZARUS}fTextDrawer:=nil;{$ENDIF}
fInternalImage.Free;
{$IFDEF SYN_LAZARUS}fInternalImage:=nil;{$ENDIF}
fFontDummy.Free;
{$IFDEF SYN_LAZARUS}fFontDummy:=nil;{$ENDIF}
Lines.Free;
{$IFDEF SYN_LAZARUS}fLines:=nil;{$ENDIF}
{$ELSE}
FreeAndNil(fScrollTimer);
FreeAndNil(fTSearch);
FreeAndNil(fMarkList);
FreeAndNil(fBookMarkOpt);
FreeAndNil(fKeyStrokes);
FreeAndNil(fSelectedColor);
FreeAndNil(fUndoList);
FreeAndNil(fRedoList);
FreeAndNil(fGutter);
FreeAndNil(fTextDrawer);
FreeAndNil(fInternalImage);
FreeAndNil(fFontDummy);
FreeAndNil(fLines);
{$ENDIF}
inherited Destroy;
end;

View File

@ -452,6 +452,7 @@ begin
ReleaseFontsInfo(APheSharedFontsInfo);
end;
FFontsInfo.Free;
FFontsInfo:=nil;
end;
inherited Destroy;
@ -638,6 +639,7 @@ end;
constructor TheFontStock.Create(InitialFont: TFont);
begin
writeln(' AAA TheFontStock.Create Self=',HexStr(Cardinal(Self),8));
inherited Create;
SetBaseFont(InitialFont);
@ -645,6 +647,8 @@ end;
destructor TheFontStock.Destroy;
begin
writeln(' AAA TheFontStock.Destroy Self=',HexStr(Cardinal(Self),8));
ReleaseFontsInfo;
ASSERT(FDCRefCount = 0);
@ -741,6 +745,8 @@ end;
procedure TheFontStock.ReleaseFontsInfo;
begin
writeln(' AAA TheFontStock.ReleaseFontsInfo Self=',HexStr(Cardinal(Self),8));
if Assigned(FpInfo) then
with GetFontsInfoManager do
begin
@ -847,10 +853,14 @@ begin
SetBaseFont(ABaseFont);
FColor := clWindowText;
FBkColor := clWindow;
writeln(' AAA TheTextDrawer.Create Self=',HexStr(Cardinal(Self),8));
end;
destructor TheTextDrawer.Destroy;
begin
writeln(' AAA TheTextDrawer.Destroy Self=',HexStr(Cardinal(Self),8));
FFontStock.Free;
ReleaseETODist;

View File

@ -43,15 +43,30 @@ type
EditMenuItem: TMenuItem;
MoveNodeUpMenuItem: TMenuItem;
MoveNodeDownMenuItem: TMenuItem;
InsertDefineMenuItem: TMenuItem;
InsertDefineAllMenuItem: TMenuItem;
InsertUndefineMenuItem: TMenuItem;
InsertBlockMenuItem: TMenuItem;
InsertDirectoryMenuItem: TMenuItem;
InsertIfMenuItem: TMenuItem;
InsertIfDefMenuItem: TMenuItem;
InsertIfNotDefMenuItem: TMenuItem;
InsertElseMenuItem: TMenuItem;
MoveNodeLvlUpMenuItem: TMenuItem;
MoveNodeLvlDownMenuItem: TMenuItem;
InsertBehindMenuItem: TMenuItem;
InsertBehindDefineMenuItem: TMenuItem;
InsertBehindDefineAllMenuItem: TMenuItem;
InsertBehindUndefineMenuItem: TMenuItem;
InsertBehindBlockMenuItem: TMenuItem;
InsertBehindDirectoryMenuItem: TMenuItem;
InsertBehindIfMenuItem: TMenuItem;
InsertBehindIfDefMenuItem: TMenuItem;
InsertBehindIfNotDefMenuItem: TMenuItem;
InsertBehindElseIfMenuItem: TMenuItem;
InsertBehindElseMenuItem: TMenuItem;
InsertAsChildMenuItem: TMenuItem;
InsertAsChildDefineMenuItem: TMenuItem;
InsertAsChildDefineAllMenuItem: TMenuItem;
InsertAsChildUndefineMenuItem: TMenuItem;
InsertAsChildBlockMenuItem: TMenuItem;
InsertAsChildDirectoryMenuItem: TMenuItem;
InsertAsChildIfMenuItem: TMenuItem;
InsertAsChildIfDefMenuItem: TMenuItem;
InsertAsChildIfNotDefMenuItem: TMenuItem;
InsertAsChildElseIfMenuItem: TMenuItem;
InsertAsChildElseMenuItem: TMenuItem;
DeleteNodeMenuItem: TMenuItem;
CopyToClipbrdMenuItem: TMenuItem;
PasteFromClipbrdMenuItem: TMenuItem;
@ -88,9 +103,14 @@ type
procedure SaveAndExitMenuItemClick(Sender: TObject);
procedure DontSaveAndExitMenuItemClick(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure DefineTreeViewMouseUp(Sender:TObject; Button:TMouseButton;
Shift:TShiftState; X,Y:integer);
procedure ValueNoteBookPageChanged(Sender:TObject);
procedure DefineTreeViewMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X,Y: integer);
procedure ValueNoteBookPageChanged(Sender: TObject);
procedure MoveFilePathUpBitBtnClick(Sender: TObject);
procedure MoveFilePathDownBitBtnClick(Sender: TObject);
procedure DeleteFilePathBitBtnClick(Sender: TObject);
procedure InsertFilePathBitBtnClick(Sender: TObject);
procedure InsertNodeMenuItemClick(Sender: TObject);
private
FDefineTree: TDefineTree;
FLastSelectedNode: TTreeNode;
@ -104,6 +124,7 @@ type
procedure SaveSelectedValues;
procedure ShowSelectedValues;
function ValueToFilePathText(const AValue: string): string;
procedure InsertNewNode(Behind: boolean; Action: TDefineAction);
public
procedure Assign(ACodeToolBoss: TCodeToolManager;
Options: TCodeToolsOptions);
@ -268,6 +289,70 @@ begin
if ValueNoteBook.PageIndex=0 then ValueAsPathToValueAsText;
end;
procedure TCodeToolsDefinesEditor.MoveFilePathUpBitBtnClick(Sender: TObject);
var y: integer;
begin
if ValueAsFilePathsSynEdit.ReadOnly then exit;
y:=ValueAsFilePathsSynEdit.CaretY;
if (y>1) and (y<=ValueAsFilePathsSynEdit.Lines.Count) then
ValueAsFilePathsSynEdit.Lines.Move(y,y-1);
end;
procedure TCodeToolsDefinesEditor.MoveFilePathDownBitBtnClick(Sender: TObject);
var y: integer;
begin
if ValueAsFilePathsSynEdit.ReadOnly then exit;
y:=ValueAsFilePathsSynEdit.CaretY;
if (y>=1) and (y<ValueAsFilePathsSynEdit.Lines.Count) then
ValueAsFilePathsSynEdit.Lines.Move(y,y+1);
end;
procedure TCodeToolsDefinesEditor.DeleteFilePathBitBtnClick(Sender: TObject);
var y: integer;
begin
if ValueAsFilePathsSynEdit.ReadOnly then exit;
y:=ValueAsFilePathsSynEdit.CaretY;
if (y>=1) and (y<=ValueAsFilePathsSynEdit.Lines.Count) then
ValueAsFilePathsSynEdit.Lines.Delete(y);
end;
procedure TCodeToolsDefinesEditor.InsertFilePathBitBtnClick(Sender: TObject);
var y: integer;
begin
if ValueAsFilePathsSynEdit.ReadOnly then exit;
y:=ValueAsFilePathsSynEdit.CaretY;
if (y>=1) and (y<=ValueAsFilePathsSynEdit.Lines.Count) then
ValueAsFilePathsSynEdit.Lines.Insert(y,'');
end;
procedure TCodeToolsDefinesEditor.InsertNodeMenuItemClick(Sender: TObject);
var Behind: boolean;
Action: TDefineAction;
begin
Behind:=(TMenuItem(Sender).Parent=InsertBehindMenuItem);
if Sender=InsertBehindDefineMenuItem then Action:=da_Define
else if Sender=InsertBehindDefineAllMenuItem then Action:=da_DefineAll
else if Sender=InsertBehindUndefineMenuItem then Action:=da_Undefine
else if Sender=InsertBehindBlockMenuItem then Action:=da_Block
else if Sender=InsertBehindDirectoryMenuItem then Action:=da_Directory
else if Sender=InsertBehindIfMenuItem then Action:=da_If
else if Sender=InsertBehindIfDefMenuItem then Action:=da_IfDef
else if Sender=InsertBehindIfNotDefMenuItem then Action:=da_IfNDef
else if Sender=InsertBehindElseIfMenuItem then Action:=da_ElseIf
else if Sender=InsertBehindElseMenuItem then Action:=da_Else
else if Sender=InsertAsChildDefineMenuItem then Action:=da_Define
else if Sender=InsertAsChildDefineAllMenuItem then Action:=da_DefineAll
else if Sender=InsertAsChildUndefineMenuItem then Action:=da_Undefine
else if Sender=InsertAsChildBlockMenuItem then Action:=da_Block
else if Sender=InsertAsChildDirectoryMenuItem then Action:=da_Directory
else if Sender=InsertAsChildIfMenuItem then Action:=da_If
else if Sender=InsertAsChildIfDefMenuItem then Action:=da_IfDef
else if Sender=InsertAsChildIfNotDefMenuItem then Action:=da_IfNDef
else if Sender=InsertAsChildElseIfMenuItem then Action:=da_ElseIf
else if Sender=InsertAsChildElseMenuItem then Action:=da_Else;
InsertNewNode(Behind,Action);
end;
procedure TCodeToolsDefinesEditor.CreateComponents;
procedure CreateWinControl(var AWinControl: TWinControl;
@ -303,6 +388,7 @@ procedure TCodeToolsDefinesEditor.CreateComponents;
TheImageList.Add(Pixmap,nil)
end;
var i: integer;
begin
TheImageList:=TImageList.Create(Self);
with TheImageList do begin
@ -346,24 +432,14 @@ begin
EditMenuItem);
AddMenuItem(MoveNodeDownMenuItem,'MoveNodeDownMenuItem','Move node down',
EditMenuItem);
AddMenuItem(MoveNodeLvlUpMenuItem,'MoveNodeLvlUpMenuItem','Move node one level up',
EditMenuItem);
AddMenuItem(MoveNodeLvlDownMenuItem,'MoveNodeLvlDownMenuItem','Move node one level down',
EditMenuItem);
EditMenuItem.Add(CreateSeperator);
AddMenuItem(InsertDefineMenuItem,'InsertDefineMenuItem','Insert Define',
AddMenuItem(InsertBehindMenuItem,'InsertBehindMenuItem','Insert node behind',
EditMenuItem);
AddMenuItem(InsertDefineAllMenuItem,'InsertDefineAllMenuItem','Insert Define All',
EditMenuItem);
AddMenuItem(InsertUndefineMenuItem,'InsertUndefineMenuItem','Insert Undefine',
EditMenuItem);
AddMenuItem(InsertBlockMenuItem,'InsertBlockMenuItem','Insert Block',
EditMenuItem);
AddMenuItem(InsertDirectoryMenuItem,'InsertDirectoryMenuItem','Insert Directory',
EditMenuItem);
AddMenuItem(InsertIfMenuItem,'InsertIfMenuItem','Insert If',
EditMenuItem);
AddMenuItem(InsertIfDefMenuItem,'InsertIfDefMenuItem','Insert IfDef',
EditMenuItem);
AddMenuItem(InsertIfNotDefMenuItem,'InsertIfNotDefMenuItem','Insert IfNDef',
EditMenuItem);
AddMenuItem(InsertElseMenuItem,'InsertElseMenuItem','Insert Else',
AddMenuItem(InsertAsChildMenuItem,'InsertAsChildMenuItem','Insert node as child',
EditMenuItem);
EditMenuItem.Add(CreateSeperator);
AddMenuItem(DeleteNodeMenuItem,'DeleteNodeMenuItem','Delete node',
@ -374,6 +450,60 @@ begin
AddMenuItem(PasteFromClipbrdMenuItem,'PasteFromClipbrdMenuItem',
'Paste from clipboard',EditMenuItem);
// insert node behind submenu
AddMenuItem(InsertBehindDefineMenuItem,'InsertBehindDefineMenuItem','Define',
InsertBehindMenuItem);
AddMenuItem(InsertBehindDefineAllMenuItem,'InsertBehindDefineAllMenuItem','Define All',
InsertBehindMenuItem);
AddMenuItem(InsertBehindUndefineMenuItem,'InsertBehindUndefineMenuItem','Undefine',
InsertBehindMenuItem);
InsertBehindMenuItem.Add(CreateSeperator);
AddMenuItem(InsertBehindBlockMenuItem,'InsertBehindBlockMenuItem','Block',
InsertBehindMenuItem);
AddMenuItem(InsertBehindDirectoryMenuItem,'InsertBehindDirectoryMenuItem','Directory',
InsertBehindMenuItem);
InsertBehindMenuItem.Add(CreateSeperator);
AddMenuItem(InsertBehindIfMenuItem,'InsertBehindIfMenuItem','If',
InsertBehindMenuItem);
AddMenuItem(InsertBehindIfDefMenuItem,'InsertBehindIfDefMenuItem','IfDef',
InsertBehindMenuItem);
AddMenuItem(InsertBehindIfNotDefMenuItem,'InsertBehindIfNotDefMenuItem','IfNDef',
InsertBehindMenuItem);
AddMenuItem(InsertBehindElseIfMenuItem,'InsertBehindElseIfMenuItem','ElseIf',
InsertBehindMenuItem);
AddMenuItem(InsertBehindElseMenuItem,'InsertBehindElseMenuItem','Else',
InsertBehindMenuItem);
for i:=0 to InsertBehindMenuItem.Count-1 do
if InsertBehindMenuItem[i].Caption<>'-' then
InsertBehindMenuItem[i].OnClick:=@InsertNodeMenuItemClick;
// insert node as child submenu
AddMenuItem(InsertAsChildDefineMenuItem,'InsertAsChildDefineMenuItem','Define',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildDefineAllMenuItem,'InsertAsChildDefineAllMenuItem','Define All',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildUndefineMenuItem,'InsertAsChildUndefineMenuItem','Undefine',
InsertAsChildMenuItem);
InsertAsChildMenuItem.Add(CreateSeperator);
AddMenuItem(InsertAsChildBlockMenuItem,'InsertAsChildBlockMenuItem','Block',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildDirectoryMenuItem,'InsertAsChildDirectoryMenuItem','Directory',
InsertAsChildMenuItem);
InsertAsChildMenuItem.Add(CreateSeperator);
AddMenuItem(InsertAsChildIfMenuItem,'InsertAsChildIfMenuItem','If',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildIfDefMenuItem,'InsertAsChildIfDefMenuItem','IfDef',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildIfNotDefMenuItem,'InsertAsChildIfNotDefMenuItem','IfNDef',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildElseIfMenuItem,'InsertAsChildElseIfMenuItem','ElseIf',
InsertAsChildMenuItem);
AddMenuItem(InsertAsChildElseMenuItem,'InsertAsChildElseMenuItem','Else',
InsertAsChildMenuItem);
for i:=0 to InsertAsChildMenuItem.Count-1 do
if InsertAsChildMenuItem[i].Caption<>'-' then
InsertAsChildMenuItem[i].OnClick:=@InsertNodeMenuItemClick;
// tools
AddMenuItem(ToolsMenuItem,'ToolsMenuItem','Tools',nil);
AddMenuItem(OpenPreviewMenuItem,'OpenPreviewMenuItem','Open Preview',
@ -447,19 +577,23 @@ begin
CreateWinControl(MoveFilePathUpBitBtn,TBitBtn,'MoveFilePathUpBitBtn',
ValueNoteBook.Page[1]);
MoveFilePathUpBitBtn.Caption:='Move path up';
MoveFilePathUpBitBtn.Caption:='Up';
MoveFilePathUpBitBtn.OnClick:=@MoveFilePathUpBitBtnClick;
CreateWinControl(MoveFilePathDownBitBtn,TBitBtn,'MoveFilePathDownBitBtn',
ValueNoteBook.Page[1]);
MoveFilePathDownBitBtn.Caption:='Move path down';
MoveFilePathDownBitBtn.Caption:='Down';
MoveFilePathDownBitBtn.OnClick:=@MoveFilePathDownBitBtnClick;
CreateWinControl(DeleteFilePathBitBtn,TBitBtn,'DeleteFilePathBitBtn',
ValueNoteBook.Page[1]);
DeleteFilePathBitBtn.Caption:='Delete path';
DeleteFilePathBitBtn.Caption:='Delete';
DeleteFilePathBitBtn.OnClick:=@DeleteFilePathBitBtnClick;
CreateWinControl(InsertFilePathBitBtn,TBitBtn,'InsertFilePathBitBtn',
ValueNoteBook.Page[1]);
InsertFilePathBitBtn.Caption:='Insert path';
InsertFilePathBitBtn.Caption:='Insert';
InsertFilePathBitBtn.OnClick:=@InsertFilePathBitBtnClick;
end;
function TCodeToolsDefinesEditor.CreateSeperator : TMenuItem;
@ -646,6 +780,84 @@ begin
if Result[i]=';' then Result[i]:=#13;
end;
procedure TCodeToolsDefinesEditor.InsertNewNode(Behind: boolean;
Action: TDefineAction);
var SelTreeNode, NodeInFront, ParentNode, ANode, FirstNode,
NewTreeNode: TTreeNode;
NewDefNode: TDefineTemplate;
NewName, NewDescription, NewVariable, NewValue: string;
i: integer;
begin
SelTreeNode:=DefineTreeView.Selected;
NodeInFront:=nil;
ParentNode:=nil;
if SelTreeNode<>nil then begin
// there is an selected node
if Behind then
// insert behind selected node
NodeInFront:=SelTreeNode
else begin
// insert as last child of selected node
ParentNode:=SelTreeNode;
NodeInFront:=ParentNode.GetFirstChild;
if NodeInFront<>nil then begin
while NodeInFront.GetNextSibling<>nil do
NodeInFront:=NodeInFront.GetNextSibling;
end;
end;
end else begin
// no node selected, add as last root node
NodeInFront:=DefineTreeView.Items.GetLastNode;
if NodeInFront<>nil then begin
while NodeInFront.GetNextSibling<>nil do
NodeInFront:=NodeInFront.GetNextSibling;
end;
end;
// find a unique name
if ParentNode<>nil then
FirstNode:=ParentNode.GetFirstChild
else
FirstNode:=nil;
if FirstNode=nil then FirstNode:=NodeInFront;
if FirstNode<>nil then begin
while FirstNode.GetPrevSibling<>nil do
FirstNode:=FirstNode.GetPrevSibling;
end;
i:=0;
repeat
inc(i);
ANode:=FirstNode;
while ANode<>nil do begin
if TDefineTemplate(ANode.Data).Name='NewNode'+IntToStr(i) then break;
ANode:=ANode.GetNextSibling;
end;
until ANode=nil;
NewName:='NewNode'+IntToStr(i);
NewDescription:=NewName;
NewVariable:='';
NewValue:='';
NewDefNode:=TDefineTemplate.Create(NewName,NewDescription,NewVariable,
NewValue,Action);
// add node to treeview
if ParentNode<>nil then
// add as last child
NewTreeNode:=DefineTreeView.Items.AddChildObject(ParentNode,NewName,
NewDefNode)
else if (NodeInFront<>nil) and (NodeInFront.GetNextSibling<>nil) then
// insert in front
NewTreeNode:=DefineTreeView.Items.InsertObjectBehind(
NodeInFront,NewName,NewDefNode);
SetNodeImages(NewTreeNode);
// add node to define tree
if NodeInFront<>nil then
NewDefNode.InsertAfter(TDefineTemplate(NodeInFront.Data))
else if ParentNode<>nil then
TDefineTemplate(ParentNode.Data).AddChild(NewDefNode)
else
FDefineTree.Add(NewDefNode);
end;
procedure TCodeToolsDefinesEditor.Assign(ACodeToolBoss: TCodeToolManager;
Options: TCodeToolsOptions);
begin

View File

@ -75,6 +75,7 @@ type
fGenDebugDBX: Boolean;
fUseLineInfoUnit: Boolean;
fUseHeaptrc: Boolean;
fGenGProfCode: Boolean;
fStripSymbols: Boolean;
fLinkStyle: Integer;
fPassLinkerOpt: Boolean;
@ -162,6 +163,7 @@ type
property GenerateDebugDBX: Boolean read fGenDebugDBX write fGenDebugDBX;
property UseLineInfoUnit: Boolean read fUseLineInfoUnit write fUseLineInfoUnit;
property UseHeaptrc: Boolean read fUseHeaptrc write fUseHeaptrc;
property GenGProfCode: Boolean read fGenGProfCode write fGenGProfCode;
property StripSymbols: Boolean read fStripSymbols write fStripSymbols;
property LinkStyle: Integer read fLinkStyle write fLinkStyle;
property PassLinkerOptions: Boolean read fPassLinkerOpt write fPassLinkerOpt;
@ -261,6 +263,7 @@ type
chkDebugDBX: TCheckBox;
chkUseLineInfoUnit: TCheckBox;
chkUseHeaptrc: TCheckBox;
chkGenGProfCode: TCheckBox;
chkSymbolsStrip: TCheckBox;
grpLinkLibraries: TGroupBox;
@ -451,6 +454,7 @@ begin
GenerateDebugDBX := XMLConfigFile.GetValue('CompilerOptions/Linking/Debugging/GenerateDebugDBX/Value', false);
UseLineInfoUnit := XMLConfigFile.GetValue('CompilerOptions/Linking/Debugging/UseLineInfoUnit/Value', true);
UseHeaptrc := XMLConfigFile.GetValue('CompilerOptions/Linking/Debugging/UseHeaptrc/Value', false);
GenGProfCode := XMLConfigFile.GetValue('CompilerOptions/Linking/Debugging/GenGProfCode/Value', false);
StripSymbols := XMLConfigFile.GetValue('CompilerOptions/Linking/Debugging/StripSymbols/Value', false);
LinkStyle := XMLConfigFile.GetValue('CompilerOptions/CodeGeneration/LinkStyle/Value', 1);
PassLinkerOptions := XMLConfigFile.GetValue('CompilerOptions/Linking/Options/PassLinkerOptions/Value', false);
@ -552,6 +556,7 @@ begin
XMLConfigFile.SetValue('CompilerOptions/Linking/Debugging/GenerateDebugDBX/Value', GenerateDebugDBX);
XMLConfigFile.SetValue('CompilerOptions/Linking/Debugging/UseLineInfoUnit/Value', UseLineInfoUnit);
XMLConfigFile.SetValue('CompilerOptions/Linking/Debugging/UseHeaptrc/Value', UseHeaptrc);
XMLConfigFile.SetValue('CompilerOptions/Linking/Debugging/GenGProfCode/Value', GenGProfCode);
XMLConfigFile.SetValue('CompilerOptions/Linking/Debugging/StripSymbols/Value', StripSymbols);
XMLConfigFile.SetValue('CompilerOptions/CodeGeneration/LinkStyle/Value', LinkStyle);
XMLConfigFile.SetValue('CompilerOptions/Linking/Options/PassLinkerOptions/Value', PassLinkerOptions);
@ -929,6 +934,10 @@ begin
if (UseHeaptrc) then
switches := switches + ' -gh';
{ Generate code gprof }
if (GenGProfCode) then
switches := switches + ' -pg';
{ Strip Symbols }
if (StripSymbols) then
switches := switches + ' -Xs';
@ -1204,6 +1213,7 @@ begin
fGenDebugDBX := false;
fUseLineInfoUnit := true;
fUseHeaptrc := false;
fGenGProfCode := false;
fStripSymbols := false;
fLinkStyle := 1;
fPassLinkerOpt := false;
@ -1275,6 +1285,7 @@ begin
fGenDebugDBX := CompOpts.fGenDebugDBX;
fUseLineInfoUnit := CompOpts.fUseLineInfoUnit;
fUseHeaptrc := CompOpts.fUseHeaptrc;
fGenGProfCode := CompOpts.fGenGProfCode;
fStripSymbols := CompOpts.fStripSymbols;
fLinkStyle := CompOpts.fLinkStyle;
fPassLinkerOpt := CompOpts.fPassLinkerOpt;
@ -1508,6 +1519,7 @@ begin
chkDebugDBX.Checked := CompilerOpts.GenerateDebugDBX;
chkUseLineInfoUnit.Checked := CompilerOpts.UseLineInfoUnit;
chkUseHeaptrc.Checked := CompilerOpts.UseHeaptrc;
chkGenGProfCode.Checked := CompilerOpts.GenGProfCode;
chkSymbolsStrip.Checked := CompilerOpts.StripSymbols;
case CompilerOpts.LinkStyle of
@ -1634,6 +1646,7 @@ begin
CompilerOpts.GenerateDebugDBX := chkDebugDBX.Checked;
CompilerOpts.UseLineInfoUnit := chkUseLineInfoUnit.Checked;
CompilerOpts.UseHeaptrc := chkUseHeaptrc.Checked;
CompilerOpts.GenGProfCode := chkGenGProfCode.Checked;
CompilerOpts.StripSymbols := chkSymbolsStrip.Checked;
CompilerOpts.PassLinkerOptions := chkOptionsLinkOpt.Checked;
@ -2202,7 +2215,7 @@ begin
Parent := nbMain.Page[2];
Top := 10;
Left := 10;
Height := 130;
Height := 151;
Width := Self.ClientWidth-28;
Caption := 'Debugging:';
Visible := True;
@ -2256,12 +2269,24 @@ begin
Visible := True;
end;
chkGenGProfCode := TCheckBox.Create(grpDebugging);
with chkGenGProfCode do
begin
Parent := grpDebugging;
Caption := 'Generate code for gprof';
Top := 90;
Left := 8;
Height := 16;
Width := 330;
Visible := True;
end;
chkSymbolsStrip := TCheckBox.Create(grpDebugging);
with chkSymbolsStrip do
begin
Parent := grpDebugging;
Caption := 'Strip Symbols From Executable';
Top := 90;
Top := 111;
Left := 8;
Height := 16;
Width := 330;

View File

@ -1304,9 +1304,12 @@ type
function GetLastNode: TTreeNode; // last top level node
function GetLastSubNode: TTreeNode; // absolute last node
function GetLastExpandedSubNode: TTreeNode; // absolute last node
function Insert(Node: TTreeNode; const S: string): TTreeNode;
function Insert(NextNode: TTreeNode; const S: string): TTreeNode;
function InsertObject(NextNode: TTreeNode; const S: string;
Data: Pointer): TTreeNode;
function InsertBehind(PrevNode: TTreeNode; const S: string): TTreeNode;
function InsertObjectBehind(PrevNode: TTreeNode; const S: string;
Data: Pointer): TTreeNode;
function ConsistencyCheck: integer;
procedure WriteDebugReport(const Prefix: string; AllNodes: boolean);
property Count: Integer read GetCount;
@ -1751,6 +1754,9 @@ end.
{ =============================================================================
$Log$
Revision 1.22 2002/03/04 07:28:53 lazarus
MG: find declaration: fixed function in with context
Revision 1.21 2002/03/02 17:03:19 lazarus
MG: fixed TTreeView resize update

View File

@ -1554,9 +1554,9 @@ begin
end;
end;
function TTreeNodes.Insert(Node: TTreeNode; const S: string): TTreeNode;
function TTreeNodes.Insert(NextNode: TTreeNode; const S: string): TTreeNode;
begin
Result := InsertObject(Node, S, nil);
Result := InsertObject(NextNode, S, nil);
end;
function TTreeNodes.InsertObject(NextNode: TTreeNode; const S: string;
@ -1567,6 +1567,23 @@ begin
Result:=InternalAddObject(NextNode,S,Data,taInsert);
end;
function TTreeNodes.InsertBehind(PrevNode: TTreeNode; const S: string
): TTreeNode;
begin
Result := InsertObjectBehind(PrevNode, S, nil);
end;
function TTreeNodes.InsertObjectBehind(PrevNode: TTreeNode; const S: string;
Data: Pointer): TTreeNode;
// create a new node with Text=S and Data=Data and insert in front of
// NextNode (as sibling with same parent).
begin
if (PrevNode<>nil) and (PrevNode.GetNextSibling<>nil) then
Result:=InternalAddObject(PrevNode.GetNextSibling,S,Data,taInsert)
else
Result:=AddObject(nil,S,Data);
end;
function TTreeNodes.InternalAddObject(Node: TTreeNode; const S: string;
Data: Pointer; AddMode: TAddMode): TTreeNode;
//var Item: HTreeItem;