Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : WINDOW.PRG

 
Output of file : WINDOW.PRG contained in archive : OOPMENU.ZIP
/*
Window.prg - Class(y) simple window class

Copyright (c) 1991, 1992 Anton van Straaten

Created 1 Aug 1991 avs
Modified 19 Aug 1991 avs
*/

#include "class(y).ch"


CREATE CLASS Window
VAR buf
VAR colorArr

EXPORT:
VAR top, left READONLY
VAR bottom, right READONLY
VAR colorSpec READONLY

METHOD show, hide
METHOD clear
METHOD frame
MESSAGE setColor METHOD winSetColor // since we use SETCOLOR() function in this module
METHOD sayAt
END CLASS


CONSTRUCTOR new( nTop, nLeft, nBottom, nRight, cColor )
::top := nTop
::left := nLeft
::bottom := nBottom
::right := nRight

::setColor( IF( cColor == NIL, SetColor(), cColor ) )
RETURN


METHOD show
LOCAL buf := SaveScreen( ::top, ::left, ::bottom, ::right )

SetColor( ::colorSpec )

IF ::buf == NIL
::clear()
ELSE
RestScreen( ::top, ::left, ::bottom, ::right, ::buf )
ENDIF

::buf := buf
RETURN self


METHOD PROCEDURE hide
LOCAL buf := SaveScreen( ::top, ::left, ::bottom, ::right )
RestScreen( ::top, ::left, ::bottom, ::right, ::buf )
::buf := buf
RETURN


METHOD PROCEDURE clear
@ ::top, ::left CLEAR TO ::bottom, ::right
RETURN


METHOD PROCEDURE frame( type )
DispBox( ::top, ::left, ::bottom, ::right, type )
RETURN


METHOD winSetColor( cColor )
IF cColor <> NIL
::colorSpec := cColor
::colorArr := ListAsArray( ::colorSpec )
ENDIF
RETURN ::colorSpec


METHOD PROCEDURE sayAt( nRow, nCol, cTxt, nColor )
LOCAL cOldColor := setcolor()
IF nColor <> NIL
SetColor( ::colorArr[nColor] )
ENDIF
@ ::top + nRow, ::left + nCol SAY cTxt
SetColor( cOldColor )
RETURN


// eof window.prg


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPMENU.ZIP
Filename : WINDOW.PRG

  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/