fpsymbol.pas 53 KB

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