2
0

fpide.pas 55 KB

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