**********************************************************************
* DOS3D driver for GENSCRNX
***************************
*  Version 1.30  -  07/08/94
*
*  written by:  Rick Strahl  -  CIS #:76427,2363
*               West Wind Technologies
*               400 Morton Road
*               Hood River, Oregon 97031
*               ---------------------------------
*               (503) 386-2087
*
*   copyright:  none (Public Domain)
*
*   Special thanks to Randy Pearsen for contributing
*   some valuable fixes and suggestions to this driver and
*   helping me understand GSX drivers better.
*
***********************************************************************
*  Change Log:
*  -----------
*
*  07/08/94  
*  --------
*    * Fix driver from being called multiple times when inserting
*      objects from library files. *:DOS3D is now turned off
*      after processing each object.
*
*    * Fix bug introduced with Version 2.0 of GENSCRNX that would
*      not generate the proper *:IF bracketing for objects treated
*      with the *:DOS3D directive. Please note: All comment snippet
*      code is now forwarded into the 'shadow objects'. 
*
*    * Added DOS3D_ALLOBJECTS Setup Directive which will generate 
*      DOS3D shadows for all objects except radio buttons, free form
*      text and checkboxes. All objects can now receive the *:DOS3D 
*      directive in the Comment field.
*
*    * Added *:DOS3D OFF comment directive to allow turning off
*      automatic generation from *:DOS3D_ALLOBJECTS or 
*      *:DOS3D_ALLBUTTONS
*
*    * Changed code to work more like 'standard' Genscrnx drivers
*      using GSX internal functions for directive processing. 
*    
*  
*  03/15/94
*  --------
*    * Added support for making all buttons use the shadow
*	   effect. Use the *:DOS3D_ALLBUTTONS keyword in the
*      setup snippet to have all standard buttons worked
*	   on.   
*
*    * Use insrec() to add new object records for the shadow
*      objects instead of APPEND BLANK.
*
*  02/05/94
*  --------
*    * Additional comments and added constants with #DEFINE's
*
*    * DOS3D now leaves a stub that identifies it in the .SPR.
*      The stub precedes the color definitions in the Setup code.
*   
*  01/07/94
*  --------
*    * Fixed bug that caused the shadows to be drawn even when the
*      screen object had an *:IF clause that evaluates to .F. Fixed.
*
*    * Added additional comments for multi-buttons
*
*  12/17/93:
*  ---------
*    *  Added support for multi-buttons
*
*    *  Fixed bug that caused occasional errors when generating
*       screens last modified under DOS and then generated under
*       Windows. Fixed.
*********************************************************************

DOS3D GENSCRNX Driver Notes:
----------------------------
This driver simply generates a drop shadow on any object that has 
the *:DOS3D directive in its comment snippet.

The driver works on all DOS objects except for radio buttons.
Multi-buttons are also supported. If the shadow won't fit into
the window because the object touches the window border with 
either the bottom or right side, no shadow is drawn.

Please have mercy on your users and practice good screen
design <g>... don't abuse the effect like I did in the test 
screen! The main use for this driver is probably making 
buttons look nicer than the standard Fox < buttons >.

Usage:
------
   Setup Snippet Options:

        *** Tell GENSCRNX to run DOS3D driver 
        *:SCXDRV5 DOS3D      
          
        *** OPtional - Add shadows to all buttons 
        *:DOS3D_ALLBUTTONS   
        
        *** Optional - Add Shadows to all objects
        *:DOS3D_ALLOBJECTS
        			         

   Comment Snippet:

        *** Shadow effect for object
        *:DOS3D                
        
        *** Don't set button color - use default
        *:DOS3D NOBCOLOR       
        
        *** Don't generate shadow
        *:DOS3D OFF 

How it works:
-------------
The idea behind DOS3D is that a drop shadow is nothing more
than two special lines that surround a screen object - one
below and one to the left. Using GENSCRNX it is easy to add
these lines into the screen database as the screen is generated
automatically creating the drop shadows.

There are essentially 3 parts to the driver:

1.  Setting up the color scheme for the reverse color shadows
    and buttons.
    
2.  Figure out where the shadow object(s) need to go. This
    includes preprocessing the DOS3D_ALLBUTTONS and 
    DOS3D_ALLOBJECTS directives and dumping '*:DOS3D' into
    the appropriate comment snippets.

3.  Add the new shadow objects into the screen database after
    the appropriate screen objects.


The first is done by adding code to the SETUP code of the screen
by inserting code that creates variables containing the 
reverse color and button color strings. These variables are also
stuffed into the new fields' SCHEME fields so they are the
generated color schemes at runtime. Note the short and cryptic
names for these. This is necessary, because the scheme field
is limited to 8 characters which in case of the button scheme
must include paranthesis and quotes. Please note that the
color scheme for the button colors is hardcoded. I haven't
figured out a way to handle this any differently. You can
override this of course by using the NOBCOLOR option and
use your own color; or simply change the color scheme in the
.PRG to your liking.

The second is accomplished by saving all the size and location
values of the object that is being worked on and deriving new
offsets for the shadows. Multi-objects in buttons are also 
considered by computing offsets for the next object and running
the addition of objects in a loop to run through all possible
objects in the button group.

The third simply adds records into the screen database and then
assigns the computed values to the new records in the screen
database.

To see how this works take a look at the code in DOS3D.PRG. The
code is liberally documented and (hopefully) easily followed.

If you have any comments or suggestions please contact me via
CIS #: 76427,2363 on FoxForum (Third Party).

+++ Rick ---