TSCFG.DOC 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. Customizing The TopSpeed Environment - TSCFG
  2. =============================================
  3. The TopSpeed configuration text file (TSCFG.TXT) and other files
  4. TS*.TXT included by it contain the message text, menu
  5. definitions, project system configuration and compiler
  6. definitions installed in the TopSpeed System.
  7. This information may be 're-compiled' (using TSCFG.EXE) to
  8. produce a new TSDATA.OVL data overlay which is read whenever
  9. the TopSpeed environment is entered. This allows you to change
  10. your environment menu layout, hot keys, Editing keys and text
  11. messages to your own requirements.
  12. The top-level configuration file TSCFG.TXT sets some directives
  13. (see below), then includes other .TXT files which contain
  14. configuration text as follows:
  15. TSMAIN.TXT editor keys, menus, and environment options
  16. TSPRJ.TXT configuration of project system (see Developers
  17. Guide).
  18. TSMAKE.TXT Messages and initialization data for Project
  19. System and Linker
  20. TSISL.TXT Messages for code generator
  21. TSCPP.TXT C++ compiler messages
  22. TSC.TXT C compiler messages
  23. TSPAS.TXT Pascal compiler messages
  24. TSMOD.TXT Modula2 compiler messages
  25. To run TSCFG.EXE just type:
  26. TSCFG
  27. at the main DOS or OS/2 prompt in the system directory where
  28. you keep TSDATA.OVL. This will create a new TSDATA.OVL,
  29. and the old TSDATA.OVL is renamed to TSDATA.OLD. The new
  30. configuration can then be immediately used on starting the
  31. TopSpeed Environment.
  32. You are encouraged to experiment by changing the TopSpeed
  33. Configuration File TSMAIN.TXT to discover the setup that best
  34. suits you. However, before you edit TSMAIN.TXT, you should save
  35. a copy of the file, in case you later want to go back to the
  36. default definitions supplied with the TopSpeed system.
  37. The following sections describe changes you can make within
  38. the Menu Definition File.
  39. Changing the Main Menu Type
  40. ---------------------------
  41. You can use three types of menus: pop-up, pull-down, and bar.
  42. The type of the main menu is defined by the line
  43. ! LinePull | [ TopSpeed ] <F10> <AltF9> <AltF10>
  44. which defines a "Bar" style menu (i.e. a Pull-Down menu with no
  45. frame). If you wish to have a horizontal "Pull-Down" menu with a
  46. frame, you should change LinePull to PullDown. If you want a
  47. vertical "Pop-Up" style menu, you should change LinePull to
  48. PopUp.
  49. If you wish to change the title displayed at the top of a menu,
  50. you can edit the "TopSpeed" between the square brackets ('['
  51. and ']'). For example, you may want to change it to:
  52. !PullDown [ My TopSpeed C, Hands Off! ] | <F10>
  53. You can also change the key that invokes the main menu
  54. by changing the <F10> after the '|' . For example, if you need
  55. ShiftF10 to invoke the main menu you might have the line:
  56. !PullDown [ TopSpeed ] | <ShiftF10>
  57. Changing Menu Text
  58. ------------------
  59. In the Menu Definition File, you can change the text displayed
  60. in the menu by editing the appropriate line. For example, if you
  61. want to change Files to read PcDos on the Main Menu you can
  62. change the line:
  63. {F}iles | <AltF>
  64. to
  65. {P}cDos | <AltF>
  66. Note that the character enclosed in the braces ( { and } )
  67. defines the command character that invokes the menu line.
  68. This command character may be in the middle of the word - for
  69. example, Pc{D}os - or left out altogether if not required.
  70. The number of leading spaces before the menu text defines the
  71. Level of the menu within the menu tree. Don't change this
  72. unless the menu tree is to be changed, as described in the
  73. next section.
  74. Changing the Menu Tree
  75. ----------------------
  76. In addition to changing the text of the menu, you can also
  77. change the actual structure of the menu tree. This means you
  78. can reorder menus, create new submenus or even delete
  79. unwanted commands.
  80. To illustrate how to change the menu tree, suppose you wish
  81. to group the "Compilation Functions" together in a single
  82. menu. To do this, the lines containing:
  83. {E}dit | Editor <AltE>
  84. {C}ompile | Compiler <AltC>
  85. {L}ink | Linker <AltL>
  86. {M}ake | Make <AltM>
  87. {R}un | Run program <AltR>
  88. {P}roject | {ProjOptions} [Project Options] <AltP>
  89. could be changed to:
  90. {E}dit | Editor <AltE>
  91. {C}ompilation
  92. {C}ompile | Compiler <AltC>
  93. {L}ink | Linker <AltL>
  94. {M}ake | Make <AltM>
  95. {R}un | Run program <AltR>
  96. {P}roject | {ProjOptions} [Project Options] <AltP>
  97. This creates a new submenu under the command Compilation.
  98. The indentation of the menu text (i.e. number of leading spaces)
  99. determines the start and end of each menu. In the above example,
  100. this means that the extra spaces added in front of {C}ompile
  101. cause a new submenu to be started. This submenu continues until
  102. {P}roject where the indentation returns to its previous level.
  103. Look at the Project Menu for further examples of "nested"
  104. submenus.
  105. Changing ShortCut Keys
  106. ----------------------
  107. At the end of a Menu Definition Line, there also may be a
  108. ShortCut key sequence defined. This sequence activates that
  109. function or submenu. You may change or add to these key
  110. definitions to change the ShortCut keys. For example, to assign
  111. the key F4 to the {O}ptions {R}un {C}ommand-Line function, you
  112. would change the line:
  113. {C} - Command line | Command Line
  114. to
  115. {C} - Command line | Command Line <F4>
  116. You can specify multiple keys after the line, if you need more
  117. than one key to activate the same function.
  118. You can also define keys independently of the menus. An example
  119. of this is the zoom window function, which is defined as follows:
  120. !Key | Zoom Window <F5>
  121. You can change, add to, or delete these key definitions in the
  122. same way as changing the Menu Definition lines.
  123. External DOS Commands
  124. ---------------------
  125. As you may have already noticed, there is an Action Name after
  126. the | and before the ShortCut keys in Menu and Key Definition
  127. lines. This name defines the action that is performed when the
  128. menu line is selected, or the ShortCut key is pressed.
  129. In addition to the pre-defined environment actions (which are
  130. listed further on) you can also install a DOS Command String
  131. which will be executed under a DOS shell whenever the Menu Line
  132. is selected. In this way, you can attach your own programs to
  133. the environment menus and keys. For example, if you required
  134. the DOS command
  135. delete *.bak
  136. as a menu function, then you might add the line:
  137. Delete {B}AK files | 'del *.BAK' <AltF3>
  138. to the menu definition. The DOS command required should be
  139. enclosed by single or double quote characters, and may prompt
  140. for parameters by placing %M or %P within the command string.
  141. The Editor Keys and Menus
  142. -------------------------
  143. The Environment Editor has its own specific keys and menus.
  144. These are separated from the rest of the Menu Definition by
  145. the line:
  146. !Editor
  147. Everything after this line and before the line !MsgText is
  148. only valid when within the Editor. If you want to add or
  149. change Editor keys or menus, the you should edit the lines
  150. after !Editor.
  151. Text Messages
  152. -------------
  153. Text after the !MsgText directive (and in included files)
  154. defines all the text messages used by the environment. These
  155. may be translated to other languages or personalized by adding
  156. your own text. The length of most messages may be changed,
  157. but in general it is best to retain the approximate length of
  158. each message (especially when lengthening messages). Some
  159. messages are used as initialized data and should only be
  160. changed with extreme care (or preferably not at all!) An
  161. example of this is the C reserved words.
  162. TSMAIN.TXT Format
  163. =================
  164. The TopSpeed Configuration file contains lines of text that
  165. may be either Directives, Menu Text or Message text. Blank
  166. lines are not significant, and can therefore be used for clarity.
  167. Directives inform the TSCFG program of, Menu Types, Menu Titles,
  168. Conditional sections and ShortCut Keys. The Menu Text defines
  169. the structure of the menu tree and the associated functions.
  170. The Message Text defines the text used and displayed by the
  171. TopSpeed Environment.
  172. Directives
  173. ----------
  174. Directives always begin with a '!'. Following the '!' is the
  175. directive name, together with any parameters required. Directives
  176. can be global to the entire environment, or they can be
  177. restricted to the editor.
  178. The directives, together with some examples, are as follows:
  179. Menu Type
  180. ---------
  181. You can have three forms of Menu Type directives:
  182. !PopUp [ MenuTitle ] | KeySequences
  183. or:
  184. !PullDown [ MenuTitle ] | KeySequences
  185. or:
  186. !LinePull | KeySequences
  187. Such directives define the type and title of a top level menu
  188. and any ShortCut keys that should invoke the menu. The menu
  189. title and shortcut keys are optional.
  190. The type of the top menu can be one of the following
  191. Line Pull (default), a Pull Down menu with no frame or title.
  192. Pop Up, which has vertical menu selections.
  193. Pull Down, which has horizontal menu selections.
  194. The menu title is text - enclosed by square brackets ( [ and ] )
  195. and will appear in the top center of the frame enclosing the
  196. menu. You can define one or more KeySequences to invoke the menu.
  197. The KeySequence format later.
  198. Example:
  199. !PullDown [ TopSpeed ] | <F10>
  200. specifies that the menu named "TopSpeed" is to be a pull down
  201. menu, and is to be activated by pressing F10.
  202. Editor Section
  203. --------------
  204. !Editor
  205. Generally, your directives will apply to the entire environment.
  206. Sometimes, however, you may have directives that should apply
  207. only to the editor. For example, you might want to use a
  208. different Help Line for the editor.
  209. To make this possible, the menu definition is split into two
  210. distinct sections. The first section contains general menus
  211. and keys, available from anywhere within the environment. The
  212. second section contains editor menus and keys that are only
  213. available while editing.
  214. To split the two sections, the directive !Editor must be
  215. included in the menu definition. Everything above this directive
  216. is global to the environment, and everything down to the
  217. Message text section is local to the editor.
  218. ShortCut Key Definition
  219. -----------------------
  220. !Key | Action KeySequences
  221. You can use the !Key directive to define ShortCut keys that
  222. invoke commands not found on any menu. This directive assigns
  223. the specified action to one or more key sequences.
  224. The format of actions (which can be a DOS command) is described
  225. below.
  226. Whenever a sequence of keys is pressed, the appropriate action
  227. will be invoked. Keys defined before the !Editor directive will
  228. be active anywhere within the environment, and keys defined
  229. after will be active only while editing. An example of an Editor
  230. Key is the Case Correct Key which is defined as follows:
  231. !Key | Ed Case Correct <ShiftF7>
  232. Comment
  233. -------
  234. !! <comment text>
  235. A line beginning with '!!' serves as a comment on other
  236. material. The line is ignored by the environment, but will be
  237. useful to you or someone else trying to get an overview of the
  238. file's contents. You can include comment lines anywhere in the
  239. file.
  240. Example:
  241. !! TopSpeed C Version 3.10
  242. !! -----------------------
  243. Conditional Sections
  244. --------------------
  245. Sections of the menu definition may be bracketed by the !if
  246. and !end directives these take the form:
  247. !if conditionname
  248. conditional section
  249. !end
  250. If the condition has been previously set using the !set
  251. directive (e.g: !set conditionname) then the conditional
  252. section will be read, otherwise it will be ignored by the
  253. TSCFG program. These sections may be nested and cannot
  254. bracket messages in the !MsgText section.
  255. Multiple conditions may be specified - for example
  256. !if c | cpp
  257. will cause the following lines to be included if either of
  258. the conditions have been specified.
  259. Menu Line Definition
  260. --------------------
  261. A menu line defines the menu level, the menu text, the command
  262. character, and the function to be invoked, as well as any
  263. ShortCut keys.
  264. The format of a menu line definition is:
  265. MenuText | Action KeySequences
  266. The menu text specifies what will appear on the screen when the
  267. menu is invoked. The level of the menu is determined by the
  268. number of leading spaces before the menu text.
  269. When a new submenu definition begins, its text is indented
  270. further to the right. When the submenu definition ends, the
  271. text is indented to the left to the same indentation as the
  272. parent menu.
  273. The Action is the name of the function to be invoked and is
  274. described in the following section, "Menu Actions".
  275. Note that menu lines that invoke submenus should not have an
  276. Action defined. They can have associated ShortCut keys, however.
  277. Within the menu text, you can define a single command character
  278. (which invokes that menu line) by enclosing that character
  279. within braces - for example, {E}. A command character defined
  280. in this way should be unique for that particular menu.
  281. Trailing and leading spaces are ignored within the menu text
  282. (except that leading spaces serve to define the menu level,
  283. as described above). If you need actual spaces at the beginning
  284. or end of the text, you should use the underscore _ character.
  285. This will be translated into actual spaces in the displayed
  286. menu text.
  287. A Menu Line may also contain after the '|' character, Help File
  288. Links (contained within the braces '{' and '}'), Menu title
  289. text (contained between '[' and ']') and, after the action,
  290. option definition text. Option definition text (also contained
  291. within the characters '[' and ']') is read and decoded by the
  292. TopSpeed compilers and environment so should NOT be changed.
  293. You may change the Menu Title Text however which determines the
  294. title displayed at the top and center of the menu window.
  295. Menu Actions
  296. ------------
  297. The menu actions are invoked either by a key or by menu
  298. selection. There are two different kinds of actions, Pre-Defined
  299. Actions and External Actions. Pre-Defined Actions invoke an
  300. environment command, while External Actions run an external
  301. program under DOS.
  302. Pre-Defined Actions
  303. -------------------
  304. These actions are specified by name. The first eight non-space
  305. characters in the name are significant. The following lists
  306. specify the pre-defined actions, together with the page number
  307. of the section that describes their function. The first list
  308. shows the global actions and the second list shows the actions
  309. accessible in the editor.
  310. Global Actions
  311. --------------
  312. The Global Actions, which may be invoked throughout the
  313. environment, are as follows:
  314. LoadFile (load file into editor)
  315. LoadF RO (Load file read-only)
  316. PickFile (Pick file from pick list)
  317. SaveFile (Save file in current editor)
  318. SaveAllF (Save all files)
  319. ChangeDir (Change DOS directory)
  320. Directory (Display DOS directory)
  321. DOSShell (Execute DOS Shell)
  322. Execute (Execute single line program)
  323. Quit (Leave environment)
  324. Editor (Invoke editor)
  325. Compiler (Compile program)
  326. Make (Make project)
  327. Run program (Run program)
  328. ProjNew (New project name)
  329. ProjOpt (Project options)
  330. ModelOpt (Memory model options)
  331. CompOpt (Compiler options)
  332. MakeOpt (Make options)
  333. Command Line (Command line for Run program)
  334. RunOpt (Run options)
  335. EdOpt (Editor Options)
  336. Default Filenames (Define default filenames)
  337. Default Extensions (Define default extensions)
  338. No Of Backups (No of editor file backups)
  339. Top Scroll Zone (Set top scroll zone)
  340. Bottom Scroll Zone (Set bottom scroll zone)
  341. EnvOpt (Environment option)
  342. Load Red File (Load redirection file)
  343. Red Edit (Edit redirection file)
  344. Load Macs (Load macro file)
  345. Save Macs (Save macro file)
  346. Load Config File (Load CFG file)
  347. Save Config File (Save CFG file)
  348. Asciitab (Ascii table)
  349. Calculator (Calculator)
  350. Find Error (Find run-time error)
  351. WildSearch (Search for text)
  352. Search List (Search pick-list)
  353. ScanCodes (Keyboard codes)
  354. Print (Print file)
  355. PrintSet (Print settings)
  356. Review Screen (Review DOS screen)
  357. View File (View file as data)
  358. Help (Enter help system)
  359. Info (Information window)
  360. Edit0-Edit9 (Invoke editor windows 0-9)
  361. Zoom Window (Zoom window)
  362. Cycle Windows (Cycle windows)
  363. CutKey (Cut text from screen) (Single key only)
  364. WinKey (Enter window control mode) (Single key only)
  365. Editor Actions
  366. --------------
  367. The Editor Actions, which may be invoked throughout the editor
  368. but not elsewhere, are as follows:
  369. Ed Load File Ed Load F RO Save File
  370. Ed Write File Ed Find Ed Replace
  371. Ed Start Screen Ed End Screen Ed Start File
  372. Ed End File Ed Start Line Ed End Line
  373. Ed Goto Begin Block Ed Goto End Block Ed Prev Position
  374. Ed Del End Line Ed Restore Line Ed Goto Line
  375. Save File Save All Files Ed Begin Block
  376. Ed End Block Ed Hide Block Ed Mark Word
  377. Ed Mark Line Ed Copy Block Ed Move Block
  378. Ed Del Block Ed Read Block Ed Write Block
  379. Ed Get Block Ed Print Block Ed Indent Block
  380. Ed Undo Ed Quit Ed Opt
  381. Toggle RO Ed Tab Width Ed Word Left
  382. Ed Page Down Ed Move Right Ed Move Up
  383. Ed Word Right Ed Del Forward Ed Del Backward
  384. Ed Tab Ed Find Again Ed Ins Line
  385. Ed Ins Below Ed Prefix Ed Page Up
  386. Ed Move Left Ed Del Word Ed Upper Case
  387. Ed Scrl Down Ed Move Down Ed Del Line
  388. Ed Scrl Up Ed Next Error Ed Prev Error
  389. Ed Case Correct Ed Goto M1 Ed Goto M2
  390. Ed Set M1 Ed Set M2 Paste
  391. Editor Actions can only be used as the action within the
  392. Editor section of the menu definition, while Global Actions
  393. can be used in either section.
  394. External Commands
  395. -----------------
  396. Within the environment menu system it's possible to attach an
  397. external DOS or OS/2 command or program to any key or menu entry.
  398. This can be done by enclosing the command line in either single
  399. or double quotes and using it as an Action in the Menu or Key
  400. definition described above.
  401. For example, suppose you have the following menu lines defined:
  402. {B}ackup Files | 'copy *.c a:'
  403. !Key | "find 'Version' *.h" <AltZ>
  404. If you select the {B}ackup Files menu entry, then the DOS
  405. command line:
  406. copy *.C a:
  407. is executed. Similarly, when you press AltZ the command line:
  408. find 'Version' *.h
  409. is executed.
  410. External Command Parameters
  411. ---------------------------
  412. Suppose you need to pass the current Project name to the command
  413. you want to execute. You can do this, by including %M in the
  414. command at the spot in which you want the name. Similarly %L
  415. can be used to insert the current command line set.
  416. To prompt for a string you can put %P (prompt string) in the
  417. command string. The %P will then be expanded to the entered
  418. string.
  419. For example, suppose you define:
  420. {E}rase | 'del %P(File to delete: )'
  421. {D}ebug | 'debug %M.EXE'
  422. Selecting Erase prompts for
  423. File to delete:
  424. After you type a file name (let's say, FTODEL) and press Enter,
  425. the command line:
  426. del ftodel
  427. is executed. Similarly selecting Debug will prompt for the
  428. Project name and will then execute the command
  429. debug mainfile.exe
  430. You can include as many '%P's as you need in the command string.
  431. Key Sequences
  432. -------------
  433. The !Key directives and menu entries can have one or more
  434. KeySequences attached. These key sequences consist of key names
  435. enclosed by the characters '<' and '>'.
  436. Examples of key sequences include:
  437. <AltA> Alt A
  438. <CtrlZ> Control Z
  439. <CtrlQ D> Control Q followed by D
  440. <CtrlK M 1> Control K followed by M then 1
  441. <ShiftF2> F2 Shifted
  442. <Home End> Home followed by End
  443. The following keys are valid and represent the names to use:
  444. F1 - F10 CtrlF1 - CtrlF10
  445. ShiftF1 - ShiftF10 AltF1 - AltF10
  446. Alt0 - Alt9 AltA - AltZ
  447. UpArr DownArr LeftArr RightArr
  448. CtrlUpArr CtrlDownArr CtrlLeftArr CtrlRightArr
  449. PageDown PageUp Home End
  450. CtrlPageDown CtrlPageUp CtrlHome CtrlEnd
  451. Del Ins AltEqual ShiftTab
  452. If ambiguous key sequences are defined in the menu definition
  453. (for example, CtrlK and CtrlK B and CtrlK K), then the menu
  454. system will wait a short interval after the initial sequence
  455. has been typed. If the remainder of a longer sequence is typed,
  456. within this time then the long sequence will be executed.
  457. Otherwise, the shorter sequence will be assumed. This can be
  458. used to create automatic "pop-up" menus in the menu definition.
  459. To remove the automatic Pop-Up facility from the standard menu
  460. configuration, remove the "short" key sequences - that is,
  461. remove the lines in TSMAIN.TXT containing the sequences
  462. CtrlQ, CtrlK and CtrlO.
  463. Message Text
  464. ------------
  465. The message text section is located at the end of the TSCFG.TXT
  466. file and is introduced by the !MsgText directive. Text
  467. following this directive will be interpreted as text messages.
  468. The !MsgText directive when followed by a filename can also be
  469. used to 'include' an external set of text messages.
  470. e.g:
  471. !MsgText
  472. starts the message text section.
  473. Text messages have the format: decimal number followed by a
  474. single space followed by the message text. Trailing in the
  475. message text spaces are ignored, but if required can be added
  476. by placing a '@' delimiter character at the desired end of
  477. message. In this case the '@' is deleted.
  478. Text messages must be kept in the correct numerical sequence.
  479. However some message numbers may be omitted. TopSpeed compilers
  480. have their error messages within external files and are
  481. included as described above.
  482. Generally it is easy to determine the message use from either
  483. inspection or trial and error. Some useful messages that may
  484. be configured are listed below:
  485. 25 - Default Backup extension
  486. 26 - Backup extension when no of backups > 1
  487. 34 - Printer device as used by the editor
  488. 36 - Characters used together with alpha-numerics to
  489. define a 'word'
  490. (as used by next/prev word, delete word etc)
  491. 46 - Character Prefix prompt (CtrlP)
  492. 61 - Yes or No alternative keys (YN)
  493. 73 - Abort/Retry alternative keys (AR)
  494. 81-82 - am pm for date strings
  495. 119,127,144,145,149,156,181-183 -
  496. Help lines displayed at the bottom of the screen.
  497. Text enclosed in braces is highlighted.
  498. ~nnn specifies the ASCII character nnn, which can be
  499. used to insert unprintable characters.
  500. 147 - The names of the keys
  501. 174-178,185-186,189-190,195-199:
  502. Various default filenames and extensions
  503. 180 - Search option characters
  504. 188 - Location of OS/2 error message file
  505. 193 - OS/2 Start session command line
  506. 210+n DOS error message for error n
  507. 250-264 Project file text messages
  508. 310-315 Command line options description
  509. 400-460 TopSpeed Run-time-error messages
  510. 500-516 DLL Run-time-error messages
  511.