fpide.pas 56 KB

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