home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG077.ARC
/
SCRNHND.DOC
< prev
next >
Wrap
Text File
|
1979-12-31
|
8KB
|
164 lines
DOCUMENTATION FOR SCREEN HANDLER
Screeε handle≥ i≤ ß useful∞ anΣ fas⌠ screeε handle≥ fo≥ usσ withiε Turb∩ ì
Pascal« I⌠ replace≤ al∞ standarΣ I╧ routine≤ iε Turbo¼ includinτ Write¼ ì
Writeln, Gotoxy, LowVideo, NormVideo, ClrEol, ClrScr etc.
Therσá arσ ß numbe≥ oµ advantage≤ wheε usinτ ScrnHnd«á Onσ i≤á thσ ì
speeΣ oµ execution«á N∩ test≤ havσ beeε made¼ bu⌠ increase≤ iε speeΣ oµ ì
u≡á t∩ 10░ time≤ coulΣ bσ expected«á Thσ routine≤ als∩ usσ thσ hardwarσ ì
cursor¼á allowinτá fo≥ flashinτ anΣ differen⌠ sizσ cursors¼á a≤ wel∞á a≤ ì
eas∙ method≤ oµ turninτ oε anΣ ofµ thσ cursor«á ScrnHnΣ als∩á support≤ ì
colour, (if fitted ).
USE OF SCRNHND.
ScrnhnΣá come≤ iε tw∩ files«á Thσ firs⌠ onσ (SCRNHND.FDC⌐ contain≤ ì
FORWAR─áá declaration≤á fo≥á thσá maiεá routines«áá Thσáá seconΣáá filσ ì
(SCRNHND.FWD⌐á contain≤ thσ routine≤ themselves«á Thσ reasoε fo≥á doinτ ì
thi≤á i≤ s∩ thσ bulδ oµ thσ routine≤ caε bσ compileΣ a⌠ thσ enΣ oµá you≥ ì
program«á Placσá aεá includσá filσ fo≥ SCRNHND.FD├ a⌠ thσá to≡á oµá thσ ì
prograφá (in thσ firs⌠ includσ files)¼á anΣ iε includσ a⌠ thσ enΣ oµá thσ ì
program for the second. (ie, just before the main program block).
An assumption is made that you have a TYPE declaration
String80 = String[ 80 ];
placed in your program before the first file in included.
PROCEDURES AVAILABLE WITHIN SCRNHND.
Below is a list of procedures available.
ScreenInitá Thi≤ initialize≤ thσ ScrnHnΣ routines« Thi≤ mus⌠ bσ ì
ááááááááááááááácalleΣ oncσ fo≥ eacΦ prograφ beforσ an∙ attemp⌠ i≤ madσ ì
áááááááááááááááto use any of the routines.
ClearScreenááááUseΣ t∩ clea≥ thσ curren⌠ windo≈ areß (initially¼ th≈ ì
áááááááááááááááwhole screen). Use in place of ClrScr;
ClearEOL UseΣ t∩ clea≥ froφ thσ curren⌠ curso≥ positioε t∩ thσ enΣ ì
áááááááááááááááoµ thσ curren⌠ window« (initially¼ thσ righ⌠ hanΣ sidσ oµ ì
áááááááááááááááthe screen.
InsertLine Insert a line at the current cursor position.
DeleteLine Delete a line from the current cursor position.
InsertChar Insert a blank character at the current cursor position.
DeleteChar Delete a character from the current cursor position.
DoWrite( Str : String80 );
Replacemen⌠ fo≥ WRITE« Usσ thi≤ procedurσ t∩ placσ tex⌠ ì
áááááááááááááááoε thσ screeε a⌠ thσ curren⌠ curso≥ position« Afte≥ ì
áááááááááááááááplacinτ thσ tex⌠ oε thσ screen¼ thσ curso≥ wil∞ movσ t∩ ì
áááááááááááááááthσ enΣ oµ thσ text« Pleasσ notσ tha⌠ iµ thσ tex⌠ flow≤ ì
ááááááááááááááápas⌠ thσ enΣ oµ thσ curren⌠ window¼ i⌠ wil∞ "wrapó t∩ thσ ì
ááááááááááááááánex⌠ line« Iµ thσ tex⌠ flow≤ ofµ thσ bottoφ oµ thσ ì
ááááááááááááááácurren⌠ window¼ N╧ scrollinτ wil∞ occur« PLEAS┼ NOTE« ì
áááááááááááááááThi≤ procedurσ i≤ fa≥ morσ restricteΣ thaε thσ standarΣ ì
áááááááááááááááWRIT┼ procedure« Thi≤ procedurσ wil∞ takσ onl∙ onσ ì
áááááááááááááááparameter¼ anΣ i⌠ mus⌠ bσ ß string« Therefore¼ t∩ writσ ìèáááááááááááááááaε intege≥ o≥ rea∞ t∩ thσ screen¼ i⌠ i≤ necessar∙ t∩ ì
áááááááááááááááconver⌠ i⌠ t∩ ß string« Thi≤ procedurσ i≤ reasonabl∙ ì
áááááááááááááááslow¼ a≤ i⌠ check≤ fo≥ specia∞ contro∞ characters¼ sucΦ ì
áááááááááááááááas ^M,^G,^J,^H, and acts accordingly.
DoWriteln( Str : String80 );
Thi≤ i≤ thσ samσ a≤ DoWrite¼ excep⌠ tha⌠ thσ curso≥ i≤ ì
ááááááááááááááápu⌠ ßt the start of the next line after the write.
NMDoWrite( X,Y : byte ; Str : String80 );
Thi≤ procedurσ wil∞ pu⌠ thσ strinτ a⌠ thσ X,┘ positioε ì
áááááááááááááááwithiε thσ curren⌠ window« Thσ curso≥ i≤ no⌠ moved¼ anΣ ì
ááááááááááááááán∩ contro∞ character≤ arσ checkeΣ for« Thi≤ procedurσ i≤ ì
ááááááááááááááávery fast.
Procedure RNMDoWrite( X,Y : byte ; Str : String80 );
Thi≤ procedurσ i≤ ver∙ simila≥ t∩ thσ onσ above¼ excep⌠ ì
ááááááááááááááátha⌠ thσ X,┘ coordinate≤ arσ no⌠ withiε thσ curren⌠ ì
áááááááááááááááwindow¼ bu⌠ REA╠ coordinate≤ (ie¼ froφ thσ to≡ lef⌠ ì
ááááááááááááááácorne≥ oµ thσ screen« Notσ tha⌠ iµ n∩ window≤ arσ ì
áááááááááááááááactive, these 2 procedures are identical.
Procedure CentreText( Str : String80 ; Y : Byte );
Thi≤ procedurσ wil∞ placσ thσ strinτ a⌠ thσ centrσ oµ thσ ì
ááááááááááááááácurren⌠ window at line "Y".
Procedure SetFlash;
áááááááááááááááThi≤ procedurσ wil∞ se⌠ thσ curso≥ t∩ flashing« Thi≤ i≤ ì
áááááááááááááááthe default.
Procedure SetBlock;
áááááááááááááááThis procedure will set a block (ie no flashing) cursor.
Procedure SetSize( TopLine , BotLine : byte );
Thi≤ procedurσ allow≤ yo⌡ t∩ definσ thσ sizσ oµ thσ ì
ááááááááááááááácursor.
Function CreateWindow( x1 , y1 , x2 , y2 : byte ): byte;
Thi≤ FUNCTIO╬ wil∞ creatσ ß windo≈ a⌠ thσ position≤ ì
ááááááááááááááádefineΣ b∙ thσ parameters« X1,Y▒ i≤ thσ to≡ lef⌠ corne≥ ì
áááááááááááááááoµ thσ window¼ anΣ x2,y▓ i≤ thσ bottoφ righ⌠ corner« Thσ ì
ááááááááááááááávaluσ thσ functioε return≤ i≤ thσ numbe≥ oµ thσ window« ì
ááááááááááááááá(ie¼ thσ firs⌠ onσ wil∞ returε 1¼ seconΣ 2¼ etc)« Iµ ì
ááááááááááááááátherσ i≤ no⌠ enougΦ memor∙ availablσ t∩ creatσ thσ ì
áááááááááááááááwindow, it will return 0.
Function RestoreWindow : byte;
áááááááááááááááThi≤ FUNCTIO╬ wil∞ restorσ ONL┘ TH┼ LAS╘ CREATE─ WINDOW« ì
áááááááááááááááThσ functioε wil∞ returε thσ numbe≥ oµ thσ windo≈ tha⌠ ì
áááááááááááááááwa≤ restored« Iµ zer∩ i≤ returned¼ theσ i≤ n∩ windo≈ t∩ ì
ááááááááááááááárestore« Notσ tha⌠ al∞ screeε anΣ colou≥ informatioε i≤ ì
ááááááááááááááárestored, but no PCG or ATTRIBUTE data is stored.
Procedure RestoreAll
This procedure will restore all active windows.èProcedure DrawBorder;
Thi≤ procedurσ wil∞ dra≈ ß borde≥ arounΣ thσ curren⌠ ì
áááááááááááááááwindow« Notσ tha⌠ certaiε constant≤ arσ useΣ fo≥ thui≤ ì
áááááááááááááááprocedure¼ anΣ thesσ ma∙ havσ t∩ bσ defined(o≥ modified⌐ ì
áááááááááááááááb∙ yo⌡ beforσ thi≤ procedurσ wil∞ work« Usσ PCGE─ (als∩ ì
áááááááááááááááavailable on MBBS) to create new border characters.
Procedure TurnOnCurs;
Thi≤ procedurσ wil∞ turε oε thσ cursor« Thi≤ i≤ thσ ì
ááááááááááááááádefault.
Procedure TurnOffCurs;
áááááááááááááááThis procedure will turn OFF the cursor.
Procedure PutCurs( X , Y : byte );
Thi≤ wil∞ placσ thσ curso≥ a⌠ thσ X,┘ positioε WITHI╬ ì
áááááááááááááááTH┼ CURREN╘ WINDOW
Procedure LowVideo;
Thi≤ procedurσ wil∞ causσ resultinτ DoWritσ etπ ì
ááááááááááááááástatement≤ t∩ bσ printeΣ iε inversσ (a≤ pe≥ standarΣ ì
áááááááááááááááLowVideo).
Procedure NormVideo;
As per standard NormVideo;
Procedure SetBorderMode;
Thi≤ procedurσ wil∞ se⌠ u≡ BorderMode« Iµ thσ modσ i≤ ì
áááááááááááááááactive¼ n∩ DoWrite'≤ DoWriteln's¼ ClearEOL¼ DeleteCha≥ ì
áááááááááááááááetπ wil∞ bσ alloweΣ t∩ overwritσ thσ borde≥ characters« ì
áááááááááááááááAlso¼ wheε CreateWindo≈ i≤ called¼ ß borde≥ wil∞ ì
áááááááááááááááautomatically be drawn.
Procedure ResetBorderMode;
This procedure will RESET the BorderMode.
Procedure SetWindowColours( BCol , FCol : byte );
Thi≤ procedurσ wil∞ se⌠ thσ colour≤ oµ thσ curren⌠ ì
áááááááááááááááwindow« BCO╠ i≤ thσ BackgrounΣ colou≥ tha⌠ wil∞ bσ set¼ ì
áááááááááááááááanΣ FCO╠ i≤ thσ Forσ grounΣ colour« Thσ followinτ pre-ì
ááááááááááááááádefined constants may be used.
áááááááááááááááRED, GREEN, BLUE, YELLOW, CYAN, BLACK, WHITE.
Procedure SetUpCols(BCol , FCol , X1 , y1 , X2 , y2: integer);
Thi≤ i≤ ver∙ simila≥ t∩ thσ above¼ excep⌠ tha⌠ thσ areß t∩ bσ ì
áááááááááááááááse⌠ caε bσ specified« Pleasσ notσ tha⌠ iε botΦ procedures¼ ß ì
áááááááááááááááchecδ i≤ madσ t∩ seσ iµ colou≥ i≤ fitted¼ anΣ iµ not¼ thσ ì
ááááááááááááááástatement will be ignored.
The concept of windows:
Iε al∞ oµ thσ abovσ discussions¼ thσ X,┘ position≤ relatσ t∩ ì
thσ CURREN╘ WINDO╫ only« Initially¼ thi≤ i≤ thσ entirσ screen« E╟ ì
ClearScreeε etπ wil∞ onl∙ clea≥ thσ curren⌠ window¼ no⌠ necessaril∙ thσ ì
entire screen.
èPleasσ havσ ß looδ a⌠ thσ SCRNTST.PA╙ fo≥ ß shor⌠ examplσ oµ ho≈ thi≤ caε bσ ì
used.