fpide.pas 57 KB

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