Dec 222017
 
C window routines for Clipper. They feature exploding boxes, true shadowing, etc. Full source is included.
File RWINDOW.ZIP from The Programmer’s Corner in
Category Dbase Source Code
C window routines for Clipper. They feature exploding boxes, true shadowing, etc. Full source is included.
File Name File Size Zip Size Zip Type
WIND.PRG 12113 3036 deflated
WDEMO.PRG 9596 3157 deflated
READ.ME 7803 2509 deflated
SHADOW.OBJ 1323 922 deflated
SHADOW.C 1488 613 deflated
WLINK.BAT 72 51 deflated

Download File RWINDOW.ZIP Here

Contents of the READ.ME file





=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
W I N D O W S F O R C L I P P E R
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Ok...here's the dirt, use wLink.bat to compile and link if you don't use
tlink edit wLink.bat for your linker.

If you wanted to save the parameters that users edit, through wMove() and
wSize(), to be used when the program is re-entered, you could save your
array parameters to a MEM file and re-write wInit() so that it checks for
already existing window arrays in a MEM file. If it does, you just restore
the additive and foregoe the initialization process.

This is fairly close to the idea of object oriented programming (OOP) as
you will be able to deduce by looking at the code for wDemo.Prg. Many
things can be added to this, I just ask that you keep them in the original
package noting your updates, dating and writting your name at the top of
the source code and re-UpLoading it. If everybody works on this it could
become pretty impressive. For myself, I am going to start re-writing this
in Turbo-C and speed it up. Hopefully, I will also be able to add "window
promoting", one example of which would be sliding a window out from the
middle of an overlapping row without creating blank or erroneous spaces
in the surrounding or overlapping windows.

wSay() - There are alot of things that can be added to the string parsing
that formats the text in the window. For example, you could have wSay()
create a new line when it encounters "/" so that you could create tables.
Right now wSay() just checks the length and truncates at the nearest blank
space. wSay() takes care of color. That is, it save the current colors then
gets the color string from the selected window, displays the text and sets
the colors back to the 'current color'. This is saves a lot of time when
writing to different windows. I would, however, add an optional parameter
or another version of wSay() that doesn't fuck with the colors at all so
that you have flexibility within the window.

wGet() has not been written, I pretty much stopped when I decided to re-
write the objects. It is as easy as copying wSay() and replacing SAY with
GET. You could also automatically reverse text. I would add an optional
parameter for picture and valid clauses.




Anyway, here are the current commands.


wInit()
-----------
Creates the window arrays (structures). is the Max amount of
windows that can be displayed. If you wMake() without wInit(), wMake()
will automatically invoke wInit() with 100 as the Max.


wMake(,,,,,[,[,[,]]])
---------------------------------------------------------
Function: Formats a window to be opened.

= Title Character String
= Top Row
= Left Column
= Bottom Row
= Right Column
= Color String
= Logical - To Explode or not to Explode
= Logical - Shadow Hmm...Yes, no, forget maybe
= Numerical Border Type 1 - 5

Returns : Numeric value of window - 0 if wMake() failed.

wOpen()
-----------
Function: Opens the selected window.

= a memory variable containing the window Number.

Returns : Logical -.T. if successful, .F. if Failed.


wSay(,,,)
-------------------------
Function: Prints a character string at the specified coordinates
within the specified window. If the line is too long
it wraps to the next top row position.

= Window
= Relative X coordinate
= Relative Y coordinate
= Character String - text.

Returns : Logical - True if not errors.

Notes : 0,0 is upper left hand corner of every window.




wClose()
------------
Function: Closes and deactivates the specified window.

= Window Name.

Returns : Logical - True if not errors.


wClear()
------------
Function: Clears the contents of the specified window.

= Window Name

Returns : None


wClearEOL(,)
--------------------
Function: Clear to the End of a specified line within a window.

= Window Name
= Row to Clear.

Returns : None


wMove([,[,]])
-------------------------
Function: Interactively Moves a window with the arrow keys.

= The Window Name
= Optional parameter to define the Exit key value
= Optional parameter to define the Save key value

Returns : None

Notes : Default exit key is Escape (27), save is Enter (13).
Window text is not lost in this operation.


wSize([,[,]])
-------------------------
Function: Interactively Re-Sizes a window with the arrow keys.

= The Window Name
= Optional parameter to define the Exit key value
= Optional parameter to define the Save key value

Returns : None

Notes : Default exit key is Escape (27), save is Enter (13).
Window text is lost in this operation.



wDispTit([,])
---------------------
Function: Used by wOpen() to display window title

= Window Name.
= Optional parameter - Title String.

Returns : None.

Notes : If no title string is specified it uses the title
defined by wMake(). If one is specified, it becomes
the new default title.


wDispMsg(,)
-------------------
Function: Displays a window footer on bottom row of window.

= Window Name.
= Footer String.

Returns : None.


Related Commands

Shadow(,,,)
---------------------------
Function: Creates a non-destuctive shadow around the given coordinates.

= Top Row
= Left Column
= Bottom Row
= Right Column

Returns : None.

Notes : This function is used by wOpen but can be run on its own
to create non-destructive shadows. It does not create a
box or clear the enclose area.


Explode(,,,,)
---------------------------------
Function: Explodes a box with a frame.

= Top Row
= Left Column
= Bottom Row
= Right Column
= Character string contain the frame charactes.

Returns : None.

Notes : This function is used by wOpen but can be run on its own.





Robert DiFalco
Compuserve ID: 71610,1705

3548 18th Street Apt #3
San Franciso, CA
94110

(415) 398-4131
(415) 863-0438



 December 22, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)