|
@@ -45,6 +45,7 @@ type
|
|
PSymbolScopeView = ^TSymbolScopeView;
|
|
PSymbolScopeView = ^TSymbolScopeView;
|
|
TSymbolScopeView = object(TSymbolView)
|
|
TSymbolScopeView = object(TSymbolView)
|
|
constructor Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
|
|
constructor Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
|
|
|
|
+ destructor Done; virtual;
|
|
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
|
|
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
|
|
procedure HandleEvent(var Event: TEvent); virtual;
|
|
procedure HandleEvent(var Event: TEvent); virtual;
|
|
procedure Draw; virtual;
|
|
procedure Draw; virtual;
|
|
@@ -59,6 +60,7 @@ type
|
|
PSymbolReferenceView = ^TSymbolReferenceView;
|
|
PSymbolReferenceView = ^TSymbolReferenceView;
|
|
TSymbolReferenceView = object(TSymbolView)
|
|
TSymbolReferenceView = object(TSymbolView)
|
|
constructor Init(var Bounds: TRect; AReferences: PReferenceCollection; AHScrollBar, AVScrollBar: PScrollBar);
|
|
constructor Init(var Bounds: TRect; AReferences: PReferenceCollection; AHScrollBar, AVScrollBar: PScrollBar);
|
|
|
|
+ destructor Done; virtual;
|
|
procedure HandleEvent(var Event: TEvent); virtual;
|
|
procedure HandleEvent(var Event: TEvent); virtual;
|
|
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
|
|
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
|
|
procedure SelectItem(Item: Sw_Integer); virtual;
|
|
procedure SelectItem(Item: Sw_Integer); virtual;
|
|
@@ -71,6 +73,7 @@ type
|
|
PSymbolMemInfoView = ^TSymbolMemInfoView;
|
|
PSymbolMemInfoView = ^TSymbolMemInfoView;
|
|
TSymbolMemInfoView = object(TStaticText)
|
|
TSymbolMemInfoView = object(TStaticText)
|
|
constructor Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
|
|
constructor Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
|
|
|
|
+ destructor Done; virtual;
|
|
procedure GetText(var S: String); virtual;
|
|
procedure GetText(var S: String); virtual;
|
|
function GetPalette: PPalette; virtual;
|
|
function GetPalette: PPalette; virtual;
|
|
private
|
|
private
|
|
@@ -80,6 +83,7 @@ type
|
|
PSymbolInheritanceView = ^TSymbolInheritanceView;
|
|
PSymbolInheritanceView = ^TSymbolInheritanceView;
|
|
TSymbolInheritanceView = object(TOutlineViewer)
|
|
TSymbolInheritanceView = object(TOutlineViewer)
|
|
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
|
|
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
|
|
|
|
+ destructor Done; virtual;
|
|
function GetRoot: Pointer; virtual;
|
|
function GetRoot: Pointer; virtual;
|
|
function HasChildren(Node: Pointer): Boolean; virtual;
|
|
function HasChildren(Node: Pointer): Boolean; virtual;
|
|
function GetChild(Node: Pointer; I: Integer): Pointer; virtual;
|
|
function GetChild(Node: Pointer; I: Integer): Pointer; virtual;
|
|
@@ -144,12 +148,53 @@ function IsSymbolInfoAvailable: boolean;
|
|
|
|
|
|
procedure OpenOneSymbolBrowser(Name : String);
|
|
procedure OpenOneSymbolBrowser(Name : String);
|
|
|
|
|
|
|
|
+procedure CloseAllBrowsers;
|
|
|
|
+
|
|
|
|
+procedure RemoveBrowsersCollection;
|
|
|
|
+
|
|
|
|
+const
|
|
|
|
+ GlobalsCollection : PSortedCollection = nil;
|
|
|
|
+ ModulesCollection : PSortedCollection = nil;
|
|
|
|
+
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses Commands,App,
|
|
uses Commands,App,
|
|
WEditor,WViews,
|
|
WEditor,WViews,
|
|
FPConst,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif};
|
|
FPConst,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif};
|
|
|
|
|
|
|
|
+procedure CloseAllBrowsers;
|
|
|
|
+ procedure SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
|
|
|
|
+ begin
|
|
|
|
+ if assigned(P) and
|
|
|
|
+ ((TypeOf(P^)=TypeOf(TBrowserWindow)) or
|
|
|
|
+ (TypeOf(P^)=TypeOf(TSymbolView)) or
|
|
|
|
+ (TypeOf(P^)=TypeOf(TSymbolScopeView)) or
|
|
|
|
+ (TypeOf(P^)=TypeOf(TSymbolReferenceView)) or
|
|
|
|
+ (TypeOf(P^)=TypeOf(TSymbolMemInfoView)) or
|
|
|
|
+ (TypeOf(P^)=TypeOf(TSymbolInheritanceView))) then
|
|
|
|
+ Message(P,evCommand,cmClose,nil);
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ Desktop^.ForEach(@SendCloseIfBrowser);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure RemoveBrowsersCollection;
|
|
|
|
+begin
|
|
|
|
+ if assigned(GlobalsCollection) then
|
|
|
|
+ begin
|
|
|
|
+ GlobalsCollection^.deleteAll;
|
|
|
|
+ Dispose(GlobalsCollection,done);
|
|
|
|
+ GlobalsCollection:=nil;
|
|
|
|
+ end;
|
|
|
|
+ if assigned(ModulesCollection) then
|
|
|
|
+ begin
|
|
|
|
+ ModulesCollection^.deleteAll;
|
|
|
|
+ Dispose(ModulesCollection,done);
|
|
|
|
+ ModulesCollection:=nil;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
function NewBrowserTabItem(ASign: char; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
|
|
function NewBrowserTabItem(ASign: char; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
|
|
var P: PBrowserTabItem;
|
|
var P: PBrowserTabItem;
|
|
begin
|
|
begin
|
|
@@ -435,6 +480,17 @@ begin
|
|
SetRange(Symbols^.Count);
|
|
SetRange(Symbols^.Count);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+destructor TSymbolScopeView.Done;
|
|
|
|
+begin
|
|
|
|
+ {if assigned(Symbols) then
|
|
|
|
+ begin
|
|
|
|
+ the elements belong to other lists
|
|
|
|
+ Symbols^.DeleteAll;
|
|
|
|
+ dispose(Symbols,done);
|
|
|
|
+ end;}
|
|
|
|
+ Inherited Done;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TSymbolScopeView.HandleEvent(var Event: TEvent);
|
|
procedure TSymbolScopeView.HandleEvent(var Event: TEvent);
|
|
var OldFocus: sw_integer;
|
|
var OldFocus: sw_integer;
|
|
begin
|
|
begin
|
|
@@ -520,6 +576,11 @@ begin
|
|
SetRange(References^.Count);
|
|
SetRange(References^.Count);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+destructor TSymbolReferenceView.Done;
|
|
|
|
+begin
|
|
|
|
+ Inherited Done;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
|
|
procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
|
|
var OldFocus: sw_integer;
|
|
var OldFocus: sw_integer;
|
|
begin
|
|
begin
|
|
@@ -563,16 +624,24 @@ begin
|
|
MemInfo:=AMemInfo;
|
|
MemInfo:=AMemInfo;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+destructor TSymbolMemInfoView.Done;
|
|
|
|
+begin
|
|
|
|
+{ if assigned(MemInfo) then
|
|
|
|
+ dispose(MemInfo);}
|
|
|
|
+ Inherited Done;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TSymbolMemInfoView.GetText(var S: String);
|
|
procedure TSymbolMemInfoView.GetText(var S: String);
|
|
function SizeStr(Size: longint): string;
|
|
function SizeStr(Size: longint): string;
|
|
var S: string[40];
|
|
var S: string[40];
|
|
begin
|
|
begin
|
|
S:=IntToStrL(Size,7);
|
|
S:=IntToStrL(Size,7);
|
|
S:=S+' byte';
|
|
S:=S+' byte';
|
|
- if Size>0 then S:=S+'s';
|
|
|
|
|
|
+ if Size>1 then S:=S+'s';
|
|
SizeStr:=S;
|
|
SizeStr:=S;
|
|
end;
|
|
end;
|
|
function AddrStr(Addr: longint): string;
|
|
function AddrStr(Addr: longint): string;
|
|
|
|
+{ Warning this is endian specific code !! (PM) }
|
|
type TLongint = record LoW,HiW: word; end;
|
|
type TLongint = record LoW,HiW: word; end;
|
|
begin
|
|
begin
|
|
with TLongint(Addr) do
|
|
with TLongint(Addr) do
|
|
@@ -609,6 +678,15 @@ begin
|
|
ExpandAll(GetRoot); Update;
|
|
ExpandAll(GetRoot); Update;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+destructor TSymbolInheritanceView.Done;
|
|
|
|
+begin
|
|
|
|
+ { do not dispose,
|
|
|
|
+ belongs to a symbolcollection (PM)
|
|
|
|
+ if assigned(Root) then
|
|
|
|
+ dispose(Root,done); }
|
|
|
|
+ Inherited Done;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TSymbolInheritanceView.GetRoot: Pointer;
|
|
function TSymbolInheritanceView.GetRoot: Pointer;
|
|
begin
|
|
begin
|
|
GetRoot:=Root;
|
|
GetRoot:=Root;
|
|
@@ -811,8 +889,8 @@ end;
|
|
|
|
|
|
destructor TBrowserTab.Done;
|
|
destructor TBrowserTab.Done;
|
|
begin
|
|
begin
|
|
- inherited Done;
|
|
|
|
if Items<>nil then DisposeBrowserTabList(Items);
|
|
if Items<>nil then DisposeBrowserTabList(Items);
|
|
|
|
+ inherited Done;
|
|
end;
|
|
end;
|
|
|
|
|
|
constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
|
|
constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
|
|
@@ -1082,7 +1160,11 @@ end;
|
|
END.
|
|
END.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.16 1999-06-17 23:44:01 pierre
|
|
|
|
|
|
+ Revision 1.17 1999-06-28 12:35:05 pierre
|
|
|
|
+ + CloseAllBrowsers needed before compilation to avoid problems
|
|
|
|
+ + ModulesCollection and GlobalsCollection to avoid memory leaks
|
|
|
|
+
|
|
|
|
+ Revision 1.16 1999/06/17 23:44:01 pierre
|
|
* problem with Inheritance list
|
|
* problem with Inheritance list
|
|
|
|
|
|
Revision 1.15 1999/04/15 08:58:06 peter
|
|
Revision 1.15 1999/04/15 08:58:06 peter
|