fpconst.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Constants used by the IDE
  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 FPConst;
  13. interface
  14. uses Views,App,Commands,
  15. WViews;
  16. const
  17. VersionStr = '0.9';
  18. MaxRecentFileCount = 5;
  19. MaxToolCount = 16;
  20. ReservedWordMaxLen = 16;
  21. CompilerStatusUpdateDelay = 0.8; { in secs }
  22. ININame = 'fp.ini';
  23. SwitchesName = 'fp.cfg';
  24. DesktopName = 'fp.dsk';
  25. ToolCaptureName = '__tool__.out'; { all '$' signs replaces with '_'s }
  26. FilterCaptureName = '_filter_.out';
  27. FPOutFileName = 'fp___.out';
  28. FPErrFileName = 'fp___.err';
  29. GDBOutFileName = 'gdb___.out';
  30. GDBOutPutFileName = 'gdb___.txt';
  31. HelpFileExts = '*.tph;*.htm*';
  32. EnterSign = #17#196#217;
  33. { Strings/Messages }
  34. strLoadingHelp = 'Loading help files...';
  35. strBuildingHelpIndex = 'Building Help Index...';
  36. strLocatingTopic = 'Locating topic...';
  37. { Main menu submenu indexes }
  38. menuFile = 0;
  39. menuTools = 6;
  40. { MouseAction constants }
  41. acNone = 0;
  42. acTopicSearch = 1;
  43. acGotoCursor = 2;
  44. acBreakpoint = 3;
  45. acEvaluate = 4;
  46. acAddWatch = 5;
  47. acBrowseSymbol = 6;
  48. acFirstAction = acTopicSearch;
  49. acLastAction = acBrowseSymbol;
  50. { Startup Option constants }
  51. soReturnToLastDir = $00000001;
  52. { Desktop Flag constants - what to include in the desktop file }
  53. dfHistoryLists = $00000001;
  54. dfClipboardContent = $00000002;
  55. dfWatches = $00000004;
  56. dfBreakpoints = $00000008;
  57. dfOpenWindows = $00000010;
  58. dfSymbolInformation = $00000020;
  59. { Auto Save flag constants }
  60. asEditorFiles = $00000001; { Editor files }
  61. asEnvironment = $00000002; { .INI file }
  62. asDesktop = $00000004; { .DSK file }
  63. { Misc. Options flag constants }
  64. moAutoTrackSource = $00000001;
  65. moCloseOnGotoSource = $00000002;
  66. moChangeDirOnOpen = $00000004;
  67. { Desktop Location constants }
  68. dlCurrentDir = $00;
  69. dlConfigFileDir = $01;
  70. { Command constants }
  71. cmShowClipboard = 201;
  72. cmFindProcedure = 206;
  73. cmObjects = 207;
  74. cmModules = 208;
  75. cmGlobals = 209;
  76. cmRun = 210;
  77. cmParameters = 211;
  78. cmCompile = 212;
  79. cmMake = 213;
  80. cmBuild = 214;
  81. cmTarget = 215;
  82. cmPrimaryFile = 216;
  83. cmClearPrimary = 217;
  84. cmInformation = 218;
  85. cmWindowList = 219;
  86. cmHelpTopicSearch = 220;
  87. cmMsgGotoSource = 221;
  88. cmMsgTrackSource = 222;
  89. cmGotoCursor = 223;
  90. {cmToggleBreakpoint = 224; never disabled =>2403 }
  91. cmAddWatch = 225;
  92. cmTraceInto = 226;
  93. cmStepOver = 227;
  94. cmResetDebugger = 228;
  95. cmContToCursor = 229;
  96. cmOpenGDBWindow = 230;
  97. cmToolsMsgNext = 231;
  98. cmToolsMsgPrev = 232;
  99. cmGrep = 233;
  100. cmCompilerMessages = 234;
  101. cmSymbol = 235;
  102. cmStack = 236;
  103. cmBreakpointList = 237;
  104. cmWatches = 238;
  105. cmUntilReturn = 239;
  106. { WARNING these two are also defined in weditor.pas PM }
  107. cmCopyWin = 240;
  108. cmPasteWin = 241;
  109. cmNotImplemented = 1000;
  110. cmNewFromTemplate = 1001;
  111. cmSearchWindow = 1500;
  112. cmSourceWndClosing = 1601;
  113. cmCalculatorPaste = 1603;
  114. cmMsgClear = 1604;
  115. cmUpdateTools = 1605;
  116. { cmGrep = 160?;}
  117. cmAddItem = 1620;
  118. cmEditItem = 1621;
  119. cmDeleteItem = 1622;
  120. cmUserScreen = 1650;
  121. cmUserScreenWindow = 1651;
  122. cmEvaluate = 1652;
  123. cmCalculator = 1653;
  124. cmASCIITable = 1654;
  125. cmToolsMessages = 1700;
  126. cmToolsBase = 1800;
  127. cmRecentFileBase = 1850;
  128. cmCompiler = 2000;
  129. cmMemorySizes = 2001;
  130. cmLinker = 2002;
  131. cmDebugger = 2003;
  132. cmDirectories = 2004;
  133. cmTools = 2005;
  134. cmPreferences = 2006;
  135. cmEditor = 2007;
  136. cmMouse = 2008;
  137. cmStartup = 2009;
  138. cmColors = 2010;
  139. cmOpenINI = 2011;
  140. cmSaveINI = 2012;
  141. cmSaveAsINI = 2013;
  142. cmSwitchesMode = 2014;
  143. cmBrowser = 2015;
  144. cmDesktopOptions = 2016;
  145. cmHelpContents = 2100;
  146. cmHelpIndex = 2101;
  147. cmHelpPrevTopic = 2103;
  148. cmHelpUsingHelp = 2104;
  149. cmHelpFiles = 2105;
  150. cmAbout = 2106;
  151. cmOpenAtCursor = 2200;
  152. cmBrowseAtCursor = 2201;
  153. cmEditorOptions = 2202;
  154. cmBrowserOptions = 2203;
  155. cmTrackReference = 2300;
  156. cmGotoReference = 2301;
  157. cmEditBreakpoint = 2400;
  158. cmNewBreakpoint = 2401;
  159. cmDeleteBreakpoint = 2402;
  160. cmToggleBreakpoint = 2403;
  161. cmDumpUndo = 2500;
  162. cmUndoAll = 2501;
  163. cmRedoAll = 2502;
  164. { Help constants }
  165. hcSourceWindow = 8000;
  166. hcHelpWindow = 8001;
  167. hcClipboardWindow = 8002;
  168. hcCalcWindow = 8003;
  169. hcInfoWindow = 8004;
  170. hcBrowserWindow = 8005;
  171. hcMessagesWindow = 8006;
  172. hcGDBWindow = 8007;
  173. hcBreakpointListWindow = 8008;
  174. hcShift = 10000;
  175. hcUsingHelp = 2;
  176. hcContents = 3;
  177. hcQuit = hcShift+cmQuit;
  178. hcRedo = hcShift+cmRedo;
  179. hcFind = hcShift+cmFind;
  180. hcReplace = hcShift+cmReplace;
  181. hcSearchAgain = hcShift+cmSearchAgain;
  182. hcGotoLine = hcShift+cmJumpLine;
  183. hcUserScreen = hcShift+cmUserScreen;
  184. hcUserScreenWindow = hcShift+cmUserScreenWindow;
  185. hcToolsMessages = hcShift+cmToolsMessages;
  186. hcToolsBase = hcShift+cmToolsBase;
  187. hcRecentFileBase = hcShift+cmRecentFileBase;
  188. hcCompiler = hcShift+cmCompiler;
  189. hcMemorySizes = hcShift+cmMemorySizes;
  190. hcLinker = hcShift+cmLinker;
  191. hcDebugger = hcShift+cmDebugger;
  192. hcDirectories = hcShift+cmDirectories;
  193. hcTools = hcShift+cmTools;
  194. hcPreferences = hcShift+cmPreferences;
  195. hcEditor = hcShift+cmEditor;
  196. hcMouse = hcShift+cmMouse;
  197. hcStartup = hcShift+cmStartup;
  198. hcColors = hcShift+cmColors;
  199. hcOpenINI = hcShift+cmOpenINI;
  200. hcSaveINI = hcShift+cmSaveINI;
  201. hcSaveAsINI = hcShift+cmSaveAsINI;
  202. hcCalculator = hcShift+cmCalculator;
  203. hcAsciiTable = hcShift+cmAsciiTable;
  204. { hcGrep = hcShift+cmGrep;}
  205. hcSwitchesMode = hcShift+cmSwitchesMode;
  206. hcBrowser = hcShift+cmBrowser;
  207. hcDesktopOptions = hcShift+cmDesktopOptions;
  208. hcAbout = hcShift+cmAbout;
  209. hcCompilerMessages = hcShift+cmCompilerMessages;
  210. hcSystemMenu = 9000;
  211. hcFileMenu = 9001;
  212. hcEditMenu = 9002;
  213. hcSearchMenu = 9003;
  214. hcRunMenu = 9004;
  215. hcCompileMenu = 9005;
  216. hcDebugMenu = 9006;
  217. hcToolsMenu = 9007;
  218. hcOptionsMenu = 9008;
  219. hcEnvironmentMenu = 9009;
  220. hcWindowMenu = 9010;
  221. hcHelpMenu = 9011;
  222. hcFirstCommand = hcSystemMenu;
  223. hcLastCommand = 65535;
  224. hcShowClipboard = hcShift+cmShowClipboard;
  225. hcCopyWin = hcShift+cmCopyWin;
  226. hcPasteWin = hcShift+cmPasteWin;
  227. hcFindProcedure = hcShift+cmFindProcedure;
  228. hcObjects = hcShift+cmObjects;
  229. hcModules = hcShift+cmModules;
  230. hcGlobals = hcShift+cmGlobals;
  231. hcSymbol = hcShift+cmSymbol;
  232. hcRun = hcShift+cmRun;
  233. hcParameters = hcShift+cmParameters;
  234. hcResetDebugger = hcShift+cmResetDebugger;
  235. hcContToCursor = hcShift+cmContToCursor;
  236. hcUntilReturn = hcShift+cmUntilReturn;
  237. hcOpenGDBWindow = hcShift+cmOpenGDBWindow;
  238. hcToolsMsgNext = hcShift+cmToolsMsgNext;
  239. hcToolsMsgPrev = hcShift+cmToolsMsgPrev;
  240. hcCompile = hcShift+cmCompile;
  241. hcMake = hcShift+cmMake;
  242. hcBuild = hcShift+cmBuild;
  243. hcTarget = hcShift+cmTarget;
  244. hcPrimaryFile = hcShift+cmPrimaryFile;
  245. hcClearPrimary = hcShift+cmClearPrimary;
  246. hcInformation = hcShift+cmInformation;
  247. hcWindowList = hcShift+cmWindowList;
  248. hcNewFromTemplate = hcShift+cmNewFromTemplate;
  249. hcHelpTopicSearch = hcShift+cmHelpTopicSearch;
  250. hcHelpContents = hcShift+cmHelpContents;
  251. hcHelpIndex = hcShift+cmHelpIndex;
  252. hcHelpPrevTopic = hcShift+cmHelpPrevTopic;
  253. hcHelpUsingHelp = hcShift+cmHelpUsingHelp;
  254. hcHelpFiles = hcShift+cmHelpFiles;
  255. hcUpdate = hcShift+cmUpdate;
  256. hcMsgClear = hcShift+cmMsgClear;
  257. hcMsgGotoSource = hcShift+cmMsgGotoSource;
  258. hcMsgTrackSource = hcShift+cmMsgTrackSource;
  259. hcGotoCursor = hcShift+cmGotoCursor;
  260. hcNewBreakpoint = hcShift+cmNewBreakpoint;
  261. hcEditBreakpoint = hcShift+cmEditBreakpoint;
  262. hcDeleteBreakpoint = hcShift+cmDeleteBreakpoint;
  263. hcToggleBreakpoint = hcShift+cmToggleBreakpoint;
  264. hcEvaluate = hcShift+cmEvaluate;
  265. hcAddWatch = hcShift+cmAddWatch;
  266. hcWatches = hcShift+cmWatches;
  267. hcGrep = hcShift+cmGrep;
  268. hcStack = hcShift+cmStack;
  269. hcBreakPointList = hcShift+cmBreakpointList;
  270. hcOpenAtCursor = hcShift+cmOpenAtCursor;
  271. hcBrowseAtCursor = hcShift+cmBrowseAtCursor;
  272. hcEditorOptions = hcShift+cmEditorOptions;
  273. { History constants }
  274. hisChDirDialog = 2000;
  275. CIDEHelpDialog =
  276. #128#129#130#131#132#133#134#135#136#137#138#139#140#141#142#143 +
  277. #144#145#146#147#148#149#150#151#152#153#154#155#156#157#158#159 +
  278. #160#161#162#163 +
  279. #164#165#166;
  280. CSourceWindow =
  281. #167#168#169#170#171#172#173#174#175#176#177#178#179#180#181#182 +
  282. #183#184#185#186#187#188#189#190#191#192#193#194#195#196#197#198 +
  283. #199#200#201#202#203#204#205#206#207#208#209#210#211#212#213#214 ;
  284. CBrowserWindow =
  285. #215#216#217#218#219#220#221#222#223#224#225#226;
  286. CBrowserListBox =
  287. #9#9#10#11#12;
  288. CBrowserTab =
  289. #6#12;
  290. CBrowserOutline = #9#10#10#11;
  291. CGDBInputLine = #9#9#10#11#12;
  292. CFPClockView = #0#227;
  293. CIDEAppColor = CAppColor +
  294. { CIDEHelpDialog }
  295. {128-143}#$70#$7F#$7A#$13#$13#$70#$70#$7F#$7E#$20#$2B#$2F#$78#$2E#$70#$30 + { 1-16}
  296. {144-159}#$3F#$3E#$1F#$2F#$1A#$20#$72#$31#$31#$30#$2F#$3E#$31#$13#$38#$00 + {17-32}
  297. {160-163}#$30#$3E#$1E#$70 + { CHelpViewer } {33-36}
  298. {164-166}#$30#$3F#$3A + { CHelpFrame } {37-39}
  299. { CSourceWindow }
  300. {167-182}#$17#$1F#$1A#$31#$31#$1E#$71#$1F#$00#$00#$00#$00#$00#$00#$00#$00 + { 1-16}
  301. {183-198}#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00 + {17-32}
  302. {199-214}#$1E#$1F#$17#$1F#$1E#$1B#$13#$1A#$1E#$71#$3F#$30#$1C#$13#$1F#$4E + {33-48}
  303. { CBrowserWindow }
  304. {215-226}#$31#$3F#$3A#$31#$31#$31#$71#$1F#$31#$2F#$3E#$3F +
  305. { CFPClockView }
  306. {227- }#$70;
  307. implementation
  308. END.
  309. {
  310. $Log$
  311. Revision 1.30 1999-11-03 09:39:23 peter
  312. * fixed uppercase filenames
  313. * savetostream did twice a -1 on the linecount, so the lastline of a
  314. file wasn't saved correctly
  315. Revision 1.29 1999/10/27 12:10:42 pierre
  316. + With DebugUndo added 3 menu items
  317. "Dump Undo" "Undo All" and "Redo All"
  318. for Undo checks
  319. Revision 1.28 1999/10/14 10:23:44 pierre
  320. ClockView Black on Gray by default
  321. Revision 1.27 1999/09/13 16:24:43 peter
  322. + clock
  323. * backspace unident like tp7
  324. Revision 1.26 1999/09/09 16:31:45 pierre
  325. * some breakpoint related fixes and Help contexts
  326. Revision 1.25 1999/09/09 14:15:27 pierre
  327. + cmCopyWin,cmPasteWin
  328. Revision 1.24 1999/08/16 18:25:14 peter
  329. * Adjusting the selection when the editor didn't contain any line.
  330. * Reserved word recognition redesigned, but this didn't affect the overall
  331. syntax highlight speed remarkably (at least not on my Amd-K6/350).
  332. The syntax scanner loop is a bit slow but the main problem is the
  333. recognition of special symbols. Switching off symbol processing boosts
  334. the performance up to ca. 200%...
  335. * The editor didn't allow copying (for ex to clipboard) of a single character
  336. * 'File|Save as' caused permanently run-time error 3. Not any more now...
  337. * Compiler Messages window (actually the whole desktop) did not act on any
  338. keypress when compilation failed and thus the window remained visible
  339. + Message windows are now closed upon pressing Esc
  340. + At 'Run' the IDE checks whether any sources are modified, and recompiles
  341. only when neccessary
  342. + BlockRead and BlockWrite (Ctrl+K+R/W) implemented in TCodeEditor
  343. + LineSelect (Ctrl+K+L) implemented
  344. * The IDE had problems closing help windows before saving the desktop
  345. Revision 1.23 1999/08/03 20:22:27 peter
  346. + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
  347. + Desktop saving should work now
  348. - History saved
  349. - Clipboard content saved
  350. - Desktop saved
  351. - Symbol info saved
  352. * syntax-highlight bug fixed, which compared special keywords case sensitive
  353. (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
  354. * with 'whole words only' set, the editor didn't found occourences of the
  355. searched text, if the text appeared previously in the same line, but didn't
  356. satisfied the 'whole-word' condition
  357. * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
  358. (ie. the beginning of the selection)
  359. * when started typing in a new line, but not at the start (X=0) of it,
  360. the editor inserted the text one character more to left as it should...
  361. * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
  362. * Shift shouldn't cause so much trouble in TCodeEditor now...
  363. * Syntax highlight had problems recognizing a special symbol if it was
  364. prefixed by another symbol character in the source text
  365. * Auto-save also occours at Dos shell, Tool execution, etc. now...
  366. Revision 1.22 1999/07/12 13:14:14 pierre
  367. * LineEnd bug corrected, now goes end of text even if selected
  368. + Until Return for debugger
  369. + Code for Quit inside GDB Window
  370. Revision 1.21 1999/07/10 01:24:13 pierre
  371. + First implementation of watches window
  372. Revision 1.20 1999/06/30 23:58:11 pierre
  373. + BreakpointsList Window implemented
  374. with Edit/New/Delete functions
  375. + Individual breakpoint dialog with support for all types
  376. ignorecount and conditions
  377. (commands are not yet implemented, don't know if this wolud be useful)
  378. awatch and rwatch have problems because GDB does not annotate them
  379. I fixed v4.16 for this
  380. Revision 1.19 1999/06/28 19:32:18 peter
  381. * fixes from gabor
  382. Revision 1.18 1999/06/25 00:38:59 pierre
  383. +cmSymbol,cmStack,cmBreakpointList
  384. Revision 1.17 1999/04/07 21:55:44 peter
  385. + object support for browser
  386. * html help fixes
  387. * more desktop saving things
  388. * NODEBUG directive to exclude debugger
  389. Revision 1.16 1999/03/23 15:11:27 peter
  390. * desktop saving things
  391. * vesa mode
  392. * preferences dialog
  393. Revision 1.15 1999/03/19 16:04:28 peter
  394. * new compiler dialog
  395. Revision 1.14 1999/03/16 12:38:08 peter
  396. * tools macro fixes
  397. + tph writer
  398. + first things for resource files
  399. Revision 1.13 1999/03/01 15:41:51 peter
  400. + Added dummy entries for functions not yet implemented
  401. * MenuBar didn't update itself automatically on command-set changes
  402. * Fixed Debugging/Profiling options dialog
  403. * TCodeEditor converts spaces to tabs at save only if efUseTabChars is set
  404. * efBackSpaceUnindents works correctly
  405. + 'Messages' window implemented
  406. + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros
  407. + Added TP message-filter support (for ex. you can call GREP thru
  408. GREP2MSG and view the result in the messages window - just like in TP)
  409. * A 'var' was missing from the param-list of THelpFacility.TopicSearch,
  410. so topic search didn't work...
  411. * In FPHELP.PAS there were still context-variables defined as word instead
  412. of THelpCtx
  413. * StdStatusKeys() was missing from the statusdef for help windows
  414. + Topic-title for index-table can be specified when adding a HTML-files
  415. Revision 1.12 1999/02/22 11:51:34 peter
  416. * browser updates from gabor
  417. Revision 1.11 1999/02/20 15:18:28 peter
  418. + ctrl-c capture with confirm dialog
  419. + ascii table in the tools menu
  420. + heapviewer
  421. * empty file fixed
  422. * fixed callback routines in fpdebug to have far for tp7
  423. Revision 1.10 1999/02/11 19:07:19 pierre
  424. * GDBWindow redesigned :
  425. normal editor apart from
  426. that any kbEnter will send the line (for begin to cursor)
  427. to GDB command !
  428. GDBWindow opened in Debugger Menu
  429. still buggy :
  430. -echo should not be present if at end of text
  431. -GDBWindow becomes First after each step (I don't know why !)
  432. Revision 1.9 1999/02/08 17:40:00 pierre
  433. + cmContToCursor added
  434. Revision 1.8 1999/02/04 12:23:43 pierre
  435. + cmResetDebugger and cmGrep
  436. * Avoid StatusStack overflow
  437. Revision 1.7 1999/01/22 10:24:02 peter
  438. * first debugger things
  439. Revision 1.6 1999/01/21 11:54:12 peter
  440. + tools menu
  441. + speedsearch in symbolbrowser
  442. * working run command
  443. Revision 1.5 1999/01/12 14:29:33 peter
  444. + Implemented still missing 'switch' entries in Options menu
  445. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  446. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  447. ASCII chars and inserted directly in the text.
  448. + Added symbol browser
  449. * splitted fp.pas to fpide.pas
  450. Revision 1.4 1999/01/04 11:49:43 peter
  451. * 'Use tab characters' now works correctly
  452. + Syntax highlight now acts on File|Save As...
  453. + Added a new class to syntax highlight: 'hex numbers'.
  454. * There was something very wrong with the palette managment. Now fixed.
  455. + Added output directory (-FE<xxx>) support to 'Directories' dialog...
  456. * Fixed some possible bugs in Running/Compiling, and the compilation/run
  457. process revised
  458. Revision 1.2 1998/12/28 15:47:43 peter
  459. + Added user screen support, display & window
  460. + Implemented Editor,Mouse Options dialog
  461. + Added location of .INI and .CFG file
  462. + Option (INI) file managment implemented (see bottom of Options Menu)
  463. + Switches updated
  464. + Run program
  465. Revision 1.3 1998/12/22 10:39:41 peter
  466. + options are now written/read
  467. + find and replace routines
  468. }