Dec 102017
A Clipper 5.0 window library. Many screen functions. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
DEMO.PRG | 2250 | 796 | deflated |
MKDEMO.BAT | 39 | 33 | deflated |
VINNY50.LIB | 24773 | 5601 | deflated |
WINDOW.CH | 1902 | 452 | deflated |
WINDOW.DOC | 10351 | 3142 | deflated |
Download File VWINDOW.ZIP Here
Contents of the WINDOW.DOC file
UPLOADED TO THE PUBLIC DOMAIN ON 1/21/91
AUTHOR: VINCENT SIMONE, COMPUSERVE ID: 72740,417
With the new release of clipper 5.0 (c) I found myself needing
some windowing functions, because I did not feel like converting
my S87 versions to 5.0. So I sat down and created some functions
that would make my life easier. The one things the windowing
system lacks is a shadow, which I am working on. Every windowing
function requires a window name which you create when the window
is created. The reason for this is to provide a little more
flexibility. For example, if you had two windows on the screen and
you wanted to clear one of them and change the border on the other,
you would be able to just by substituting the window name. If you
have any questions or input, I can be reached on compuserve.
FILES IN VWINDOW.ARC
VINNY50.LIB The library that contains all the functions
DEMO.PRG A small demo showing the windowing functions
WINDOW.CH UDC for the windowing system
WINDOW.DOC The documentation (what you are reading)
MKDEMO.BAT A batch file to make the demo.prg
-----------------------------------------------------------------
VWINDOW 1.0 FUNCTION SYNTAX
FUNCTION: VWINDOW()
SYNTAX: WINDOW(,,,,,
,)
PURPOSE: VWINDOW() creates a window at expN 1-4. You can specify
the color, box type, shadow, and if you want it to
explode.
PARAMETERS:
expC = The name of the window you are creating
expN1 = starting row
expN2 = starting column
expN3 = bottom row of the window
expN4 = right part of the window
expC2 = the color string (what color you want the text)
expN5 = box type
1 = Single line (default)
2 = Double line
3 = Single line with double down the sides
4 = Double line with single down the sides
5 = Thick lines
6 = None
expL1 = Explode Toggle (.T. = Yes, .F. = NO (default)
RETURNS: NIL
EXAMPLE: VWINDOW("win1",5,10,15,70,"W+/B+",2,.T.,.T.)
FUNCTION: WKILL()
SYNTAX: WKILL(,)
PURPOSE: To un-pop a window.
PARAMETERS:
expC = The name of the window you want to un-pop
expC1 = If you want the window to implode. "I" = yes, blank no.
RETURNS: NIL
EXAMPLE: To un-pop win1: WKILL("win1")
to un-pop win1 imploding: WKILL("win1","I")
FUNCTION: WNROW()
SYNTAX: WNROW(,)
PURPOSE: Returns what row inside the window you are in.
If you wanted to go to row 2 in the window, WNROW
would return the necessary position. This function
would be used when you want to have an @ say
in a window. When you want to use this function WNROW
assumes that position 1 is the first clear area in the
window. If you had a window at 10,15,20,79 position 1
would be row 11. WNROW(1) return 11. SEE ALSO WNCOL().
PARAMETERS:
expC = The name of the window you want to use
expN = The row you want the cursor to be in
RETURNS: Numeric
EXAMPLE: To place a message in row 1 of win1:
@ WNROW("win1",1),WNCOL("win1",3) SAY "WINDOW 1"
FUNCTION: WNCOL()
SYNTAX: WNCOL(,)
PURPOSE: Returns what column inside the window you are in.
IF you wanted to go to column 50 in the window, WNCOL
would return the necessary position. SEE ALSO WNROW()
PARAMETERS:
expC = The name of the window you want to use
expN = The column you want the cursor to be in
RETURNS: Numeric
EXAMPLE: To place a message starting at column 5 of the window:
@ WNROW("win1",3),WNCOL("win1",5) SAY "WINDOW"
FUNCTION: WCLEAR()
SYNTAX: WCLEAR(,)
PURPOSE: This function will clear the text in the window you
specify. It works like the clear command but it acts
like you are in a true window environment. By specifying
you can change the color of the window.
PARAMETERS:
expC = The name of the window you want to use
expC2 = The color you want to change the window to (optional).
RETURNS: NIL
EXAMPLE: To clear any text in window 1: WCLEAR("win1")
To change the color in window 1: WCLEAR("win1","W+/B+")
FUNCTION: WTITLE()
SYNTAX: WTITLE(,,,,)
PURPOSE: To place a title on a window.
PARAMETERS:
expC = The name of the window you want to use
expC2 = The title or message you want shown
expC3 = The justification of the title:
L = Left (default)
C = Centered
R = Right
expC4 = The position of the title:
T = Top (default)
B = Bottom
expC5 = The delimiters you want to surround the title (optional)
RETURNS: NIL
EXAMPLE: To place a message in window 1:
WTITLE("win1","View Client","L","T","[]")
To center a title on the bottom
WTITLE("win1","Press To Quit","C","B")
FUNCTION: WMOVE()
SYNTAX: WMOVE(,,,,)
PURPOSE: WMOVE can be used for two things. The first is to move
a window to a new screen position. The other is to
resize a window.
PARAMETERS:
expC = The name of the window you want to use.
expN1 = The new starting row
expN2 = The new starting column
expN3 = The new bottom row
expn4 = The new starting column
RETURNS: NIL
EXAMPLE: To resize window 1:
WMOVE("win1",10,10,20,50)
FUNCTION: WSCROLL()
SYNTAX: WSCROLL(,
PURPOSE: WSCROLL will scroll text in the window you choose.
PARAMETERS:
expC = The name of the window you want to use
expN = The number of lines you want to move up or down (-,+).
RETURNS: NIL
EXAMPLE: To scroll up one line in window 1.
WSCROLL("win1",-1)
To scroll down one line.
WSCROLL("win1",1)
FUNCTION: WBORDER()
SYNTAX: WBORDER(,,)
PURPOSE: WBORDER will change or redo a border on the window you
choose.
PARAMETERS:
expC1 = The name of the window you want to use
expN = The type of box you want to use (see gbox for details)
expC2 = The color of the border (default is the current color)
RETURNS: NIL
EXAMPLE: To change the border in window 1 to thick, and the
colors to Red on White:
WBORDER("win1",5,"R+/W+")
FUNCTION: WPOP()
SYNTAX: WPOP()
PURPOSE: WPOP will re-pop a window that has currently been
un-popped
PARAMETERS:
expC = The name of the window you want to use
RETURNS: NIL
EXAMPLE: To re-pop window 1:
WPOP("win1")
NOTE: The window must currently be un-popped with WKILL
in order for it to be re-popped.
FUNCTION: WCLSTACK()
SYNTAX: WCLSTACK()
PURPOSE: WCLSTACK will clear the array that hold all the window
information
PARAMETERS:
NONE
RETURNS: NIL
EXAMPLE: To clear the window stack:
WCLSTACK()
FUNCTION: WRELEASE()
SYNTAX: WRELEASE()
PURPOSE: WRELEASE will delete a window from the stack
PARAMETERS:
expC = The name of the window you want to use
RETURNS: NIL
EXAMPLE: To delete window 1 from the stack:
WRELEASE("win1")
FUNCTION: WSAY()
SYNTAX: WSAY(,,,)
PURPOSE: WSAY will say a string at window coordinates
expN1,expN2
PARAMETERS:
expC1 = The name of the window you want to use
expN1 = The starting window row
expN2 = The starting window column
expC2 = The string to say
RETURNS: NIL
EXAMPLE: To say a message in window 1 at 3,5:
WSAY("win1",3,5,"HELLO")
FUNCTION: DBOX()
SYNTAX: DBOX(,,,,,,
PURPOSE: This will portray a string or an array in a box with or
without a shadow
PARAMETERS:
expN1 = starting row to draw box
expN2 = starting column to draw box
expCA = the string or array to display in the box
expC = The color to make the box (default current color)
expL1 = Shadow toggle .T. is include .F. don't (default .F.)
expN2 = the type of box you want drawn (default 2)
See G_BOX for details
expL2 = Exploding Box (.T. = Yes, .F. = No (default .F.)
RETURNS: NIL
EXAMPLE: To display a string in a box at row 3 column 5:
DBOX(3,5,"THIS WILL BE IN THE BOX","R+/W",.T.,1,.F.)
To display an array in a box:
ar = { "WARNING:",
"ARE YOU SURE YOU WANT TO CONTINUE:"}
DBOX(3,5,ar,"R+/W",.T.,1,.T.)
SEE ALSO UNBOX
FUNCTION: UNBOX()
SYNTAX: UNBOX()
PURPOSE: UNBOX will un-pop a window used with DBOX, and restore
the prior screen.
PARAMETERS:
NONE
RETURNS: NIL
EXAMPLE: DBOX(3,5,"ARE YOU SURE (Y/N) => ","W+/B+")
yn = INKEY(0)
IF UPPER(CHAR(yn)) = "Y"
DO ....
ENDIF
UNBOX()
FUNCTION: G_BOX
SYNTAX: G_BOX()
PURPOSE: G_BOX will return the box characters defined in box.ch
PARAMETERS:
expN = the number equivalent of the type of box desired
1 = SINGLE
2 = DOUBLE
3 = SINGLE WITH DOUBLE DOWN THE SIDES
4 = DOUBLE WITH SINGLE DOWN THE SIDES
5 = SOLID
6 = NO BORDER
RETURNS: NIL
EXAMPLE: To draw a double line on the screen:
@ 3,4,10,78 BOX G_BOX(2)
FUNCTION: SCENTE()
SYNTAX: SCENTE(expC>,,)
PURPOSE: SCENTE will center a string (expC> at the row you
specify
PARAMETERS:
expC = The string you want to specify
expN1 = The row to display the string
expN2 = The screen width (40 is the default)
RETURNS: NIL
EXAMPLE: SCENTE("THIS IS CENTERED",3)
AUTHOR: VINCENT SIMONE, COMPUSERVE ID: 72740,417
With the new release of clipper 5.0 (c) I found myself needing
some windowing functions, because I did not feel like converting
my S87 versions to 5.0. So I sat down and created some functions
that would make my life easier. The one things the windowing
system lacks is a shadow, which I am working on. Every windowing
function requires a window name which you create when the window
is created. The reason for this is to provide a little more
flexibility. For example, if you had two windows on the screen and
you wanted to clear one of them and change the border on the other,
you would be able to just by substituting the window name. If you
have any questions or input, I can be reached on compuserve.
FILES IN VWINDOW.ARC
VINNY50.LIB The library that contains all the functions
DEMO.PRG A small demo showing the windowing functions
WINDOW.CH UDC for the windowing system
WINDOW.DOC The documentation (what you are reading)
MKDEMO.BAT A batch file to make the demo.prg
-----------------------------------------------------------------
VWINDOW 1.0 FUNCTION SYNTAX
FUNCTION: VWINDOW()
SYNTAX: WINDOW(
PURPOSE: VWINDOW() creates a window at expN 1-4. You can specify
the color, box type, shadow, and if you want it to
explode.
PARAMETERS:
expC = The name of the window you are creating
expN1 = starting row
expN2 = starting column
expN3 = bottom row of the window
expN4 = right part of the window
expC2 = the color string (what color you want the text)
expN5 = box type
1 = Single line (default)
2 = Double line
3 = Single line with double down the sides
4 = Double line with single down the sides
5 = Thick lines
6 = None
expL1 = Explode Toggle (.T. = Yes, .F. = NO (default)
RETURNS: NIL
EXAMPLE: VWINDOW("win1",5,10,15,70,"W+/B+",2,.T.,.T.)
FUNCTION: WKILL()
SYNTAX: WKILL(
PURPOSE: To un-pop a window.
PARAMETERS:
expC = The name of the window you want to un-pop
expC1 = If you want the window to implode. "I" = yes, blank no.
RETURNS: NIL
EXAMPLE: To un-pop win1: WKILL("win1")
to un-pop win1 imploding: WKILL("win1","I")
FUNCTION: WNROW()
SYNTAX: WNROW(
PURPOSE: Returns what row inside the window you are in.
If you wanted to go to row 2 in the window, WNROW
would return the necessary position. This function
would be used when you want to have an @ say
in a window. When you want to use this function WNROW
assumes that position 1 is the first clear area in the
window. If you had a window at 10,15,20,79 position 1
would be row 11. WNROW(1) return 11. SEE ALSO WNCOL().
PARAMETERS:
expC = The name of the window you want to use
expN = The row you want the cursor to be in
RETURNS: Numeric
EXAMPLE: To place a message in row 1 of win1:
@ WNROW("win1",1),WNCOL("win1",3) SAY "WINDOW 1"
FUNCTION: WNCOL()
SYNTAX: WNCOL(
PURPOSE: Returns what column inside the window you are in.
IF you wanted to go to column 50 in the window, WNCOL
would return the necessary position. SEE ALSO WNROW()
PARAMETERS:
expC = The name of the window you want to use
expN = The column you want the cursor to be in
RETURNS: Numeric
EXAMPLE: To place a message starting at column 5 of the window:
@ WNROW("win1",3),WNCOL("win1",5) SAY "WINDOW"
FUNCTION: WCLEAR()
SYNTAX: WCLEAR(
PURPOSE: This function will clear the text in the window you
specify. It works like the clear command but it acts
like you are in a true window environment. By specifying
PARAMETERS:
expC = The name of the window you want to use
expC2 = The color you want to change the window to (optional).
RETURNS: NIL
EXAMPLE: To clear any text in window 1: WCLEAR("win1")
To change the color in window 1: WCLEAR("win1","W+/B+")
FUNCTION: WTITLE()
SYNTAX: WTITLE(
PURPOSE: To place a title on a window.
PARAMETERS:
expC = The name of the window you want to use
expC2 = The title or message you want shown
expC3 = The justification of the title:
L = Left (default)
C = Centered
R = Right
expC4 = The position of the title:
T = Top (default)
B = Bottom
expC5 = The delimiters you want to surround the title (optional)
RETURNS: NIL
EXAMPLE: To place a message in window 1:
WTITLE("win1","View Client","L","T","[]")
To center a title on the bottom
WTITLE("win1","Press
FUNCTION: WMOVE()
SYNTAX: WMOVE(
PURPOSE: WMOVE can be used for two things. The first is to move
a window to a new screen position. The other is to
resize a window.
PARAMETERS:
expC = The name of the window you want to use.
expN1 = The new starting row
expN2 = The new starting column
expN3 = The new bottom row
expn4 = The new starting column
RETURNS: NIL
EXAMPLE: To resize window 1:
WMOVE("win1",10,10,20,50)
FUNCTION: WSCROLL()
SYNTAX: WSCROLL(
PURPOSE: WSCROLL will scroll text in the window you choose.
PARAMETERS:
expC = The name of the window you want to use
expN = The number of lines you want to move up or down (-,+).
RETURNS: NIL
EXAMPLE: To scroll up one line in window 1.
WSCROLL("win1",-1)
To scroll down one line.
WSCROLL("win1",1)
FUNCTION: WBORDER()
SYNTAX: WBORDER(
PURPOSE: WBORDER will change or redo a border on the window you
choose.
PARAMETERS:
expC1 = The name of the window you want to use
expN = The type of box you want to use (see gbox for details)
expC2 = The color of the border (default is the current color)
RETURNS: NIL
EXAMPLE: To change the border in window 1 to thick, and the
colors to Red on White:
WBORDER("win1",5,"R+/W+")
FUNCTION: WPOP()
SYNTAX: WPOP(
PURPOSE: WPOP will re-pop a window that has currently been
un-popped
PARAMETERS:
expC = The name of the window you want to use
RETURNS: NIL
EXAMPLE: To re-pop window 1:
WPOP("win1")
NOTE: The window must currently be un-popped with WKILL
in order for it to be re-popped.
FUNCTION: WCLSTACK()
SYNTAX: WCLSTACK()
PURPOSE: WCLSTACK will clear the array that hold all the window
information
PARAMETERS:
NONE
RETURNS: NIL
EXAMPLE: To clear the window stack:
WCLSTACK()
FUNCTION: WRELEASE()
SYNTAX: WRELEASE(
PURPOSE: WRELEASE will delete a window from the stack
PARAMETERS:
expC = The name of the window you want to use
RETURNS: NIL
EXAMPLE: To delete window 1 from the stack:
WRELEASE("win1")
FUNCTION: WSAY()
SYNTAX: WSAY(
PURPOSE: WSAY will say a string at window coordinates
expN1,expN2
PARAMETERS:
expC1 = The name of the window you want to use
expN1 = The starting window row
expN2 = The starting window column
expC2 = The string to say
RETURNS: NIL
EXAMPLE: To say a message in window 1 at 3,5:
WSAY("win1",3,5,"HELLO")
FUNCTION: DBOX()
SYNTAX: DBOX(
PURPOSE: This will portray a string or an array in a box with or
without a shadow
PARAMETERS:
expN1 = starting row to draw box
expN2 = starting column to draw box
expCA = the string or array to display in the box
expC = The color to make the box (default current color)
expL1 = Shadow toggle .T. is include .F. don't (default .F.)
expN2 = the type of box you want drawn (default 2)
See G_BOX for details
expL2 = Exploding Box (.T. = Yes, .F. = No (default .F.)
RETURNS: NIL
EXAMPLE: To display a string in a box at row 3 column 5:
DBOX(3,5,"THIS WILL BE IN THE BOX","R+/W",.T.,1,.F.)
To display an array in a box:
ar = { "WARNING:",
"ARE YOU SURE YOU WANT TO CONTINUE:"}
DBOX(3,5,ar,"R+/W",.T.,1,.T.)
SEE ALSO UNBOX
FUNCTION: UNBOX()
SYNTAX: UNBOX()
PURPOSE: UNBOX will un-pop a window used with DBOX, and restore
the prior screen.
PARAMETERS:
NONE
RETURNS: NIL
EXAMPLE: DBOX(3,5,"ARE YOU SURE (Y/N) => ","W+/B+")
yn = INKEY(0)
IF UPPER(CHAR(yn)) = "Y"
DO ....
ENDIF
UNBOX()
FUNCTION: G_BOX
SYNTAX: G_BOX(
PURPOSE: G_BOX will return the box characters defined in box.ch
PARAMETERS:
expN = the number equivalent of the type of box desired
1 = SINGLE
2 = DOUBLE
3 = SINGLE WITH DOUBLE DOWN THE SIDES
4 = DOUBLE WITH SINGLE DOWN THE SIDES
5 = SOLID
6 = NO BORDER
RETURNS: NIL
EXAMPLE: To draw a double line on the screen:
@ 3,4,10,78 BOX G_BOX(2)
FUNCTION: SCENTE()
SYNTAX: SCENTE(expC>,
PURPOSE: SCENTE will center a string (expC> at the row you
specify
PARAMETERS:
expC = The string you want to specify
expN1 = The row to display the string
expN2 = The screen width (40 is the default)
RETURNS: NIL
EXAMPLE: SCENTE("THIS IS CENTERED",3)
December 10, 2017
Add comments