nCrt history

nCrt is a partial replacement for the standard FPC crt unit. The FPC unit works well mostly only with the VT100 terminal type and the Linux console. nCrt uses the ncurses library for all it's screen manipulation, so the big gain is in terminal independence. Although not intended as a drop-in replacement for crt, nCrt includes most of the procedures and functions from crt, as well as many more functions to ease up screen control when writing programs with FPC on Linux. For the most part, it should not be necessary to use crt or ncurses directly, as nCrt handles multiple windows, cursor control and colors. A Linux version of the old inline FWrite() is included which writes a string to the screen with x,y positioning, color, and a defined clear-to-col, without moving the cursor. Screens can also be built incrementally, then put to the screen with a single call. Michael's ncurses unit is required.
Version 1.01, Nov 22,1999 - Released to ftp.
Version 1.02, Nov 26,1999 - Added new function nKeyPressed(). This is like keypressed but uses a timeout value and no cpu cycles.
Version 1.03, Dec 01,1999 - Added global variable nIsActive. This is set to true when StartCurses() returns succesfully. Any nCrt function that accesses the ncurses library will simply exit if nIsActive is FALSE.
Version 1.04, Dec 03,1999 - Added procedures nHLine, nVLine, nWriteAC, and some more ACS functions. These add new capabilities for, and correct some problems when using the line drawing characters.
Version 1.10, Dec 12,1999 - This version has had much rework done to make it more robust, more efficient, and easier to use. The main addition to this version is a window object using BP7 style OOP. All of the procedural style code is still available, but the window object makes working with multiple windows much simpler. Also included in this version is the addition of a string editor which uses the cursor keys and can trap for the function keys and other extended keys. The demo program, ncrt_demo, has been updated to show the OOP windowing functions and also another demo program, edit_demo, has been added to show a very simple wysiwyg screen editor using the OOP functions.
Version 1.11, Dec 12,1999 - Added Special property to tEC object. This allows a list of any normal characters to trigger SEdit() to exit when specified.


Version 2.00, Dec 14, 1999 - More major rework!
nCrt has been split into two separate units. nCrt and oCrt. nCrt is now a drop-in replacement for the FPC crt unit. It contains all of, and only the functions, procedures, and variables available in the standard crt unit. oCrt includes all of the functionality of nCrt, plus all of the OOP extensions introduced in version 1.10 of nCrt. Please note that if using oCrt, it is not necessary to include nCrt in your uses clause.
Version 2.01, Dec 15, 1999 - A tnWindow object now becomes the target for stdout following Init & Show. A Hide will put the target back to stdscr. Added nSetActiveWin() to manually pick a target window for stdout.
Version 2.02, Dec 15, 1999 - Some minor bug fixes and improvements.
Version 2.03, Dec 16, 1999 - More minor bug fixes. Added support for the shifted f-keys and also the standard BP alt'd keyset.
Version 2.04, Jan 04, 2000 - keypressed function changed back to using getch vs. select. Using select defeated the ability to use a "while keypressed" block that's checking for char(0) followed by a second scan code to identify an extended keycode. The required ncurses ungetch used in nReadkey does not produce a change in STDIN.
Version 2.05, Jan 06, 2000 - echoing and refresh now work more reliably with oCrt. nDelWindow now checks the window pointers more thoroughly and validates the active window. Window() changed to position the cursor to x1,y1 and not clear the window. This is consistant with crt. FWrite now uses a flag to check whether it's working internally (by the unit) or externally (by the app) to fix some problems with using the wrong window pointer. nSEdit was not setting tec.firsttime when tec.special was processed so characters were being lost.
Version 2.06, Jan 11, 2000 - Fixed a regression bug with Keypressed from 2.04 changes. It now works correctly with windows again. ClrEol now correctly uses the current textattr value rather than the window color.
Version 2.07, Jan 31, 2000 - Changes to TextAttr constant are now reflected at next write. Added GetColor, GetFrameColor, GetHeaderColor methods to tnWindow object.
Version 2.08, June 09, 2000 - Added nCheckPXPicture() function. This function adds input masking capabilities to nSEdit() by using a picture string. Used by itself, a program can guaranty that a string matches a defined picture string format.
Version 2.08.01, June 11, 2000 - Fix for nCheckPXPicture() spin cycle problem.
Version 2.09, June 16, 2000 - Minor bug fixes. nEdit() is now overloaded to edit types other than strings. nEdit can now use control keys for cursor movement (good for dumb terminals). Improved the handling of embedded control characters in an nEdit string. The demo "edit_demo" has been dressed up a bit.
Version 2.10, June 23, 2000 - Minor bug fixes. Added character mapping to the editing functions. Added functions nEditNumber() and nEditDate().
Version 2.11, June 27, 2000 - Fixed some bugs introduced in 2.10 ;-( Also some loose ends with 2.10. Re-worked oCrt internals some and added some more overloaded edit functions along with FWrite. These functions can be called with or without a window pointer so that they can be used for a specific window or the currently active window. CrtRead() in nCrt now uses ncurses for keyboard input so console control keys work correctly.
Version 2.12, June 29, 2000 - Added nMakeWindow procedure as a one-line procedural wrapper for tnWindow.Init and tnWindow.PutHeader methods. Added tnWindow.GetX, GetY, and IsFramed methods. Added db_demo program that simulates a database record editor.
Version 2.13, June 30, 2000 - Added nStop and nStart procedures. These are important for programs that spawn other processes that require normal output to the console. nStop will temporarily disable ncurses processing. nStart will reinstate ncurses processing. Note that this is NOT a complete shutdown and restarting of ncurses.
Version 2.14, July 05, 2000 - Added nEscDelay and nCursor functions. nEscDelay sets the delay time after pressing the esc key to determine if it was a single key or an escape combo. nCursor sets the cursor visibility state to invisible, visible, or very visible.

Version 2.15, July 25, 2000 - Added nMaxRows and nMaxCols consts which are initialzed at unit startup. These are the maximum rows and columns values of the full screen window. Added the tnMenu object. This is an OOP wrapper for the ncurses menu library. Currently, it is fully functional, providing single or multiple row/col, framed or unframed menus with colors, positioned anywhere on the screen, and with full cursor navigation using the keypad arrows, etc., or using control keys for dumb terminals. This is the first level of menuing functionality, with more to be added later.

Version 2.16, August 28, 2000 - Lot's of small internal adjustments. Added nTermName. Added some new methods to the tnMenu object. Added tnWindow.Resize method. Added new procedures for reading character and color info from the screen including nGrabScreen and nPopScreen for saving and restoring portions or all of a screen. See screen_demo.pp for examples of use. The edit_demo program has been enhanced some with more menuing work and it now reads and writes text files and includes full navigation with scrolling and paging through the entire file in memory.
Note: Some modifications to update ncurses.pp were required so make sure you use the ncurses.pp included with nCrt.

Version 2.16.01, October 09, 2000 - Bug fix. Keypressed function was echoing the character typed. Amazing it went this long undetected!

Version 2.16.02, December 08, 2000 - Added nkTab const. nShowMessage now sets and restores textattr.

Version 2.16.03, February 09, 2001 - Bug fix. nClreol was not handling TextAttr completely.

Version 2.16.04, February 15, 2001 - Bug fix. Added patch to update WindMin and WindMax in Window() procedure. Thanks to Santucco for submitting the patch!

Version 2.16.05, May 13, 2002 - Updates for stricter 1.06 compiler.

Version 2.17.00, March 07, 2003 - Added some minor language support. Added overloaded versions of tnWindow.Align() for using optional offsets. Based on ideas from Rainer Hantsch. Thanks Rainer!

Back to Cncware Free Pascal Library