home *** CD-ROM | disk | FTP | other *** search
- TVGRAPH 1.10
- TURBO VISION
- using TURBO VISION In EGA/VGA graphics
- (C) Mindware 1991,1993
- Brisbane,QLD,Australia
- Fido : 3:640/307
-
- 0. See Modified TVDEMO program and STYX.PAS to show you how to do things
-
- 1. All that is required is to include TVGRAPH in the uses statement in your
- main program and amazing - TV will work in graphics mode.
-
- 2. Declarations are as follows
-
- type
- PGRect=^GRect;
- GRect=Trect;
-
- PGPoint=^GPoint;
- GPoint=TPoint; (* These two just to avoid confusion *)
-
- 3. Graphics IDs
- All "text" windows are given a graphics ID of 0, each window you want
- to use graphics in - you need to assign a graphics ID to it, if a line is
- drawn using the internal RawDrawLine - then if the current graphics window
- is the same as the location you are writing to on the screen then the graphics
- will overwrite - else the graphics will be clipped.
-
- function NextGraphId:byte; (* Get next available graphics id *)
- procedure UseGraphId(b:byte); (* Use graphics ID for following graphics *)
- procedure ReleaseGraphId(b:byte); (* release graphics ID for use *)
-
- To assign a graphics id to a character cell ensure you write character n with
- attribute 0FFh into the location using standard TURBO VISION methods.
-
-
- 4. Working with BGI
- You can use BGI routines without initialising, TVgraph has already done that.
- Warning TVision will overwrite BGI graphics and vice-versa.
-
- 5. Interface Sections :
- --------------------------- TVGRAPH ---------------------------------------
- const
- cmTvGraphDraw = 1991; (* Send this to a TVGView to draw the view *)
- cmTvGraphProd = 1992; (* Send this to a TVGView to prod the view *)
-
- type
- PTVGApp = ^TVGApp;
- TVGApp = object(TProgram)
- constructor Init;
- destructor Done; virtual;
- procedure SetScreenMode(Mode: Word);
- {$IFDEF Ver70}
- procedure Cascade;
- procedure DosShell;
- procedure GetTileRect(var R: TRect); virtual;
- procedure HandleEvent(var Event: TEvent); virtual;
- procedure Tile;
- procedure WriteShellMsg; virtual;
- {$ENDIF}
- end;
-
- PTVGView = ^TVGView;
- TVGView = object(TView)
- GraphWindowId:byte;
- constructor Init(Var Bounds:Trect);
- destructor Done;virtual;
- procedure Prod; virtual;
- procedure GraphDraw; virtual;
- procedure Draw; virtual;
- procedure GetGraphBounds(var R:GRect);
- procedure GetGraphClipRect(var R:GRect);
- procedure HandleEvent(var Event:TEvent); virtual;
- end;
-
- PTVGWindow = ^TVGWindow;
- TVGWindow = object(TWindow)
- constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Integer);
- end;
-
- --------------------------- TVGDEFS ---------------------------------------
- {$IFDEF Ver60}
- const
- Seg0040=$0040;
- SegA000=$A000;
- {$ENDIF}
-
- const
- GraphXMax=10000;
- GraphYMax=07500;
- smEGA = $1010;
- smVGA = $1012;
- smGraphAutoDetect=$10FF; (* Autodetect *)
- wrmOVERWRITE = 0;
- wrmAND = 1;
- wrmOR = 2;
- wrmXOR = 3;
-
- const
- BGIPath:string='';
- CurrentGraphWindow:byte=1;
- CurrentLineStyle:word=$FFFF;
- (* Current Line style in 1=line 0=no line *)
- CurrentLineWriteMode:byte=$00;
- (* Current Write mode for lines *)
- TVgraphCheckSnow:byte=101;
- (* Set Checksnow to this to start the graphics *)
- (* Version of REP STO *)
- type
- PGRect=^GRect;
- GRect=Trect;
-
- PGPoint=^GPoint;
- GPoint=TPoint;
-
- var
- CharWidth,CharHeight:byte;
- (* Width and Height in text mode *)
- GraphWidth,GraphHeight:word;
- (* Width and height in graphics *)
- TvGraphLoc,TvGraphCursor:word;
- (* Store current text x,y and top/bottom cursor *)
- GraphMouseLoc:TPoint; (* Graphics location of Mouse *)
- TVGraphVideoMode:word;
- BytesPerLine:word; (* Bytes per line in graphics mode *)
- SaveJump:word; (* Save jump location for GraphMov *)
- FontTable:ABitFont; (* In Memory font table *)
- PtrFontTable:PABitFont;(* Pointer to In Memory font table *)
- GraphWriteAvail:array[0..4095] of byte;
- (* one byte for each text position on the screen, 0=text screen and *)
- (* a number 1-254 representing distinct graphics windows and 255 *)
- (* represents the mouse cursor positions *)
- GraphIdSet:set of byte;
- VideoBufferSeg:word; (* Video Segment for display *)
-
- procedure GlobalToPhysical(Var X,Y:integer);
- procedure PhysicalToGlobal(Var P:GPoint);
- procedure TextToGraphics(T:TRect;var G:GRect);
-
- function NextGraphId:byte;
- procedure UseGraphId(b:byte);
- procedure ReleaseGraphId(b:byte);
- function GraphIdAt(X,Y:integer):byte;
-
- procedure MouseCursorOff;
- procedure MouseCursorOn;
- procedure ResetMouse;
-
- --------------------------- TVGWHIZ ---------------------------------------
- procedure DrawLine(X1,Y1,X2,Y2:integer;Color:word);
- procedure RawDrawLine(X1,Y1,X2,Y2:integer;Color:word);
-
- ---------------------------------------------------------------------------
-
- TVGDEMEX.ZIP
-
- 168752 TVDEMO.EXE Compiled demo in real mode TP7/BP7
-
- T6DEMSRC.ZIP
-
- 3553 STYX.PAS STYX.PAS for Turbo 6 TVDEMO
- 18013 TVDEMO.PAS TVDEMO.PAS modified Turbo 6 Turbo Vision
-
- T6DEMBIN.ZIP
-
- 4256 TVGDEFS.TPU ] Demo
- 5760 TVGDRIVE.TPU ] Units
- 10928 TVGRAPH.TPU ] Compiled
- 4000 TVGWHIZ.TPU ] For TP6
-
- B7DEMBIN.ZIP
-
- 3728 TVGDEFS.TPU ] Demo
- 3616 TVGDRIVE.TPU ] Units
- 9056 TVGRAPH.TPU ] Compiled
- 2336 TVGWHIZ.TPU ] For TP7 real mode
- 3728 TVGDEFS.TPP ] Demo
- 3616 TVGDRIVE.TPP ] Units
- 9168 TVGRAPH.TPP ] Compiled
- 2352 TVGWHIZ.TPP ] For BP7 protected mode
-
- B7DEMSRC.ZIP
-
- 19714 TVDEMO.PAS TVDEMO.PAS modified TP7/BP7 Turbo Vision
- 3548 STYX.PAS STYX.PAS for Turbo 7/BP 7 TVDEMO
-