Category : Modula II Source Code
Archive   : SCROLL.ZIP
Filename : SCROLLT.MOD

 
Output of file : SCROLLT.MOD contained in archive : SCROLL.ZIP
MODULE ScrollT ;

(* Demonstration program for Scroll, a Window *)
(* scrolling module for JPI TopSpeed Modula-2 *)
(* Roy Harvey 1988 (bix id "royharv") *)
(* Placed in the public domain - good luck *)

IMPORT Lib, Window, IO; (* From JPI *)
IMPORT KbdInput, Key ; (* From PMI's Repertoire *)
IMPORT Scroll ;

VAR W1 : Window.WinType ;
VAR ScrollInfo : Scroll.ScrollData ;
VAR Result : BOOLEAN ;

(*==========================================================================*)
PROCEDURE StartUpWindow ;
VAR
WD : Window.WinDef ;
P : Window.PaletteDef ;
BEGIN
WITH WD DO
X1 := 20 ; Y1 := 0 ;
X2 := 60 ; Y2 := 24 ;
CursorOn := FALSE ;
WrapOn := FALSE ;
Hidden := FALSE ;
FrameOn := TRUE ;
FrameDef := Window.SingleFrame ;
END ;

W1 := Window.PaletteOpen(WD, Scroll.DfltP) ;

END StartUpWindow;

(*==========================================================================*)
PROCEDURE WriteALine(n: CARDINAL) ;

BEGIN ;

IO.WrCard(n, 5) ;
Window.ClrEol ;

END WriteALine ;

(*==========================================================================*)
PROCEDURE SetUpScrolling() ;

BEGIN ;

ScrollInfo.NumberOfScrollableEntries := 125 ;
ScrollInfo.First := 1 ;
ScrollInfo.High := 1 ;
ScrollInfo.HighOn := TRUE ;
ScrollInfo.LowPaletteEntry := Scroll.DfltLowPE ;
ScrollInfo.HighPaletteEntry := Scroll.DfltHighPE ;
ScrollInfo.WriteOneProc := WriteALine ;
Result := Scroll.ScrollInit(W1, ScrollInfo) ;

END SetUpScrolling ;

(*==========================================================================*)
PROCEDURE LoopOnKeyboard() ;

VAR KeyStroke : CARDINAL ;

BEGIN ;

LOOP
KeyStroke := KbdInput.KeyHit(KbdInput.AnyKeyNum) ;
CASE KeyStroke OF
| Key.Escape : EXIT ;
| Key.Home : Result := Scroll.GeneralScroll(W1, ScrollInfo, Scroll.ScrHome) ;
| Key.Up : Result := Scroll.GeneralScroll(W1, ScrollInfo, Scroll.ScrUp) ;
| Key.Down : Result := Scroll.GeneralScroll(W1, ScrollInfo, Scroll.ScrDown) ;
| Key.PgUp : Result := Scroll.GeneralScroll(W1, ScrollInfo, Scroll.ScrPgUp) ;
| Key.PgDn : Result := Scroll.GeneralScroll(W1, ScrollInfo, Scroll.ScrPgDown) ;
| Key.CtrlPgDn: Result := Scroll.GeneralHighlight(W1, ScrollInfo, Scroll.WLineLast) ;
| Key.CtrlPgUp: Result := Scroll.GeneralHighlight(W1, ScrollInfo, Scroll.WLineFirst) ;
| Key.End : Result := Scroll.GeneralScroll(W1, ScrollInfo, Scroll.ScrEnd) ;
END ;
END ;

END LoopOnKeyboard ;

(*==========================================================================*)
BEGIN ;

StartUpWindow() ;
SetUpScrolling() ;
LoopOnKeyboard() ;

Window.CursorOn ;

END ScrollT .


  3 Responses to “Category : Modula II Source Code
Archive   : SCROLL.ZIP
Filename : SCROLLT.MOD

  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/