fpmsrch.inc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Search menu entries
  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. procedure TIDEApp.Objects;
  13. begin
  14. end;
  15. procedure TIDEApp.Globals;
  16. var R: TRect;
  17. S: PSortedSymbolCollection;
  18. Overflow: boolean;
  19. Level : longint;
  20. procedure InsertInS(P: PSymbol); {$ifndef FPC}far;{$endif}
  21. procedure InsertItemsInS(P: PSymbolCollection);
  22. var I: Sw_integer;
  23. begin
  24. for I:=0 to P^.Count-1 do
  25. InsertInS(P^.At(I));
  26. end;
  27. begin
  28. Inc(level);
  29. if S^.Count=MaxCollectionSize then
  30. begin Overflow:=true; Exit; end;
  31. S^.Insert(P);
  32. { this is wrong because it inserted args or locals of proc
  33. in the globals list !! PM}
  34. if (P^.Items<>nil) and (level=1) then
  35. InsertItemsInS(P^.Items);
  36. Dec(level);
  37. end;
  38. begin
  39. level:=0;
  40. if BrowCol.Modules=nil then
  41. begin ErrorBox('No debug info available.',nil); Exit; end;
  42. Overflow:=false;
  43. New(S, Init(500,500));
  44. BrowCol.Modules^.ForEach(@InsertInS);
  45. if Overflow then
  46. WarningBox('Too many symbols. Can''t display all of them.',nil);
  47. Desktop^.GetExtent(R); R.A.X:=R.B.X-35;
  48. Desktop^.Insert(New(PBrowserWindow, Init(R,
  49. 'Browse: Globals',SearchFreeWindowNo,nil,'Global scope',S,nil)));
  50. end;
  51. procedure TIDEApp.Modules;
  52. var
  53. S: PSortedSymbolCollection;
  54. procedure InsertInS(P: PSymbol); {$ifndef FPC}far;{$endif}
  55. begin
  56. S^.Insert(P);
  57. end;
  58. begin
  59. if BrowCol.Modules=nil then
  60. begin ErrorBox('No debug info available.',nil); Exit; end;
  61. New(S, Init(500,500));
  62. BrowCol.Modules^.ForEach(@InsertInS);
  63. OpenSymbolBrowser(0,0,'Units','Global scope',nil,S,nil);
  64. end;
  65. {
  66. $Log$
  67. Revision 1.4 1999-02-10 09:51:03 pierre
  68. * Adapted to TBrowserWindow changes
  69. Revision 1.3 1999/02/04 13:32:08 pierre
  70. * Several things added (I cannot commit them independently !)
  71. + added TBreakpoint and TBreakpointCollection
  72. + added cmResetDebugger,cmGrep,CmToggleBreakpoint
  73. + Breakpoint list in INIFile
  74. * Select items now also depend of SwitchMode
  75. * Reading of option '-g' was not possible !
  76. + added search for -Fu args pathes in TryToOpen
  77. + added code for automatic opening of FileDialog
  78. if source not found
  79. Revision 1.2 1999/01/14 21:42:23 peter
  80. * source tracking from Gabor
  81. Revision 1.1 1999/01/12 14:29:37 peter
  82. + Implemented still missing 'switch' entries in Options menu
  83. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  84. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  85. ASCII chars and inserted directly in the text.
  86. + Added symbol browser
  87. * splitted fp.pas to fpide.pas
  88. Revision 1.9 1999/01/09 18:00:47 peter
  89. Original implementation
  90. }