Category : Pascal Source Code
Archive   : ANSIVI.ZIP
Filename : ANSIVIEW.DOC

 
Output of file : ANSIVIEW.DOC contained in archive : ANSIVI.ZIP


ANSIVIEW.PAS

By Marcos R. Della


OVERVIEW - ANSIView is a unit that will give you the features that you came
to enjoy from the CRT unit with the earlier versions of Turbo
Pascal while still retaining the features of the new TVISION enviroment.
ANSIView provides a single object that will give you the ability to open
a "CRT" window on your desktop and interface with it exactly as you would
with a "normal" pascal program.


USAGE - To use this with your program, you will be setting it up exactly
as you would a normal window. That is, you need to initialize it
with certain parameters and insert it into your desktop chain and you
need to dispose of the window when you are done. An example of the
ANSIView window can be seen in the following:


Uses AnsiView;

Var MyWindow : PANSIWindow;

PROCEDURE MyApp.Init;
VAR R : TRect;
L : TPoint;
BEGIN
R.Assign(0,0,50,10);
L.X := 80; {Our "screen" size}
L.Y := 25;
MyWindow := NEW(PANSIWindow,Init(R,L,'Demo Window',1));
IF MyWindow <> NIL THEN
DeskTop^.Insert(MyWindow);
END;

NOTE: The L variable in this example defines the actual size of the
screen that you are trying to set up. A normal screen size is 80x25,
however you can set the X value up to MaxViewWidth and the Y value up
to MaxViewHeight. The Minimums are defined by MinWinSize.

The R variable defines the size of the window that will "actually" be
on the screen. It will include scroll bars so that you can scan around
the entire L defined screen. You can also move the window around and
Grow or Shrink the displayable view. The virtual screen will still work
to the size defined in L.

Just like the TWindow object, you can override anything in here that
you really want to however I would not recommend it. User this unit

as a basis of your own applications! Might just be interesting!



FUNCTIONS - There are quite a few functions available to the TANSIView
object. Most of these work exactly as they would in the CRT
enviroment. Those that are different I'll mention.


PROCEDURE PrintLN(s : STRING);

This procedure works like the WRITELN procedure in pascal. It will write
the string S out at the current cursor location and will screen wrap when
it hits the right "virtual" edge of the screen. It will also scroll when
it hits the bottom of the screen. Note: The displayable scrolling
region will not follow the writeln's unless AUTOSCROLL is set ON.

PROCEDURE Print(s : STRING);

This is the same as the WRITE procedure. It will do exactly the same as
the PrintLN above however it will not do a Carriage Return/LineFeed at
the end of the string.

PROCEDURE PrintChar(Ch : CHAR);

A nifty little feature. Since I couldn't make things as nice as the WRITE
routine where it figures out the type being sent to it, you get a
seperate procedure to WRITE single characters.

PROCEDURE PutChar(X, Y : WORD; Ch : CHAR; Attr : BYTE);

For those times that you want to put a specific character to the virtual
screen at a specific position. Note that this will put all 255 characters
on the screen as represented in the IBM Extended ASCII Character Set.
If ch is zero (Null) then no modification is made to the character at
that position. If Attr is zero then no change is made to the textattr
at that position.

PROCEDURE SetANSI(Flag : BOOLEAN);

Defaults to FALSE. If you set it to TRUE, then the display routines will
process ANSI requests as if there was an ANSI driver in memory for the
virtual screen. Note that the keyboard re-definitions are not part of
this implementation, just the video standards.

PROCEDURE CursorOn;

This will turn on the cursor at the cursor location when this window is
sfFocused. Note that if the cursor is outside of the relative display
box, then it will not be visible until you manuever the scroll bars
around to the current cursor location.

PROCEDURE CursorOff;

This turns off the cursor in the virtual window.

PROCEDURE AutoScrollOn;

Default to TRUE;
If you set AutoScroll to on, then the system will keep scrolling the
relative display box to match the cursor location. This is handy if
you are dumping a file to the little window and want the user to keep
up with what is being output.

PROCEDURE AutoScrollOff;

This turns off the AutoScroll feature.

PROCEDURE ClrScr;

Same as the CRT Unit. Sets the cursor to the 0,0 location.

PROCEDURE ClrEol;

Same as the CRT Unit.

PROCEDURE DelLine;

Same as the CRT Unit.

PROCEDURE GotoXY(X,Y : WORD);

Somewhat the same as the CRT Unit. This will let you go ANYWHERE in the
virtual window that you have defined. If you define a window of 80,1024
then you can do a GotoXY(50,1000) and the system will go to that virtual
location!

PROCEDURE HighVideo;

Same as the CRT Unit.

PROCEDURE InsLine;

Same as the CRT Unit.

PROCEDURE LowVideo;

Same as the CRT Unit.

PROCEDURE TextBackground(Color : BYTE);

Same as the CRT Unit.

PROCEDURE TextColor(Color : BYTE);

Same as the CRT Unit.

FUNCTION WhereX : BYTE;

Same as the CRT Unit.

FUNCTION WhereY : WORD;

Somewhat the same as the CRT Unit. This will return a value from 0 on
through your limit for the virtual screen. It might come back rather
large!

------------------------------------------------------------------------------

If you have any questions or if you have suggestions (definatly if you have
suggestions!) you can get in contact with me at one of the following...

Marcos R. Della
5084 Rincon Ave.
Santa Rosa, CA 95409

CIS: 71675,765

Note: I will be leaving for Saudi Arabia March '91 (Yes, I'm in the Army.
I'm a Tank Platoon Leader) so if you have any instant pressing
questions, I'd recommend getting them in before then as having my
mail forwarded overseas and back again after that might just get you
a LONG response time. But keep on trying. I have no idea when I'll
be back from the dessert. Might just come home early!



  3 Responses to “Category : Pascal Source Code
Archive   : ANSIVI.ZIP
Filename : ANSIVIEW.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/