fpsymbol.pas 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Symbol browse support routines for the IDE
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {$i globdir.inc}
  13. unit FPSymbol;
  14. interface
  15. uses Objects,Drivers,Views,Menus,Dialogs,Outline,
  16. BrowCol,
  17. WViews,
  18. FPViews;
  19. const
  20. { Browser tab constants }
  21. btScope = 0;
  22. btReferences = 1;
  23. btInheritance = 2;
  24. btMemInfo = 3;
  25. btUnitInfo = 4;
  26. btBreakWatch = 7;
  27. type
  28. PBrowserWindow = ^TBrowserWindow;
  29. PGDBValueCollection = ^TGDBValueCollection;
  30. PGDBValue = ^TGDBValue;
  31. TGDBValue = Object(TObject)
  32. constructor Init(Const AExpr : String;ASym : PSymbol);
  33. procedure GetValue;
  34. function GetText : String;
  35. destructor Done;virtual;
  36. private
  37. expr : Pstring;
  38. St : Pstring;
  39. S : PSymbol;
  40. GDBI : longint;
  41. end;
  42. TGDBValueCollection = Object(TCollection)
  43. function At(Index: sw_Integer): PGDBValue;
  44. end;
  45. PSymbolView = ^TSymbolView;
  46. TSymbolView = object(TLocalMenuListBox)
  47. constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
  48. procedure HandleEvent(var Event: TEvent); virtual;
  49. procedure SetState(AState: Word; Enable: Boolean); virtual;
  50. function GotoItem(Item: sw_integer): boolean; virtual;
  51. function TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
  52. function GetPalette: PPalette; virtual;
  53. function GetLocalMenu: PMenu; virtual;
  54. procedure ClearHighlights;
  55. procedure AutoTrackSource; virtual;
  56. procedure Browse; virtual;
  57. procedure GotoSource; virtual;
  58. procedure TrackSource; virtual;
  59. procedure OptionsDlg; virtual;
  60. private
  61. MyBW : PBrowserWindow;
  62. function TrackReference(R: PReference; AutoTrack: boolean): boolean; virtual;
  63. function GotoReference(R: PReference): boolean; virtual;
  64. end;
  65. PSymbolScopeView = ^TSymbolScopeView;
  66. TSymbolScopeView = object(TSymbolView)
  67. constructor Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
  68. destructor Done; virtual;
  69. procedure SetGDBCol;
  70. function GetText(Item,MaxLen: Sw_Integer): String; virtual;
  71. procedure HandleEvent(var Event: TEvent); virtual;
  72. procedure Draw; virtual;
  73. procedure LookUp(S: string); virtual;
  74. function GotoItem(Item: sw_integer): boolean; virtual;
  75. function TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
  76. private
  77. Symbols: PSymbolCollection;
  78. SymbolsValue : PGDBValueCollection;
  79. LookupStr: string;
  80. end;
  81. PSymbolReferenceView = ^TSymbolReferenceView;
  82. TSymbolReferenceView = object(TSymbolView)
  83. constructor Init(var Bounds: TRect; AReferences: PReferenceCollection; AHScrollBar, AVScrollBar: PScrollBar);
  84. destructor Done; virtual;
  85. procedure HandleEvent(var Event: TEvent); virtual;
  86. function GetText(Item,MaxLen: Sw_Integer): String; virtual;
  87. procedure SelectItem(Item: Sw_Integer); virtual;
  88. function GotoItem(Item: sw_integer): boolean; virtual;
  89. function TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
  90. procedure Browse; virtual;
  91. private
  92. References: PReferenceCollection;
  93. end;
  94. PSymbolMemInfoView = ^TSymbolMemInfoView;
  95. TSymbolMemInfoView = object(TStaticText)
  96. constructor Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
  97. destructor Done; virtual;
  98. procedure GetText(var S: String); virtual;
  99. function GetPalette: PPalette; virtual;
  100. private
  101. MemInfo: PSymbolMemInfo;
  102. MyBW : PBrowserWindow;
  103. end;
  104. PSymbolMemoView = ^TSymbolMemoView;
  105. TSymbolMemoView = object(TFPMemo)
  106. function GetPalette: PPalette; virtual;
  107. end;
  108. PSymbolInheritanceView = ^TSymbolInheritanceView;
  109. TSymbolInheritanceView = object(TOutlineViewer)
  110. constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
  111. destructor Done; virtual;
  112. function GetRoot: Pointer; virtual;
  113. function HasChildren(Node: Pointer): Boolean; virtual;
  114. function GetChild(Node: Pointer; I: Integer): Pointer; virtual;
  115. function GetNumChildren(Node: Pointer): Integer; virtual;
  116. function GetText(Node: Pointer): String; virtual;
  117. procedure Adjust(Node: Pointer; Expand: Boolean); virtual;
  118. function IsExpanded(Node: Pointer): Boolean; virtual;
  119. procedure Selected(I: Integer); virtual;
  120. procedure HandleEvent(var Event: TEvent); virtual;
  121. function GetPalette: PPalette; virtual;
  122. private
  123. Root : PObjectSymbol;
  124. MyBW : PBrowserWindow;
  125. end;
  126. PBrowserTabItem = ^TBrowserTabItem;
  127. TBrowserTabItem = record
  128. Sign : char;
  129. Link : PView;
  130. Next : PBrowserTabItem;
  131. end;
  132. PBrowserTab = ^TBrowserTab;
  133. TBrowserTab = object(TView)
  134. Items: PBrowserTabItem;
  135. constructor Init(var Bounds: TRect; AItems: PBrowserTabItem);
  136. function GetItemCount: sw_integer; virtual;
  137. function GetItem(Index: sw_integer): PBrowserTabItem; virtual;
  138. procedure SetParams(AFlags: word; ACurrent: Sw_integer); virtual;
  139. procedure SelectItem(Index: Sw_integer); virtual;
  140. procedure Draw; virtual;
  141. function GetPalette: PPalette; virtual;
  142. procedure HandleEvent(var Event: TEvent); virtual;
  143. destructor Done; virtual;
  144. private
  145. Flags : word;
  146. Current : Sw_integer;
  147. end;
  148. PUnitInfoPanel = ^TUnitInfoPanel;
  149. TUnitInfoPanel = object(TPanel)
  150. InOwnerCall: boolean;
  151. procedure HandleEvent(var Event: TEvent); virtual;
  152. end;
  153. TBrowserWindow = object(TFPWindow)
  154. constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
  155. const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
  156. AInheritance: PObjectSymbol; AMemInfo: PSymbolMemInfo);
  157. procedure HandleEvent(var Event: TEvent); virtual;
  158. procedure SetState(AState: Word; Enable: Boolean); virtual;
  159. procedure Close; virtual;
  160. procedure SelectTab(BrowserTab: Sw_integer); virtual;
  161. function GetPalette: PPalette; virtual;
  162. destructor Done;virtual;
  163. private
  164. PageTab : PBrowserTab;
  165. ST : PStaticText;
  166. Sym : PSymbol;
  167. ScopeView : PSymbolScopeView;
  168. ReferenceView : PSymbolReferenceView;
  169. InheritanceView: PSymbolInheritanceView;
  170. MemInfoView : PSymbolMemInfoView;
  171. UnitInfoText : PSymbolMemoView;
  172. UnitInfoUsed : PSymbolScopeView;
  173. UnitInfoDependent : PSymbolScopeView;
  174. UnitInfo : PUnitInfoPanel;
  175. Prefix : PString;
  176. IsValid : boolean;
  177. DebuggerValue : PGDBValue;
  178. end;
  179. procedure OpenSymbolBrowser(X,Y: Sw_integer;const Name,Line: string;S : PSymbol;
  180. ParentBrowser : PBrowserWindow;
  181. Symbols: PSymbolCollection; References: PReferenceCollection;
  182. Inheritance: PObjectSymbol; MemInfo: PSymbolMemInfo);
  183. function IsSymbolInfoAvailable: boolean;
  184. procedure OpenOneSymbolBrowser(Name : String);
  185. procedure CloseAllBrowsers;
  186. procedure RemoveBrowsersCollection;
  187. const
  188. GlobalsCollection : PSortedCollection = nil;
  189. ModulesCollection : PSortedCollection = nil;
  190. implementation
  191. uses Commands,App,
  192. {$ifdef BROWSERCOL}
  193. symconst,
  194. {$endif BROWSERCOL}
  195. WUtils,WEditor,
  196. FPConst,FPString,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif},FPIDE;
  197. procedure CloseAllBrowsers;
  198. procedure SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
  199. begin
  200. if assigned(P) and
  201. ((TypeOf(P^)=TypeOf(TBrowserWindow)) or
  202. (TypeOf(P^)=TypeOf(TSymbolView)) or
  203. (TypeOf(P^)=TypeOf(TSymbolScopeView)) or
  204. (TypeOf(P^)=TypeOf(TSymbolReferenceView)) or
  205. (TypeOf(P^)=TypeOf(TSymbolMemInfoView)) or
  206. (TypeOf(P^)=TypeOf(TSymbolMemoView)) or
  207. (TypeOf(P^)=TypeOf(TSymbolInheritanceView))) then
  208. Message(P,evCommand,cmClose,nil);
  209. end;
  210. begin
  211. Desktop^.ForEach(@SendCloseIfBrowser);
  212. end;
  213. procedure RemoveBrowsersCollection;
  214. begin
  215. if assigned(GlobalsCollection) then
  216. begin
  217. GlobalsCollection^.deleteAll;
  218. Dispose(GlobalsCollection,done);
  219. GlobalsCollection:=nil;
  220. end;
  221. if assigned(ModulesCollection) then
  222. begin
  223. ModulesCollection^.deleteAll;
  224. Dispose(ModulesCollection,done);
  225. ModulesCollection:=nil;
  226. end;
  227. end;
  228. function NewBrowserTabItem(ASign: char; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
  229. var P: PBrowserTabItem;
  230. begin
  231. New(P); FillChar(P^,SizeOf(P^),0);
  232. with P^ do begin Sign:=ASign; Link:=ALink; Next:=ANext; end;
  233. NewBrowserTabItem:=P;
  234. end;
  235. procedure DisposeBrowserTabItem(P: PBrowserTabItem);
  236. begin
  237. if P<>nil then Dispose(P);
  238. end;
  239. procedure DisposeBrowserTabList(P: PBrowserTabItem);
  240. begin
  241. if P<>nil then
  242. begin
  243. if P^.Next<>nil then DisposeBrowserTabList(P^.Next);
  244. DisposeBrowserTabItem(P);
  245. end;
  246. end;
  247. function IsSymbolInfoAvailable: boolean;
  248. begin
  249. IsSymbolInfoAvailable:=BrowCol.Modules<>nil;
  250. end;
  251. procedure OpenOneSymbolBrowser(Name : String);
  252. var Index : sw_integer;
  253. PS,S : PSymbol;
  254. Anc : PObjectSymbol;
  255. P : Pstring;
  256. Symbols: PSymbolCollection;
  257. function Search(P : PSymbol) : boolean;
  258. begin
  259. Search:=UpcaseStr(P^.Items^.LookUp(Name,Index))=Name;
  260. end;
  261. begin
  262. Name:=UpcaseStr(Name);
  263. If BrowCol.Modules<>nil then
  264. begin
  265. PS:=BrowCol.Modules^.FirstThat(@Search);
  266. If assigned(PS) then
  267. begin
  268. S:=PS^.Items^.At(Index);
  269. Symbols:=S^.Items;
  270. if (not assigned(symbols) or (symbols^.count=0)) and
  271. assigned(S^.Ancestor) then
  272. Symbols:=S^.Ancestor^.Items;
  273. if (S^.Flags and sfObject)=0 then
  274. Anc:=nil
  275. else if S^.Ancestor=nil then
  276. Anc:=ObjectTree
  277. else
  278. Anc:=SearchObjectForSymbol(S^.Ancestor);
  279. OpenSymbolBrowser(0,20,
  280. PS^.Items^.At(Index)^.GetName,
  281. PS^.Items^.At(Index)^.GetText,
  282. PS^.Items^.At(Index),nil,
  283. Symbols,PS^.Items^.At(Index)^.References,Anc,PS^.MemInfo);
  284. end
  285. else
  286. begin
  287. P:=@Name;
  288. ErrorBox(msg_symbolnotfound,@P);
  289. end;
  290. end
  291. else
  292. ErrorBox(msg_nobrowserinfoavailable,nil);
  293. end;
  294. (*procedure ReadBrowseLog(FileName: string);
  295. var f: text;
  296. IOOK,EndOfFile: boolean;
  297. Line: string;
  298. procedure NextLine;
  299. begin
  300. readln(f,Line);
  301. EndOfFile:=Eof(f);
  302. end;
  303. var Level: integer;
  304. procedure ProcessSymTable(Indent: integer; Owner: PSymbolCollection);
  305. var IndentS,S,Source: string;
  306. Sym: PSymbol;
  307. Ref: PSymbolReference;
  308. P: byte;
  309. PX: TPoint;
  310. PS: PString;
  311. PCount: integer;
  312. Params: array[0..30] of PString;
  313. Typ: tsymtyp;
  314. ExitBack: boolean;
  315. begin
  316. Inc(Level);
  317. IndentS:=CharStr(' ',Indent); ExitBack:=false;
  318. Sym:=nil;
  319. repeat
  320. if copy(Line,1,length(IndentS))<>IndentS then ExitBack:=true else
  321. if copy(Line,Indent+1,3)='***' then
  322. { new symbol }
  323. begin
  324. S:=copy(Line,Indent+1+3,255);
  325. P:=Pos('***',S); if P=0 then P:=length(S)+1;
  326. S:=Trim(copy(S,1,P-1));
  327. if (copy(S,1,1)='_') and (Pos('$$',S)>0) then
  328. begin
  329. repeat
  330. P:=Pos('$$',S);
  331. if P>0 then Delete(S,1,P+1);
  332. until P=0;
  333. P:=Pos('$',S);
  334. Delete(S,1,P);
  335. PCount:=0;
  336. repeat
  337. P:=Pos('$',S); if P=0 then P:=length(S)+1;
  338. Params[PCount]:=TypeNames^.Add(copy(S,1,P-1));
  339. Inc(PCount);
  340. Delete(S,1,P);
  341. until S='';
  342. Sym^.Typ:=procsym;
  343. Sym^.SetParams(PCount,@Params);
  344. end
  345. else
  346. New(Sym, Init(S, varsym, 0, nil));
  347. Owner^.Insert(Sym);
  348. NextLine;
  349. end else
  350. if copy(Line,Indent+1,3)='---' then
  351. { child symtable }
  352. begin
  353. S:=Trim(copy(Line,Indent+1+12,255));
  354. if Level=1 then Typ:=unitsym else
  355. Typ:=typesym;
  356. if (Sym<>nil) and (Sym^.GetName=S) then
  357. else
  358. begin
  359. New(Sym, Init(S, Typ, 0, nil));
  360. Owner^.Insert(Sym);
  361. end;
  362. Sym^.Typ:=Typ;
  363. NextLine;
  364. New(Sym^.Items, Init(0,50));
  365. ProcessSymTable(Indent+2,Sym^.Items);
  366. end else
  367. { if Sym<>nil then}
  368. if copy(Line,Indent+1,1)=' ' then
  369. { reference }
  370. begin
  371. S:=copy(Line,Indent+1+2,255);
  372. P:=Pos('(',S); if P=0 then P:=length(S)+1;
  373. Source:=Trim(copy(S,1,P-1)); Delete(S,1,P);
  374. P:=Pos(',',S); if P=0 then P:=length(S)+1;
  375. PX.Y:=StrToInt(copy(S,1,P-1)); Delete(S,1,P);
  376. P:=Pos(')',S); if P=0 then P:=length(S)+1;
  377. PX.X:=StrToInt(copy(S,1,P-1)); Delete(S,1,P);
  378. PS:=ModuleNames^.Add(Source);
  379. New(Ref, Init(PS, PX));
  380. if Sym^.References=nil then
  381. New(Sym^.References, Init(10,50));
  382. Sym^.References^.Insert(Ref);
  383. end;
  384. if ExitBack=false then
  385. NextLine;
  386. until EndOfFile or ExitBack;
  387. Dec(Level);
  388. end;
  389. begin
  390. DoneSymbolBrowser;
  391. InitSymbolBrowser;
  392. {$I-}
  393. Assign(f,FileName);
  394. Reset(f);
  395. Level:=0;
  396. NextLine;
  397. while (IOResult=0) and (EndOfFile=false) do
  398. ProcessSymTable(0,Modules);
  399. Close(f);
  400. EatIO;
  401. {$I+}
  402. end;*)
  403. {****************************************************************************
  404. TGDBValue
  405. ****************************************************************************}
  406. constructor TGDBValue.Init(Const AExpr : String;ASym : PSymbol);
  407. begin
  408. St := nil;
  409. S := ASym;
  410. Expr:=NewStr(AExpr);
  411. GDBI:=-1;
  412. end;
  413. destructor TGDBValue.Done;
  414. begin
  415. If Assigned(St) then
  416. DisposeStr(St);
  417. If Assigned(Expr) then
  418. DisposeStr(Expr);
  419. end;
  420. procedure TGDBValue.GetValue;
  421. begin
  422. {$ifdef BROWSERCOL}
  423. {$ifndef NODEBUG}
  424. if not assigned(Debugger) then
  425. exit;
  426. if not Debugger^.IsRunning then
  427. exit;
  428. if (S^.typ<>varsym) or (GDBI=Debugger^.RunCount) then
  429. exit;
  430. If Assigned(St) then
  431. DisposeStr(St);
  432. if assigned(Expr) then
  433. begin
  434. St:=NewStr(GetPChar(Debugger^.GetValue(Expr^)));
  435. GDBI:=Debugger^.RunCount;
  436. end;
  437. {$endif ndef NODEBUG}
  438. {$endif BROWSERCOL}
  439. end;
  440. function TGDBValue.GetText : String;
  441. begin
  442. GetValue;
  443. if assigned(St) then
  444. GetText:=S^.GetText+' = '+GetStr(St)
  445. else
  446. GetText:=S^.GetText;
  447. end;
  448. {****************************************************************************
  449. TGDBValueCollection
  450. ****************************************************************************}
  451. function TGDBValueCollection.At(Index: sw_Integer): PGDBValue;
  452. begin
  453. At:= Inherited At(Index);
  454. end;
  455. {****************************************************************************
  456. TSymbolView
  457. ****************************************************************************}
  458. constructor TSymbolView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
  459. begin
  460. inherited Init(Bounds,1,AVScrollBar);
  461. HScrollBar:=AHScrollBar;
  462. MyBW:=nil;
  463. if assigned(HScrollBar) then
  464. HScrollBar^.SetRange(1,80);
  465. Options:=Options or (ofSelectable+ofTopSelect);
  466. EventMask:=EventMask or evBroadcast;
  467. end;
  468. procedure TSymbolView.ClearHighlights;
  469. begin
  470. Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
  471. end;
  472. procedure TSymbolView.AutoTrackSource;
  473. begin
  474. if Range>0 then
  475. TrackSource;
  476. end;
  477. procedure TSymbolView.OptionsDlg;
  478. begin
  479. { Abstract }
  480. end;
  481. procedure TSymbolView.SetState(AState: Word; Enable: Boolean);
  482. var OState: longint;
  483. begin
  484. OState:=State;
  485. inherited SetState(AState,Enable);
  486. if ((OState xor State) and sfFocused)<>0 then
  487. if GetState(sfFocused) then
  488. begin
  489. if (MiscOptions and moAutoTrackSource)<>0 then
  490. AutoTrackSource;
  491. end
  492. else
  493. Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
  494. end;
  495. procedure TSymbolView.Browse;
  496. begin
  497. SelectItem(Focused);
  498. end;
  499. procedure TSymbolView.GotoSource;
  500. begin
  501. if GotoItem(Focused) then
  502. PutCommand(Owner,evCommand,cmClose,nil);
  503. end;
  504. procedure TSymbolView.TrackSource;
  505. begin
  506. TrackItem(Focused,false);
  507. end;
  508. procedure TSymbolView.HandleEvent(var Event: TEvent);
  509. var DontClear: boolean;
  510. begin
  511. case Event.What of
  512. evKeyDown :
  513. begin
  514. DontClear:=false;
  515. case Event.KeyCode of
  516. kbEnter :
  517. Browse;
  518. kbCtrlEnter :
  519. GotoSource;
  520. kbSpaceBar :
  521. TrackSource;
  522. kbRight,kbLeft :
  523. if HScrollBar<>nil then
  524. HScrollBar^.HandleEvent(Event);
  525. else DontClear:=true;
  526. end;
  527. if DontClear=false then ClearEvent(Event);
  528. end;
  529. evMouseDown :
  530. begin
  531. if Event.double then
  532. begin
  533. Browse;
  534. ClearEvent(Event);
  535. end;
  536. end;
  537. evCommand :
  538. begin
  539. DontClear:=false;
  540. case Event.Command of
  541. cmSymBrowse :
  542. Browse;
  543. cmSymGotoSource :
  544. GotoSource;
  545. cmSymTrackSource :
  546. TrackSource;
  547. cmSymOptions :
  548. OptionsDlg;
  549. else DontClear:=true;
  550. end;
  551. if DontClear=false then ClearEvent(Event);
  552. end;
  553. evBroadcast :
  554. case Event.Command of
  555. cmListFocusChanged :
  556. if Event.InfoPtr=@Self then
  557. if (MiscOptions and moAutoTrackSource)<>0 then
  558. if GetState(sfFocused) then
  559. AutoTrackSource;
  560. end;
  561. end;
  562. inherited HandleEvent(Event);
  563. end;
  564. function TSymbolView.GetPalette: PPalette;
  565. const
  566. P: string[length(CBrowserListBox)] = CBrowserListBox;
  567. begin
  568. GetPalette:=@P;
  569. end;
  570. function TSymbolView.GetLocalMenu: PMenu;
  571. begin
  572. GetLocalMenu:=NewMenu(
  573. NewItem(menu_symlocal_browse,'',kbNoKey,cmSymBrowse,hcSymBrowse,
  574. NewItem(menu_symlocal_gotosource,'',kbNoKey,cmSymGotoSource,hcSymGotoSource,
  575. NewItem(menu_symlocal_tracksource,'',kbNoKey,cmSymTrackSource,hcSymTrackSource,
  576. NewLine(
  577. NewItem(menu_symlocal_options,'',kbNoKey,cmSymOptions,hcSymOptions,
  578. nil))))));
  579. end;
  580. function TSymbolView.GotoItem(Item: sw_integer): boolean;
  581. begin
  582. SelectItem(Item);
  583. GotoItem:=true;
  584. end;
  585. function TSymbolView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
  586. begin
  587. SelectItem(Item);
  588. TrackItem:=true;
  589. end;
  590. function LastBrowserWindow: PBrowserWindow;
  591. var BW: PBrowserWindow;
  592. procedure IsBW(P: PView); {$ifndef FPC}far;{$endif}
  593. begin
  594. if (P^.HelpCtx=hcBrowserWindow) then
  595. BW:=pointer(P);
  596. end;
  597. begin
  598. BW:=nil;
  599. Desktop^.ForEach(@IsBW);
  600. LastBrowserWindow:=BW;
  601. end;
  602. function TSymbolView.TrackReference(R: PReference; AutoTrack: boolean): boolean;
  603. var W: PSourceWindow;
  604. BW: PBrowserWindow;
  605. P: TPoint;
  606. begin
  607. ClearHighlights;
  608. Desktop^.Lock;
  609. P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
  610. if AutoTrack then
  611. W:=SearchOnDesktop(R^.GetFileName,false)
  612. else
  613. W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y,true);
  614. if W<>nil then
  615. begin
  616. BW:=LastBrowserWindow;
  617. if BW=nil then
  618. W^.Select
  619. else
  620. begin
  621. Desktop^.Delete(W);
  622. Desktop^.InsertBefore(W,BW^.NextView);
  623. end;
  624. W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
  625. end;
  626. Desktop^.UnLock;
  627. if Assigned(W)=false then
  628. ErrorBox(FormatStrStr(msg_cantfindfile,R^.GetFileName),nil);
  629. TrackReference:=W<>nil;
  630. end;
  631. function TSymbolView.GotoReference(R: PReference): boolean;
  632. var W: PSourceWindow;
  633. begin
  634. Desktop^.Lock;
  635. W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
  636. if Assigned(W) then
  637. W^.Select;
  638. Desktop^.UnLock;
  639. if Assigned(W)=false then
  640. ErrorBox(FormatStrStr(msg_cantfindfile,R^.GetFileName),nil);
  641. GotoReference:=W<>nil;
  642. end;
  643. {****************************************************************************
  644. TSymbolScopeView
  645. ****************************************************************************}
  646. constructor TSymbolScopeView.Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
  647. begin
  648. inherited Init(Bounds,AHScrollBar, AVScrollBar);
  649. Symbols:=ASymbols;
  650. NewList(ASymbols);
  651. New(SymbolsValue,Init(50,50));
  652. SetRange(Symbols^.Count);
  653. end;
  654. destructor TSymbolScopeView.Done;
  655. begin
  656. {if assigned(Symbols) then
  657. begin
  658. the elements belong to other lists
  659. Symbols^.DeleteAll;
  660. dispose(Symbols,done);
  661. end;}
  662. Inherited Done;
  663. end;
  664. procedure TSymbolScopeView.HandleEvent(var Event: TEvent);
  665. var OldFocus: sw_integer;
  666. begin
  667. case Event.What of
  668. evKeyDown :
  669. case Event.KeyCode of
  670. kbBack :
  671. begin
  672. LookUp(copy(LookUpStr,1,length(LookUpStr)-1));
  673. ClearEvent(Event);
  674. end;
  675. else
  676. if Event.CharCode in[#33..#255] then
  677. begin
  678. LookUp(LookUpStr+Event.CharCode);
  679. ClearEvent(Event);
  680. end;
  681. end;
  682. end;
  683. OldFocus:=Focused;
  684. inherited HandleEvent(Event);
  685. if OldFocus<>Focused then
  686. Lookup('');
  687. end;
  688. procedure TSymbolScopeView.Draw;
  689. var DeltaX: sw_integer;
  690. begin
  691. inherited Draw;
  692. if Assigned(HScrollBar)=false then DeltaX:=0 else
  693. DeltaX:=HScrollBar^.Value-HScrollBar^.Min;
  694. SetCursor(2+SymbolTypLen+length(LookUpStr)-DeltaX,Focused-TopItem);
  695. end;
  696. procedure TSymbolScopeView.LookUp(S: string);
  697. var Idx,Slength: Sw_integer;
  698. NS: string;
  699. begin
  700. NS:=LookUpStr;
  701. Slength:=Length(S);
  702. if (Symbols=nil) or (S='') then NS:='' else
  703. begin
  704. S:=Symbols^.LookUp(S,Idx);
  705. if Idx<>-1 then
  706. begin
  707. NS:=S;
  708. FocusItem(Idx);
  709. end;
  710. end;
  711. LookUpStr:=Copy(NS,1,Slength);
  712. SetState(sfCursorVis,LookUpStr<>'');
  713. DrawView;
  714. end;
  715. function TSymbolScopeView.GotoItem(Item: sw_integer): boolean;
  716. var S: PSymbol;
  717. OK: boolean;
  718. begin
  719. OK:=Range>0;
  720. if OK then
  721. begin
  722. S:=List^.At(Item);
  723. OK:=(S^.References<>nil) and (S^.References^.Count>0);
  724. if OK then
  725. OK:=GotoReference(S^.References^.At(0));
  726. end;
  727. GotoItem:=OK;
  728. end;
  729. function TSymbolScopeView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
  730. var S: PSymbol;
  731. OK: boolean;
  732. begin
  733. OK:=Range>0;
  734. if OK then
  735. begin
  736. S:=List^.At(Item);
  737. OK:=(S^.References<>nil) and (S^.References^.Count>0);
  738. if OK then
  739. OK:=TrackReference(S^.References^.At(0),AutoTrack);
  740. end;
  741. TrackItem:=OK;
  742. end;
  743. procedure TSymbolScopeView.SetGDBCol;
  744. var S : PSymbol;
  745. I : sw_integer;
  746. begin
  747. if assigned(MyBW) and (SymbolsValue^.Count=0) then
  748. begin
  749. For i:=0 to Symbols^.Count-1 do
  750. begin
  751. S:=Symbols^.At(I);
  752. SymbolsValue^.Insert(New(PGDBValue,Init(GetStr(MyBW^.Prefix)+S^.GetName,S)));
  753. end;
  754. end;
  755. end;
  756. function TSymbolScopeView.GetText(Item,MaxLen: Sw_Integer): String;
  757. var S1: string;
  758. S : PSymbol;
  759. SG : PGDBValue;
  760. begin
  761. S:=Symbols^.At(Item);
  762. if Assigned(SymbolsValue) and (SymbolsValue^.Count>Item) then
  763. SG:=SymbolsValue^.At(Item)
  764. else
  765. SG:=nil;
  766. if assigned(SG) then
  767. S1:=SG^.getText
  768. else
  769. S1:=S^.GetText;
  770. GetText:=copy(S1,1,MaxLen);
  771. end;
  772. {****************************************************************************
  773. TSymbolReferenceView
  774. ****************************************************************************}
  775. constructor TSymbolReferenceView.Init(var Bounds: TRect; AReferences: PReferenceCollection;
  776. AHScrollBar, AVScrollBar: PScrollBar);
  777. begin
  778. inherited Init(Bounds,AHScrollBar, AVScrollBar);
  779. References:=AReferences;
  780. NewList(AReferences);
  781. SetRange(References^.Count);
  782. end;
  783. destructor TSymbolReferenceView.Done;
  784. begin
  785. Inherited Done;
  786. end;
  787. procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
  788. var OldFocus: sw_integer;
  789. { DontClear: boolean;}
  790. begin
  791. OldFocus:=Focused;
  792. { case Event.What of
  793. evKeyDown :
  794. begin
  795. DontClear:=false;
  796. case Event.KeyCode of
  797. kbEnter :
  798. TrackItem(Focused,false);
  799. kbCtrlEnter :
  800. GotoItem(Focused);
  801. else DontClear:=true;
  802. end;
  803. if DontClear=false then ClearEvent(Event);
  804. end;
  805. end;}
  806. inherited HandleEvent(Event);
  807. if OldFocus<>Focused then
  808. if (MiscOptions and moAutoTrackSource)=0 then
  809. ClearHighlights;
  810. end;
  811. procedure TSymbolReferenceView.Browse;
  812. begin
  813. { do nothing here }
  814. end;
  815. function TSymbolReferenceView.GetText(Item,MaxLen: Sw_Integer): String;
  816. var S: string;
  817. P: PReference;
  818. begin
  819. P:=References^.At(Item);
  820. S:=P^.GetFileName+'('+IntToStr(P^.Position.Y)+','+IntToStr(P^.Position.X)+')';
  821. GetText:=copy(S,1,MaxLen);
  822. end;
  823. function TSymbolReferenceView.GotoItem(Item: sw_integer): boolean;
  824. var OK: boolean;
  825. begin
  826. OK:=Range>0;
  827. if OK then
  828. OK:=GotoReference(List^.At(Item));
  829. GotoItem:=OK;
  830. end;
  831. function TSymbolReferenceView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
  832. var OK: boolean;
  833. begin
  834. OK:=Range>0;
  835. if OK then
  836. OK:=TrackReference(List^.At(Item),AutoTrack);
  837. TrackItem:=OK;
  838. end;
  839. procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
  840. begin
  841. GotoItem(Item);
  842. end;
  843. constructor TSymbolMemInfoView.Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
  844. begin
  845. inherited Init(Bounds,'');
  846. Options:=Options or (ofSelectable+ofTopSelect);
  847. MemInfo:=AMemInfo;
  848. MyBW:=nil;
  849. end;
  850. destructor TSymbolMemInfoView.Done;
  851. begin
  852. { if assigned(MemInfo) then
  853. dispose(MemInfo);}
  854. Inherited Done;
  855. end;
  856. procedure TSymbolMemInfoView.GetText(var S: String);
  857. function SizeStr(Size: longint): string;
  858. var S: string[40];
  859. begin
  860. S:=IntToStrL(Size,7);
  861. S:=S+' byte';
  862. if Size>1 then S:=S+'s';
  863. if Size=-1 then
  864. SizeStr:='variable'
  865. else
  866. SizeStr:=S;
  867. end;
  868. function AddrStr(Addr: longint): string;
  869. { Warning this is endian specific code !! (PM) }
  870. type TLongint = record LoW,HiW: word; end;
  871. begin
  872. with TLongint(Addr) do
  873. AddrStr:='$'+IntToHex(HiW,4)+IntToHex(HiW,4);
  874. end;
  875. begin
  876. ClearFormatParams;
  877. AddFormatParamStr(msg_sizeinmemory);
  878. AddFormatParamStr(msg_sizeonstack);
  879. S:=
  880. FormatStrF(
  881. #13+
  882. { ' Memory location: '+AddrStr(MemInfo^.Addr)+#13+
  883. ' Local address: '+AddrStr(MemInfo^.LocalAddr)+#13+}
  884. { ??? internal linker ??? }
  885. '%18s: '+SizeStr(MemInfo^.Size)+#13+
  886. '%18s: '+SizeStr(MemInfo^.PushSize)+#13+
  887. '',
  888. FormatParams);
  889. end;
  890. function TSymbolMemInfoView.GetPalette: PPalette;
  891. begin
  892. GetPalette:=inherited GetPalette;
  893. end;
  894. function TSymbolMemoView.GetPalette: PPalette;
  895. const P: string[length(CFPSymbolMemo)] = CFPSymbolMemo;
  896. begin
  897. GetPalette:=@P;
  898. end;
  899. {****************************************************************************
  900. TSymbolInheritanceView
  901. ****************************************************************************}
  902. constructor TSymbolInheritanceView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
  903. begin
  904. inherited Init(Bounds,AHScrollBar,AVScrollBar);
  905. Options:=Options or (ofSelectable+ofTopSelect);
  906. Root:=ARoot;
  907. MyBW:=nil;
  908. ExpandAll(GetRoot);
  909. Update;
  910. end;
  911. destructor TSymbolInheritanceView.Done;
  912. begin
  913. { do not dispose,
  914. belongs to a symbolcollection (PM)
  915. if assigned(Root) then
  916. dispose(Root,done); }
  917. Inherited Done;
  918. end;
  919. function TSymbolInheritanceView.GetRoot: Pointer;
  920. begin
  921. GetRoot:=Root;
  922. end;
  923. function TSymbolInheritanceView.HasChildren(Node: Pointer): Boolean;
  924. begin
  925. HasChildren:=GetNumChildren(Node)>0;
  926. end;
  927. function TSymbolInheritanceView.GetChild(Node: Pointer; I: Integer): Pointer;
  928. begin
  929. GetChild:=PObjectSymbol(Node)^.GetDescendant(I);
  930. end;
  931. function TSymbolInheritanceView.GetNumChildren(Node: Pointer): Integer;
  932. begin
  933. GetNumChildren:=PObjectSymbol(Node)^.GetDescendantCount;
  934. end;
  935. function TSymbolInheritanceView.GetText(Node: Pointer): String;
  936. begin
  937. GetText:=PObjectSymbol(Node)^.GetName;
  938. end;
  939. procedure TSymbolInheritanceView.Adjust(Node: Pointer; Expand: Boolean);
  940. begin
  941. PObjectSymbol(Node)^.Expanded:=Expand;
  942. end;
  943. function TSymbolInheritanceView.IsExpanded(Node: Pointer): Boolean;
  944. begin
  945. IsExpanded:=PObjectSymbol(Node)^.Expanded;
  946. end;
  947. procedure TSymbolInheritanceView.HandleEvent(var Event: TEvent);
  948. var DontClear: boolean;
  949. begin
  950. case Event.What of
  951. evKeyDown :
  952. begin
  953. DontClear:=false;
  954. case Event.KeyCode of
  955. kbLeft,kbRight,
  956. kbCtrlLeft,kbCtrlRight :
  957. if Assigned(HScrollBar) then
  958. HScrollBar^.HandleEvent(Event)
  959. else
  960. DontClear:=true;
  961. else DontClear:=true;
  962. end;
  963. if DontClear=false then ClearEvent(Event);
  964. end;
  965. end;
  966. inherited HandleEvent(Event);
  967. end;
  968. function TSymbolInheritanceView.GetPalette: PPalette;
  969. const P: string[length(CBrowserOutline)] = CBrowserOutline;
  970. begin
  971. GetPalette:=@P;
  972. end;
  973. procedure TSymbolInheritanceView.Selected(I: Integer);
  974. var P: pointer;
  975. S: PSymbol;
  976. St : String;
  977. Anc: PObjectSymbol;
  978. begin
  979. P:=GetNode(I);
  980. if P=nil then Exit;
  981. S:=PObjectSymbol(P)^.Symbol;
  982. { this happens for the top objects view (PM) }
  983. if S=nil then exit;
  984. st:=S^.GetName;
  985. if S^.Ancestor=nil then
  986. Anc:=ObjectTree
  987. else
  988. Anc:=SearchObjectForSymbol(S^.Ancestor);
  989. OpenSymbolBrowser(Origin.X-1,FOC-Delta.Y+1,
  990. st,
  991. S^.GetText,S,nil,
  992. S^.Items,S^.References,Anc,S^.MemInfo);
  993. end;
  994. {****************************************************************************
  995. TBrowserTab
  996. ****************************************************************************}
  997. constructor TBrowserTab.Init(var Bounds: TRect; AItems: PBrowserTabItem);
  998. begin
  999. inherited Init(Bounds);
  1000. Options:=Options or ofPreProcess;
  1001. Items:=AItems;
  1002. SetParams(0,0);
  1003. end;
  1004. procedure TBrowserTab.SetParams(AFlags: word; ACurrent: Sw_integer);
  1005. begin
  1006. Flags:=AFlags;
  1007. SelectItem(ACurrent);
  1008. end;
  1009. procedure TBrowserTab.SelectItem(Index: Sw_integer);
  1010. var P: PBrowserTabItem;
  1011. begin
  1012. Current:=Index;
  1013. P:=GetItem(Current);
  1014. if (P<>nil) and (P^.Link<>nil) then
  1015. P^.Link^.Focus;
  1016. DrawView;
  1017. end;
  1018. function TBrowserTab.GetItemCount: sw_integer;
  1019. var Count: integer;
  1020. P: PBrowserTabItem;
  1021. begin
  1022. Count:=0; P:=Items;
  1023. while (P<>nil) do
  1024. begin
  1025. Inc(Count);
  1026. P:=P^.Next;
  1027. end;
  1028. GetItemCount:=Count;
  1029. end;
  1030. function TBrowserTab.GetItem(Index: sw_integer): PBrowserTabItem;
  1031. var Counter: integer;
  1032. P: PBrowserTabItem;
  1033. begin
  1034. P:=Items; Counter:=0;
  1035. while (P<>nil) and (Counter<Index) do
  1036. begin
  1037. P:=P^.Next;
  1038. Inc(Counter);
  1039. end;
  1040. GetItem:=P;
  1041. end;
  1042. procedure TBrowserTab.Draw;
  1043. var B: TDrawBuffer;
  1044. SelColor, NormColor, C: word;
  1045. I,CurX,Count: Sw_integer;
  1046. function Names(Idx: integer): char;
  1047. begin
  1048. Names:=GetItem(Idx)^.Sign;
  1049. end;
  1050. begin
  1051. NormColor:=GetColor(1); SelColor:=GetColor(2);
  1052. MoveChar(B,'Ä',SelColor,Size.X);
  1053. CurX:=0; Count:=0;
  1054. for I:=0 to GetItemCount-1 do
  1055. if (Flags and (1 shl I))<>0 then
  1056. begin
  1057. Inc(Count);
  1058. if Current=I then C:=SelColor
  1059. else C:=NormColor;
  1060. if Count=1 then MoveChar(B[CurX],'´',SelColor,1)
  1061. else MoveChar(B[CurX],'³',SelColor,1);
  1062. MoveCStr(B[CurX+1],' '+Names(I)+' ',C);
  1063. Inc(CurX,4);
  1064. end;
  1065. if Count>0 then
  1066. MoveChar(B[CurX],'Ã',SelColor,1);
  1067. WriteLine(0,0,Size.X,Size.Y,B);
  1068. end;
  1069. procedure TBrowserTab.HandleEvent(var Event: TEvent);
  1070. var I,Idx: integer;
  1071. DontClear: boolean;
  1072. P: TPoint;
  1073. function GetItemForCoord(X: integer): integer;
  1074. var I,CurX,Idx: integer;
  1075. begin
  1076. CurX:=0; Idx:=-1;
  1077. for I:=0 to GetItemCount-1 do
  1078. if (Flags and (1 shl I))<>0 then
  1079. begin
  1080. if (CurX+1<=X) and (X<=CurX+3) then
  1081. begin Idx:=I; Break; end;
  1082. Inc(CurX,4);
  1083. end;
  1084. GetItemForCoord:=Idx;
  1085. end;
  1086. begin
  1087. case Event.What of
  1088. evMouseDown :
  1089. if MouseInView(Event.Where) then
  1090. begin
  1091. repeat
  1092. MakeLocal(Event.Where,P);
  1093. Idx:=GetItemForCoord(P.X);
  1094. if Idx<>-1 then
  1095. SelectItem(Idx);
  1096. until not MouseEvent(Event, evMouseMove);
  1097. ClearEvent(Event);
  1098. end;
  1099. evKeyDown :
  1100. begin
  1101. DontClear:=false; Idx:=-1;
  1102. for I:=0 to GetItemCount-1 do
  1103. if GetCtrlCode(GetItem(I)^.Sign)=Event.KeyCode then
  1104. if (Flags and (1 shl I))<>0 then
  1105. begin
  1106. Idx:=I;
  1107. Break;
  1108. end;
  1109. if Idx=-1 then
  1110. DontClear:=true
  1111. else
  1112. SelectItem(Idx);
  1113. if DontClear=false then ClearEvent(Event);
  1114. end;
  1115. end;
  1116. inherited HandleEvent(Event);
  1117. end;
  1118. function TBrowserTab.GetPalette: PPalette;
  1119. const P: string[length(CBrowserTab)] = CBrowserTab;
  1120. begin
  1121. GetPalette:=@P;
  1122. end;
  1123. destructor TBrowserTab.Done;
  1124. begin
  1125. if Items<>nil then DisposeBrowserTabList(Items);
  1126. inherited Done;
  1127. end;
  1128. procedure TUnitInfoPanel.HandleEvent(var Event: TEvent);
  1129. begin
  1130. if (Event.What=evBroadcast) and (Event.Command=cmListItemSelected) and
  1131. (InOwnerCall=false) then
  1132. begin
  1133. InOwnerCall:=true;
  1134. if Assigned(Owner) then
  1135. Owner^.HandleEvent(Event);
  1136. InOwnerCall:=false;
  1137. end;
  1138. inherited HandleEvent(Event);
  1139. end;
  1140. constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
  1141. const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
  1142. AInheritance: PObjectSymbol; AMemInfo: PSymbolMemINfo);
  1143. var R,R2,R3: TRect;
  1144. HSB,VSB: PScrollBar;
  1145. CST: PColorStaticText;
  1146. I: sw_integer;
  1147. function CreateVSB(R: TRect): PScrollBar;
  1148. var R2: TRect;
  1149. SB: PScrollBar;
  1150. begin
  1151. R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
  1152. New(SB, Init(R2)); SB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
  1153. CreateVSB:=SB;
  1154. end;
  1155. function CreateHSB(R: TRect): PScrollBar;
  1156. var R2: TRect;
  1157. SB: PScrollBar;
  1158. begin
  1159. R2.Copy(R); R2.Move(0,1); R2.A.Y:=R2.B.Y-1;
  1160. New(SB, Init(R2)); SB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
  1161. CreateHSB:=SB;
  1162. end;
  1163. begin
  1164. inherited Init(Bounds, FormatStrStr(dialog_browse,ATitle), ANumber);
  1165. HelpCtx:=hcBrowserWindow;
  1166. Sym:=ASym;
  1167. Prefix:=NewStr(APrefix);
  1168. GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+1;
  1169. {$ifndef NODEBUG}
  1170. if {assigned(Debugger) and Debugger^.IsRunning and}
  1171. assigned(Sym) and (Sym^.typ=varsym) then
  1172. begin
  1173. New(DebuggerValue,Init(ATitle,Sym));
  1174. New(ST, Init(R, ' '+DebuggerValue^.GetText));
  1175. end
  1176. else
  1177. {$endif NODEBUG}
  1178. begin
  1179. New(ST, Init(R, ' '+AName));
  1180. DebuggerValue:=nil;
  1181. end;
  1182. ST^.GrowMode:=gfGrowHiX;
  1183. Insert(ST);
  1184. GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,2);
  1185. if assigned(ASymbols) and (ASymbols^.Count>0) then
  1186. begin
  1187. HSB:=CreateHSB(R); Insert(HSB);
  1188. VSB:=CreateVSB(R); Insert(VSB);
  1189. New(ScopeView, Init(R, ASymbols, HSB, VSB));
  1190. ScopeView^.GrowMode:=gfGrowHiX+gfGrowHiY;
  1191. Insert(ScopeView);
  1192. ScopeView^.MyBW:=@Self;
  1193. ScopeView^.SetGDBCol;
  1194. end;
  1195. if assigned(AReferences) and (AReferences^.Count>0) then
  1196. begin
  1197. HSB:=CreateHSB(R); Insert(HSB);
  1198. VSB:=CreateVSB(R); Insert(VSB);
  1199. New(ReferenceView, Init(R, AReferences, HSB, VSB));
  1200. ReferenceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
  1201. Insert(ReferenceView);
  1202. ReferenceView^.MyBW:=@Self;
  1203. end;
  1204. if assigned(AInheritance) then
  1205. begin
  1206. HSB:=CreateHSB(R); Insert(HSB);
  1207. VSB:=CreateVSB(R); Insert(VSB);
  1208. New(InheritanceView, Init(R, HSB,VSB, AInheritance));
  1209. InheritanceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
  1210. Insert(InheritanceView);
  1211. InheritanceView^.MyBW:=@Self;
  1212. end;
  1213. if assigned(AMemInfo) then
  1214. begin
  1215. New(MemInfoView, Init(R, AMemInfo));
  1216. MemInfoView^.GrowMode:=gfGrowHiX+gfGrowHiY;
  1217. Insert(MemInfoView);
  1218. MemInfoView^.MyBW:=@Self;
  1219. end;
  1220. if Assigned(Asym) and (TypeOf(ASym^)=TypeOf(TModuleSymbol)) then
  1221. with PModuleSymbol(Sym)^ do
  1222. begin
  1223. New(UnitInfo, Init(R));
  1224. UnitInfo^.GetExtent(R3);
  1225. R2.Copy(R3);
  1226. R2.B.Y:=R2.A.Y+3;
  1227. if (Assigned(UsedUnits) or Assigned(DependentUnits))=false then
  1228. R2.B.Y:=R3.B.Y;
  1229. {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
  1230. VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
  1231. New(UnitInfoText, Init(R2,HSB,VSB, nil));
  1232. with UnitInfoText^ do
  1233. begin
  1234. GrowMode:=gfGrowHiX;
  1235. if Assigned(LoadedFrom) then
  1236. begin
  1237. AddLine(FormatStrStr2('%s : %s',msg_usedfirstin,GetStr(LoadedFrom)));
  1238. AddLine(FormatStrStr('%s : ',msg_mainsource));
  1239. AddLine(FormatStrStr(' %s',GetStr(MainSource)));
  1240. if Assigned(SourceFiles) and (SourceFiles^.Count>1) then
  1241. begin
  1242. AddLine(FormatStrStr('%s : ',msg_sourcefiles));
  1243. for I:=0 to SourceFiles^.Count-1 do
  1244. AddLine(FormatStrStr(' %s',GetStr(SourceFiles^.At(I))));
  1245. end;
  1246. end;
  1247. end;
  1248. UnitInfo^.Insert(UnitInfoText);
  1249. if Assigned(UsedUnits) then
  1250. begin
  1251. Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
  1252. New(CST, Init(R2,'´ Used units Ã'+CharStr('Ä',255),ColorIndex(12),false));
  1253. CST^.GrowMode:=gfGrowHiX;
  1254. UnitInfo^.Insert(CST);
  1255. Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+4;
  1256. if Assigned(DependentUnits)=false then R2.B.Y:=R3.B.Y;
  1257. {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
  1258. VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
  1259. New(UnitInfoUsed, Init(R2,UsedUnits,HSB,VSB));
  1260. UnitInfoUsed^.GrowMode:=gfGrowHiY+gfGrowHiX;
  1261. UnitInfoUsed^.MyBW:=@Self;
  1262. UnitInfo^.Insert(UnitInfoUsed);
  1263. end;
  1264. if Assigned(DependentUnits) then
  1265. begin
  1266. Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
  1267. New(CST, Init(R2,'´ Dependent units Ã'+CharStr('Ä',255),ColorIndex(12),false));
  1268. CST^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
  1269. UnitInfo^.Insert(CST);
  1270. Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R3.B.Y;
  1271. {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
  1272. VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
  1273. New(UnitInfoDependent, Init(R2,DependentUnits,HSB,VSB));
  1274. UnitInfoDependent^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
  1275. UnitInfoDependent^.MyBW:=@Self;
  1276. UnitInfo^.Insert(UnitInfoDependent);
  1277. end;
  1278. if Assigned(UnitInfoText) then
  1279. UnitInfoText^.Select;
  1280. Insert(UnitInfo);
  1281. end;
  1282. GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.B.Y:=R.A.Y+1;
  1283. New(PageTab, Init(R,
  1284. NewBrowserTabItem(label_browsertab_scope,ScopeView,
  1285. NewBrowserTabItem(label_browsertab_reference,ReferenceView,
  1286. NewBrowserTabItem(label_browsertab_inheritance,InheritanceView,
  1287. NewBrowserTabItem(label_browsertab_memory,MemInfoView,
  1288. NewBrowserTabItem(label_browsertab_unit,UnitInfo,
  1289. nil))
  1290. )))));
  1291. PageTab^.GrowMode:=gfGrowHiX;
  1292. Insert(PageTab);
  1293. if assigned(ScopeView) then
  1294. SelectTab(btScope)
  1295. else
  1296. if assigned(ReferenceView) then
  1297. SelectTab(btReferences)
  1298. else
  1299. if assigned(InheritanceView) then
  1300. SelectTab(btInheritance);
  1301. end;
  1302. destructor TBrowserWindow.Done;
  1303. begin
  1304. if assigned(DebuggerValue) then
  1305. begin
  1306. Dispose(DebuggerValue,Done);
  1307. DebuggerValue:=nil;
  1308. end;
  1309. inherited Done;
  1310. end;
  1311. procedure TBrowserWindow.HandleEvent(var Event: TEvent);
  1312. var DontClear: boolean;
  1313. S: PSymbol;
  1314. Symbols: PSymbolCollection;
  1315. Anc: PObjectSymbol;
  1316. P: TPoint;
  1317. begin
  1318. case Event.What of
  1319. evBroadcast :
  1320. case Event.Command of
  1321. cmDebuggerStopped :
  1322. begin
  1323. if Assigned(DebuggerValue) and
  1324. (DebuggerValue^.GDBI<>Event.InfoLong) then
  1325. begin
  1326. If Assigned(ST^.Text) then
  1327. DisposeStr(ST^.Text);
  1328. ST^.Text:=NewStr(DebuggerValue^.GetText);
  1329. ST^.DrawView;
  1330. end;
  1331. end;
  1332. cmSearchWindow :
  1333. ClearEvent(Event);
  1334. cmListItemSelected :
  1335. begin
  1336. S:=nil;
  1337. if (Event.InfoPtr=ScopeView) then
  1338. begin
  1339. S:=ScopeView^.Symbols^.At(ScopeView^.Focused);
  1340. MakeGlobal(ScopeView^.Origin,P);
  1341. Desktop^.MakeLocal(P,P); Inc(P.Y,ScopeView^.Focused-ScopeView^.TopItem);
  1342. Inc(P.Y);
  1343. end;
  1344. if (Event.InfoPtr=UnitInfoUsed) then
  1345. begin
  1346. S:=UnitInfoUsed^.Symbols^.At(UnitInfoUsed^.Focused);
  1347. MakeGlobal(UnitInfoUsed^.Origin,P);
  1348. Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoUsed^.Focused-UnitInfoUsed^.TopItem);
  1349. Inc(P.Y);
  1350. end;
  1351. if (Event.InfoPtr=UnitInfoDependent) then
  1352. begin
  1353. S:=UnitInfoDependent^.Symbols^.At(UnitInfoDependent^.Focused);
  1354. MakeGlobal(UnitInfoDependent^.Origin,P);
  1355. Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoDependent^.Focused-UnitInfoDependent^.TopItem);
  1356. Inc(P.Y);
  1357. end;
  1358. if Assigned(S) then
  1359. begin
  1360. if S^.Ancestor=nil then Anc:=nil else
  1361. Anc:=SearchObjectForSymbol(S^.Ancestor);
  1362. Symbols:=S^.Items;
  1363. if (not assigned(Symbols) or (symbols^.count=0)) then
  1364. if assigned(S^.Ancestor) then
  1365. Symbols:=S^.Ancestor^.Items;
  1366. if (S^.GetReferenceCount>0) or (assigned(Symbols) and (Symbols^.Count>0)) or (Anc<>nil) then
  1367. OpenSymbolBrowser(Origin.X-1,P.Y,
  1368. S^.GetName,
  1369. ScopeView^.GetText(ScopeView^.Focused,255),
  1370. S,@self,
  1371. Symbols,S^.References,Anc,S^.MemInfo);
  1372. end;
  1373. end;
  1374. end;
  1375. { evCommand :
  1376. begin
  1377. DontClear:=false;
  1378. case Event.Command of
  1379. cmGotoSymbol :
  1380. if Event.InfoPtr=ScopeView then
  1381. if ReferenceView<>nil then
  1382. if ReferenceView^.Range>0 then
  1383. ReferenceView^.GotoItem(0);
  1384. cmTrackSymbol :
  1385. if Event.InfoPtr=ScopeView then
  1386. if (ScopeView<>nil) and (ScopeView^.Range>0) then
  1387. begin
  1388. S:=ScopeView^.At(ScopeView^.Focused);
  1389. if (S^.References<>nil) and (S^.References^.Count>0) then
  1390. TrackItem(S^.References^.At(0));
  1391. else DontClear:=true;
  1392. end;
  1393. if DontClear=false then ClearEvent(Event);
  1394. end;}
  1395. evKeyDown :
  1396. begin
  1397. DontClear:=false;
  1398. case Event.KeyCode of
  1399. kbEsc :
  1400. Close;
  1401. else DontClear:=true;
  1402. end;
  1403. if DontClear=false then ClearEvent(Event);
  1404. end;
  1405. end;
  1406. inherited HandleEvent(Event);
  1407. end;
  1408. procedure TBrowserWindow.SetState(AState: Word; Enable: Boolean);
  1409. {var OldState: word;}
  1410. begin
  1411. { OldState:=State;}
  1412. inherited SetState(AState,Enable);
  1413. { if ((State xor OldState) and sfActive)<>0 then
  1414. if GetState(sfActive)=false then
  1415. Message(Desktop,evBroadcast,cmClearLineHighlights,nil);}
  1416. end;
  1417. procedure TBrowserWindow.Close;
  1418. begin
  1419. inherited Close;
  1420. end;
  1421. procedure TBrowserWindow.SelectTab(BrowserTab: Sw_integer);
  1422. var Tabs: Sw_integer;
  1423. { PB : PBreakpoint;
  1424. PS :PString;
  1425. l : longint; }
  1426. begin
  1427. (* case BrowserTab of
  1428. btScope :
  1429. if assigned(ScopeView) then
  1430. ScopeView^.Select;
  1431. btReferences :
  1432. if assigned(ReferenceView) then
  1433. ReferenceView^.Select;
  1434. btBreakWatch :
  1435. begin
  1436. if Assigned(Sym) then
  1437. begin
  1438. if Pos('proc',Sym^.GetText)>0 then
  1439. { insert function breakpoint }
  1440. begin
  1441. { make it visible }
  1442. PS:=Sym^.Name;
  1443. l:=Length(PS^);
  1444. If PS^[l]='*' then
  1445. begin
  1446. PB:=BreakpointsCollection^.GetType(bt_function,copy(GetStr(PS),1,l-1));
  1447. If Assigned(PB) then
  1448. BreakpointsCollection^.Delete(PB);
  1449. Sym^.Name:=NewStr(copy(GetStr(PS),1,l-1));
  1450. DrawView;
  1451. DisposeStr(PS);
  1452. end
  1453. else
  1454. begin
  1455. Sym^.Name:=NewStr(GetStr(PS)+'*');
  1456. DrawView;
  1457. New(PB,init_function(GetStr(PS)));
  1458. DisposeStr(PS);
  1459. BreakpointsCollection^.Insert(PB);
  1460. BreakpointsCollection^.Update;
  1461. end;
  1462. end
  1463. else if pos('var',Sym^.GetText)>0 then
  1464. { insert watch point }
  1465. begin
  1466. { make it visible }
  1467. PS:=Sym^.Name;
  1468. l:=Length(PS^);
  1469. If PS^[l]='*' then
  1470. begin
  1471. PB:=BreakpointsCollection^.GetType(bt_awatch,copy(PS^,1,l-1));
  1472. If Assigned(PB) then
  1473. BreakpointsCollection^.Delete(PB);
  1474. Sym^.Name:=NewStr(copy(PS^,1,l-1));
  1475. DrawView;
  1476. DisposeStr(PS);
  1477. end
  1478. else
  1479. begin
  1480. Sym^.Name:=NewStr(GetStr(PS)+'*');
  1481. DrawView;
  1482. New(PB,init_type(bt_awatch,GetStr(PS)));
  1483. DisposeStr(PS);
  1484. BreakpointsCollection^.Insert(PB);
  1485. BreakpointsCollection^.Update;
  1486. end;
  1487. end;
  1488. end;
  1489. end;
  1490. end;*)
  1491. Tabs:=0;
  1492. if assigned(ScopeView) then
  1493. Tabs:=Tabs or (1 shl btScope);
  1494. if assigned(ReferenceView) then
  1495. Tabs:=Tabs or (1 shl btReferences);
  1496. if assigned(InheritanceView) then
  1497. Tabs:=Tabs or (1 shl btInheritance);
  1498. if assigned(MemInfoView) then
  1499. Tabs:=Tabs or (1 shl btMemInfo);
  1500. if Assigned(Sym) then
  1501. if (Pos('proc',Sym^.GetText)>0) or (Pos('var',Sym^.GetText)>0) then
  1502. Tabs:=Tabs or (1 shl btBreakWatch);
  1503. if assigned(UnitInfo) then
  1504. Tabs:=Tabs or (1 shl btUnitInfo);
  1505. if PageTab<>nil then PageTab^.SetParams(Tabs,BrowserTab);
  1506. end;
  1507. function TBrowserWindow.GetPalette: PPalette;
  1508. const S: string[length(CBrowserWindow)] = CBrowserWindow;
  1509. begin
  1510. GetPalette:=@S;
  1511. end;
  1512. procedure OpenSymbolBrowser(X,Y: Sw_integer;const Name,Line: string;S : PSymbol;
  1513. ParentBrowser : PBrowserWindow;
  1514. Symbols: PSymbolCollection; References: PReferenceCollection;
  1515. Inheritance: PObjectSymbol; MemInfo: PSymbolMemInfo);
  1516. var R: TRect;
  1517. PB : PBrowserWindow;
  1518. St,st2 : string;
  1519. begin
  1520. if X=0 then X:=Desktop^.Size.X-35;
  1521. R.A.X:=X; R.A.Y:=Y;
  1522. R.B.X:=R.A.X+35; R.B.Y:=R.A.Y+15;
  1523. while (R.B.Y>Desktop^.Size.Y) do R.Move(0,-1);
  1524. if assigned(ParentBrowser) then
  1525. begin
  1526. st:=GetStr(ParentBrowser^.Prefix)+' '+Name;
  1527. end
  1528. else
  1529. st:=Name;
  1530. st2:=st;
  1531. if assigned(S) and ((S^.Flags and sfPointer)<>0) then
  1532. begin
  1533. st:=st+'^';
  1534. if assigned(S^.Ancestor) and
  1535. ((S^.Ancestor^.Flags and sfRecord)<>0) then
  1536. st:=st+'.';
  1537. end
  1538. else if assigned(S) and ((S^.Flags and sfRecord)<>0) then
  1539. st:=st+'.';
  1540. PB:=New(PBrowserWindow, Init(R,
  1541. st2,SearchFreeWindowNo,S,Line,st,
  1542. Symbols,References,Inheritance,MemInfo));
  1543. {$ifndef GABOR}
  1544. if (S^.typ=varsym) or (assigned(ParentBrowser) and ParentBrowser^.IsValid) then
  1545. PB^.IsValid:=true;
  1546. {$endif}
  1547. Desktop^.Insert(PB);
  1548. end;
  1549. END.
  1550. {
  1551. $Log$
  1552. Revision 1.3 2000-11-13 17:37:42 pierre
  1553. merges from fixes branch
  1554. Revision 1.1.2.2 2000/11/13 16:59:09 pierre
  1555. * some function in double removed from fputils unit
  1556. Revision 1.2 2000/10/31 22:35:55 pierre
  1557. * New big merge from fixes branch
  1558. Revision 1.1.2.1 2000/09/27 21:06:11 pierre
  1559. * fix GPF in tbrowserwindow.init
  1560. Revision 1.1 2000/07/13 09:48:36 michael
  1561. + Initial import
  1562. Revision 1.30 2000/07/05 10:19:07 pierre
  1563. + display 'variable' for open array size
  1564. Revision 1.29 2000/06/22 09:07:12 pierre
  1565. * Gabor changes: see fixes.txt
  1566. Revision 1.28 2000/06/16 08:50:42 pierre
  1567. + new bunch of Gabor's changes
  1568. Revision 1.27 2000/05/29 10:44:57 pierre
  1569. + New bunch of Gabor's changes: see fixes.txt
  1570. Revision 1.26 2000/05/02 08:42:28 pierre
  1571. * new set of Gabor changes: see fixes.txt
  1572. Revision 1.25 2000/04/18 11:42:37 pierre
  1573. lot of Gabor changes : see fixes.txt
  1574. Revision 1.24 2000/03/21 23:26:55 pierre
  1575. adapted to wcedit addition
  1576. Revision 1.23 2000/03/15 10:29:03 pierre
  1577. * TGDBValue object
  1578. Revision 1.22 2000/03/08 16:53:21 pierre
  1579. * Value of vars in browsers cleaned up
  1580. Revision 1.21 2000/03/07 21:55:16 pierre
  1581. + Add current value to browser
  1582. Revision 1.20 1999/11/10 00:42:42 pierre
  1583. * LookUp function now returns the complete name in browcol
  1584. and fpsymbol only yakes a part of LoopUpStr
  1585. Revision 1.19 1999/09/16 14:34:59 pierre
  1586. + TBreakpoint and TWatch registering
  1587. + WatchesCollection and BreakpointsCollection stored in desk file
  1588. * Syntax highlighting was broken
  1589. Revision 1.18 1999/07/28 23:11:22 peter
  1590. * fixes from gabor
  1591. Revision 1.17 1999/06/28 12:35:05 pierre
  1592. + CloseAllBrowsers needed before compilation to avoid problems
  1593. + ModulesCollection and GlobalsCollection to avoid memory leaks
  1594. Revision 1.16 1999/06/17 23:44:01 pierre
  1595. * problem with Inheritance list
  1596. Revision 1.15 1999/04/15 08:58:06 peter
  1597. * syntax highlight fixes
  1598. * browser updates
  1599. Revision 1.14 1999/04/07 21:55:53 peter
  1600. + object support for browser
  1601. * html help fixes
  1602. * more desktop saving things
  1603. * NODEBUG directive to exclude debugger
  1604. Revision 1.13 1999/03/16 00:44:44 peter
  1605. * forgotten in last commit :(
  1606. Revision 1.12 1999/03/01 15:42:02 peter
  1607. + Added dummy entries for functions not yet implemented
  1608. * MenuBar didn't update itself automatically on command-set changes
  1609. * Fixed Debugging/Profiling options dialog
  1610. * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
  1611. set
  1612. * efBackSpaceUnindents works correctly
  1613. + 'Messages' window implemented
  1614. + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
  1615. + Added TP message-filter support (for ex. you can call GREP thru
  1616. GREP2MSG and view the result in the messages window - just like in TP)
  1617. * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
  1618. so topic search didn't work...
  1619. * In FPHELP.PAS there were still context-variables defined as word instead
  1620. of THelpCtx
  1621. * StdStatusKeys() was missing from the statusdef for help windows
  1622. + Topic-title for index-table can be specified when adding a HTML-files
  1623. Revision 1.11 1999/02/22 11:51:38 peter
  1624. * browser updates from gabor
  1625. Revision 1.9 1999/02/18 13:44:34 peter
  1626. * search fixed
  1627. + backward search
  1628. * help fixes
  1629. * browser updates
  1630. Revision 1.7 1999/02/16 12:44:20 pierre
  1631. * DoubleClick works now
  1632. Revision 1.6 1999/02/10 09:44:59 pierre
  1633. + added B tab for functions and vars for break/watch
  1634. TBrowserWindow also stores the symbol itself for break/watchpoints
  1635. Revision 1.5 1999/02/04 17:53:47 pierre
  1636. + OpenOneSymbolBrowser
  1637. Revision 1.4 1999/02/04 13:16:14 pierre
  1638. + column info added
  1639. Revision 1.3 1999/01/21 11:54:23 peter
  1640. + tools menu
  1641. + speedsearch in symbolbrowser
  1642. * working run command
  1643. Revision 1.2 1999/01/14 21:42:24 peter
  1644. * source tracking from Gabor
  1645. Revision 1.1 1999/01/12 14:29:40 peter
  1646. + Implemented still missing 'switch' entries in Options menu
  1647. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  1648. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  1649. ASCII chars and inserted directly in the text.
  1650. + Added symbol browser
  1651. * splitted fp.pas to fpide.pas
  1652. Revision 1.0 1999/01/09 11:49:41 gabor
  1653. Original implementation
  1654. }