fpide.pas 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Main IDEApp object
  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. unit fpide;
  13. interface
  14. {$i globdir.inc}
  15. uses
  16. Objects,Drivers,Views,App,Gadgets,MsgBox,
  17. {$ifdef EDITORS}Editors,{$else}WEditor,WCEdit,{$endif}
  18. Comphook,Browcol,
  19. WHTMLScn,
  20. FPViews,FPSymbol,fpstring;
  21. type
  22. TExecType = (exNormal,exNoSwap,exDosShell);
  23. TIDEApp = object(TApplication)
  24. constructor Init;
  25. procedure InitDesktop; virtual;
  26. procedure InitMenuBar; virtual;
  27. procedure InitStatusLine; virtual;
  28. procedure Open(FileName: string);
  29. function OpenSearch(FileName: string) : boolean;
  30. function AskSaveAll: boolean;
  31. function SaveAll: boolean;
  32. function AutoSave: boolean;
  33. procedure Idle; virtual;
  34. procedure Update;
  35. procedure UpdateMode;
  36. procedure UpdateTarget;
  37. procedure GetEvent(var Event: TEvent); virtual;
  38. procedure HandleEvent(var Event: TEvent); virtual;
  39. procedure GetTileRect(var R: TRect); virtual;
  40. function GetPalette: PPalette; virtual;
  41. procedure DosShell; {virtual;}
  42. procedure ShowReadme;
  43. destructor Done; virtual;
  44. procedure ShowUserScreen;
  45. procedure ShowIDEScreen;
  46. function IsClosing : boolean;
  47. private
  48. procedure NewEditor;
  49. procedure NewFromTemplate;
  50. procedure OpenRecentFile(RecentIndex: integer);
  51. procedure ChangeDir;
  52. procedure ShowClipboard;
  53. procedure FindProcedure;
  54. procedure Objects;
  55. procedure Modules;
  56. procedure Globals;
  57. procedure SearchSymbol;
  58. procedure Parameters;
  59. procedure DoStepOver;
  60. procedure DoTraceInto;
  61. procedure DoRun;
  62. procedure DoResetDebugger;
  63. procedure DoContToCursor;
  64. procedure DoContUntilReturn;
  65. procedure Target;
  66. procedure DoCompilerMessages;
  67. procedure DoPrimaryFile;
  68. procedure DoClearPrimary;
  69. procedure DoUserScreenWindow;
  70. procedure DoCloseUserScreenWindow;
  71. procedure DoUserScreen;
  72. procedure DoOpenGDBWindow;
  73. procedure DoToggleBreak;
  74. procedure DoShowCallStack;
  75. procedure DoShowBreakpointList;
  76. procedure DoShowWatches;
  77. procedure DoAddWatch;
  78. procedure DoShowRegisters;
  79. procedure DoShowFPU;
  80. function AskRecompileIfModified:boolean;
  81. procedure DoInformation;
  82. procedure Messages;
  83. procedure Calculator;
  84. procedure DoAsciiTable;
  85. procedure ExecuteTool(Idx: integer);
  86. procedure SetSwitchesMode;
  87. procedure DoCompilerSwitch;
  88. procedure MemorySizes;
  89. procedure DoLinkerSwitch;
  90. procedure DoDebuggerSwitch;
  91. procedure Directories;
  92. procedure Tools;
  93. procedure DoGrep;
  94. procedure Preferences;
  95. procedure EditorOptions(Editor: PEditor);
  96. procedure CodeComplete;
  97. procedure CodeTemplates;
  98. procedure BrowserOptions(Browser: PBrowserWindow);
  99. procedure DesktopOptions;
  100. procedure Mouse;
  101. procedure StartUp;
  102. procedure Colors;
  103. procedure OpenINI;
  104. procedure SaveINI;
  105. procedure SaveAsINI;
  106. procedure CloseAll;
  107. procedure WindowList;
  108. procedure HelpContents;
  109. procedure HelpHelpIndex;
  110. procedure HelpTopicSearch;
  111. procedure HelpPrevTopic;
  112. procedure HelpUsingHelp;
  113. procedure HelpFiles;
  114. procedure About;
  115. procedure CreateAnsiFile;
  116. public
  117. procedure SourceWindowClosed;
  118. private
  119. SaveCancelled: boolean;
  120. InsideDone : boolean;
  121. LastEvent: longint;
  122. function DoExecute(ProgramPath, Params, InFile, OutFile, ErrFile: string; ExecType: TExecType): boolean;
  123. procedure AddRecentFile(AFileName: string; CurX, CurY: integer);
  124. function SearchRecentFile(AFileName: string): integer;
  125. procedure RemoveRecentFile(Index: integer);
  126. procedure CurDirChanged;
  127. procedure UpdatePrimaryFile;
  128. procedure UpdateINIFile;
  129. procedure UpdateRecentFileList;
  130. procedure UpdateTools;
  131. end;
  132. procedure PutEvent(TargetView: PView; E: TEvent);
  133. procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
  134. var
  135. IDEApp: TIDEApp;
  136. implementation
  137. uses
  138. {$ifdef HasSignal}
  139. fpcatch,
  140. {$endif HasSignal}
  141. {$ifdef WinClipSupported}
  142. WinClip,
  143. {$endif WinClipSupported}
  144. {$ifdef Unix}
  145. fpKeys,
  146. {$endif Unix}
  147. FpDpAnsi,WConsts,
  148. Video,Mouse,Keyboard,
  149. Compiler,Version,
  150. {$ifdef FVISION}
  151. FVConsts,
  152. {$else}
  153. Commands,HelpCtx,
  154. {$endif}
  155. Dos,Memory,Menus,Dialogs,StdDlg,
  156. {$ifndef FVISION}
  157. ColorSel,
  158. {$endif FVISION}
  159. Systems,
  160. WUtils,WHlpView,WViews,WHTMLHlp,WHelp,WConsole,
  161. FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompil,FPHelp,
  162. FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
  163. FPDesk,FPCodCmp,FPCodTmp;
  164. type
  165. TTargetedEvent = record
  166. Target: PView;
  167. Event: TEvent;
  168. end;
  169. const
  170. TargetedEventHead : integer = 0;
  171. TargetedEventTail : integer = 0;
  172. var
  173. TargetedEvents : array[0..10] of TTargetedEvent;
  174. function IncTargetedEventPtr(I: integer): integer;
  175. begin
  176. Inc(I);
  177. if I>High(TargetedEvents) then I:=Low(TargetedEvents);
  178. IncTargetedEventPtr:=I;
  179. end;
  180. procedure PutEvent(TargetView: PView; E: TEvent);
  181. begin
  182. if IncTargetedEventPtr(TargetedEventHead)=TargetedEventTail then Exit;
  183. with TargetedEvents[TargetedEventHead] do
  184. begin
  185. Target:=TargetView;
  186. Event:=E;
  187. end;
  188. TargetedEventHead:=IncTargetedEventPtr(TargetedEventHead);
  189. end;
  190. procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
  191. var E: TEvent;
  192. begin
  193. FillChar(E,Sizeof(E),0);
  194. E.What:=What;
  195. E.Command:=Command;
  196. E.InfoPtr:=InfoPtr;
  197. PutEvent(TargetView,E);
  198. end;
  199. function GetTargetedEvent(var P: PView; var E: TEvent): boolean;
  200. var OK: boolean;
  201. begin
  202. OK:=TargetedEventHead<>TargetedEventTail;
  203. if OK then
  204. begin
  205. with TargetedEvents[TargetedEventTail] do
  206. begin
  207. P:=Target;
  208. E:=Event;
  209. end;
  210. TargetedEventTail:=IncTargetedEventPtr(TargetedEventTail);
  211. end;
  212. GetTargetedEvent:=OK;
  213. end;
  214. function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
  215. begin
  216. IDEUseSyntaxHighlight:=(Editor^.FileName='') or MatchesFileList(NameAndExtOf(Editor^.FileName),HighlightExts);
  217. end;
  218. function IDEUseTabsPattern(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
  219. begin
  220. { the commented code lead all new files
  221. to become with TAB use enabled which is wrong in my opinion PM }
  222. IDEUseTabsPattern:={(Editor^.FileName='') or }MatchesFileList(NameAndExtOf(Editor^.FileName),TabsPattern);
  223. end;
  224. constructor TIDEApp.Init;
  225. var R: TRect;
  226. begin
  227. {$ifndef EDITORS}
  228. {$ifdef TP}
  229. UseSyntaxHighlight:=IDEUseSyntaxHighlight;
  230. UseTabsPattern:=IDEUseTabsPattern;
  231. {$else TP}
  232. UseSyntaxHighlight:=@IDEUseSyntaxHighlight;
  233. UseTabsPattern:=@IDEUseTabsPattern;
  234. {$endif TP}
  235. {$endif}
  236. inherited Init;
  237. InitAdvMsgBox;
  238. InsideDone:=false;
  239. MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
  240. New(ClockView, Init(R));
  241. ClockView^.GrowMode:=gfGrowLoX+gfGrowHiX;
  242. Application^.Insert(ClockView);
  243. New(ClipboardWindow, Init);
  244. Desktop^.Insert(ClipboardWindow);
  245. New(CalcWindow, Init); CalcWindow^.Hide;
  246. Desktop^.Insert(CalcWindow);
  247. New(CompilerMessageWindow, Init);
  248. CompilerMessageWindow^.Hide;
  249. Desktop^.Insert(CompilerMessageWindow);
  250. Message(@Self,evBroadcast,cmUpdate,nil);
  251. CurDirChanged;
  252. { heap viewer }
  253. GetExtent(R); Dec(R.B.X); R.A.X:=R.B.X-9; R.A.Y:=R.B.Y-1;
  254. New(HeapView, InitKb(R));
  255. if (StartupOptions and soHeapMonitor)=0 then HeapView^.Hide;
  256. Insert(HeapView);
  257. Drivers.ShowMouse;
  258. {$ifdef win32}
  259. // Win32ShowMouse;
  260. {$endif win32}
  261. end;
  262. procedure TIDEApp.InitDesktop;
  263. var
  264. R: TRect;
  265. begin
  266. GetExtent(R);
  267. Inc(R.A.Y);
  268. Dec(R.B.Y);
  269. Desktop:=New(PFPDesktop, Init(R));
  270. end;
  271. procedure TIDEApp.InitMenuBar;
  272. var R: TRect;
  273. WinPMI : PMenuItem;
  274. begin
  275. GetExtent(R); R.B.Y:=R.A.Y+1;
  276. WinPMI:=nil;
  277. {$ifdef WinClipSupported}
  278. if WinClipboardSupported then
  279. WinPMI:=NewLine(
  280. NewItem(menu_edit_copywin,'', kbNoKey, cmCopyWin, hcCopyWin,
  281. NewItem(menu_edit_pastewin,'', kbNoKey, cmPasteWin, hcPasteWin,
  282. nil)));
  283. {$endif WinClipSupported}
  284. MenuBar:=New(PAdvancedMenuBar, Init(R, NewMenu(
  285. NewSubMenu(menu_file,hcFileMenu, NewMenu(
  286. NewItem(menu_file_new,'',kbNoKey,cmNew,hcNew,
  287. NewItem(menu_file_template,'',kbNoKey,cmNewFromTemplate,hcNewFromTemplate,
  288. NewItem(menu_file_open,menu_key_file_open,kbF3,cmOpen,hcOpen,
  289. NewItem(menu_file_save,menu_key_file_save,kbF2,cmSave,hcSave,
  290. NewItem(menu_file_saveas,'',kbNoKey,cmSaveAs,hcSaveAs,
  291. NewItem(menu_file_saveall,'',kbNoKey,cmSaveAll,hcSaveAll,
  292. NewLine(
  293. NewItem(menu_file_changedir,'',kbNoKey,cmChangeDir,hcChangeDir,
  294. NewItem(menu_file_dosshell,'',kbNoKey,cmDOSShell,hcDOSShell,
  295. NewItem(menu_file_exit,menu_key_file_exit,kbNoKey,cmQuit,hcQuit,
  296. nil))))))))))),
  297. NewSubMenu(menu_edit,hcEditMenu, NewMenu(
  298. NewItem(menu_edit_undo,menu_key_edit_undo, kbAltBack, cmUndo, hcUndo,
  299. NewItem(menu_edit_redo,'', kbNoKey, cmRedo, hcRedo,
  300. {$ifdef DebugUndo}
  301. NewItem('~D~ump Undo','', kbNoKey, cmDumpUndo, hcUndo,
  302. NewItem('U~n~do All','', kbNoKey, cmUndoAll, hcUndo,
  303. NewItem('R~e~do All','', kbNoKey, cmRedoAll, hcRedo,
  304. {$endif DebugUndo}
  305. NewLine(
  306. NewItem(menu_edit_cut,menu_key_edit_cut, kbShiftDel, cmCut, hcCut,
  307. NewItem(menu_edit_copy,menu_key_edit_copy, kbCtrlIns, cmCopy, hcCut,
  308. NewItem(menu_edit_paste,menu_key_edit_paste, kbShiftIns, cmPaste, hcPaste,
  309. NewItem(menu_edit_clear,menu_key_edit_clear, kbCtrlDel, cmClear, hcClear,
  310. NewLine(
  311. NewItem(menu_edit_showclipboard,'', kbNoKey, cmShowClipboard, hcShowClipboard,
  312. WinPMI))))))
  313. {$ifdef DebugUndo}))){$endif DebugUndo}
  314. )))),
  315. NewSubMenu(menu_search,hcSearchMenu, NewMenu(
  316. NewItem(menu_search_find,'', kbNoKey, cmFind, hcFind,
  317. NewItem(menu_search_replace,'', kbNoKey, cmReplace, hcReplace,
  318. NewItem(menu_search_searchagain,'', kbNoKey, cmSearchAgain, hcSearchAgain,
  319. NewLine(
  320. NewItem(menu_search_jumpline,'', kbNoKey, cmJumpLine, hcGotoLine,
  321. NewItem(menu_search_findproc,'', kbNoKey, cmFindProcedure, hcFindProcedure,
  322. NewLine(
  323. NewItem(menu_search_objects,'', kbNoKey, cmObjects, hcObjects,
  324. NewItem(menu_search_modules,'', kbNoKey, cmModules, hcModules,
  325. NewItem(menu_search_globals,'', kbNoKey, cmGlobals, hcGlobals,
  326. NewLine(
  327. NewItem(menu_search_symbol,'', kbNoKey, cmSymbol, hcSymbol,
  328. nil))))))))))))),
  329. NewSubMenu(menu_run,hcRunMenu, NewMenu(
  330. NewItem(menu_run_run,menu_key_run_run, kbCtrlF9, cmRun, hcRun,
  331. NewItem(menu_run_stepover,menu_key_run_stepover, kbF8, cmStepOver, hcRun,
  332. NewItem(menu_run_traceinto,menu_key_run_traceinto, kbF7, cmTraceInto, hcRun,
  333. NewItem(menu_run_conttocursor,menu_key_run_conttocursor, kbF4, cmContToCursor, hcContToCursor,
  334. NewItem(menu_run_untilreturn,'', kbNoKey,cmUntilReturn,hcUntilReturn,
  335. NewItem(menu_run_parameters,'', kbNoKey, cmParameters, hcParameters,
  336. NewItem(menu_run_resetdebugger,menu_key_run_resetdebugger, kbCtrlF2, cmResetDebugger, hcResetDebugger,
  337. nil)))))))),
  338. NewSubMenu(menu_compile,hcCompileMenu, NewMenu(
  339. NewItem(menu_compile_compile,menu_key_compile_compile, kbAltF9, cmCompile, hcCompile,
  340. NewItem(menu_compile_make,menu_key_compile_make, kbF9, cmMake, hcMake,
  341. NewItem(menu_compile_build,'', kbNoKey, cmBuild, hcBuild,
  342. NewLine(
  343. NewItem(menu_compile_target,'', kbNoKey, cmTarget, hcTarget,
  344. NewItem(menu_compile_primaryfile,'', kbNoKey, cmPrimaryFile, hcPrimaryFile,
  345. NewItem(menu_compile_clearprimaryfile,'', kbNoKey, cmClearPrimary, hcClearPrimary,
  346. NewLine(
  347. NewItem(menu_compile_information,'', kbNoKey, cmInformation, hcInformation,
  348. NewItem(menu_compile_compilermessages,menu_key_compile_compilermessages, kbF12, cmCompilerMessages, hcCompilerMessages,
  349. nil))))))))))),
  350. NewSubMenu(menu_debug, hcDebugMenu, NewMenu(
  351. NewItem(menu_debug_output,'', kbNoKey, cmUserScreenWindow, hcUserScreenWindow,
  352. NewItem(menu_debug_userscreen,menu_key_debug_userscreen, kbAltF5, cmUserScreen, hcUserScreen,
  353. NewLine(
  354. NewItem(menu_debug_registers,'', kbNoKey, cmRegisters, hcRegistersWindow,
  355. NewItem(menu_debug_fpu_registers,'', kbNoKey, cmFPURegisters, hcRegistersWindow,
  356. NewItem(menu_debug_addwatch,menu_key_debug_addwatch, kbCtrlF7, cmAddWatch, hcAddWatch,
  357. NewItem(menu_debug_watches,'', kbNoKey, cmWatches, hcWatchesWindow,
  358. NewItem(menu_debug_breakpoint,menu_key_debug_breakpoint, kbCtrlF8, cmToggleBreakpoint, hcToggleBreakpoint,
  359. NewItem(menu_debug_breakpointlist,'', kbNoKey, cmBreakpointList, hcBreakpointList,
  360. NewItem(menu_debug_callstack,menu_key_debug_callstack, kbCtrlF3, cmStack, hcStackWindow,
  361. NewLine(
  362. NewItem(menu_debug_gdbwindow,'', kbNoKey, cmOpenGDBWindow, hcOpenGDBWindow,
  363. nil))))))))))))),
  364. NewSubMenu(menu_tools, hcToolsMenu, NewMenu(
  365. NewItem(menu_tools_messages,menu_key_tools_messages, kbF11, cmToolsMessages, hcToolsMessages,
  366. NewItem(menu_tools_msgnext,menu_key_tools_msgnext, kbAltF8, cmToolsMsgNext, hcToolsMsgNext,
  367. NewItem(menu_tools_msgprev,menu_key_tools_msgprev, kbAltF7, cmToolsMsgPrev, hcToolsMsgPrev,
  368. NewLine(
  369. NewItem(menu_tools_grep,menu_key_tools_grep, kbShiftF2, cmGrep, hcGrep,
  370. NewItem(menu_tools_calculator, '', kbNoKey, cmCalculator, hcCalculator,
  371. {$ifndef FVISION}
  372. NewItem(menu_tools_asciitable, '', kbNoKey, cmAsciiTable, hcAsciiTable,
  373. {$endif}
  374. nil))))))
  375. {$ifndef FVISION}
  376. )
  377. {$endif}
  378. ),
  379. NewSubMenu(menu_options, hcOptionsMenu, NewMenu(
  380. NewItem(menu_options_mode,'', kbNoKey, cmSwitchesMode, hcSwitchesMode,
  381. NewItem(menu_options_compiler,'', kbNoKey, cmCompiler, hcCompiler,
  382. NewItem(menu_options_memory,'', kbNoKey, cmMemorySizes, hcMemorySizes,
  383. NewItem(menu_options_linker,'', kbNoKey, cmLinker, hcLinker,
  384. NewItem(menu_options_debugger,'', kbNoKey, cmDebugger, hcDebugger,
  385. NewItem(menu_options_directories,'', kbNoKey, cmDirectories, hcDirectories,
  386. NewItem(menu_options_browser,'',kbNoKey, cmBrowser, hcBrowser,
  387. NewItem(menu_options_tools,'', kbNoKey, cmTools, hcTools,
  388. NewLine(
  389. NewSubMenu(menu_options_env, hcEnvironmentMenu, NewMenu(
  390. NewItem(menu_options_env_preferences,'', kbNoKey, cmPreferences, hcPreferences,
  391. NewItem(menu_options_env_editor,'', kbNoKey, cmEditor, hcEditor,
  392. NewItem(menu_options_env_codecomplete,'', kbNoKey, cmCodeCompleteOptions, hcCodeCompleteOptions,
  393. NewItem(menu_options_env_codetemplates,'', kbNoKey, cmCodeTemplateOptions, hcCodeTemplateOptions,
  394. NewItem(menu_options_env_desktop,'', kbNoKey, cmDesktopOptions, hcDesktopOptions,
  395. NewItem(menu_options_env_mouse,'', kbNoKey, cmMouse, hcMouse,
  396. NewItem(menu_options_env_startup,'', kbNoKey, cmStartup, hcStartup,
  397. NewItem(menu_options_env_colors,'', kbNoKey, cmColors, hcColors,
  398. {$ifdef Unix}
  399. NewItem(menu_options_learn_keys,'', kbNoKey, cmKeys, hcKeys,
  400. {$endif Unix}
  401. nil{$ifdef Unix}){$endif Unix}))))))))),
  402. NewLine(
  403. NewItem(menu_options_open,'', kbNoKey, cmOpenINI, hcOpenINI,
  404. NewItem(menu_options_save,'', kbNoKey, cmSaveINI, hcSaveINI,
  405. NewItem(menu_options_saveas,'', kbNoKey, cmSaveAsINI, hcSaveAsINI,
  406. nil))))))))))))))),
  407. NewSubMenu(menu_window, hcWindowMenu, NewMenu(
  408. NewItem(menu_window_tile,'', kbNoKey, cmTile, hcTile,
  409. NewItem(menu_window_cascade,'', kbNoKey, cmCascade, hcCascade,
  410. NewItem(menu_window_closeall,'', kbNoKey, cmCloseAll, hcCloseAll,
  411. NewLine(
  412. NewItem(menu_window_resize,menu_key_window_resize, kbCtrlF5, cmResize, hcResize,
  413. NewItem(menu_window_zoom,menu_key_window_zoom, kbF5, cmZoom, hcZoom,
  414. NewItem(menu_window_next,menu_key_window_next, kbF6, cmNext, hcNext,
  415. NewItem(menu_window_previous,menu_key_window_previous, kbShiftF6, cmPrev, hcPrev,
  416. NewItem(menu_window_hide,menu_key_window_hide, kbCtrlF6, cmHide, hcHide,
  417. NewItem(menu_window_close,menu_key_window_close, kbAltF3, cmClose, hcClose,
  418. NewLine(
  419. NewItem(menu_window_list,menu_key_window_list, kbAlt0, cmWindowList, hcWindowList,
  420. NewItem(menu_window_update,'', kbNoKey, cmUpdate, hcUpdate,
  421. nil)))))))))))))),
  422. NewSubMenu(menu_help, hcHelpMenu, NewMenu(
  423. NewItem(menu_help_contents,'', kbNoKey, cmHelpContents, hcHelpContents,
  424. NewItem(menu_help_index,menu_key_help_helpindex, kbShiftF1, cmHelpIndex, hcHelpIndex,
  425. NewItem(menu_help_topicsearch,menu_key_help_topicsearch, kbCtrlF1, cmHelpTopicSearch, hcHelpTopicSearch,
  426. NewItem(menu_help_prevtopic,menu_key_help_prevtopic, kbAltF1, cmHelpPrevTopic, hcHelpPrevTopic,
  427. NewItem(menu_help_using,'',kbNoKey, cmHelpUsingHelp, hcHelpUsingHelp,
  428. NewItem(menu_help_files,'',kbNoKey, cmHelpFiles, hcHelpFiles,
  429. NewLine(
  430. NewItem(menu_help_about,'',kbNoKey, cmAbout, hcAbout,
  431. nil))))))))),
  432. nil)))))))))))));
  433. DisableCommands(EditorCmds+SourceCmds+CompileCmds);
  434. Update;
  435. end;
  436. procedure TIDEApp.InitStatusLine;
  437. var
  438. R: TRect;
  439. begin
  440. GetExtent(R);
  441. R.A.Y := R.B.Y - 1;
  442. StatusLine:=New(PIDEStatusLine, Init(R,
  443. NewStatusDef(hcDragging, hcDragging,
  444. NewStatusKey(status_help, kbF1, cmHelp,
  445. StdStatusKeys(
  446. NewStatusKey('~'#24#25#26#27+'~ Move', kbNoKey, 65535,
  447. NewStatusKey('~Shift+'#24#25#26#27+'~ Size', kbNoKey, 65535,
  448. NewStatusKey('~'#17+'ÄÙ~ Done', kbNoKey, 65535,
  449. NewStatusKey('~Esc~ Cancel', kbNoKey, 65535,
  450. nil)))))),
  451. NewStatusDef(hcStackWindow, hcStackWindow,
  452. NewStatusKey(status_help, kbF1, cmHelp,
  453. NewStatusKey(status_disassemble, kbAltI, cmDisassemble,
  454. NewStatusKey('', kbAltF3, cmClose,
  455. NewStatusKey('', kbF5, cmZoom,
  456. NewStatusKey('', kbCtrlF5, cmResize,
  457. NewStatusKey('', kbF6, cmNext,
  458. NewStatusKey('', kbShiftF6, cmPrev,
  459. nil))))))),
  460. NewStatusDef(hcFirstCommand, hcLastCommand,
  461. NewStatusKey(status_help, kbF1, cmHelp,
  462. NewStatusKey('', kbF10, cmMenu,
  463. NewStatusKey('', kbAltF3, cmClose,
  464. NewStatusKey('', kbF5, cmZoom,
  465. NewStatusKey('', kbCtrlF5, cmResize,
  466. NewStatusKey('', kbF6, cmNext,
  467. NewStatusKey('', kbShiftF6, cmPrev,
  468. nil))))))),
  469. NewStatusDef(hcHelpWindow, hcHelpWindow,
  470. NewStatusKey(status_help_on_help, kbF1, cmHelpUsingHelp,
  471. NewStatusKey(status_help_previoustopic, kbAltF1, cmHelpPrevTopic,
  472. NewStatusKey(status_help_index, kbShiftF1, cmHelpIndex,
  473. NewStatusKey(status_help_close, kbEsc, cmClose,
  474. StdStatusKeys(
  475. nil))))),
  476. NewStatusDef(hcSourceWindow, hcSourceWindow,
  477. NewStatusKey(status_help, kbF1, cmHelp,
  478. NewStatusKey(status_save, kbF2, cmSave,
  479. NewStatusKey(status_open, kbF3, cmOpen,
  480. NewStatusKey(status_compile, kbAltF9, cmCompile,
  481. NewStatusKey(status_make, kbF9, cmMake,
  482. NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
  483. StdStatusKeys(
  484. nil))))))),
  485. NewStatusDef(hcASCIITableWindow, hcASCIITableWindow,
  486. NewStatusKey(status_help, kbF1, cmHelp,
  487. NewStatusKey(status_transferchar, kbCtrlEnter, cmTransfer,
  488. StdStatusKeys(
  489. nil))),
  490. NewStatusDef(hcMessagesWindow, hcMessagesWindow,
  491. NewStatusKey(status_help, kbF1, cmHelp,
  492. NewStatusKey(status_msggotosource, kbEnter, cmMsgGotoSource,
  493. NewStatusKey(status_msgtracksource, kbNoKey, cmMsgTrackSource,
  494. NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
  495. NewStatusKey('', kbEsc, cmClose,
  496. StdStatusKeys(
  497. nil)))))),
  498. NewStatusDef(hcCalcWindow, hcCalcWindow,
  499. NewStatusKey(status_help, kbF1, cmHelp,
  500. NewStatusKey(status_close, kbEsc, cmClose,
  501. NewStatusKey(status_calculatorpaste, kbCtrlEnter, cmCalculatorPaste,
  502. StdStatusKeys(
  503. nil)))),
  504. NewStatusDef(0, $FFFF,
  505. NewStatusKey(status_help, kbF1, cmHelp,
  506. NewStatusKey(status_open, kbF3, cmOpen,
  507. NewStatusKey(status_compile, kbAltF9, cmCompile,
  508. NewStatusKey(status_make, kbF9, cmMake,
  509. NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
  510. StdStatusKeys(
  511. nil)))))),
  512. nil)))))))))));
  513. end;
  514. procedure TIDEApp.Idle;
  515. begin
  516. inherited Idle;
  517. Message(Application,evIdle,0,nil);
  518. GiveUpTimeSlice;
  519. end;
  520. procedure TIDEApp.GetEvent(var Event: TEvent);
  521. var P: PView;
  522. begin
  523. { first of all dispatch queued targeted events }
  524. while GetTargetedEvent(P,Event) do
  525. P^.HandleEvent(Event);
  526. inherited GetEvent(Event);
  527. if (Event.What=evKeyDown) and (Event.KeyCode=kbAltF12) then
  528. begin
  529. CreateAnsiFile;
  530. ClearEvent(Event);
  531. end;
  532. if Event.What<>evNothing then
  533. LastEvent:=GetDosTicks
  534. else
  535. begin
  536. if abs(GetDosTicks-LastEvent)>SleepTimeOut then
  537. GiveUpTimeSlice;
  538. end;
  539. end;
  540. procedure TIDEApp.HandleEvent(var Event: TEvent);
  541. var DontClear: boolean;
  542. TempS: string;
  543. ForceDlg: boolean;
  544. {$ifdef HasSignal}
  545. CtrlCCatched : boolean;
  546. {$endif HasSignal}
  547. begin
  548. {$ifdef HasSignal}
  549. if (Event.What=evKeyDown) and (Event.keyCode=kbCtrlC) and
  550. (CtrlCPressed) then
  551. begin
  552. CtrlCCatched:=true;
  553. {$ifdef DEBUG}
  554. Writeln(stderr,'One CtrlC caught');
  555. {$endif DEBUG}
  556. end
  557. else
  558. CtrlCCatched:=false;
  559. {$endif HasSignal}
  560. case Event.What of
  561. evKeyDown :
  562. begin
  563. DontClear:=true;
  564. { just for debugging purposes }
  565. end;
  566. evCommand :
  567. begin
  568. DontClear:=false;
  569. case Event.Command of
  570. cmUpdate : Message(Application,evBroadcast,cmUpdate,nil);
  571. { -- File menu -- }
  572. cmNew : NewEditor;
  573. cmNewFromTemplate: NewFromTemplate;
  574. cmOpen : begin
  575. ForceDlg:=false;
  576. if (OpenFileName<>'') and
  577. ((DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0)) then
  578. begin
  579. TempS:=LocateSourceFile(OpenFileName,false);
  580. if TempS='' then
  581. ForceDlg:=true
  582. else
  583. OpenFileName:=TempS;
  584. end;
  585. if ForceDlg then
  586. OpenSearch(OpenFileName)
  587. else
  588. Open(OpenFileName);
  589. OpenFileName:='';
  590. end;
  591. cmSaveAll : SaveAll;
  592. cmChangeDir : ChangeDir;
  593. cmDOSShell : DOSShell;
  594. cmRecentFileBase..
  595. cmRecentFileBase+10
  596. : OpenRecentFile(Event.Command-cmRecentFileBase);
  597. { -- Edit menu -- }
  598. cmShowClipboard : ShowClipboard;
  599. { -- Search menu -- }
  600. cmFindProcedure : FindProcedure;
  601. cmObjects : Objects;
  602. cmModules : Modules;
  603. cmGlobals : Globals;
  604. cmSymbol : SearchSymbol;
  605. { -- Run menu -- }
  606. cmParameters : Parameters;
  607. cmStepOver : DoStepOver;
  608. cmTraceInto : DoTraceInto;
  609. cmRun : DoRun;
  610. cmResetDebugger : DoResetDebugger;
  611. cmContToCursor : DoContToCursor;
  612. cmUntilReturn : DoContUntilReturn;
  613. { -- Compile menu -- }
  614. cmCompile : DoCompile(cCompile);
  615. cmBuild : DoCompile(cBuild);
  616. cmMake : DoCompile(cMake);
  617. cmTarget : Target;
  618. cmPrimaryFile : DoPrimaryFile;
  619. cmClearPrimary : DoClearPrimary;
  620. cmInformation : DoInformation;
  621. cmCompilerMessages : DoCompilerMessages;
  622. { -- Debug menu -- }
  623. cmUserScreen : DoUserScreen;
  624. cmToggleBreakpoint : DoToggleBreak;
  625. cmStack : DoShowCallStack;
  626. cmBreakpointList : DoShowBreakpointList;
  627. cmWatches : DoShowWatches;
  628. cmAddWatch : DoAddWatch;
  629. cmOpenGDBWindow : DoOpenGDBWindow;
  630. cmRegisters : DoShowRegisters;
  631. cmFPURegisters : DoShowFPU;
  632. { -- Options menu -- }
  633. cmSwitchesMode : SetSwitchesMode;
  634. cmCompiler : DoCompilerSwitch;
  635. cmMemorySizes : MemorySizes;
  636. cmLinker : DoLinkerSwitch;
  637. cmDebugger : DoDebuggerSwitch;
  638. cmDirectories : Directories;
  639. cmTools : Tools;
  640. cmPreferences : Preferences;
  641. cmEditor : EditorOptions(nil);
  642. cmEditorOptions : EditorOptions(Event.InfoPtr);
  643. cmCodeTemplateOptions: CodeTemplates;
  644. cmCodeCompleteOptions: CodeComplete;
  645. cmBrowser : BrowserOptions(nil);
  646. cmBrowserOptions : BrowserOptions(Event.InfoPtr);
  647. cmMouse : Mouse;
  648. cmStartup : StartUp;
  649. cmDesktopOptions: DesktopOptions;
  650. cmColors : Colors;
  651. {$ifdef Unix}
  652. cmKeys : LearnKeysDialog;
  653. {$endif Unix}
  654. cmOpenINI : OpenINI;
  655. cmSaveINI : SaveINI;
  656. cmSaveAsINI : SaveAsINI;
  657. { -- Tools menu -- }
  658. cmToolsMessages : Messages;
  659. cmCalculator : Calculator;
  660. cmAsciiTable : DoAsciiTable;
  661. cmGrep : DoGrep;
  662. cmToolsBase+1..
  663. cmToolsBase+MaxToolCount
  664. : ExecuteTool(Event.Command-cmToolsBase);
  665. { -- Window menu -- }
  666. cmCloseAll : CloseAll;
  667. cmWindowList : WindowList;
  668. cmUserScreenWindow: DoUserScreenWindow;
  669. { -- Help menu -- }
  670. cmHelp,
  671. cmHelpContents : HelpContents;
  672. cmHelpIndex : HelpHelpIndex;
  673. { cmHelpTopicSearch: HelpTopicSearch;}
  674. cmHelpPrevTopic : HelpPrevTopic;
  675. cmHelpUsingHelp : HelpUsingHelp;
  676. cmHelpFiles : HelpFiles;
  677. cmAbout : About;
  678. cmShowReadme : ShowReadme;
  679. else DontClear:=true;
  680. end;
  681. if DontClear=false then ClearEvent(Event);
  682. end;
  683. evBroadcast :
  684. case Event.Command of
  685. cmSaveCancelled :
  686. SaveCancelled:=true;
  687. cmUpdateTools :
  688. UpdateTools;
  689. cmCommandSetChanged :
  690. UpdateMenu(MenuBar^.Menu);
  691. cmUpdate :
  692. Update;
  693. cmSourceWndClosing :
  694. begin
  695. with PSourceWindow(Event.InfoPtr)^ do
  696. if Editor^.FileName<>'' then
  697. AddRecentFile(Editor^.FileName,Editor^.CurPos.X,Editor^.CurPos.Y);
  698. {$ifndef NODEBUG}
  699. if assigned(Debugger) and (PView(Event.InfoPtr)=Debugger^.LastSource) then
  700. Debugger^.LastSource:=nil;
  701. {$endif}
  702. end;
  703. end;
  704. end;
  705. inherited HandleEvent(Event);
  706. {$ifdef HasSignal}
  707. { Reset flag if CrtlC was handled }
  708. if CtrlCCatched and (Event.What=evNothing) then
  709. begin
  710. CtrlCPressed:=false;
  711. {$ifdef DEBUG}
  712. Writeln(stderr,'One CtrlC handled');
  713. {$endif DEBUG}
  714. end;
  715. {$endif HasSignal}
  716. end;
  717. procedure TIDEApp.GetTileRect(var R: TRect);
  718. begin
  719. Desktop^.GetExtent(R);
  720. { Leave the compiler messages window in the bottom }
  721. if assigned(CompilerMessageWindow) and (CompilerMessageWindow^.GetState(sfVisible)) then
  722. R.B.Y:=Min(CompilerMessageWindow^.Origin.Y,R.B.Y);
  723. { Leave the messages window in the bottom }
  724. if assigned(MessagesWindow) and (MessagesWindow^.GetState(sfVisible)) then
  725. R.B.Y:=Min(MessagesWindow^.Origin.Y,R.B.Y);
  726. { Leave the watch window in the bottom }
  727. if assigned(WatchesWindow) and (WatchesWindow^.GetState(sfVisible)) then
  728. R.B.Y:=Min(WatchesWindow^.Origin.Y,R.B.Y);
  729. end;
  730. {****************************************************************************
  731. Switch Screens
  732. ****************************************************************************}
  733. procedure TIDEApp.ShowUserScreen;
  734. begin
  735. if Assigned(UserScreen) then
  736. UserScreen^.SaveIDEScreen;
  737. DoneSysError;
  738. DoneEvents;
  739. { DoneKeyboard should be called last to
  740. restore the keyboard correctly PM }
  741. {$ifndef go32v2}
  742. DoneScreen;
  743. {$endif ndef go32v2}
  744. DoneKeyboard;
  745. If UseMouse then
  746. DoneMouse
  747. else
  748. ButtonCount:=0;
  749. DoneDosMem;
  750. if Assigned(UserScreen) then
  751. UserScreen^.SwitchToConsoleScreen;
  752. end;
  753. procedure TIDEApp.ShowIDEScreen;
  754. begin
  755. if Assigned(UserScreen) then
  756. UserScreen^.SaveConsoleScreen;
  757. InitDosMem;
  758. InitKeyboard;
  759. If UseMouse then
  760. InitMouse
  761. else
  762. ButtonCount:=0;
  763. {$ifndef go32v2}
  764. InitScreen;
  765. {$endif ndef go32v2}
  766. InitEvents;
  767. InitSysError;
  768. CurDirChanged;
  769. Message(Application,evBroadcast,cmUpdate,nil);
  770. {$ifdef win32}
  771. Win32ShowMouse;
  772. {$endif win32}
  773. if Assigned(UserScreen) then
  774. UserScreen^.SwitchBackToIDEScreen;
  775. {$ifdef Unix}
  776. SetKnownKeys;
  777. {$endif Unix}
  778. {$ifndef go32v2}
  779. UpdateScreen(true);
  780. {$endif go32v2}
  781. end;
  782. function TIDEApp.AutoSave: boolean;
  783. var IOK,SOK,DOK: boolean;
  784. begin
  785. IOK:=true; SOK:=true; DOK:=true;
  786. if (AutoSaveOptions and asEnvironment)<>0 then
  787. begin
  788. IOK:=WriteINIFile(false);
  789. if IOK=false then
  790. ErrorBox(error_saving_cfg_file,nil);
  791. end;
  792. if (AutoSaveOptions and asEditorFiles)<>0 then { was a typo here ("=0") - Gabor }
  793. SOK:=SaveAll;
  794. if (AutoSaveOptions and asDesktop)<>0 then
  795. begin
  796. { destory all help & browser windows - we don't want to store them }
  797. { UserScreenWindow is also not registered PM }
  798. DoCloseUserScreenWindow;
  799. DoneDisassemblyWindow;
  800. CloseHelpWindows;
  801. CloseAllBrowsers;
  802. DOK:=SaveDesktop;
  803. if DOK=false then
  804. ErrorBox(error_saving_dsk_file,nil);
  805. end;
  806. AutoSave:=IOK and SOK and DOK;
  807. end;
  808. function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile,ErrFile: string; ExecType: TExecType): boolean;
  809. var CanRun: boolean;
  810. ConsoleMode : TConsoleMode;
  811. {$ifndef Unix}
  812. PosExe: sw_integer;
  813. {$endif Unix}
  814. begin
  815. SaveCancelled:=false;
  816. CanRun:=AutoSave;
  817. if (CanRun=false) and (SaveCancelled=false) then
  818. CanRun:=true; { do not care about .DSK or .INI saving problems - just like TP }
  819. if CanRun then
  820. begin
  821. if UserScreen=nil then
  822. begin
  823. ErrorBox(error_user_screen_not_avail,nil);
  824. Exit;
  825. end;
  826. if ExecType<>exNoSwap then
  827. ShowUserScreen;
  828. SaveConsoleMode(ConsoleMode);
  829. if ExecType=exDosShell then
  830. WriteShellMsg;
  831. { DO NOT use COMSPEC for exe files as the
  832. ExitCode is lost in those cases PM }
  833. {$ifndef Unix}
  834. posexe:=Pos('.EXE',UpCaseStr(ProgramPath));
  835. { if programpath was three char long => bug }
  836. if (posexe>0) and (posexe=Length(ProgramPath)-3) then
  837. begin
  838. {$endif Unix}
  839. if (InFile='') and (OutFile='') and (ErrFile='') then
  840. DosExecute(ProgramPath,Params)
  841. else
  842. begin
  843. if ErrFile='' then
  844. ErrFile:='stderr';
  845. ExecuteRedir(ProgramPath,Params,InFile,OutFile,ErrFile);
  846. end;
  847. {$ifndef Unix}
  848. end
  849. else if (InFile='') and (OutFile='') and (ErrFile='') then
  850. DosExecute(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params)
  851. else
  852. begin
  853. if ErrFile='' then
  854. ErrFile:='stderr';
  855. ExecuteRedir(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params,
  856. InFile,OutFile,ErrFile);
  857. end;
  858. {$endif Unix}
  859. {$ifdef Unix}
  860. if (DebuggeeTTY='') and (OutFile='') and (ExecType<>exDosShell) then
  861. begin
  862. Write(' Press any key to return to IDE');
  863. InitKeyBoard;
  864. Keyboard.GetKeyEvent;
  865. while (Keyboard.PollKeyEvent<>0) do
  866. Keyboard.GetKeyEvent;
  867. DoneKeyboard;
  868. end;
  869. {$endif}
  870. RestoreConsoleMode(ConsoleMode);
  871. if ExecType<>exNoSwap then
  872. ShowIDEScreen;
  873. end;
  874. DoExecute:=CanRun;
  875. end;
  876. procedure TIDEApp.Update;
  877. begin
  878. SetCmdState([cmSaveAll],IsThereAnyEditor);
  879. SetCmdState([cmCloseAll,cmWindowList],IsThereAnyWindow);
  880. SetCmdState([cmTile,cmCascade],IsThereAnyVisibleWindow);
  881. SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol{,cmInformation}],IsSymbolInfoAvailable);
  882. {$ifndef NODEBUG}
  883. SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
  884. {$endif}
  885. SetCmdState([cmToolsMsgNext,cmToolsMsgPrev],MessagesWindow<>nil);
  886. UpdateTools;
  887. UpdateRecentFileList;
  888. UpdatePrimaryFile;
  889. UpdateINIFile;
  890. Message(Application,evBroadcast,cmCommandSetChanged,nil);
  891. end;
  892. procedure TIDEApp.SourceWindowClosed;
  893. begin
  894. if not IsClosing then
  895. Update;
  896. end;
  897. procedure TIDEApp.CurDirChanged;
  898. begin
  899. Message(Application,evBroadcast,cmUpdateTitle,nil);
  900. UpdatePrimaryFile;
  901. UpdateINIFile;
  902. UpdateMenu(MenuBar^.Menu);
  903. end;
  904. procedure TIDEApp.UpdatePrimaryFile;
  905. begin
  906. SetMenuItemParam(SearchMenuItem(MenuBar^.Menu,cmPrimaryFile),SmartPath(PrimaryFile));
  907. SetCmdState([cmClearPrimary],PrimaryFile<>'');
  908. if PrimaryFile<>'' then
  909. SetCmdState(CompileCmds,true);
  910. UpdateMenu(MenuBar^.Menu);
  911. Message(ProgramInfoWindow,evBroadcast,cmUpdate,nil);
  912. end;
  913. procedure TIDEApp.UpdateINIFile;
  914. begin
  915. SetMenuItemParam(SearchMenuItem(MenuBar^.Menu,cmSaveINI),SmartPath(IniFileName));
  916. end;
  917. procedure TIDEApp.UpdateRecentFileList;
  918. var P: PMenuItem;
  919. {ID,}I: word;
  920. FileMenu: PMenuItem;
  921. begin
  922. { ID:=cmRecentFileBase;}
  923. FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
  924. repeat
  925. { Inc(ID);
  926. P:=SearchMenuItem(FileMenu^.SubMenu,ID);
  927. if FileMenu^.SubMenu^.Default=P then
  928. FileMenu^.SubMenu^.Default:=FileMenu^.SubMenu^.Items;
  929. if P<>nil then RemoveMenuItem(FileMenu^.SubMenu,P);}
  930. P:=GetMenuItemBefore(FileMenu^.SubMenu,nil);
  931. if (P<>nil) then
  932. begin
  933. if (cmRecentFileBase<P^.Command) and (P^.Command<=cmRecentFileBase+MaxRecentFileCount) then
  934. begin
  935. RemoveMenuItem(FileMenu^.SubMenu,P);
  936. if FileMenu^.SubMenu^.Default=P then
  937. FileMenu^.SubMenu^.Default:=FileMenu^.SubMenu^.Items;
  938. end
  939. else
  940. P:=nil;
  941. end;
  942. until P=nil;
  943. P:=GetMenuItemBefore(FileMenu^.SubMenu,nil);
  944. if (P<>nil) and IsSeparator(P) then
  945. RemoveMenuItem(FileMenu^.SubMenu,P);
  946. if RecentFileCount>0 then
  947. AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
  948. for I:=1 to RecentFileCount do
  949. begin
  950. P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
  951. kbNoKey,cmRecentFileBase+I,hcRecentFileBase+I,nil);
  952. AppendMenuItem(FileMenu^.SubMenu,P);
  953. end;
  954. end;
  955. procedure TIDEApp.UpdateTools;
  956. var P: PMenuItem;
  957. { ID,}I: word;
  958. ToolsMenu: PMenuItem;
  959. S1,S2,S3: string;
  960. W: word;
  961. begin
  962. { ID:=cmToolsBase;}
  963. ToolsMenu:=SearchSubMenu(MenuBar^.Menu,menuTools);
  964. repeat
  965. P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
  966. if (P<>nil) then
  967. begin
  968. if (cmToolsBase<P^.Command) and (P^.Command<=cmToolsBase+MaxToolCount) then
  969. begin
  970. RemoveMenuItem(ToolsMenu^.SubMenu,P);
  971. if ToolsMenu^.SubMenu^.Default=P then
  972. ToolsMenu^.SubMenu^.Default:=ToolsMenu^.SubMenu^.Items;
  973. end
  974. else
  975. P:=nil;
  976. end;
  977. until P=nil;
  978. P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
  979. if (P<>nil) and IsSeparator(P) then
  980. RemoveMenuItem(ToolsMenu^.SubMenu,P);
  981. if GetToolCount>0 then
  982. AppendMenuItem(ToolsMenu^.SubMenu,NewLine(nil));
  983. for I:=1 to GetToolCount do
  984. begin
  985. GetToolParams(I-1,S1,S2,S3,W);
  986. P:=NewItem(S1,KillTilde(GetHotKeyName(W)),W,cmToolsBase+I,hcToolsBase+I,nil);
  987. AppendMenuItem(ToolsMenu^.SubMenu,P);
  988. end;
  989. end;
  990. procedure TIDEApp.DosShell;
  991. var
  992. s : string;
  993. begin
  994. {$ifdef Unix}
  995. s:=GetEnv('SHELL');
  996. if s='' then
  997. if ExistsFile('/bin/sh') then
  998. s:='/bin/sh';
  999. {$else}
  1000. s:=GetEnv('COMSPEC');
  1001. if s='' then
  1002. if ExistsFile('c:\command.com') then
  1003. s:='c:\command.com'
  1004. else
  1005. begin
  1006. s:='command.com';
  1007. if Not LocateExeFile(s) then
  1008. s:='';
  1009. end;
  1010. {$endif}
  1011. if s='' then
  1012. ErrorBox(msg_errorexecutingshell,nil)
  1013. else
  1014. DoExecute(s, '', '', '', '', exDosShell);
  1015. { In case we have something that the compiler touched }
  1016. AskToReloadAllModifiedFiles;
  1017. end;
  1018. procedure TIDEApp.ShowReadme;
  1019. var R,R2: TRect;
  1020. D: PCenterDialog;
  1021. M: PFPMemo;
  1022. VSB: PScrollBar;
  1023. S: PBufStream;
  1024. begin
  1025. New(S, Init(ReadmeName, stOpenRead, 4096));
  1026. if S^.Status=stOK then
  1027. begin
  1028. R.Assign(0,0,63,18);
  1029. New(D, Init(R, 'Free Pascal IDE'));
  1030. with D^ do
  1031. begin
  1032. GetExtent(R);
  1033. R.Grow(-2,-2); Inc(R.B.Y);
  1034. R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
  1035. New(VSB, Init(R2)); VSB^.GrowMode:=0; Insert(VSB);
  1036. New(M, Init(R,nil,VSB,nil));
  1037. M^.LoadFromStream(S);
  1038. M^.ReadOnly:=true;
  1039. Insert(M);
  1040. end;
  1041. InsertOK(D);
  1042. ExecuteDialog(D,nil);
  1043. end;
  1044. Dispose(S, Done);
  1045. end;
  1046. {$I FPMFILE.INC}
  1047. {$I FPMEDIT.INC}
  1048. {$I FPMSRCH.INC}
  1049. {$I FPMRUN.INC}
  1050. {$I FPMCOMP.INC}
  1051. {$I FPMDEBUG.INC}
  1052. {$I FPMTOOLS.INC}
  1053. {$I FPMOPTS.INC}
  1054. {$I FPMWND.INC}
  1055. {$I FPMHELP.INC}
  1056. {$I fpmansi.inc}
  1057. procedure TIDEApp.AddRecentFile(AFileName: string; CurX, CurY: integer);
  1058. begin
  1059. if SearchRecentFile(AFileName)<>-1 then Exit;
  1060. if RecentFileCount>0 then
  1061. Move(RecentFiles[1],RecentFiles[2],SizeOf(RecentFiles[1])*Min(RecentFileCount,High(RecentFiles)-1));
  1062. if RecentFileCount<High(RecentFiles) then Inc(RecentFileCount);
  1063. with RecentFiles[1] do
  1064. begin
  1065. FileName:=AFileName;
  1066. LastPos.X:=CurX; LastPos.Y:=CurY;
  1067. end;
  1068. UpdateRecentFileList;
  1069. end;
  1070. function TIDEApp.SearchRecentFile(AFileName: string): integer;
  1071. var Idx,I: integer;
  1072. begin
  1073. Idx:=-1;
  1074. for I:=1 to RecentFileCount do
  1075. if UpcaseStr(AFileName)=UpcaseStr(RecentFiles[I].FileName) then
  1076. begin Idx:=I; Break; end;
  1077. SearchRecentFile:=Idx;
  1078. end;
  1079. procedure TIDEApp.RemoveRecentFile(Index: integer);
  1080. begin
  1081. if Index<RecentFileCount then
  1082. Move(RecentFiles[Index+1],RecentFiles[Index],SizeOf(RecentFiles[1])*(RecentFileCount-Index));
  1083. Dec(RecentFileCount);
  1084. end;
  1085. function TIDEApp.GetPalette: PPalette;
  1086. var P: string;
  1087. begin
  1088. P:=AppPalette;
  1089. GetPalette:=@P;
  1090. end;
  1091. function TIDEApp.IsClosing: Boolean;
  1092. begin
  1093. IsClosing:=InsideDone;
  1094. end;
  1095. destructor TIDEApp.Done;
  1096. begin
  1097. InsideDone:=true;
  1098. inherited Done;
  1099. RemoveBrowsersCollection;
  1100. DoneHelpSystem;
  1101. end;
  1102. END.
  1103. {
  1104. $Log$
  1105. Revision 1.7 2001-11-07 00:28:53 pierre
  1106. + Disassembly window made public
  1107. Revision 1.6 2001/10/24 14:17:27 pierre
  1108. * try to fix the Win2000 mouse problem
  1109. Revision 1.5 2001/10/02 23:56:30 pierre
  1110. * fix bug 1619 by using wconsole unit
  1111. Revision 1.4 2001/10/01 00:24:09 pierre
  1112. * fix several help problems
  1113. Revision 1.3 2001/08/05 12:23:00 peter
  1114. * Automatically support for fvision or old fv
  1115. Revision 1.2 2001/08/05 02:01:47 peter
  1116. * FVISION define to compile with fvision units
  1117. Revision 1.1 2001/08/04 11:30:23 peter
  1118. * ide works now with both compiler versions
  1119. Revision 1.1.2.30 2001/06/14 09:15:48 pierre
  1120. * adapted to new fpusrscr methods
  1121. Revision 1.1.2.29 2001/03/14 17:57:07 pierre
  1122. * fix invisible mouse problem for win32 on win9X
  1123. Revision 1.1.2.28 2001/03/13 16:19:15 pierre
  1124. + syntax highligh in disassembly window
  1125. Revision 1.1.2.27 2001/03/09 15:05:24 pierre
  1126. + Floating point Unit added to Debug menu
  1127. Revision 1.1.2.26 2001/02/19 10:40:50 pierre
  1128. * Check for changed files after Running tool or shell
  1129. Revision 1.1.2.25 2000/12/30 22:52:27 peter
  1130. * check modified while in debug mode. But placed it between a
  1131. conditional again as it reports also if the file was already modified
  1132. before the first compile.
  1133. * remove unsaved file checks when compiling without primary file so it
  1134. works the same as with a primary file set.
  1135. Revision 1.1.2.24 2000/12/20 14:27:48 pierre
  1136. * fp.ini for unix
  1137. Revision 1.1.2.23 2000/12/16 23:29:49 pierre
  1138. + Restore special keys correctly
  1139. Revision 1.1.2.22 2000/12/13 16:59:09 pierre
  1140. * ErrFile filed added to DoExecute method
  1141. Revision 1.1.2.21 2000/12/11 00:46:38 pierre
  1142. * missing uses fpkeys added
  1143. Revision 1.1.2.20 2000/12/11 00:41:42 pierre
  1144. * start of LearnKey dialog implementation
  1145. Revision 1.1.2.19 2000/12/07 16:11:06 pierre
  1146. * fix the wrong terminal settings in unixy shell mode
  1147. Revision 1.1.2.18 2000/11/29 11:26:00 pierre
  1148. + TFPDlgWindow that handles cmSearchWindow
  1149. Revision 1.1.2.17 2000/11/29 00:54:44 pierre
  1150. + preserve window number and save special windows
  1151. Revision 1.1.2.16 2000/11/27 12:05:41 pierre
  1152. Dump Ansi released
  1153. Revision 1.1.2.15 2000/11/23 16:33:30 pierre
  1154. * fix Alt-X problem and set HelpCtx for most dialogs
  1155. Revision 1.1.2.14 2000/11/21 17:43:23 pierre
  1156. + first version of dump ansi file
  1157. Revision 1.1.2.13 2000/11/19 00:23:33 pierre
  1158. Task 23: nicer error message when trying to run unit or library
  1159. Revision 1.1.2.12 2000/11/14 09:23:55 marco
  1160. * Second batch
  1161. Revision 1.1.2.11 2000/10/18 21:53:27 pierre
  1162. * several Gabor fixes
  1163. Revision 1.1.2.10 2000/10/09 16:28:25 pierre
  1164. * several linux enhancements
  1165. Revision 1.1.2.9 2000/10/04 13:30:50 pierre
  1166. * DosShell for linux
  1167. Revision 1.1.2.8 2000/09/22 15:19:04 jonas
  1168. * Linux now also uses the DosExecute and ExecuteRedir procedures
  1169. Revision 1.1.2.7 2000/08/21 12:10:19 jonas
  1170. * fixed errors in my previous commit, it now works properly
  1171. Revision 1.1.2.5 2000/08/16 18:46:14 peter
  1172. [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
  1173. [*] Make, Build now possible even in Compiler Messages Window
  1174. [+] when started in a new dir the IDE now ask whether to create a local
  1175. config, or to use the one located in the IDE dir
  1176. Revision 1.1.2.4 2000/08/15 03:40:53 peter
  1177. [*] no more fatal exits when the IDE can't find the error file (containing
  1178. the redirected assembler/linker output) after compilation
  1179. [*] hidden windows are now added always at the end of the Window List
  1180. [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
  1181. [*] selection was incorrectly adjusted when typing in overwrite mode
  1182. [*] the line wasn't expanded when it's end was reached in overw. mode
  1183. [*] the IDE now tries to locate source files also in the user specified
  1184. unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
  1185. [*] 'Open at cursor' is now aware of the extension (if specified)
  1186. Revision 1.1.2.3 2000/08/10 07:10:37 michael
  1187. * 'Auto save editor files' option did the opposite than expected, due
  1188. to a typo in FPIDE.PAS
  1189. + saving of source files before compilation is no longer neccessary.
  1190. When a modified editor file is involved in the compilation, then the
  1191. IDE saves it's contents to a memory stream and passes this to the
  1192. compiler (instead of the file on the disk)
  1193. Revision 1.1.2.2 2000/08/04 14:05:18 michael
  1194. * Fixes from Gabor:
  1195. [*] the IDE now doesn't disable Compile|Make & Build when all windows
  1196. are closed, but there's still a primary file set
  1197. (set bug 1059 to fixed!)
  1198. [*] the IDE didn't read some compiler options correctly back from the
  1199. FP.CFG file, for ex. the linker options. Now it read everything
  1200. correctly, and also automatically handles smartlinking option synch-
  1201. ronization.
  1202. (set bug 1048 to fixed!)
  1203. Revision 1.1.2.1 2000/07/18 05:50:22 michael
  1204. + Merged Gabors fixes
  1205. Revision 1.1 2000/07/13 09:48:34 michael
  1206. + Initial import
  1207. Revision 1.65 2000/06/22 09:07:12 pierre
  1208. * Gabor changes: see fixes.txt
  1209. Revision 1.64 2000/06/16 21:19:41 pierre
  1210. * Use Open instead of OpenSearch if OpenFileName is empty
  1211. Revision 1.63 2000/06/16 08:50:40 pierre
  1212. + new bunch of Gabor's changes
  1213. Revision 1.62 2000/06/11 07:01:33 peter
  1214. * give watches window also a number
  1215. * leave watches window in the bottom when cascading windows
  1216. Revision 1.61 2000/05/17 09:51:11 pierre
  1217. Disable/Enable keyboard on UserScreen
  1218. Revision 1.60 2000/05/02 10:20:40 pierre
  1219. * fix a small problem when deciding to call DosExecute directly
  1220. Revision 1.59 2000/05/02 08:42:27 pierre
  1221. * new set of Gabor changes: see fixes.txt
  1222. Revision 1.58 2000/04/25 08:42:33 pierre
  1223. * New Gabor changes : see fixes.txt
  1224. Revision 1.57 2000/04/18 11:42:37 pierre
  1225. lot of Gabor changes : see fixes.txt
  1226. Revision 1.56 2000/03/21 23:30:49 pierre
  1227. adapted to wcedit addition by Gabor
  1228. Revision 1.55 2000/03/13 20:41:35 pierre
  1229. + option -S to disable the mouse
  1230. * adapted to changes in fpusrscr for DOS
  1231. Revision 1.54 2000/03/07 21:57:59 pierre
  1232. + CtrlC handling
  1233. + UpdateMode method
  1234. Revision 1.53 2000/03/06 11:31:30 pierre
  1235. * Do not use COMSPEC to Run files with .EXE suffix
  1236. because Command.com at least does not return the errorcode
  1237. of the program called
  1238. Revision 1.52 2000/02/07 12:02:32 pierre
  1239. Gabor's changes
  1240. Revision 1.51 2000/01/23 21:25:17 florian
  1241. + start of internationalization support
  1242. Revision 1.50 2000/01/08 18:26:20 florian
  1243. + added a register window, doesn't work yet
  1244. Revision 1.49 2000/01/05 00:31:50 pierre
  1245. * avoid new files to use TABS
  1246. Revision 1.48 2000/01/03 11:38:33 michael
  1247. Changes from Gabor
  1248. Revision 1.47 1999/12/20 14:23:17 pierre
  1249. * MyApp renamed IDEApp
  1250. * TDebugController.ResetDebuggerRows added to
  1251. get resetting of debugger rows
  1252. Revision 1.46 1999/12/17 15:07:01 florian
  1253. + TIDEApp.Idle does always call GiveUpTimeSlice
  1254. Revision 1.45 1999/12/10 13:02:05 pierre
  1255. + VideoMode save/restore
  1256. Revision 1.44 1999/11/25 00:26:49 pierre
  1257. * RecentFiles missed the last char
  1258. Revision 1.43 1999/11/10 17:19:06 pierre
  1259. * Use DosExecute from Fpredir unit
  1260. Revision 1.42 1999/10/27 12:10:42 pierre
  1261. + With DebugUndo added 3 menu items
  1262. "Dump Undo" "Undo All" and "Redo All"
  1263. for Undo checks
  1264. Revision 1.41 1999/09/22 16:21:41 pierre
  1265. * Use ShrinkPas for RecentFiles
  1266. Revision 1.40 1999/09/22 13:04:31 pierre
  1267. + Close UserScreen to avoid store crash
  1268. Revision 1.39 1999/09/21 17:09:00 pierre
  1269. + Windows clipboard for win32
  1270. Revision 1.38 1999/09/13 16:24:43 peter
  1271. + clock
  1272. * backspace unident like tp7
  1273. Revision 1.37 1999/09/13 11:44:00 peter
  1274. * fixes from gabor, idle event, html fix
  1275. Revision 1.36 1999/09/09 14:15:27 pierre
  1276. + cmCopyWin,cmPasteWin
  1277. Revision 1.35 1999/08/16 18:25:19 peter
  1278. * Adjusting the selection when the editor didn't contain any line.
  1279. * Reserved word recognition redesigned, but this didn't affect the overall
  1280. syntax highlight speed remarkably (at least not on my Amd-K6/350).
  1281. The syntax scanner loop is a bit slow but the main problem is the
  1282. recognition of special symbols. Switching off symbol processing boosts
  1283. the performance up to ca. 200%...
  1284. * The editor didn't allow copying (for ex to clipboard) of a single character
  1285. * 'File|Save as' caused permanently run-time error 3. Not any more now...
  1286. * Compiler Messages window (actually the whole desktop) did not act on any
  1287. keypress when compilation failed and thus the window remained visible
  1288. + Message windows are now closed upon pressing Esc
  1289. + At 'Run' the IDE checks whether any sources are modified, and recompiles
  1290. only when neccessary
  1291. + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
  1292. + LineSelect (Ctrl+K+L) implemented
  1293. * The IDE had problems closing help windows before saving the desktop
  1294. Revision 1.34 1999/08/03 20:22:32 peter
  1295. + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
  1296. + Desktop saving should work now
  1297. - History saved
  1298. - Clipboard content saved
  1299. - Desktop saved
  1300. - Symbol info saved
  1301. * syntax-highlight bug fixed, which compared special keywords case sensitive
  1302. (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
  1303. * with 'whole words only' set, the editor didn't found occourences of the
  1304. searched text, if the text appeared previously in the same line, but didn't
  1305. satisfied the 'whole-word' condition
  1306. * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
  1307. (ie. the beginning of the selection)
  1308. * when started typing in a new line, but not at the start (X=0) of it,
  1309. the editor inserted the text one character more to left as it should...
  1310. * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
  1311. * Shift shouldn't cause so much trouble in TCodeEditor now...
  1312. * Syntax highlight had problems recognizing a special symbol if it was
  1313. prefixed by another symbol character in the source text
  1314. * Auto-save also occours at Dos shell, Tool execution, etc. now...
  1315. Revision 1.33 1999/07/12 13:14:18 pierre
  1316. * LineEnd bug corrected, now goes end of text even if selected
  1317. + Until Return for debugger
  1318. + Code for Quit inside GDB Window
  1319. Revision 1.32 1999/07/10 01:24:17 pierre
  1320. + First implementation of watches window
  1321. Revision 1.31 1999/06/29 22:50:14 peter
  1322. * more fixes from gabor
  1323. Revision 1.30 1999/06/28 19:32:20 peter
  1324. * fixes from gabor
  1325. Revision 1.29 1999/06/28 12:40:19 pierre
  1326. + RemoveBrowsersCollection in TIDEApp.Done
  1327. Revision 1.28 1999/06/25 00:46:33 pierre
  1328. + UpdateTarget to show current target
  1329. + SearchSymbol, not scope aware (this will need a PPU change !)
  1330. Revision 1.27 1999/05/22 13:44:30 peter
  1331. * fixed couple of bugs
  1332. Revision 1.26 1999/04/07 21:55:47 peter
  1333. + object support for browser
  1334. * html help fixes
  1335. * more desktop saving things
  1336. * NODEBUG directive to exclude debugger
  1337. Revision 1.25 1999/03/23 15:11:29 peter
  1338. * desktop saving things
  1339. * vesa mode
  1340. * preferences dialog
  1341. Revision 1.24 1999/03/19 16:04:29 peter
  1342. * new compiler dialog
  1343. Revision 1.23 1999/03/16 12:38:10 peter
  1344. * tools macro fixes
  1345. + tph writer
  1346. + first things for resource files
  1347. Revision 1.22 1999/03/12 01:13:57 peter
  1348. * flag if trytoopen should look for other extensions
  1349. + browser tab in the tools-compiler
  1350. Revision 1.21 1999/03/02 13:48:29 peter
  1351. * fixed far problem is fpdebug
  1352. * tile/cascading with message window
  1353. * grep fixes
  1354. Revision 1.20 1999/03/01 15:41:54 peter
  1355. + Added dummy entries for functions not yet implemented
  1356. * MenuBar didn't update itself automatically on command-set changes
  1357. * Fixed Debugging/Profiling options dialog
  1358. * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
  1359. set
  1360. * efBackSpaceUnindents works correctly
  1361. + 'Messages' window implemented
  1362. + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
  1363. + Added TP message-filter support (for ex. you can call GREP thru
  1364. GREP2MSG and view the result in the messages window - just like in TP)
  1365. * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
  1366. so topic search didn't work...
  1367. * In FPHELP.PAS there were still context-variables defined as word instead
  1368. of THelpCtx
  1369. * StdStatusKeys() was missing from the statusdef for help windows
  1370. + Topic-title for index-table can be specified when adding a HTML-files
  1371. Revision 1.19 1999/02/22 11:51:36 peter
  1372. * browser updates from gabor
  1373. Revision 1.18 1999/02/22 02:15:13 peter
  1374. + default extension for save in the editor
  1375. + Separate Text to Find for the grep dialog
  1376. * fixed redir crash with tp7
  1377. Revision 1.17 1999/02/20 15:18:30 peter
  1378. + ctrl-c capture with confirm dialog
  1379. + ascii table in the tools menu
  1380. + heapviewer
  1381. * empty file fixed
  1382. * fixed callback routines in fpdebug to have far for tp7
  1383. Revision 1.16 1999/02/18 13:44:31 peter
  1384. * search fixed
  1385. + backward search
  1386. * help fixes
  1387. * browser updates
  1388. Revision 1.15 1999/02/16 10:43:55 peter
  1389. * use -dGDB for the compiler
  1390. * only use gdb_file when -dDEBUG is used
  1391. * profiler switch is now a toggle instead of radiobutton
  1392. Revision 1.14 1999/02/11 19:07:22 pierre
  1393. * GDBWindow redesigned :
  1394. normal editor apart from
  1395. that any kbEnter will send the line (for begin to cursor)
  1396. to GDB command !
  1397. GDBWindow opened in Debugger Menu
  1398. still buggy :
  1399. -echo should not be present if at end of text
  1400. -GDBWindow becomes First after each step (I don't know why !)
  1401. Revision 1.13 1999/02/10 09:54:11 pierre
  1402. * cmSourceWindowClosing resets Debugger LastSource field to avoid problems
  1403. Revision 1.12 1999/02/08 17:43:44 pierre
  1404. * RestDebugger or multiple running of debugged program now works
  1405. + added DoContToCursor(F4)
  1406. * Breakpoints are now inserted correctly (was mainlyy a problem
  1407. of directories)
  1408. Revision 1.11 1999/02/08 10:37:44 peter
  1409. + html helpviewer
  1410. Revision 1.7 1999/02/04 13:32:03 pierre
  1411. * Several things added (I cannot commit them independently !)
  1412. + added TBreakpoint and TBreakpointCollection
  1413. + added cmResetDebugger,cmGrep,CmToggleBreakpoint
  1414. + Breakpoint list in INIFile
  1415. * Select items now also depend of SwitchMode
  1416. * Reading of option '-g' was not possible !
  1417. + added search for -Fu args pathes in TryToOpen
  1418. + added code for automatic opening of FileDialog
  1419. if source not found
  1420. Revision 1.6 1999/02/02 16:41:39 peter
  1421. + automatic .pas/.pp adding by opening of file
  1422. * better debuggerscreen changes
  1423. Revision 1.5 1999/01/22 18:13:22 pierre
  1424. * DoneScreen Removed I did not find any such proc ??
  1425. Revision 1.4 1999/01/22 10:24:03 peter
  1426. * first debugger things
  1427. Revision 1.3 1999/01/21 11:54:14 peter
  1428. + tools menu
  1429. + speedsearch in symbolbrowser
  1430. * working run command
  1431. Revision 1.2 1999/01/14 21:42:20 peter
  1432. * source tracking from Gabor
  1433. Revision 1.1 1999/01/12 14:29:34 peter
  1434. + Implemented still missing 'switch' entries in Options menu
  1435. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  1436. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  1437. ASCII chars and inserted directly in the text.
  1438. + Added symbol browser
  1439. * splitted fp.pas to fpide.pas
  1440. Revision 1.4 1999/01/04 11:49:41 peter
  1441. * 'Use tab characters' now works correctly
  1442. + Syntax highlight now acts on File|Save As...
  1443. + Added a new class to syntax highlight: 'hex numbers'.
  1444. * There was something very wrong with the palette managment. Now fixed.
  1445. + Added output directory (-FE<xxx>) support to 'Directories' dialog...
  1446. * Fixed some possible bugs in Running/Compiling, and the compilation/run
  1447. process revised
  1448. Revision 1.2 1998/12/28 15:47:40 peter
  1449. + Added user screen support, display & window
  1450. + Implemented Editor,Mouse Options dialog
  1451. + Added location of .INI and .CFG file
  1452. + Option (INI) file managment implemented (see bottom of Options Menu)
  1453. + Switches updated
  1454. + Run program
  1455. Revision 1.3 1998/12/22 10:39:38 peter
  1456. + options are now written/read
  1457. + find and replace routines
  1458. }