crt.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <?xml version="1.0" encoding="ISO8859-1"?>
  2. <fpdoc-descriptions>
  3. <!--
  4. $Id$
  5. This file is part of the FPC documentation.
  6. Copyright (C) 1997, by Michael Van Canneyt
  7. The FPC documentation is free text; you can redistribute it and/or
  8. modify it under the terms of the GNU Library General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11. The FPC Documentation is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Library General Public License for more details.
  15. You should have received a copy of the GNU Library General Public
  16. License along with the FPC documentation; see the file COPYING.LIB. If not,
  17. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. Boston, MA 02111-1307, USA.
  19. -->
  20. <package name="rtl">
  21. <module name="crt">
  22. <short>CRT - Turbo Pascal screen and keyboard handling unit</short>
  23. <!-- \FPCexampledir{crtex} -->
  24. <descr>
  25. <p>
  26. This chapter describes the <var>CRT</var> unit for Free Pascal, both under dos
  27. linux and Windows. The unit was first written for dos by Florian klaempfl.
  28. The unit was ported to linux by Mark May and enhanced by Michael Van Canneyt
  29. and Peter Vreman. It works on the linux console, and in xterm and rxvt windows
  30. under X-Windows. The functionality for both is the same, except that under
  31. linux the use of an early implementation (versions 0.9.1 and earlier of the
  32. compiler) the crt unit automatically cleared the screen at program startup.
  33. </p>
  34. <p>
  35. There are some caveats when using the CRT unit:
  36. </p>
  37. <ul>
  38. <li> Programs using the CRT unit will <em> not</em> be usable when input/output
  39. is being redirected on the command-line.
  40. </li>
  41. <li> For similar reasons they are not usable as CGI-scripts for use with a
  42. webserver.
  43. </li>
  44. <li> The use of the CRT unit and the graph unit may not always be supported.
  45. </li>
  46. <li> On linux or other unix OSes , executing other programs that expect
  47. special terminal behaviour (using one of the special functions in the linux
  48. unit) will not work. The terminal is set in RAW mode, which will destroy
  49. most terminal emulation settings.
  50. </li>
  51. </ul>
  52. </descr>
  53. <element name="Black">
  54. <short>Black color attribute</short>
  55. </element>
  56. <element name="Blue">
  57. <short>Blue color attribute</short>
  58. </element>
  59. <element name="Green">
  60. <short>Green color attribute</short>
  61. </element>
  62. <element name="Cyan">
  63. <short>Cyan color attribute</short>
  64. </element>
  65. <element name="Red">
  66. <short>Red color attribute</short>
  67. </element>
  68. <element name="Magenta">
  69. <short>Magenta color attribute</short>
  70. </element>
  71. <element name="Brown">
  72. <short>Brown color attribute</short>
  73. </element>
  74. <element name="LightGray">
  75. <short>Light gray color attribute</short>
  76. </element>
  77. <element name="DarkGray">
  78. <short>Dark gray color attribute</short>
  79. </element>
  80. <element name="LightBlue">
  81. <short>Light Blue color attribute</short>
  82. </element>
  83. <element name="LightGreen">
  84. <short>Light green color attribute</short>
  85. </element>
  86. <element name="LightCyan">
  87. <short>Light cyan color attribute</short>
  88. </element>
  89. <element name="LightRed">
  90. <short>Light red color attribute</short>
  91. </element>
  92. <element name="LightMagenta">
  93. <short>Light magenta color attribute</short>
  94. </element>
  95. <element name="Yellow">
  96. <short>Yellow color attribute</short>
  97. </element>
  98. <element name="White">
  99. <short>White color attribute</short>
  100. </element>
  101. <element name="Blink">
  102. <short>Blink attribute</short>
  103. </element>
  104. <element name="TextAttr">
  105. <short>Mask to filter text attribute</short>
  106. <descr>
  107. The <var>TextAttr</var> variable controls the attributes with which characters
  108. are written to screen.
  109. </descr>
  110. </element>
  111. <element name="TextChar">
  112. <short>Text character used when filling</short>
  113. </element>
  114. <element name="CheckBreak">
  115. <short>Check for CTRL-Break keystroke. Not used.</short>
  116. </element>
  117. <element name="CheckEOF">
  118. <short>Check for EOF on standard input. Not used.</short>
  119. </element>
  120. <element name="CheckSnow">
  121. <short>Check snow on CGA screens. Not used.</short>
  122. </element>
  123. <element name="DirectVideo">
  124. <short>Use direct video access. DOS only</short>
  125. <descr>
  126. The <var>DirectVideo</var> variable controls the writing to the screen. If it is
  127. <var>True</var>, the the cursor is set via direct port access. If <var>False</var>,
  128. then the BIOS is used. This is defined under dos only.
  129. </descr>
  130. </element>
  131. <element name="LastMode">
  132. <short>Last screen mode.</short>
  133. <descr>
  134. The <var>Lastmode</var> variable tells you which mode was last selected for the
  135. screen. It is defined on DOS only.
  136. </descr>
  137. </element>
  138. <element name="WindMin">
  139. <short>Minimum window dimension</short>
  140. </element>
  141. <element name="WindMax">
  142. <short>Maximum window dimension</short>
  143. </element>
  144. <element name="WindMaxX">
  145. <short>Maximum window X size</short>
  146. </element>
  147. <element name="WindMaxY">
  148. <short>Maximum window Y size</short>
  149. </element>
  150. <element name="WindMinX">
  151. <short>Minimum window X size</short>
  152. </element>
  153. <element name="WindMinY">
  154. <short>Minimum window Y size</short>
  155. </element>
  156. <element name="ScreenWidth">
  157. <short>Current screen width</short>
  158. </element>
  159. <element name="ScreenHeight">
  160. <short>Current screen height.</short>
  161. </element>
  162. <element name="bw40">
  163. <short>40 columns black and white screen mode.</short>
  164. </element>
  165. <element name="co40">
  166. <short>40 columns color screen mode.</short>
  167. </element>
  168. <element name="c40">
  169. <short>40 columns color screen mode.</short>
  170. </element>
  171. <element name="bw80">
  172. <short>80 columns black and white screen mode.</short>
  173. </element>
  174. <element name="co80">
  175. <short>80 columns color screen mode.</short>
  176. </element>
  177. <element name="c80">
  178. <short>80 columns color screen mode.</short>
  179. </element>
  180. <element name="mono">
  181. <short>Monochrome screen mode (hercules screens)</short>
  182. </element>
  183. <element name="Font8x8">
  184. <short>Internal ROM font mode</short>
  185. </element>
  186. <element name="ConsoleMaxX" skip="1"/>
  187. <element name="ConsoleMaxY" skip="1"/>
  188. <element name="Flushing" skip="1"/>
  189. <element name="PConsoleBuf" skip="1"/>
  190. <element name="TCharAttr" skip="1"/>
  191. <element name="TConsoleBuf" skip="1"/>
  192. <element name="ConsoleBuf" skip="1"/>
  193. <element name="AssignCrt">
  194. <short>Assign file to CRT.</short>
  195. <descr>
  196. <var>AssignCrt</var> Assigns a file <var>F</var> to the console. Everything written to
  197. the file <var>F</var> goes to the console instead. If the console contains a window,
  198. everything is written to the window instead.
  199. </descr>
  200. <errors>
  201. None.
  202. </errors>
  203. <seealso>
  204. <link id="Window"/>
  205. </seealso>
  206. <example file="crtex/ex1"/>
  207. </element>
  208. <element name="CursorBig">
  209. <short>Show big cursor</short>
  210. <descr>
  211. <var>CursorBig</var> makes the cursor a big rectangle.
  212. Not implemented on unixes.
  213. </descr>
  214. <errors>
  215. None.
  216. </errors>
  217. <seealso>
  218. <link id="CursorOn"/>
  219. <link id="CursorOff"/>
  220. </seealso>
  221. </element>
  222. <element name="ClrEol">
  223. <short>Clear from cursor position till end of line.</short>
  224. <descr>
  225. <var>ClrEol</var> clears the current line, starting from the cursor position, to the
  226. end of the window. The cursor doesn't move
  227. </descr>
  228. <errors>
  229. None.
  230. </errors>
  231. <seealso>
  232. <link id="DelLine"/>
  233. <link id="InsLine"/>
  234. <link id="ClrScr"/>
  235. </seealso>
  236. <example file="crtex/ex9"/>
  237. </element>
  238. <element name="ClrScr">
  239. <short>Clear current window.</short>
  240. <descr>
  241. <var>ClrScr</var> clears the current window (using the current colors),
  242. and sets the cursor in the top left
  243. corner of the current window.
  244. </descr>
  245. <errors>
  246. None.
  247. </errors>
  248. <seealso>
  249. <link id="Window"/>
  250. </seealso>
  251. <example file="crtex/ex8"/>
  252. </element>
  253. <element name="CursorOff">
  254. <short>Hide cursor</short>
  255. <descr>
  256. <var>CursorOff</var> switches the cursor off (i.e. the cursor is no
  257. longer visible). Not implemented on unixes.
  258. </descr>
  259. <errors>
  260. None.
  261. </errors>
  262. <seealso>
  263. <link id="CursorOn"/>
  264. <link id="CursorBig"/>
  265. </seealso>
  266. </element>
  267. <element name="CursorOn">
  268. <short>Display cursor</short>
  269. <descr>
  270. <var>CursorOn</var> switches the cursor on. Not implemented on unixes.
  271. </descr>
  272. <errors>
  273. None.
  274. </errors>
  275. <seealso>
  276. <link id="CursorBig"/>
  277. <link id="CursorOff"/>
  278. </seealso>
  279. </element>
  280. <element name="Delay">
  281. <short>Delay program execution.</short>
  282. <descr>
  283. <var>Delay</var> waits a specified number of milliseconds. The number of specified
  284. seconds is an approximation, and may be off a lot, if system load is high.
  285. </descr>
  286. <errors>
  287. None
  288. </errors>
  289. <seealso>
  290. <link id="Sound"/>
  291. <link id="NoSound"/>
  292. </seealso>
  293. <example file="crtex/ex15"/>
  294. </element>
  295. <element name="DelLine">
  296. <short>Delete line at cursor position.</short>
  297. <descr>
  298. <var>DelLine</var> removes the current line. Lines following the current line are
  299. scrolled 1 line up, and an empty line is inserted at the bottom of the
  300. current window. The cursor doesn't move.
  301. </descr>
  302. <errors>
  303. None.
  304. </errors>
  305. <seealso>
  306. <link id="ClrEol"/>
  307. <link id="InsLine"/>
  308. <link id="ClrScr"/>
  309. </seealso>
  310. <example file="crtex/ex11"/>
  311. </element>
  312. <element name="GotoXY">
  313. <short>Set cursor position on screen.</short>
  314. <descr>
  315. <var>GotoXY</var> positions the cursor at <var>(X,Y)</var>, <var>X</var> in horizontal, <var>Y</var> in
  316. vertical direction relative to the origin of the current window. The origin
  317. is located at <var>(1,1)</var>, the upper-left corner of the window.
  318. </descr>
  319. <errors>
  320. None.
  321. </errors>
  322. <seealso>
  323. <link id="WhereX"/>
  324. <link id="WhereY"/>
  325. <link id="Window"/>
  326. </seealso>
  327. <example file="crtex/ex6"/>
  328. </element>
  329. <element name="HighVideo">
  330. <short>Switch to highlighted text mode</short>
  331. <descr>
  332. <var>HighVideo</var> switches the output to highlighted text. (It sets the high
  333. intensity bit of the video attribute)
  334. </descr>
  335. <errors>
  336. None.
  337. </errors>
  338. <seealso>
  339. <link id="TextColor"/>
  340. <link id="TextBackground"/>
  341. <link id="LowVideo"/>
  342. <link id="NormVideo"/>
  343. </seealso>
  344. <example file="crtex/ex14"/>
  345. </element>
  346. <element name="InsLine">
  347. <short>Insert an empty line at cursor position</short>
  348. <descr>
  349. <var>InsLine</var> inserts an empty line at the current cursor position.
  350. Lines following the current line are scrolled 1 line down,
  351. causing the last line to disappear from the window.
  352. The cursor doesn't move.
  353. </descr>
  354. <errors>
  355. None.
  356. </errors>
  357. <seealso>
  358. <link id="ClrEol"/>
  359. <link id="DelLine"/>
  360. <link id="ClrScr"/>
  361. </seealso>
  362. <example file="crtex/ex10"/>
  363. </element>
  364. <element name="KeyPressed">
  365. <short>Check if there is a keypress in the keybuffer</short>
  366. <descr>
  367. <var>Keypressed</var> scans the keyboard buffer and sees if a key has
  368. been pressed. If this is the case, <var>True</var> is returned. If not,
  369. <var>False</var> is returned. The <var>Shift, Alt, Ctrl</var> keys are not reported.
  370. The key is not removed from the buffer, and can hence still be read after
  371. the <var>KeyPressed</var> function has been called.
  372. </descr>
  373. <errors>
  374. None.
  375. </errors>
  376. <seealso>
  377. <link id="ReadKey"/>
  378. </seealso>
  379. <example file="crtex/ex2"/>
  380. </element>
  381. <element name="LowVideo">
  382. <short>Switch to low intensity colors.</short>
  383. <descr>
  384. <p>
  385. <var>LowVideo</var> switches the output to non-highlighted text. (It clears the high
  386. intensity bit of the video attribute)
  387. </p>
  388. <p>
  389. For an example, see <link id="HighVideo"/>
  390. </p>
  391. </descr>
  392. <errors>
  393. None.
  394. </errors>
  395. <seealso>
  396. <link id="TextColor"/>
  397. <link id="TextBackground"/>
  398. <link id="HighVideo"/>
  399. <link id="NormVideo"/>
  400. </seealso>
  401. </element>
  402. <element name="NormVideo">
  403. <short>Return to normal (startup) modus</short>
  404. <descr>
  405. <p>
  406. <var>NormVideo</var> switches the output to the defaults, read at startup. (The
  407. defaults are read from the cursor position at startup)
  408. </p>
  409. <p>
  410. For an example, see <link id="HighVideo"/>
  411. </p>
  412. </descr>
  413. <errors>
  414. None.
  415. </errors>
  416. <seealso>
  417. <link id="TextColor"/>
  418. <link id="TextBackground"/>
  419. <link id="LowVideo"/>
  420. <link id="HighVideo"/>
  421. </seealso>
  422. </element>
  423. <element name="NoSound">
  424. <short>Stop system speaker</short>
  425. <descr>
  426. <var>NoSound</var> stops the speaker sound.
  427. This call is not supported on all operating systems.
  428. </descr>
  429. <errors>
  430. None.
  431. </errors>
  432. <seealso>
  433. <link id="Sound"/>
  434. </seealso>
  435. <example file="crtex/ex16"/>
  436. </element>
  437. <element name="ReadKey">
  438. <short>Read key from keybuffer</short>
  439. <descr>
  440. <p>
  441. <var>ReadKey</var> reads 1 key from the keyboard buffer, and returns this.
  442. If an extended or function key has been pressed, then the zero ASCII code is
  443. returned. You can then read the scan code of the key with a second ReadKey
  444. call.
  445. </p>
  446. <p>
  447. Key mappings under Linux can cause the wrong key to be
  448. reported by <var>ReadKey</var>, so caution is needed when using
  449. <var>ReadKey</var>.
  450. </p>
  451. </descr>
  452. <errors>
  453. None.
  454. </errors>
  455. <seealso>
  456. <link id="KeyPressed"/>
  457. </seealso>
  458. <example file="crtex/ex3"/>
  459. </element>
  460. <element name="Sound">
  461. <short>Sound system speaker</short>
  462. <descr>
  463. <var>Sound</var> sounds the speaker at a frequency of <var>hz</var>. Under Windows,
  464. a system sound is played and the frequency parameter is ignored.
  465. On other operating systems, this routine may not be implemented.
  466. </descr>
  467. <errors>
  468. None.
  469. </errors>
  470. <seealso>
  471. <link id="NoSound"/>
  472. </seealso>
  473. </element>
  474. <element name="TextBackground">
  475. <short>Set text background</short>
  476. <descr>
  477. <var>TextBackground</var> sets the background color to <var>CL</var>. <var>CL</var> can be one of the
  478. predefined color constants.
  479. </descr>
  480. <errors>
  481. None.
  482. </errors>
  483. <seealso>
  484. <link id="TextColor"/>
  485. <link id="HighVideo"/>
  486. <link id="LowVideo"/>
  487. <link id="NormVideo"/>
  488. </seealso>
  489. <example file="crtex/ex13"/>
  490. </element>
  491. <element name="TextColor">
  492. <short>Set text color</short>
  493. <descr>
  494. <var>TextColor</var> sets the foreground color to <var>CL</var>. <var>CL</var> can be one of the
  495. predefined color constants.
  496. </descr>
  497. <errors>
  498. None.
  499. </errors>
  500. <seealso>
  501. <link id="TextBackground"/>
  502. <link id="HighVideo"/>
  503. <link id="LowVideo"/>
  504. <link id="NormVideo"/>
  505. </seealso>
  506. <example file="crtex/ex12"/>
  507. </element>
  508. <element name="TextMode">
  509. <short>Set screen mode.</short>
  510. <descr>
  511. <p>
  512. <var>TextMode</var> sets the textmode of the screen (i.e. the number of lines
  513. and columns of the screen). The lower byte is use to set the VGA text mode.
  514. </p>
  515. <p>
  516. This procedure is only implemented on dos.
  517. </p>
  518. </descr>
  519. <errors>
  520. None.
  521. </errors>
  522. <seealso>
  523. <link id="Window"/>
  524. </seealso>
  525. </element>
  526. <element name="WhereX">
  527. <short>Return X (horizontal) cursor position</short>
  528. <descr>
  529. <var>WhereX</var> returns the current X-coordinate of the cursor, relative to the
  530. current window. The origin is <var>(1,1)</var>, in the upper-left corner of the
  531. window.
  532. </descr>
  533. <errors>
  534. None.
  535. </errors>
  536. <seealso>
  537. <link id="GotoXY"/>
  538. <link id="WhereY"/>
  539. <link id="Window"/>
  540. </seealso>
  541. <example file="crtex/ex7"/>
  542. </element>
  543. <element name="WhereY">
  544. <short>Return Y (vertical) cursor position</short>
  545. <descr>
  546. <var>WhereY</var> returns the current Y-coordinate of the cursor, relative to the
  547. current window. The origin is <var>(1,1)</var>, in the upper-left corner of the
  548. window.
  549. </descr>
  550. <errors>
  551. None.
  552. </errors>
  553. <seealso>
  554. <link id="GotoXY"/>
  555. <link id="WhereX"/>
  556. <link id="Window"/>
  557. </seealso>
  558. <example file="crtex/ex7"/>
  559. </element>
  560. <element name="Window">
  561. <short>Create new window on screen.</short>
  562. <descr>
  563. <var>Window</var> creates a window on the screen, to which output will be sent.
  564. <var>(X1,Y1)</var> are the coordinates of the upper left corner of the window,
  565. <var>(X2,Y2)</var> are the coordinates of the bottom right corner of the window.
  566. These coordinates are relative to the entire screen, with the top left
  567. corner equal to <var>(1,1)</var>.
  568. Further coordinate operations, except for the next Window call,
  569. are relative to the window's top left corner.
  570. </descr>
  571. <errors>
  572. None.
  573. </errors>
  574. <seealso>
  575. <link id="GotoXY"/>
  576. <link id="WhereX"/>
  577. <link id="WhereY"/>
  578. <link id="ClrScr"/>
  579. </seealso>
  580. <example file="crtex/ex5"/>
  581. </element>
  582. </module>
  583. </package>
  584. </fpdoc-descriptions>