fpide.pas 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648
  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. StdStatusKeys(
  455. nil))),
  456. NewStatusDef(hcFirstCommand, hcLastNormalCommand,
  457. NewStatusKey(status_help, kbF1, cmHelp,
  458. StdStatusKeys(
  459. nil)),
  460. NewStatusDef(hcFirstNoAltXCommand, 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. (
  485. nil))))))),
  486. NewStatusDef(hcASCIITableWindow, hcASCIITableWindow,
  487. NewStatusKey(status_help, kbF1, cmHelp,
  488. NewStatusKey(status_transferchar, kbCtrlEnter, cmTransfer,
  489. StdStatusKeys(
  490. nil))),
  491. NewStatusDef(hcMessagesWindow, hcMessagesWindow,
  492. NewStatusKey(status_help, kbF1, cmHelp,
  493. NewStatusKey(status_msggotosource, kbEnter, cmMsgGotoSource,
  494. NewStatusKey(status_msgtracksource, kbNoKey, cmMsgTrackSource,
  495. NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
  496. NewStatusKey('', kbEsc, cmClose,
  497. StdStatusKeys(
  498. nil)))))),
  499. NewStatusDef(hcCalcWindow, hcCalcWindow,
  500. NewStatusKey(status_help, kbF1, cmHelp,
  501. NewStatusKey(status_close, kbEsc, cmClose,
  502. NewStatusKey(status_calculatorpaste, kbCtrlEnter, cmCalculatorPaste,
  503. StdStatusKeys(
  504. nil)))),
  505. NewStatusDef(0, $FFFF,
  506. NewStatusKey(status_help, kbF1, cmHelp,
  507. NewStatusKey(status_open, kbF3, cmOpen,
  508. NewStatusKey(status_compile, kbAltF9, cmCompile,
  509. NewStatusKey(status_make, kbF9, cmMake,
  510. NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
  511. StdStatusKeys(
  512. nil)))))),
  513. nil))))))))))));
  514. end;
  515. procedure TIDEApp.Idle;
  516. begin
  517. inherited Idle;
  518. Message(Application,evIdle,0,nil);
  519. GiveUpTimeSlice;
  520. end;
  521. procedure TIDEApp.GetEvent(var Event: TEvent);
  522. var P: PView;
  523. begin
  524. { first of all dispatch queued targeted events }
  525. while GetTargetedEvent(P,Event) do
  526. P^.HandleEvent(Event);
  527. inherited GetEvent(Event);
  528. {$ifdef DEBUG}
  529. if (Event.What=evKeyDown) and (Event.KeyCode=kbAltF11) then
  530. begin
  531. Generate_SIGSEGV;
  532. end;
  533. {$endif DEBUG}
  534. if (Event.What=evKeyDown) and (Event.KeyCode=kbAltF12) then
  535. begin
  536. CreateAnsiFile;
  537. ClearEvent(Event);
  538. end;
  539. if Event.What<>evNothing then
  540. LastEvent:=GetDosTicks
  541. else
  542. begin
  543. if abs(GetDosTicks-LastEvent)>SleepTimeOut then
  544. GiveUpTimeSlice;
  545. end;
  546. end;
  547. procedure TIDEApp.HandleEvent(var Event: TEvent);
  548. var DontClear: boolean;
  549. TempS: string;
  550. ForceDlg: boolean;
  551. {$ifdef HasSignal}
  552. CtrlCCatched : boolean;
  553. {$endif HasSignal}
  554. begin
  555. {$ifdef HasSignal}
  556. if (Event.What=evKeyDown) and (Event.keyCode=kbCtrlC) and
  557. (CtrlCPressed) then
  558. begin
  559. CtrlCCatched:=true;
  560. {$ifdef DEBUG}
  561. Writeln(stderr,'One CtrlC caught');
  562. {$endif DEBUG}
  563. end
  564. else
  565. CtrlCCatched:=false;
  566. {$endif HasSignal}
  567. case Event.What of
  568. evKeyDown :
  569. begin
  570. DontClear:=true;
  571. { just for debugging purposes }
  572. end;
  573. evCommand :
  574. begin
  575. DontClear:=false;
  576. case Event.Command of
  577. cmUpdate : Message(Application,evBroadcast,cmUpdate,nil);
  578. { -- File menu -- }
  579. cmNew : NewEditor;
  580. cmNewFromTemplate: NewFromTemplate;
  581. cmOpen : begin
  582. ForceDlg:=false;
  583. if (OpenFileName<>'') and
  584. ((DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0)) then
  585. begin
  586. TempS:=LocateSourceFile(OpenFileName,false);
  587. if TempS='' then
  588. ForceDlg:=true
  589. else
  590. OpenFileName:=TempS;
  591. end;
  592. if ForceDlg then
  593. OpenSearch(OpenFileName)
  594. else
  595. Open(OpenFileName);
  596. OpenFileName:='';
  597. end;
  598. cmSaveAll : SaveAll;
  599. cmChangeDir : ChangeDir;
  600. cmDOSShell : DOSShell;
  601. cmRecentFileBase..
  602. cmRecentFileBase+10
  603. : OpenRecentFile(Event.Command-cmRecentFileBase);
  604. { -- Edit menu -- }
  605. cmShowClipboard : ShowClipboard;
  606. { -- Search menu -- }
  607. cmFindProcedure : FindProcedure;
  608. cmObjects : Objects;
  609. cmModules : Modules;
  610. cmGlobals : Globals;
  611. cmSymbol : SearchSymbol;
  612. { -- Run menu -- }
  613. cmParameters : Parameters;
  614. cmStepOver : DoStepOver;
  615. cmTraceInto : DoTraceInto;
  616. cmRun : DoRun;
  617. cmResetDebugger : DoResetDebugger;
  618. cmContToCursor : DoContToCursor;
  619. cmUntilReturn : DoContUntilReturn;
  620. { -- Compile menu -- }
  621. cmCompile : DoCompile(cCompile);
  622. cmBuild : DoCompile(cBuild);
  623. cmMake : DoCompile(cMake);
  624. cmTarget : Target;
  625. cmPrimaryFile : DoPrimaryFile;
  626. cmClearPrimary : DoClearPrimary;
  627. cmInformation : DoInformation;
  628. cmCompilerMessages : DoCompilerMessages;
  629. { -- Debug menu -- }
  630. cmUserScreen : DoUserScreen;
  631. cmToggleBreakpoint : DoToggleBreak;
  632. cmStack : DoShowCallStack;
  633. cmBreakpointList : DoShowBreakpointList;
  634. cmWatches : DoShowWatches;
  635. cmAddWatch : DoAddWatch;
  636. cmOpenGDBWindow : DoOpenGDBWindow;
  637. cmRegisters : DoShowRegisters;
  638. cmFPURegisters : DoShowFPU;
  639. { -- Options menu -- }
  640. cmSwitchesMode : SetSwitchesMode;
  641. cmCompiler : DoCompilerSwitch;
  642. cmMemorySizes : MemorySizes;
  643. cmLinker : DoLinkerSwitch;
  644. cmDebugger : DoDebuggerSwitch;
  645. cmDirectories : Directories;
  646. cmTools : Tools;
  647. cmPreferences : Preferences;
  648. cmEditor : EditorOptions(nil);
  649. cmEditorOptions : EditorOptions(Event.InfoPtr);
  650. cmCodeTemplateOptions: CodeTemplates;
  651. cmCodeCompleteOptions: CodeComplete;
  652. cmBrowser : BrowserOptions(nil);
  653. cmBrowserOptions : BrowserOptions(Event.InfoPtr);
  654. cmMouse : Mouse;
  655. cmStartup : StartUp;
  656. cmDesktopOptions: DesktopOptions;
  657. cmColors : Colors;
  658. {$ifdef Unix}
  659. cmKeys : LearnKeysDialog;
  660. {$endif Unix}
  661. cmOpenINI : OpenINI;
  662. cmSaveINI : SaveINI;
  663. cmSaveAsINI : SaveAsINI;
  664. { -- Tools menu -- }
  665. cmToolsMessages : Messages;
  666. cmCalculator : Calculator;
  667. cmAsciiTable : DoAsciiTable;
  668. cmGrep : DoGrep;
  669. cmToolsBase+1..
  670. cmToolsBase+MaxToolCount
  671. : ExecuteTool(Event.Command-cmToolsBase);
  672. { -- Window menu -- }
  673. cmCloseAll : CloseAll;
  674. cmWindowList : WindowList;
  675. cmUserScreenWindow: DoUserScreenWindow;
  676. { -- Help menu -- }
  677. cmHelp,
  678. cmHelpContents : HelpContents;
  679. cmHelpIndex : HelpHelpIndex;
  680. { cmHelpTopicSearch: HelpTopicSearch;}
  681. cmHelpPrevTopic : HelpPrevTopic;
  682. cmHelpUsingHelp : HelpUsingHelp;
  683. cmHelpFiles : HelpFiles;
  684. cmAbout : About;
  685. cmShowReadme : ShowReadme;
  686. else DontClear:=true;
  687. end;
  688. if DontClear=false then ClearEvent(Event);
  689. end;
  690. evBroadcast :
  691. case Event.Command of
  692. cmSaveCancelled :
  693. SaveCancelled:=true;
  694. cmUpdateTools :
  695. UpdateTools;
  696. cmCommandSetChanged :
  697. UpdateMenu(MenuBar^.Menu);
  698. cmUpdate :
  699. Update;
  700. cmSourceWndClosing :
  701. begin
  702. with PSourceWindow(Event.InfoPtr)^ do
  703. if Editor^.FileName<>'' then
  704. AddRecentFile(Editor^.FileName,Editor^.CurPos.X,Editor^.CurPos.Y);
  705. {$ifndef NODEBUG}
  706. if assigned(Debugger) and (PView(Event.InfoPtr)=Debugger^.LastSource) then
  707. Debugger^.LastSource:=nil;
  708. {$endif}
  709. end;
  710. end;
  711. end;
  712. inherited HandleEvent(Event);
  713. {$ifdef HasSignal}
  714. { Reset flag if CrtlC was handled }
  715. if CtrlCCatched and (Event.What=evNothing) then
  716. begin
  717. CtrlCPressed:=false;
  718. {$ifdef DEBUG}
  719. Writeln(stderr,'One CtrlC handled');
  720. {$endif DEBUG}
  721. end;
  722. {$endif HasSignal}
  723. end;
  724. procedure TIDEApp.GetTileRect(var R: TRect);
  725. begin
  726. Desktop^.GetExtent(R);
  727. { Leave the compiler messages window in the bottom }
  728. if assigned(CompilerMessageWindow) and (CompilerMessageWindow^.GetState(sfVisible)) then
  729. R.B.Y:=Min(CompilerMessageWindow^.Origin.Y,R.B.Y);
  730. { Leave the messages window in the bottom }
  731. if assigned(MessagesWindow) and (MessagesWindow^.GetState(sfVisible)) then
  732. R.B.Y:=Min(MessagesWindow^.Origin.Y,R.B.Y);
  733. { Leave the watch window in the bottom }
  734. if assigned(WatchesWindow) and (WatchesWindow^.GetState(sfVisible)) then
  735. R.B.Y:=Min(WatchesWindow^.Origin.Y,R.B.Y);
  736. end;
  737. {****************************************************************************
  738. Switch Screens
  739. ****************************************************************************}
  740. procedure TIDEApp.ShowUserScreen;
  741. begin
  742. if Assigned(UserScreen) then
  743. UserScreen^.SaveIDEScreen;
  744. DoneSysError;
  745. DoneEvents;
  746. { DoneKeyboard should be called last to
  747. restore the keyboard correctly PM }
  748. {$ifndef go32v2}
  749. DoneScreen;
  750. {$endif ndef go32v2}
  751. DoneKeyboard;
  752. If UseMouse then
  753. DoneMouse
  754. else
  755. ButtonCount:=0;
  756. DoneDosMem;
  757. if Assigned(UserScreen) then
  758. UserScreen^.SwitchToConsoleScreen;
  759. end;
  760. procedure TIDEApp.ShowIDEScreen;
  761. begin
  762. if Assigned(UserScreen) then
  763. UserScreen^.SaveConsoleScreen;
  764. InitDosMem;
  765. InitKeyboard;
  766. If UseMouse then
  767. InitMouse
  768. else
  769. ButtonCount:=0;
  770. {$ifndef go32v2}
  771. InitScreen;
  772. {$endif ndef go32v2}
  773. InitEvents;
  774. InitSysError;
  775. CurDirChanged;
  776. Message(Application,evBroadcast,cmUpdate,nil);
  777. {$ifdef win32}
  778. Win32ShowMouse;
  779. {$endif win32}
  780. if Assigned(UserScreen) then
  781. UserScreen^.SwitchBackToIDEScreen;
  782. {$ifdef Unix}
  783. SetKnownKeys;
  784. {$endif Unix}
  785. {$ifndef go32v2}
  786. UpdateScreen(true);
  787. {$endif go32v2}
  788. end;
  789. function TIDEApp.AutoSave: boolean;
  790. var IOK,SOK,DOK: boolean;
  791. begin
  792. IOK:=true; SOK:=true; DOK:=true;
  793. if (AutoSaveOptions and asEnvironment)<>0 then
  794. begin
  795. IOK:=WriteINIFile(false);
  796. if IOK=false then
  797. ErrorBox(error_saving_cfg_file,nil);
  798. end;
  799. if (AutoSaveOptions and asEditorFiles)<>0 then { was a typo here ("=0") - Gabor }
  800. SOK:=SaveAll;
  801. if (AutoSaveOptions and asDesktop)<>0 then
  802. begin
  803. { destory all help & browser windows - we don't want to store them }
  804. { UserScreenWindow is also not registered PM }
  805. DoCloseUserScreenWindow;
  806. DoneDisassemblyWindow;
  807. CloseHelpWindows;
  808. CloseAllBrowsers;
  809. DOK:=SaveDesktop;
  810. if DOK=false then
  811. ErrorBox(error_saving_dsk_file,nil);
  812. end;
  813. AutoSave:=IOK and SOK and DOK;
  814. end;
  815. function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile,ErrFile: string; ExecType: TExecType): boolean;
  816. var CanRun: boolean;
  817. ConsoleMode : TConsoleMode;
  818. {$ifndef Unix}
  819. PosExe: sw_integer;
  820. {$endif Unix}
  821. begin
  822. SaveCancelled:=false;
  823. CanRun:=AutoSave;
  824. if (CanRun=false) and (SaveCancelled=false) then
  825. CanRun:=true; { do not care about .DSK or .INI saving problems - just like TP }
  826. if CanRun then
  827. begin
  828. if UserScreen=nil then
  829. begin
  830. ErrorBox(error_user_screen_not_avail,nil);
  831. Exit;
  832. end;
  833. if ExecType<>exNoSwap then
  834. ShowUserScreen;
  835. SaveConsoleMode(ConsoleMode);
  836. if ExecType=exDosShell then
  837. WriteShellMsg;
  838. { DO NOT use COMSPEC for exe files as the
  839. ExitCode is lost in those cases PM }
  840. {$ifndef Unix}
  841. posexe:=Pos('.EXE',UpCaseStr(ProgramPath));
  842. { if programpath was three char long => bug }
  843. if (posexe>0) and (posexe=Length(ProgramPath)-3) then
  844. begin
  845. {$endif Unix}
  846. if (InFile='') and (OutFile='') and (ErrFile='') then
  847. DosExecute(ProgramPath,Params)
  848. else
  849. begin
  850. if ErrFile='' then
  851. ErrFile:='stderr';
  852. ExecuteRedir(ProgramPath,Params,InFile,OutFile,ErrFile);
  853. end;
  854. {$ifndef Unix}
  855. end
  856. else if (InFile='') and (OutFile='') and (ErrFile='') then
  857. DosExecute(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params)
  858. else
  859. begin
  860. if ErrFile='' then
  861. ErrFile:='stderr';
  862. ExecuteRedir(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params,
  863. InFile,OutFile,ErrFile);
  864. end;
  865. {$endif Unix}
  866. {$ifdef Unix}
  867. if (DebuggeeTTY='') and (OutFile='') and (ExecType<>exDosShell) then
  868. begin
  869. Write(' Press any key to return to IDE');
  870. InitKeyBoard;
  871. Keyboard.GetKeyEvent;
  872. while (Keyboard.PollKeyEvent<>0) do
  873. Keyboard.GetKeyEvent;
  874. DoneKeyboard;
  875. end;
  876. {$endif}
  877. RestoreConsoleMode(ConsoleMode);
  878. if ExecType<>exNoSwap then
  879. ShowIDEScreen;
  880. end;
  881. DoExecute:=CanRun;
  882. end;
  883. procedure TIDEApp.Update;
  884. begin
  885. SetCmdState([cmSaveAll],IsThereAnyEditor);
  886. SetCmdState([cmCloseAll,cmWindowList],IsThereAnyWindow);
  887. SetCmdState([cmTile,cmCascade],IsThereAnyVisibleWindow);
  888. SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol{,cmInformation}],IsSymbolInfoAvailable);
  889. {$ifndef NODEBUG}
  890. SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
  891. {$endif}
  892. SetCmdState([cmToolsMsgNext,cmToolsMsgPrev],MessagesWindow<>nil);
  893. UpdateTools;
  894. UpdateRecentFileList;
  895. UpdatePrimaryFile;
  896. UpdateINIFile;
  897. Message(Application,evBroadcast,cmCommandSetChanged,nil);
  898. end;
  899. procedure TIDEApp.SourceWindowClosed;
  900. begin
  901. if not IsClosing then
  902. Update;
  903. end;
  904. procedure TIDEApp.CurDirChanged;
  905. begin
  906. Message(Application,evBroadcast,cmUpdateTitle,nil);
  907. UpdatePrimaryFile;
  908. UpdateINIFile;
  909. UpdateMenu(MenuBar^.Menu);
  910. end;
  911. procedure TIDEApp.UpdatePrimaryFile;
  912. begin
  913. SetMenuItemParam(SearchMenuItem(MenuBar^.Menu,cmPrimaryFile),SmartPath(PrimaryFile));
  914. SetCmdState([cmClearPrimary],PrimaryFile<>'');
  915. if PrimaryFile<>'' then
  916. SetCmdState(CompileCmds,true);
  917. UpdateMenu(MenuBar^.Menu);
  918. Message(ProgramInfoWindow,evBroadcast,cmUpdate,nil);
  919. end;
  920. procedure TIDEApp.UpdateINIFile;
  921. begin
  922. SetMenuItemParam(SearchMenuItem(MenuBar^.Menu,cmSaveINI),SmartPath(IniFileName));
  923. end;
  924. procedure TIDEApp.UpdateRecentFileList;
  925. var P: PMenuItem;
  926. {ID,}I: word;
  927. FileMenu: PMenuItem;
  928. begin
  929. { ID:=cmRecentFileBase;}
  930. FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
  931. repeat
  932. { Inc(ID);
  933. P:=SearchMenuItem(FileMenu^.SubMenu,ID);
  934. if FileMenu^.SubMenu^.Default=P then
  935. FileMenu^.SubMenu^.Default:=FileMenu^.SubMenu^.Items;
  936. if P<>nil then RemoveMenuItem(FileMenu^.SubMenu,P);}
  937. P:=GetMenuItemBefore(FileMenu^.SubMenu,nil);
  938. if (P<>nil) then
  939. begin
  940. if (cmRecentFileBase<P^.Command) and (P^.Command<=cmRecentFileBase+MaxRecentFileCount) then
  941. begin
  942. RemoveMenuItem(FileMenu^.SubMenu,P);
  943. if FileMenu^.SubMenu^.Default=P then
  944. FileMenu^.SubMenu^.Default:=FileMenu^.SubMenu^.Items;
  945. end
  946. else
  947. P:=nil;
  948. end;
  949. until P=nil;
  950. P:=GetMenuItemBefore(FileMenu^.SubMenu,nil);
  951. if (P<>nil) and IsSeparator(P) then
  952. RemoveMenuItem(FileMenu^.SubMenu,P);
  953. if RecentFileCount>0 then
  954. AppendMenuItem(FileMenu^.SubMenu,NewLine(nil));
  955. for I:=1 to RecentFileCount do
  956. begin
  957. P:=NewItem('~'+IntToStr(I)+'~ '+ShrinkPath(SmartPath(RecentFiles[I].FileName),27),' ',
  958. kbNoKey,cmRecentFileBase+I,hcRecentFileBase+I,nil);
  959. AppendMenuItem(FileMenu^.SubMenu,P);
  960. end;
  961. end;
  962. procedure TIDEApp.UpdateTools;
  963. var P: PMenuItem;
  964. { ID,}I: word;
  965. ToolsMenu: PMenuItem;
  966. S1,S2,S3: string;
  967. W: word;
  968. begin
  969. { ID:=cmToolsBase;}
  970. ToolsMenu:=SearchSubMenu(MenuBar^.Menu,menuTools);
  971. repeat
  972. P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
  973. if (P<>nil) then
  974. begin
  975. if (cmToolsBase<P^.Command) and (P^.Command<=cmToolsBase+MaxToolCount) then
  976. begin
  977. RemoveMenuItem(ToolsMenu^.SubMenu,P);
  978. if ToolsMenu^.SubMenu^.Default=P then
  979. ToolsMenu^.SubMenu^.Default:=ToolsMenu^.SubMenu^.Items;
  980. end
  981. else
  982. P:=nil;
  983. end;
  984. until P=nil;
  985. P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
  986. if (P<>nil) and IsSeparator(P) then
  987. RemoveMenuItem(ToolsMenu^.SubMenu,P);
  988. if GetToolCount>0 then
  989. AppendMenuItem(ToolsMenu^.SubMenu,NewLine(nil));
  990. for I:=1 to GetToolCount do
  991. begin
  992. GetToolParams(I-1,S1,S2,S3,W);
  993. P:=NewItem(S1,KillTilde(GetHotKeyName(W)),W,cmToolsBase+I,hcToolsBase+I,nil);
  994. AppendMenuItem(ToolsMenu^.SubMenu,P);
  995. end;
  996. end;
  997. procedure TIDEApp.DosShell;
  998. var
  999. s : string;
  1000. begin
  1001. {$ifdef Unix}
  1002. s:=GetEnv('SHELL');
  1003. if s='' then
  1004. if ExistsFile('/bin/sh') then
  1005. s:='/bin/sh';
  1006. {$else}
  1007. s:=GetEnv('COMSPEC');
  1008. if s='' then
  1009. if ExistsFile('c:\command.com') then
  1010. s:='c:\command.com'
  1011. else
  1012. begin
  1013. s:='command.com';
  1014. if Not LocateExeFile(s) then
  1015. s:='';
  1016. end;
  1017. {$endif}
  1018. if s='' then
  1019. ErrorBox(msg_errorexecutingshell,nil)
  1020. else
  1021. DoExecute(s, '', '', '', '', exDosShell);
  1022. { In case we have something that the compiler touched }
  1023. AskToReloadAllModifiedFiles;
  1024. end;
  1025. procedure TIDEApp.ShowReadme;
  1026. var R,R2: TRect;
  1027. D: PCenterDialog;
  1028. M: PFPMemo;
  1029. VSB: PScrollBar;
  1030. S: PBufStream;
  1031. begin
  1032. New(S, Init(ReadmeName, stOpenRead, 4096));
  1033. if S^.Status=stOK then
  1034. begin
  1035. R.Assign(0,0,63,18);
  1036. New(D, Init(R, 'Free Pascal IDE'));
  1037. with D^ do
  1038. begin
  1039. GetExtent(R);
  1040. R.Grow(-2,-2); Inc(R.B.Y);
  1041. R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
  1042. New(VSB, Init(R2)); VSB^.GrowMode:=0; Insert(VSB);
  1043. New(M, Init(R,nil,VSB,nil));
  1044. M^.LoadFromStream(S);
  1045. M^.ReadOnly:=true;
  1046. Insert(M);
  1047. end;
  1048. InsertOK(D);
  1049. ExecuteDialog(D,nil);
  1050. end;
  1051. Dispose(S, Done);
  1052. end;
  1053. {$I FPMFILE.INC}
  1054. {$I FPMEDIT.INC}
  1055. {$I FPMSRCH.INC}
  1056. {$I FPMRUN.INC}
  1057. {$I FPMCOMP.INC}
  1058. {$I FPMDEBUG.INC}
  1059. {$I FPMTOOLS.INC}
  1060. {$I FPMOPTS.INC}
  1061. {$I FPMWND.INC}
  1062. {$I FPMHELP.INC}
  1063. {$I fpmansi.inc}
  1064. procedure TIDEApp.AddRecentFile(AFileName: string; CurX, CurY: integer);
  1065. begin
  1066. if SearchRecentFile(AFileName)<>-1 then Exit;
  1067. if RecentFileCount>0 then
  1068. Move(RecentFiles[1],RecentFiles[2],SizeOf(RecentFiles[1])*Min(RecentFileCount,High(RecentFiles)-1));
  1069. if RecentFileCount<High(RecentFiles) then Inc(RecentFileCount);
  1070. with RecentFiles[1] do
  1071. begin
  1072. FileName:=AFileName;
  1073. LastPos.X:=CurX; LastPos.Y:=CurY;
  1074. end;
  1075. UpdateRecentFileList;
  1076. end;
  1077. function TIDEApp.SearchRecentFile(AFileName: string): integer;
  1078. var Idx,I: integer;
  1079. begin
  1080. Idx:=-1;
  1081. for I:=1 to RecentFileCount do
  1082. if UpcaseStr(AFileName)=UpcaseStr(RecentFiles[I].FileName) then
  1083. begin Idx:=I; Break; end;
  1084. SearchRecentFile:=Idx;
  1085. end;
  1086. procedure TIDEApp.RemoveRecentFile(Index: integer);
  1087. begin
  1088. if Index<RecentFileCount then
  1089. Move(RecentFiles[Index+1],RecentFiles[Index],SizeOf(RecentFiles[1])*(RecentFileCount-Index));
  1090. Dec(RecentFileCount);
  1091. end;
  1092. function TIDEApp.GetPalette: PPalette;
  1093. var P: string;
  1094. begin
  1095. P:=AppPalette;
  1096. GetPalette:=@P;
  1097. end;
  1098. function TIDEApp.IsClosing: Boolean;
  1099. begin
  1100. IsClosing:=InsideDone;
  1101. end;
  1102. destructor TIDEApp.Done;
  1103. begin
  1104. InsideDone:=true;
  1105. inherited Done;
  1106. RemoveBrowsersCollection;
  1107. DoneHelpSystem;
  1108. end;
  1109. END.
  1110. {
  1111. $Log$
  1112. Revision 1.9 2002-03-20 14:52:01 pierre
  1113. + deliberatly generate a SIGSEGV if Alt+F11 is pressed (DEBUG code)
  1114. Revision 1.8 2002/01/24 09:21:42 pierre
  1115. * only disable Alt-X in Options|Compiler dialog
  1116. Revision 1.7 2001/11/07 00:28:53 pierre
  1117. + Disassembly window made public
  1118. Revision 1.6 2001/10/24 14:17:27 pierre
  1119. * try to fix the Win2000 mouse problem
  1120. Revision 1.5 2001/10/02 23:56:30 pierre
  1121. * fix bug 1619 by using wconsole unit
  1122. Revision 1.4 2001/10/01 00:24:09 pierre
  1123. * fix several help problems
  1124. Revision 1.3 2001/08/05 12:23:00 peter
  1125. * Automatically support for fvision or old fv
  1126. Revision 1.2 2001/08/05 02:01:47 peter
  1127. * FVISION define to compile with fvision units
  1128. Revision 1.1 2001/08/04 11:30:23 peter
  1129. * ide works now with both compiler versions
  1130. Revision 1.1.2.30 2001/06/14 09:15:48 pierre
  1131. * adapted to new fpusrscr methods
  1132. Revision 1.1.2.29 2001/03/14 17:57:07 pierre
  1133. * fix invisible mouse problem for win32 on win9X
  1134. Revision 1.1.2.28 2001/03/13 16:19:15 pierre
  1135. + syntax highligh in disassembly window
  1136. Revision 1.1.2.27 2001/03/09 15:05:24 pierre
  1137. + Floating point Unit added to Debug menu
  1138. Revision 1.1.2.26 2001/02/19 10:40:50 pierre
  1139. * Check for changed files after Running tool or shell
  1140. Revision 1.1.2.25 2000/12/30 22:52:27 peter
  1141. * check modified while in debug mode. But placed it between a
  1142. conditional again as it reports also if the file was already modified
  1143. before the first compile.
  1144. * remove unsaved file checks when compiling without primary file so it
  1145. works the same as with a primary file set.
  1146. Revision 1.1.2.24 2000/12/20 14:27:48 pierre
  1147. * fp.ini for unix
  1148. Revision 1.1.2.23 2000/12/16 23:29:49 pierre
  1149. + Restore special keys correctly
  1150. Revision 1.1.2.22 2000/12/13 16:59:09 pierre
  1151. * ErrFile filed added to DoExecute method
  1152. Revision 1.1.2.21 2000/12/11 00:46:38 pierre
  1153. * missing uses fpkeys added
  1154. Revision 1.1.2.20 2000/12/11 00:41:42 pierre
  1155. * start of LearnKey dialog implementation
  1156. Revision 1.1.2.19 2000/12/07 16:11:06 pierre
  1157. * fix the wrong terminal settings in unixy shell mode
  1158. Revision 1.1.2.18 2000/11/29 11:26:00 pierre
  1159. + TFPDlgWindow that handles cmSearchWindow
  1160. Revision 1.1.2.17 2000/11/29 00:54:44 pierre
  1161. + preserve window number and save special windows
  1162. Revision 1.1.2.16 2000/11/27 12:05:41 pierre
  1163. Dump Ansi released
  1164. Revision 1.1.2.15 2000/11/23 16:33:30 pierre
  1165. * fix Alt-X problem and set HelpCtx for most dialogs
  1166. Revision 1.1.2.14 2000/11/21 17:43:23 pierre
  1167. + first version of dump ansi file
  1168. Revision 1.1.2.13 2000/11/19 00:23:33 pierre
  1169. Task 23: nicer error message when trying to run unit or library
  1170. Revision 1.1.2.12 2000/11/14 09:23:55 marco
  1171. * Second batch
  1172. Revision 1.1.2.11 2000/10/18 21:53:27 pierre
  1173. * several Gabor fixes
  1174. Revision 1.1.2.10 2000/10/09 16:28:25 pierre
  1175. * several linux enhancements
  1176. Revision 1.1.2.9 2000/10/04 13:30:50 pierre
  1177. * DosShell for linux
  1178. Revision 1.1.2.8 2000/09/22 15:19:04 jonas
  1179. * Linux now also uses the DosExecute and ExecuteRedir procedures
  1180. Revision 1.1.2.7 2000/08/21 12:10:19 jonas
  1181. * fixed errors in my previous commit, it now works properly
  1182. Revision 1.1.2.5 2000/08/16 18:46:14 peter
  1183. [*] double clicking on a droplistbox caused GPF (due to invalid recurson)
  1184. [*] Make, Build now possible even in Compiler Messages Window
  1185. [+] when started in a new dir the IDE now ask whether to create a local
  1186. config, or to use the one located in the IDE dir
  1187. Revision 1.1.2.4 2000/08/15 03:40:53 peter
  1188. [*] no more fatal exits when the IDE can't find the error file (containing
  1189. the redirected assembler/linker output) after compilation
  1190. [*] hidden windows are now added always at the end of the Window List
  1191. [*] TINIFile parsed entries encapsulated in string delimiters incorrectly
  1192. [*] selection was incorrectly adjusted when typing in overwrite mode
  1193. [*] the line wasn't expanded when it's end was reached in overw. mode
  1194. [*] the IDE now tries to locate source files also in the user specified
  1195. unit dirs (for ex. as a response to 'Open at cursor' (Ctrl+Enter) )
  1196. [*] 'Open at cursor' is now aware of the extension (if specified)
  1197. Revision 1.1.2.3 2000/08/10 07:10:37 michael
  1198. * 'Auto save editor files' option did the opposite than expected, due
  1199. to a typo in FPIDE.PAS
  1200. + saving of source files before compilation is no longer neccessary.
  1201. When a modified editor file is involved in the compilation, then the
  1202. IDE saves it's contents to a memory stream and passes this to the
  1203. compiler (instead of the file on the disk)
  1204. Revision 1.1.2.2 2000/08/04 14:05:18 michael
  1205. * Fixes from Gabor:
  1206. [*] the IDE now doesn't disable Compile|Make & Build when all windows
  1207. are closed, but there's still a primary file set
  1208. (set bug 1059 to fixed!)
  1209. [*] the IDE didn't read some compiler options correctly back from the
  1210. FP.CFG file, for ex. the linker options. Now it read everything
  1211. correctly, and also automatically handles smartlinking option synch-
  1212. ronization.
  1213. (set bug 1048 to fixed!)
  1214. Revision 1.1.2.1 2000/07/18 05:50:22 michael
  1215. + Merged Gabors fixes
  1216. Revision 1.1 2000/07/13 09:48:34 michael
  1217. + Initial import
  1218. Revision 1.65 2000/06/22 09:07:12 pierre
  1219. * Gabor changes: see fixes.txt
  1220. Revision 1.64 2000/06/16 21:19:41 pierre
  1221. * Use Open instead of OpenSearch if OpenFileName is empty
  1222. Revision 1.63 2000/06/16 08:50:40 pierre
  1223. + new bunch of Gabor's changes
  1224. Revision 1.62 2000/06/11 07:01:33 peter
  1225. * give watches window also a number
  1226. * leave watches window in the bottom when cascading windows
  1227. Revision 1.61 2000/05/17 09:51:11 pierre
  1228. Disable/Enable keyboard on UserScreen
  1229. Revision 1.60 2000/05/02 10:20:40 pierre
  1230. * fix a small problem when deciding to call DosExecute directly
  1231. Revision 1.59 2000/05/02 08:42:27 pierre
  1232. * new set of Gabor changes: see fixes.txt
  1233. Revision 1.58 2000/04/25 08:42:33 pierre
  1234. * New Gabor changes : see fixes.txt
  1235. Revision 1.57 2000/04/18 11:42:37 pierre
  1236. lot of Gabor changes : see fixes.txt
  1237. Revision 1.56 2000/03/21 23:30:49 pierre
  1238. adapted to wcedit addition by Gabor
  1239. Revision 1.55 2000/03/13 20:41:35 pierre
  1240. + option -S to disable the mouse
  1241. * adapted to changes in fpusrscr for DOS
  1242. Revision 1.54 2000/03/07 21:57:59 pierre
  1243. + CtrlC handling
  1244. + UpdateMode method
  1245. Revision 1.53 2000/03/06 11:31:30 pierre
  1246. * Do not use COMSPEC to Run files with .EXE suffix
  1247. because Command.com at least does not return the errorcode
  1248. of the program called
  1249. Revision 1.52 2000/02/07 12:02:32 pierre
  1250. Gabor's changes
  1251. Revision 1.51 2000/01/23 21:25:17 florian
  1252. + start of internationalization support
  1253. Revision 1.50 2000/01/08 18:26:20 florian
  1254. + added a register window, doesn't work yet
  1255. Revision 1.49 2000/01/05 00:31:50 pierre
  1256. * avoid new files to use TABS
  1257. Revision 1.48 2000/01/03 11:38:33 michael
  1258. Changes from Gabor
  1259. Revision 1.47 1999/12/20 14:23:17 pierre
  1260. * MyApp renamed IDEApp
  1261. * TDebugController.ResetDebuggerRows added to
  1262. get resetting of debugger rows
  1263. Revision 1.46 1999/12/17 15:07:01 florian
  1264. + TIDEApp.Idle does always call GiveUpTimeSlice
  1265. Revision 1.45 1999/12/10 13:02:05 pierre
  1266. + VideoMode save/restore
  1267. Revision 1.44 1999/11/25 00:26:49 pierre
  1268. * RecentFiles missed the last char
  1269. Revision 1.43 1999/11/10 17:19:06 pierre
  1270. * Use DosExecute from Fpredir unit
  1271. Revision 1.42 1999/10/27 12:10:42 pierre
  1272. + With DebugUndo added 3 menu items
  1273. "Dump Undo" "Undo All" and "Redo All"
  1274. for Undo checks
  1275. Revision 1.41 1999/09/22 16:21:41 pierre
  1276. * Use ShrinkPas for RecentFiles
  1277. Revision 1.40 1999/09/22 13:04:31 pierre
  1278. + Close UserScreen to avoid store crash
  1279. Revision 1.39 1999/09/21 17:09:00 pierre
  1280. + Windows clipboard for win32
  1281. Revision 1.38 1999/09/13 16:24:43 peter
  1282. + clock
  1283. * backspace unident like tp7
  1284. Revision 1.37 1999/09/13 11:44:00 peter
  1285. * fixes from gabor, idle event, html fix
  1286. Revision 1.36 1999/09/09 14:15:27 pierre
  1287. + cmCopyWin,cmPasteWin
  1288. Revision 1.35 1999/08/16 18:25:19 peter
  1289. * Adjusting the selection when the editor didn't contain any line.
  1290. * Reserved word recognition redesigned, but this didn't affect the overall
  1291. syntax highlight speed remarkably (at least not on my Amd-K6/350).
  1292. The syntax scanner loop is a bit slow but the main problem is the
  1293. recognition of special symbols. Switching off symbol processing boosts
  1294. the performance up to ca. 200%...
  1295. * The editor didn't allow copying (for ex to clipboard) of a single character
  1296. * 'File|Save as' caused permanently run-time error 3. Not any more now...
  1297. * Compiler Messages window (actually the whole desktop) did not act on any
  1298. keypress when compilation failed and thus the window remained visible
  1299. + Message windows are now closed upon pressing Esc
  1300. + At 'Run' the IDE checks whether any sources are modified, and recompiles
  1301. only when neccessary
  1302. + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
  1303. + LineSelect (Ctrl+K+L) implemented
  1304. * The IDE had problems closing help windows before saving the desktop
  1305. Revision 1.34 1999/08/03 20:22:32 peter
  1306. + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
  1307. + Desktop saving should work now
  1308. - History saved
  1309. - Clipboard content saved
  1310. - Desktop saved
  1311. - Symbol info saved
  1312. * syntax-highlight bug fixed, which compared special keywords case sensitive
  1313. (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
  1314. * with 'whole words only' set, the editor didn't found occourences of the
  1315. searched text, if the text appeared previously in the same line, but didn't
  1316. satisfied the 'whole-word' condition
  1317. * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
  1318. (ie. the beginning of the selection)
  1319. * when started typing in a new line, but not at the start (X=0) of it,
  1320. the editor inserted the text one character more to left as it should...
  1321. * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
  1322. * Shift shouldn't cause so much trouble in TCodeEditor now...
  1323. * Syntax highlight had problems recognizing a special symbol if it was
  1324. prefixed by another symbol character in the source text
  1325. * Auto-save also occours at Dos shell, Tool execution, etc. now...
  1326. Revision 1.33 1999/07/12 13:14:18 pierre
  1327. * LineEnd bug corrected, now goes end of text even if selected
  1328. + Until Return for debugger
  1329. + Code for Quit inside GDB Window
  1330. Revision 1.32 1999/07/10 01:24:17 pierre
  1331. + First implementation of watches window
  1332. Revision 1.31 1999/06/29 22:50:14 peter
  1333. * more fixes from gabor
  1334. Revision 1.30 1999/06/28 19:32:20 peter
  1335. * fixes from gabor
  1336. Revision 1.29 1999/06/28 12:40:19 pierre
  1337. + RemoveBrowsersCollection in TIDEApp.Done
  1338. Revision 1.28 1999/06/25 00:46:33 pierre
  1339. + UpdateTarget to show current target
  1340. + SearchSymbol, not scope aware (this will need a PPU change !)
  1341. Revision 1.27 1999/05/22 13:44:30 peter
  1342. * fixed couple of bugs
  1343. Revision 1.26 1999/04/07 21:55:47 peter
  1344. + object support for browser
  1345. * html help fixes
  1346. * more desktop saving things
  1347. * NODEBUG directive to exclude debugger
  1348. Revision 1.25 1999/03/23 15:11:29 peter
  1349. * desktop saving things
  1350. * vesa mode
  1351. * preferences dialog
  1352. Revision 1.24 1999/03/19 16:04:29 peter
  1353. * new compiler dialog
  1354. Revision 1.23 1999/03/16 12:38:10 peter
  1355. * tools macro fixes
  1356. + tph writer
  1357. + first things for resource files
  1358. Revision 1.22 1999/03/12 01:13:57 peter
  1359. * flag if trytoopen should look for other extensions
  1360. + browser tab in the tools-compiler
  1361. Revision 1.21 1999/03/02 13:48:29 peter
  1362. * fixed far problem is fpdebug
  1363. * tile/cascading with message window
  1364. * grep fixes
  1365. Revision 1.20 1999/03/01 15:41:54 peter
  1366. + Added dummy entries for functions not yet implemented
  1367. * MenuBar didn't update itself automatically on command-set changes
  1368. * Fixed Debugging/Profiling options dialog
  1369. * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
  1370. set
  1371. * efBackSpaceUnindents works correctly
  1372. + 'Messages' window implemented
  1373. + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
  1374. + Added TP message-filter support (for ex. you can call GREP thru
  1375. GREP2MSG and view the result in the messages window - just like in TP)
  1376. * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
  1377. so topic search didn't work...
  1378. * In FPHELP.PAS there were still context-variables defined as word instead
  1379. of THelpCtx
  1380. * StdStatusKeys() was missing from the statusdef for help windows
  1381. + Topic-title for index-table can be specified when adding a HTML-files
  1382. Revision 1.19 1999/02/22 11:51:36 peter
  1383. * browser updates from gabor
  1384. Revision 1.18 1999/02/22 02:15:13 peter
  1385. + default extension for save in the editor
  1386. + Separate Text to Find for the grep dialog
  1387. * fixed redir crash with tp7
  1388. Revision 1.17 1999/02/20 15:18:30 peter
  1389. + ctrl-c capture with confirm dialog
  1390. + ascii table in the tools menu
  1391. + heapviewer
  1392. * empty file fixed
  1393. * fixed callback routines in fpdebug to have far for tp7
  1394. Revision 1.16 1999/02/18 13:44:31 peter
  1395. * search fixed
  1396. + backward search
  1397. * help fixes
  1398. * browser updates
  1399. Revision 1.15 1999/02/16 10:43:55 peter
  1400. * use -dGDB for the compiler
  1401. * only use gdb_file when -dDEBUG is used
  1402. * profiler switch is now a toggle instead of radiobutton
  1403. Revision 1.14 1999/02/11 19:07:22 pierre
  1404. * GDBWindow redesigned :
  1405. normal editor apart from
  1406. that any kbEnter will send the line (for begin to cursor)
  1407. to GDB command !
  1408. GDBWindow opened in Debugger Menu
  1409. still buggy :
  1410. -echo should not be present if at end of text
  1411. -GDBWindow becomes First after each step (I don't know why !)
  1412. Revision 1.13 1999/02/10 09:54:11 pierre
  1413. * cmSourceWindowClosing resets Debugger LastSource field to avoid problems
  1414. Revision 1.12 1999/02/08 17:43:44 pierre
  1415. * RestDebugger or multiple running of debugged program now works
  1416. + added DoContToCursor(F4)
  1417. * Breakpoints are now inserted correctly (was mainlyy a problem
  1418. of directories)
  1419. Revision 1.11 1999/02/08 10:37:44 peter
  1420. + html helpviewer
  1421. Revision 1.7 1999/02/04 13:32:03 pierre
  1422. * Several things added (I cannot commit them independently !)
  1423. + added TBreakpoint and TBreakpointCollection
  1424. + added cmResetDebugger,cmGrep,CmToggleBreakpoint
  1425. + Breakpoint list in INIFile
  1426. * Select items now also depend of SwitchMode
  1427. * Reading of option '-g' was not possible !
  1428. + added search for -Fu args pathes in TryToOpen
  1429. + added code for automatic opening of FileDialog
  1430. if source not found
  1431. Revision 1.6 1999/02/02 16:41:39 peter
  1432. + automatic .pas/.pp adding by opening of file
  1433. * better debuggerscreen changes
  1434. Revision 1.5 1999/01/22 18:13:22 pierre
  1435. * DoneScreen Removed I did not find any such proc ??
  1436. Revision 1.4 1999/01/22 10:24:03 peter
  1437. * first debugger things
  1438. Revision 1.3 1999/01/21 11:54:14 peter
  1439. + tools menu
  1440. + speedsearch in symbolbrowser
  1441. * working run command
  1442. Revision 1.2 1999/01/14 21:42:20 peter
  1443. * source tracking from Gabor
  1444. Revision 1.1 1999/01/12 14:29:34 peter
  1445. + Implemented still missing 'switch' entries in Options menu
  1446. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  1447. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  1448. ASCII chars and inserted directly in the text.
  1449. + Added symbol browser
  1450. * splitted fp.pas to fpide.pas
  1451. Revision 1.4 1999/01/04 11:49:41 peter
  1452. * 'Use tab characters' now works correctly
  1453. + Syntax highlight now acts on File|Save As...
  1454. + Added a new class to syntax highlight: 'hex numbers'.
  1455. * There was something very wrong with the palette managment. Now fixed.
  1456. + Added output directory (-FE<xxx>) support to 'Directories' dialog...
  1457. * Fixed some possible bugs in Running/Compiling, and the compilation/run
  1458. process revised
  1459. Revision 1.2 1998/12/28 15:47:40 peter
  1460. + Added user screen support, display & window
  1461. + Implemented Editor,Mouse Options dialog
  1462. + Added location of .INI and .CFG file
  1463. + Option (INI) file managment implemented (see bottom of Options Menu)
  1464. + Switches updated
  1465. + Run program
  1466. Revision 1.3 1998/12/22 10:39:38 peter
  1467. + options are now written/read
  1468. + find and replace routines
  1469. }